/* Console components (CONTRACTS 5.6-5.9): the shell frame built on the copied
   classic rules, the sidebar groups and states (SOON pill, lock, warning dot),
   the user card, the top-bar counters, the Available menu, the state panels
   and the accessibility basics. Classes are prefixed zc- (the shell's prefix). */

/* ---- Accessibility basics (5.9) ---- */
.zc-sr { position:absolute !important; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.zc-skip { position:absolute; left:12px; top:-80px; z-index:100; background:var(--ink-2); color:var(--mist); padding:10px 14px; border-radius:10px; font-size:13px; font-weight:700; box-shadow:0 10px 30px rgba(31,20,20,.3); }
.zc-skip:focus { top:12px; }
:focus-visible { outline:2px solid var(--brass); outline-offset:2px; }
.zc-main:focus { outline:none; }
@media (prefers-reduced-motion: reduce) { .toast { transition:none; } }

/* ---- Loading screen ---- */
.zc-boot { min-height:100vh; display:flex; align-items:center; justify-content:center; background:var(--ink); }
.zc-boot-card { display:flex; flex-direction:column; align-items:center; gap:12px; color:var(--slate); font-size:14px; font-weight:600; text-align:center; padding:24px; }

/* ---- Brand mark ---- */
.zc-mark { width:26px; height:20px; flex:none; }
.logo .zc-mark { width:28px; height:22px; }
.zc-logo-sub { font-weight:600; color:var(--slate); }

/* ---- Sign-in card (5.7) ---- */
.card p.zc-mt12 { margin-top:12px; }
.zc-msg { color:var(--slate); }
.zc-msg.zc-bad { color:var(--bad); }
.card button:disabled { opacity:.6; cursor:progress; }

/* ---- Sidebar (5.6) ---- */
.zc-sidebar { width:var(--zc-sidebar-w); }
.zc-nav { overflow-y:auto; overflow-x:hidden; margin:0 -14px; padding:0 14px; }
.zc-group { font-size:10.5px; font-weight:700; letter-spacing:.12em; text-transform:uppercase; color:var(--sb-dim); padding:12px 12px 6px; }
.zc-group:first-child { padding-top:4px; }
.zc-group.zc-group-next { border-top:1px solid var(--sb-line); margin-top:10px; padding-top:16px; }
.zc-items { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:2px; }
.zc-item-title { flex:1; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
/* not_connected: dimmed, the reason is the tooltip (4.3) */
.nav a.zc-dim { opacity:.6; }
.nav a.zc-dim:hover, .nav a.zc-dim.active { opacity:1; }
/* soon and locked: greyed */
.nav a.zc-grey { color:var(--sb-dim); }
.nav a.zc-grey:hover { color:var(--sb-text); }
.nav a[aria-disabled="true"] { cursor:default; }
.zc-soon { margin-left:auto; flex:none; font-size:9px; font-weight:800; letter-spacing:.08em; color:#E0A23B; border:1px solid rgba(224,162,59,.45); background:rgba(224,162,59,.08); border-radius:999px; padding:1px 7px; line-height:1.5; }
.zc-lock { margin-left:auto; flex:none; display:inline-flex; color:var(--sb-dim); }
.nav a .zc-lock .ic { width:14px; height:14px; stroke-width:2; }
/* unavailable: normal, with a small warning dot */
.zc-warn-dot { margin-left:auto; flex:none; width:7px; height:7px; border-radius:50%; background:#E0A23B; box-shadow:0 0 0 3px rgba(224,162,59,.18); }

/* ---- User card (5.4) ---- */
.zc-user { display:flex; align-items:center; gap:10px; border-top:1px solid var(--sb-line); padding:14px 4px 0; margin-top:10px; }
.zc-avatar { position:relative; width:36px; height:36px; flex:none; border-radius:50%; background:var(--wax); color:#fff; display:inline-flex; align-items:center; justify-content:center; font-size:12.5px; font-weight:800; letter-spacing:.02em; }
.zc-adot { position:absolute; right:-1px; bottom:-1px; width:12px; height:12px; border-radius:50%; background:var(--slate-dim); border:2px solid var(--sb); }
.zc-adot.on { background:var(--ok); }
.zc-user-text { flex:1; min-width:0; line-height:1.3; }
.zc-user-name { color:#fff; font-size:13px; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.zc-user-role { color:var(--sb-dim); font-size:11.5px; font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.zc-signout { flex:none; border:0; background:transparent; color:var(--sb-text); padding:7px; border-radius:8px; display:inline-flex; }
.zc-signout:hover { color:#fff; background:var(--sb-hover); }
.zc-signout .ic { width:17px; height:17px; }

/* ---- Banners above the top bar (5.6) ---- */
.zc-banners { padding:12px 24px 0; }
.zc-banners:empty { display:none; }

/* ---- Top bar (5.6) ---- */
.zc-topbar { height:var(--zc-topbar-h); justify-content:flex-start; gap:20px; padding:0 24px; }
.zc-tb-title { min-width:0; flex:none; max-width:320px; }
.zc-tb-title h2 { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.zc-tb-title .sub { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.zc-tb-title .sub:empty { display:none; }
.zc-toolbar { display:flex; align-items:center; gap:8px; min-width:0; }
.zc-toolbar:empty { display:none; }
.zc-counters { display:flex; align-items:center; gap:16px; font-size:13px; font-weight:500; color:var(--slate); white-space:nowrap; }
.zc-ctr { display:inline-flex; align-items:center; gap:6px; }
.zc-ctr::before { content:''; width:6px; height:6px; border-radius:50%; background:var(--slate-dim); }
.zc-ctr.open::before { background:var(--wax); }
.zc-ctr.unassigned::before { background:#E59A2F; }
.zc-ctr.active::before { background:var(--ok); }
.zc-notice { font-size:12px; font-weight:600; color:var(--warn); background:var(--warn-bg); border-radius:999px; padding:4px 11px; white-space:nowrap; }
.zc-topbar .topbar-right { margin-left:auto; gap:12px; }
.zc-store { padding:7px 10px; border:1.5px solid var(--line); border-radius:10px; background:var(--ink-2); color:var(--mist); font:inherit; font-size:12.5px; font-weight:600; max-width:240px; }
.zc-store:focus { outline:none; border-color:var(--brass); }
.zc-tb-avatar { width:38px; height:38px; font-size:13px; }

/* ---- Available menu (5.4) ---- */
.zc-avail-wrap { position:relative; }
.avail .zc-caret .ic { width:12px; height:12px; color:var(--slate); stroke-width:2.2; }
.avail .zc-caret { display:inline-flex; margin-left:2px; }
.zc-pop { position:absolute; right:0; top:calc(100% + 8px); min-width:240px; background:var(--ink-2); border:1px solid var(--line); border-radius:12px; box-shadow:0 18px 50px rgba(31,20,20,.18); padding:6px; z-index:30; }
.zc-pop-opt { display:flex; align-items:center; gap:4px; width:100%; border:0; background:transparent; padding:9px 10px; border-radius:8px; font-size:13px; font-weight:600; color:var(--mist); text-align:left; }
.zc-pop-opt:hover { background:var(--bg); }
.zc-pop-opt[aria-checked="true"]::after { content:'\2713'; margin-left:auto; color:var(--brass); font-weight:800; }
.zc-pop-sep { height:1px; background:var(--line); margin:6px 4px; }
.zc-pop-info { padding:6px 10px 2px; font-size:12.5px; font-weight:600; color:var(--mist); }
.zc-pop-h { padding:8px 10px 2px; font-size:10px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--slate); }
.zc-pop-list { list-style:none; margin:0; padding:2px 10px 6px; max-height:220px; overflow-y:auto; }
.zc-pop-list li { display:flex; align-items:center; font-size:12.5px; padding:4px 0; color:var(--mist); min-width:0; }
.zc-pop-list li.zc-pop-empty { color:var(--slate); }
.zc-pop-name { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* ---- Main area, module root, read-only (4.6) ---- */
.zc-main { flex:1; min-width:0; }
.zc-module-root { min-width:0; }
/* The shell marks a read-only module root; classic markup inside it keeps
   working with .view[data-readonly] too (portal.css:364-365). */
.zc-module-root[data-readonly] [data-write] { display:none !important; }
.zc-module-root[data-readonly] [data-lock] { pointer-events:none; opacity:.6; }

/* ---- State panels (4.3, 5.1) and module placeholders (5.10) ---- */
.view.on.zc-state { display:flex; align-items:center; justify-content:center; min-height:calc(100vh - var(--zc-topbar-h)); padding:40px 28px; }
.zc-state-card { max-width:480px; text-align:center; display:flex; flex-direction:column; align-items:center; gap:10px; }
.zc-state-ic { width:54px; height:54px; border-radius:16px; background:var(--accent-soft); color:var(--wax); display:flex; align-items:center; justify-content:center; margin-bottom:4px; }
.zc-state-ic .ic { width:24px; height:24px; }
.zc-state-ic.zc-warn { background:var(--warn-bg); color:var(--warn); }
.zc-state-ic.zc-grey { background:var(--bg); color:var(--slate); border:1px solid var(--line); }
.zc-state-card h3 { margin:0; font-size:18px; font-weight:800; letter-spacing:-.015em; color:var(--mist); }
.zc-state-card p { margin:0; font-size:13.5px; line-height:1.6; color:var(--slate); }
.zc-state-card .zc-state-reason { color:var(--mist); font-weight:600; }
.zc-state-actions { display:flex; gap:8px; margin-top:8px; flex-wrap:wrap; justify-content:center; }
.zc-state-actions a.btn { display:inline-flex; align-items:center; }

/* ---- Phase 2 (CONTRACTS-P2 5.2, 5.8, 5.10) ---- */
/* The operator sign-in on the sign-in card, and the region select */
.card p.zc-op-row { margin:0; }
.card select { width:100%; padding:12px 14px; border:1.5px solid var(--line); border-radius:10px; font-size:15px; margin-bottom:10px; background:var(--bg); color:var(--mist); font-family:inherit; }
.card select:focus { outline:none; border-color:var(--brass); }
/* The reset and invite pages (auth.html) */
.zc-auth-label { display:block; font-size:12.5px; font-weight:600; color:var(--slate); margin:2px 0 6px; }
/* The failed-sync dot on a ready module (ZOffers) */
.zc-alert-dot { background:var(--bad); box-shadow:0 0 0 3px rgba(220,38,38,.18); }
/* The ZBRIX sign-in panel of the ZBRIX modules */
.zc-zb-connecting { font-weight:600; }
.zc-zb-form { width:100%; max-width:340px; margin-top:6px; text-align:left; }
.zc-zb-form input[type="email"], .zc-zb-form input[type="password"] { width:100%; padding:11px 13px; border:1.5px solid var(--line); border-radius:10px; font-size:14px; margin-bottom:10px; background:var(--bg); color:var(--mist); font-family:inherit; }
.zc-zb-form input[type="email"]:focus, .zc-zb-form input[type="password"]:focus { outline:none; border-color:var(--brass); }
.zc-zb-check { display:flex; align-items:center; gap:8px; font-size:13px; font-weight:500; color:var(--mist); margin:2px 0 12px; cursor:pointer; }
.zc-zb-check input { width:16px; height:16px; margin:0; accent-color:var(--wax); }
.zc-zb-submit { width:100%; padding:11px 14px; font-size:13.5px; }
.zc-zb-submit:disabled { opacity:.6; cursor:progress; }
.zc-state-card .zc-zb-note { margin:0 0 10px; padding:8px 11px; border-radius:10px; background:var(--warn-bg); color:var(--warn); font-size:12.5px; font-weight:600; }
.zc-state-card .zc-zb-hint { margin:10px 0 0; font-size:12.5px; }

/* ---- Small screens: the classic stacks the sidebar at 720px (portal.css:257) ---- */
@media (max-width:720px) {
  .zc-sidebar { width:100%; }
  .zc-sidebar .brand { flex-basis:100%; }
  .zc-nav { margin:0; padding:0; flex-basis:100%; }
  .zc-items { flex-direction:row; flex-wrap:wrap; }
  .zc-group { flex-basis:100%; }
  .zc-group.zc-group-next { margin-top:6px; padding-top:10px; }
  .zc-user { flex-basis:100%; }
  .zc-topbar { height:auto; min-height:var(--zc-topbar-h); flex-wrap:wrap; padding:12px 16px; gap:10px 16px; }
  .zc-tb-title { max-width:100%; }
  .zc-topbar .topbar-right { margin-left:0; flex-wrap:wrap; }
  .view.on.zc-state { min-height:60vh; padding:28px 16px; }
}
