/* Cybera 3.0 — the cockpit layer and the measured standards (docs/STANDARTLAR.md). Loaded after admin.css: it sets the
   tokens the audit (admin/dev/ui-audit.js) found below the standard, the instrument strip, the queue dock, the one-scroll
   page and the sizes of controls. */

/* ---------- tokens: text contrast ≥ 4.5:1 on every panel (WCAG 2.2, 1.4.3) ---------- */
:root { --faint: #8794a6; --muted: #98a4b5; --ok-text: #6ee79a; --warn-text: #fcd34d; --bad-text: #fca5a5; --info-text: #93c5fd; --dock: 360px; --strip-h: 36px; }
:root[data-mode=light] { --faint: #5f6b7c; --muted: #4f5b6c; --ok-text: #166534; --warn-text: #8a5a00; --bad-text: #b42318; --info-text: #1d4ed8; }

/* ---------- controls: a target is at least 32 px with a mouse, 40 px on a touch screen ---------- */
summary { min-height: 36px; display: flex; align-items: center; gap: 8px; cursor: var(--cy-pointer, pointer); }
input[type=range] { min-height: 32px; }
@media (pointer: coarse) {
  .btn, .icon-btn, .chip, button.chip, .seg button, summary, .strip-chip, .queue-btn { min-height: 40px; }
  .icon-btn { min-width: 40px; }
  input[type=range] { min-height: 40px; }
}

/* ---------- top bar: the instrument strip ---------- */
.topbar { gap: 10px; }
.topbar h1 { white-space: nowrap; }
.strip { display: flex; align-items: center; gap: 6px; margin-left: 10px; min-width: 0; flex: 0 1 auto; overflow: hidden; }
.strip-chip { display: inline-flex; align-items: center; gap: 6px; height: var(--strip-h); padding: 0 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: 12.5px; font-weight: 600; white-space: nowrap; flex: none; transition: border-color .15s, background .15s; }
.strip-chip b { color: var(--text); font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.strip-chip:hover { border-color: var(--line2); color: var(--text); }
.strip-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.strip-chip.busy svg { color: var(--ok); } .strip-chip.free svg { color: var(--info); } .strip-chip.paused svg { color: var(--warn); }
.strip-chip.ending { border-color: color-mix(in srgb, var(--warn) 55%, transparent); background: color-mix(in srgb, var(--warn) 12%, var(--panel)); }
.strip-chip.ending svg, .strip-chip.ending span { color: var(--warn-text); }
.strip-chip.dim svg { color: var(--warn); }
.queue-btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 8px 0 12px; border-radius: 11px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-weight: 700; flex: none; }
.queue-btn b { min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; background: var(--panel3); display: grid; place-items: center; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.queue-btn.critical b { background: var(--bad); color: #fff; } .queue-btn.warning b { background: var(--warn); color: #241a00; }
.queue-btn.critical { border-color: color-mix(in srgb, var(--bad) 60%, transparent); animation: queue-pulse 2s ease-in-out infinite; }
.queue-btn.pinned, .queue-btn.open { border-color: var(--accent); }
.queue-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@keyframes queue-pulse { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--bad) 22%, transparent); } }
@media (prefers-reduced-motion: reduce) { .queue-btn.critical { animation: none; } }
/* Narrower screens give the strip room first (the section name, the search's words and the language switch, which the
   side menu also has, fold away), then keep the numbers without their words; chips that still do not fit are left out
   whole by cockpit.js (fitStrip). */
@media (max-width: 1700px) { .topbar .crumb { display: none; } .searchbtn { width: 44px; justify-content: center; padding: 0; } .searchbtn span, .searchbtn kbd { display: none; } .app:not(.side-mini) .topbar .staff-language { display: none; } .app:not(.side-mini) .side-foot .staff-language { display: inline-flex; align-self: flex-start; margin: 0 12px 10px; } }
@media (max-width: 1280px) { .strip-chip span { display: none; } .strip-chip { padding: 0 9px; } }
@media (max-width: 900px) { .strip { display: none; } .queue-btn span { display: none; } .queue-btn { padding: 0 8px; } }

/* ---------- the work area: the page and the queue dock ---------- */
.workarea { flex: 1; min-height: 0; display: flex; position: relative; }
.workarea > .content { flex: 1; min-width: 0; }
.dock { width: var(--dock); flex: none; border-left: 1px solid var(--line); background: var(--bg2); overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.app.dock-overlay .dock { position: absolute; top: 0; right: 0; bottom: 0; z-index: 60; width: min(400px, 100%); box-shadow: var(--shadow); animation: dock-in .18s ease-out; }
@keyframes dock-in { from { transform: translateX(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .app.dock-overlay .dock { animation: none; } }
.dock-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 14px 14px 10px 18px; background: var(--bg2); border-bottom: 1px solid var(--line); }
.dock-head h2 { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 16px; }
.dock-head h2 small { color: var(--muted); font-size: 13px; font-weight: 700; }
.dock-group { padding: 8px 10px 2px; }
.dock-group h3 { display: flex; align-items: center; gap: 8px; margin: 6px 8px 8px; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.dock-group h3 small { margin-left: auto; font-size: 12px; letter-spacing: 0; }
.dock-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.dock-item { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 4px 10px; padding: 10px 10px 10px 8px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--line2); }
.dock-item.critical { border-left-color: var(--bad); background: color-mix(in srgb, var(--bad) 7%, var(--panel)); }
.dock-item.warning { border-left-color: var(--warn); }
.dock-item.info { border-left-color: var(--info); }
.dock-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--panel3); color: var(--muted); }
.dock-item.critical .dock-ic { color: var(--bad-text); } .dock-item.warning .dock-ic { color: var(--warn-text); } .dock-item.info .dock-ic { color: var(--info-text); }
.dock-text { min-width: 0; }
.dock-text b { display: block; font-size: 13.5px; line-height: 1.3; overflow-wrap: anywhere; }
.dock-text small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; overflow-wrap: anywhere; }
.dock-actions { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.dock-actions .btn { min-height: 32px; }
/* 4.0.14: tick rows and take them off the queue (or all of them). */
.dock-head { flex-wrap: wrap; }
.dock-bulk { flex-basis: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 32px; }
.dock-all { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--muted); cursor: pointer; user-select: none; }
.dock-bulk .btn { display: inline-flex; align-items: center; gap: 6px; }
.dock-all span, .dock-bulk .btn span { white-space: nowrap; }
.dock-bulk .btn.ghost { padding: 0 8px; }
.dock-pick { grid-column: 3; grid-row: 1; display: grid; place-items: center; width: 24px; height: 24px; cursor: pointer; }
.dock-pick input, .dock-all input { width: 17px; height: 17px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.dock-item.picked { border-top-color: color-mix(in srgb, var(--accent) 55%, var(--line)); border-right-color: color-mix(in srgb, var(--accent) 55%, var(--line)); border-bottom-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }
.dock-empty { display: grid; justify-items: center; gap: 6px; padding: 48px 24px; text-align: center; color: var(--muted); }
.dock-empty svg { color: var(--ok); } .dock-empty p { margin: 0; color: var(--text); font-weight: 700; } .dock-empty small { font-size: 12.5px; }
@media (max-width: 760px) { .app.dock-overlay .dock { width: 100%; } }

/* ---------- one scroll per page; the first controls row stays at the top ---------- */
.content.workspace-page.workspace-flow { display: block; overflow-y: auto; }
.content.workspace-flow > * + * { margin-top: 0; }
.sticky-bar { position: sticky; top: 0; z-index: 8; background: var(--bg); margin-left: -24px; margin-right: -24px; padding: 10px 24px; border-bottom: 1px solid var(--line); box-shadow: 0 8px 14px -12px rgba(0, 0, 0, .55); }
@media (max-width: 760px) { .sticky-bar { top: 0; margin-left: -16px; margin-right: -16px; padding: 8px 16px; } }
/* A phone has no room for areas that scroll on their own: the bar and the cash desk flow as one page there too. */
@media (max-width: 760px) {
  .content.workspace-page { display: block; overflow-y: auto; }
  .content.workspace-page .workspace-column, .content.workspace-page .workspace-grid { display: block; overflow: visible; height: auto; min-height: 0; }
  .content.workspace-page .workspace-head, .content.workspace-page .workspace-scroll { max-height: none; overflow: visible; min-height: 0; height: auto; }
  .content.workspace-page .workspace-column > * + * { margin-top: 12px; }
  .workspace-scroll:has(> #barbody), .workspace-scroll:has(> #sbody), .workspace-scroll:has(> #dayrep), .workspace-scroll:has(> #shiftrep) { display: block; }
  .workspace-page .pos-cart { max-height: none; }
}
@media (pointer: coarse) {
  .searchbtn { height: 40px; min-width: 40px; }
  .fleet-tool, .fleet-swipe { min-width: 40px; min-height: 40px; }
  .seg button { min-width: 40px; }
  .link.cu-pc-name { min-height: 40px; }
  input.color { min-width: 40px; min-height: 40px; }
  .mlink { min-height: 44px; }
  .input-clearable + .search-clear, .search-clear { min-width: 40px; min-height: 40px; }
}

/* ---------- the cockpit page (Kompyuterlar): the strip carries the numbers ---------- */
@media (min-width: 901px) { .fleet-page #fleet-top { display: none; } }

/* ---------- audit findings (2.12.20 → 3.0) ---------- */
.pc-state-label { color: color-mix(in srgb, var(--pc-state) 62%, var(--text)); }
:root[data-mode=light] .pc-state-label { color: color-mix(in srgb, var(--pc-state) 55%, #0b1220); }
.pc .pick, .pcs:not(.list) .pc .pick { width: 24px; height: 24px; border-radius: 7px; }
.link.cu-pc-name { min-height: 28px; }
.stats .stat { min-width: 0; } .stats .stat > div { min-width: 0; } .stats .stat b { overflow-wrap: anywhere; }
.pc-foot .tag.bad { color: var(--bad-text); } .pc-foot .tag.warn { color: var(--warn-text); } .pc-foot .tag.info { color: var(--info-text); }
/* A free PC called for a waiting customer shows for whom even on cards (where a plain "Bo‘sh" is hidden). */
.pcs:not(.list) .pc-user:has(> .pc-free.pc-called:only-child) { display: flex; }
.pc-free.pc-called { color: var(--warn-text); opacity: 1; min-width: 0; } .pc-called > span { overflow: hidden; text-overflow: ellipsis; }
/* O‘yinlar va ilovalar: the card's controls in two rows — showing, then edit and delete — so neither is ever cut off
   (2.12.20 cut "O‘chirish" off the card at 1366 px: the row was wider than the card and the card clips). */
.game-actions { margin-top: auto; display: grid; gap: 10px; }
.game-visible { gap: 8px; min-height: 32px; }
.game-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 6px; }
.game-buttons .btn { justify-content: center; min-height: 34px; }
.notification-count, .nav a .count { pointer-events: none; }

/* Touch screens last, so they win over the sizes above. */
@media (pointer: coarse) { .link.cu-pc-name { min-height: 40px; } .pc .pick, .pcs:not(.list) .pc .pick { width: 40px; height: 40px; border-radius: 10px; } }
#fleet-list.pcs:not(.list)>.pc>.pc-top { grid-template-columns: max-content auto minmax(0,1fr); }
.pcs:not(.list)>.pc>.pc-top>.pick { grid-row: 1 / 3; }
#fleet-list .pc.sel { background: color-mix(in srgb, var(--fleet-accent) 16%, var(--panel)); border-color: var(--fleet-accent); box-shadow: inset 0 0 0 1px var(--fleet-accent); }
.fleet-page .pc:not(.sel):hover .pick { border-color: var(--line2); }
.fleet-page .pc:focus-visible, .fleet-page .pick:focus-visible { outline: 2px dashed var(--text); outline-offset: -3px; }
/* Below 900 px the strip is folded and the PC page shows its own four numbers again: two to a row, never cut. */
@media (max-width: 900px) { .fleet-page .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; } .fleet-page .stat b { white-space: normal; } }

/* ---------- 3.0.1 money: the flow table (in, between the boxes, out, net) and a box whose work was not started ---------- */
.dr-flow .dr-group td { padding-top: 14px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.dr-flow .dr-sub td { border-top: 1px dashed var(--line); background: color-mix(in srgb, var(--panel2) 60%, transparent); }
.dr-flow td small.muted { font-weight: 400; }
.sr-boxes .sr-missing td { background: color-mix(in srgb, var(--warn) 9%, transparent); }

/* ---------- Hisobotlar: occupancy map, conclusions, the next 7 days ---------- */
.occupancy-grid { grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); margin-bottom: 16px; }
@media (max-width: 1180px) { .occupancy-grid { grid-template-columns: 1fr; } }
.hm { display: grid; gap: 3px; overflow-x: auto; padding-bottom: 4px; }
.hm-row { display: grid; grid-template-columns: 26px repeat(24, minmax(12px, 1fr)); gap: 3px; align-items: center; min-width: 420px; }
.hm-row b { font-size: 11.5px; color: var(--muted); }
.hm-row i { height: 22px; border-radius: 4px; background: color-mix(in srgb, var(--accent) var(--v, 0%), var(--panel3)); }
.hm-row i.hm-none { background: repeating-linear-gradient(135deg, var(--panel2) 0 4px, transparent 4px 8px); }
.hm-head small { font-size: 10.5px; color: var(--muted); text-align: left; }
.hm-scale { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 11px; color: var(--muted); }
.hm-scale i { flex: 0 0 140px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--panel3), var(--accent)); }
.insights { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.insights li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--panel2); font-size: 13px; line-height: 1.4; }
.insights li svg { flex: none; margin-top: 1px; color: var(--accent); } .insights li.quiet svg { color: var(--info-text); } .insights li.full svg { color: var(--warn-text); }
.forecast { display: grid; gap: 8px; }
.fc-row { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(60px, 1.4fr) auto; gap: 10px; align-items: center; font-size: 13px; }
.fc-row .bar { height: 8px; border-radius: 4px; background: var(--panel3); overflow: hidden; display: block; }
.fc-row .bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.fc-row b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.strip-chip.waiting svg { color: var(--info); }

/* The dock sliding in never widens the page; its buttons are touch-sized on a touch screen. */
.workarea { overflow-x: clip; }
@media (pointer: coarse) { .dock-actions .btn { min-height: 40px; padding: 0 14px; } }
