/* Command Center — review cockpit layout (icon rail, user menu, shared period bar, Needs-you home, matrix, unit drawer,
   3-pane review queue, sticky decision bar, bottom tabs on phone). Loaded after uranus-glass.css + uranus-glass-command.css. */

.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { flex: none; }
[dir="rtl"] .ic.flip, [dir="ltr"] .ic.flip { transform: scaleX(-1); }
[dir="rtl"] .pstep .ic:not(.flip), [dir="rtl"] .nchev { transform: scaleX(-1); }
[dir="rtl"] .pstep .ic.flip { transform: none; }
.tx-bad { color: var(--bad); } .tx-warn { color: var(--warn); }
:focus-visible { outline: 2px solid var(--ug-gold-text); outline-offset: 2px; }

/* ---------- frame ---------- */
.app.ck { display: grid; grid-template-columns: 84px minmax(0, 1fr); min-height:100vh;min-height:100dvh; }
.app.ck .main { min-width: 0; display: flex; flex-direction: column; }

/* ---------- icon rail ---------- */
.rail { position: sticky; top: 0; height:100vh;height:100dvh; z-index: 30; display: flex; flex-direction: column; gap: 6px; padding: 12px 8px;
  background: var(--ug-bar); border-inline-end: 1px solid var(--ug-line); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4); }
.rail-brand { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 4px 0 12px; border-bottom: 1px solid var(--ug-line); margin-bottom: 4px; }
.rail-brand img { max-width: 56px; max-height: 36px; }
.rail-brand .wm { display: none; color: var(--u-text); font-weight: 800; letter-spacing: .08em; font-size: 14px; line-height: 1.15; }
.rail-brand .wm small { display: block; color: var(--ug-gold-text); font-weight: 700; letter-spacing: .02em; font-size: 11.5px; }
.rail-nav { display: flex; flex-direction: column; gap: 4px; }
.rail-btn { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 100%; min-height: 58px; padding: 8px 4px;
  border: 1px solid transparent; border-radius: 14px; background: none; color: var(--ink-2); font: inherit; font-size: 11px; font-weight: 700; line-height: 1.2; text-align: center; cursor: pointer; transition: background .2s, color .2s; }
.rail-btn .ic { width: 22px; height: 22px; }
.rail-btn:hover { background: var(--ug-soft); color: var(--u-text); }
.rail-btn.active { color: var(--ug-gold-text); background: var(--ug-pill-on); box-shadow: var(--ug-pill-on-shadow); }
html[data-theme="dark"] .rail-btn.active { color: #FFD48A; }
.rail-btn .rl { max-width: 100%; overflow-wrap: anywhere; }
.rc { position: absolute; top: 4px; inset-inline-end: 8px; min-width: 18px; padding: 0 5px; border-radius: 999px; background: #C2352F; color: #fff; font-size: 10.5px; font-weight: 800; line-height: 18px; font-style: normal; text-align: center; }
.rail-admin { margin-top: auto; position: relative; }
.gear-pop { position: absolute; bottom: 0; inset-inline-start: calc(100% + 10px); z-index: 60; min-width: 230px; }
.gear-pop, .um-pop, .mm-pop, .sheet { padding: 6px; border: 1px solid var(--ug-line-2); border-radius: 16px; background: var(--ug-glass-solid); box-shadow: var(--ug-shadow-pop); color: var(--ink); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
@media (min-width: 1440px) {
  .app.ck { grid-template-columns: 224px minmax(0, 1fr); }
  .rail { padding: 14px 12px; }
  .rail-brand { justify-content: flex-start; padding-inline: 8px; }
  .rail-brand .wm { display: block; }
  .rail-btn { flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 44px; padding: 10px 12px; font-size: 14px; text-align: start; }
  .rail-btn .rc { position: static; margin-inline-start: auto; }
}

/* ---------- top bar + user menu ---------- */
.app.ck .top { padding: 10px 24px; min-height: 62px; flex-wrap: nowrap; }
.ttl { display: flex; flex-direction: column; min-width: 0; }
.ttl .crumb { font-size: 11.5px; font-weight: 700; color: var(--ink-3); letter-spacing: .02em; }
.ttl h1 { font-size: 19px; line-height: 1.25; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.um { position: relative; }
.um-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 12px 4px 4px; border: 1px solid var(--ug-line-2); border-radius: 999px; background: var(--ug-soft); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
[dir="rtl"] .um-btn { padding: 4px 4px 4px 12px; }
.um-btn:hover { border-color: var(--ug-hover); }
.av { display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 50%; background: var(--ug-gold-btn); color: var(--ug-on-gold); font-size: 12.5px; font-weight: 800; }
.gdot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--warn); box-shadow: 0 0 0 2px var(--ug-soft); }
.gdot.on { background: var(--good); }
.um-pop { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 60; width: 320px; max-width: calc(100vw - 24px); }
.um-who { display: flex; align-items: center; gap: 10px; padding: 10px 12px 12px; border-bottom: 1px solid var(--ug-line); margin-bottom: 6px; }
.um-who div { display: flex; flex-direction: column; min-width: 0; }
.um-who span { font-size: 12px; color: var(--ink-3); }
.um-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: none; color: var(--ink); font: inherit; font-weight: 600; text-align: start; text-decoration: none; cursor: pointer; }
.um-item:hover { background: var(--ug-soft); }
.um-item.danger { color: var(--bad); }
.um-row { display: flex; align-items: center; gap: 8px; padding: 8px 12px; flex-wrap: wrap; }
.um-row .um-l { flex: 1; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink-2); }
.um-row select.inp { width: auto; min-height: 36px; padding: 4px 10px; }
.um-row .seg button { display: inline-flex; align-items: center; gap: 4px; }
.um-row .seg .ic { width: 16px; height: 16px; }

/* ---------- shared period bar ---------- */
.pbar { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; padding: 10px 24px; border-bottom: 1px solid var(--ug-line); }
.pbar .seg { max-width: none; }
.pstep { display: inline-flex; align-items: center; gap: 6px; }
.pbtn { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--ug-line-2); border-radius: 50%; background: var(--ug-soft); color: var(--ink); cursor: pointer; }
.pbtn:hover:not(:disabled) { border-color: var(--ug-hover); }
.pbtn:disabled { opacity: .4; cursor: not-allowed; }
.plabel { font-weight: 800; font-size: 15px; color: var(--u-text); min-width: 0; }
.pdue { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }

/* ---------- sub views of an area ---------- */
.subtabs { display: inline-flex; gap: 4px; padding: 5px; margin: 14px 24px 0; width: max-content; max-width: calc(100% - 48px); overflow-x: auto; scrollbar-width: none; border-radius: 999px;
  background: var(--ug-capsule); border: 1px solid var(--ug-line-2); box-shadow: var(--ug-capsule-shadow); -webkit-backdrop-filter: var(--ug-blur-strong); backdrop-filter: var(--ug-blur-strong); }
.subtabs::-webkit-scrollbar { display: none; }
.subtabs .count, .seg .n { display: inline-block; min-width: 18px; padding: 0 5px; margin-inline-start: 4px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); font-size: 11px; line-height: 18px; text-align: center; }
.subtabs .tab.active .count { background: #C2352F; color: #fff; }
.app.ck .content { padding: 16px 24px 64px; gap: 16px; }
.sec-h { margin: 10px 0 -4px; font-size: 15px; color: var(--ink-2); }

/* ---------- home: Needs you + KPI strip + matrix ---------- */
.home-grid { display: grid; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); gap: 16px; align-items: start; }
.home-grid > section { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.nlist, .nmini ul, .tlist, .dr-sec ul, .q-ul { list-style: none; margin: 0; padding: 0; }
.nlist { display: flex; flex-direction: column; gap: 6px; }
.nitem { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 1px solid var(--ug-line); border-radius: 14px; background: var(--ug-soft); color: var(--ink); font: inherit; text-align: start; cursor: pointer; }
.nitem:hover { border-color: var(--ug-hover); }
.nn { min-width: 34px; font-size: 22px; font-weight: 800; text-align: center; line-height: 1; }
.s-bad .nn { color: var(--bad); } .s-warn .nn { color: var(--warn); } .s-info .nn { color: var(--info); }
.nl { flex: 1; min-width: 0; font-weight: 700; font-size: 13.5px; }
.nl small { display: block; font-weight: 600; color: var(--ink-3); font-size: 12px; }
.nchev { width: 16px; height: 16px; color: var(--ink-3); }
.nmini { margin-top: 16px; }
.nmini h4 { display: flex; align-items: center; justify-content: space-between; margin: 0 0 6px; font-size: 13px; color: var(--ink-2); }
.nmini li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 7px 0; border-bottom: 1px solid var(--ug-line); font-size: 13px; }
.nmini li:last-child { border-bottom: 0; }
.nmini li small { width: 100%; }
.tlist li + li { border-top: 1px solid var(--ug-line); }
.titem { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; width: 100%; padding: 8px 2px; border: 0; background: none; color: var(--ink); font: inherit; font-size: 13px; text-align: start; cursor: pointer; }
.titem span[dir] { flex: 1; min-width: 140px; }
.kstrip { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; }
.k { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--ug-line); border-radius: 16px; background: var(--ug-glass); box-shadow: var(--ug-shadow); color: var(--ink); font: inherit; text-align: start; -webkit-backdrop-filter: var(--ug-blur); backdrop-filter: var(--ug-blur); }
button.k { cursor: pointer; } button.k:hover { border-color: var(--ug-hover); }
.k .lbl { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.k b { font-size: 24px; font-weight: 800; line-height: 1.2; }
.k b small { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.k .ft { font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.k-wide { grid-column: span 2; }
.k .bar { height: 6px; background: var(--line-2); border-radius: 99px; overflow: hidden; margin: 4px 0 2px; }
.k .bar i { display: block; height: 100%; background: var(--ug-gold-btn); border-radius: 99px; }

/* ---------- matrix ---------- */
.mx-bd { display: flex; flex-direction: column; gap: 12px; }
.mx-f { max-width: 100%; }
.mx-wrap { overflow-x: auto; }
.mx { table-layout: fixed; min-width: 620px; }
.mx th, .mx td { padding: 4px; border: 0; background: none; text-align: center; }
.mx thead th { font-size: 12px; color: var(--ink-2); white-space: normal; line-height: 1.25; padding-bottom: 6px; }
.mx th[scope="row"] { width: 128px; text-align: start; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mx thead th:first-child { width: 128px; text-align: start; }
.mx-cell { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; min-height: 46px; padding: 4px; border: 1px solid var(--ug-line); border-radius: 12px; background: var(--ug-soft); color: var(--ink); font: inherit; cursor: pointer; transition: transform .12s, border-color .12s, opacity .2s; }
.mx-cell:hover { border-color: var(--ug-hover); transform: translateY(-1px); }
.mx-v { font-size: 17px; font-weight: 800; line-height: 1; }
.mx-m { position: absolute; top: 3px; inset-inline-end: 5px; font-size: 11px; font-weight: 800; }
.mx-d { font-size: 11.5px; font-weight: 700; color: inherit; margin-bottom: 4px; }
.st-ontime { color: var(--good); }
.st-missing { background: var(--bad-bg); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.st-late { background: var(--warn-bg); color: var(--warn); }
.st-notdue { color: var(--ink-3); }
.st-draft { background: var(--info-bg); color: var(--info); }
.st-review { box-shadow: inset 0 0 0 2px var(--ug-gold-line); }
.st-revision { background: var(--bad-bg); color: var(--bad); }
.h-good { background: var(--good-bg); color: var(--good); }
.h-warn { background: var(--warn-bg); color: var(--warn); }
.h-bad { background: var(--bad-bg); color: var(--bad); }
.mx-cell.dim, .dot.dim { opacity: .28; }
.mx-hint { margin: 0; }
.mx-legend .lg { width: 12px; height: 12px; border-radius: 4px; display: inline-block; border: 1px solid var(--ug-line); }
.mx-acc { display: none; }
.mx-row { border-bottom: 1px solid var(--ug-line); }
.mx-row:last-child { border-bottom: 0; }
.mx-row summary { display: flex; align-items: center; gap: 6px; padding: 12px 2px; cursor: pointer; list-style: none; flex-wrap: wrap; }
.mx-row summary::-webkit-details-marker { display: none; }
.mx-row summary .sp { flex: 1; }
.mx-row .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--line-2); display: inline-block; border: 1px solid var(--ug-line); }
.mx-row .dot.h-good { background: var(--good); } .mx-row .dot.h-warn { background: var(--warn); } .mx-row .dot.h-bad, .mx-row .dot.st-missing, .mx-row .dot.st-revision { background: var(--bad); }
.mx-row .dot.st-late { background: var(--warn); } .mx-row .dot.st-draft { background: var(--info); }
.mx-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 6px; padding: 0 0 12px; }
.mx-chips .mx-cell { min-height: 56px; }

/* ---------- unit drawer ---------- */
.drawer-bg { position: fixed; inset: 0; z-index: 80; background: var(--ug-scrim); }
.drawer { position: fixed; top: 0; bottom: 0; inset-inline-end: 0; z-index: 90; width: min(460px, 100%); display: flex; flex-direction: column; background: var(--ug-glass-solid); border-inline-start: 1px solid var(--ug-line-2); box-shadow: var(--ug-shadow-pop); color: var(--ink); -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px); }
.dr-hd { display: flex; align-items: flex-start; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--ug-line); }
.dr-hd > div { flex: 1; min-width: 0; }
.dr-hd h3 { margin: 0 0 2px; font-size: 17px; }
.dr-bd { flex: 1; overflow: auto; padding: 14px 18px; display: flex; flex-direction: column; gap: 16px; }
.dr-sec h4 { margin: 0 0 8px; font-size: 13px; color: var(--ink-2); }
.dr-sec li { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--ug-line); font-size: 13px; }
.dr-sec li:last-child { border-bottom: 0; }
.dr-sec > .row { margin-top: 8px; }
.hstrip { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; }
.hcell { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 50px; padding: 4px 0; border: 1px solid var(--ug-line); border-radius: 10px; background: var(--ug-soft); color: var(--ink); font: inherit; font-weight: 800; font-size: 14px; cursor: pointer; }
.hcell:disabled { cursor: default; }
.hcell small { font-size: 10.5px; font-weight: 700; color: var(--ink-2); }
.dr-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.dr-kpis div { display: flex; flex-direction: column; align-items: center; padding: 8px; border: 1px solid var(--ug-line); border-radius: 12px; background: var(--ug-soft); }
.dr-kpis b { font-size: 20px; } .dr-kpis span { font-size: 11.5px; color: var(--ink-2); font-weight: 600; }
.dr-ft { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 18px; border-top: 1px solid var(--ug-line); }

/* ---------- review queue ---------- */
.queue { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 16px; align-items: start; }
.qlist { position: sticky; top: 76px; max-height:calc(100vh - 96px);max-height:calc(100dvh - 96px); overflow: auto; border: 1px solid var(--ug-line); border-radius: 18px; background: var(--ug-glass); box-shadow: var(--ug-shadow); -webkit-backdrop-filter: var(--ug-blur); backdrop-filter: var(--ug-blur); scrollbar-width: thin; }
.q-hd { position: sticky; top: 0; z-index: 2; padding: 10px; border-bottom: 1px solid var(--ug-line); background: var(--ug-glass-solid); }
.q-hd .seg { max-width: 100%; }
.q-ul { padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.q-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border: 1px solid transparent; border-radius: 12px; background: none; color: var(--ink); font: inherit; text-align: start; cursor: pointer; }
.q-row:hover { background: var(--ug-soft); }
.q-row.on { background: var(--ug-pill-on); border-color: var(--ug-gold-line); }
.q-k { flex: none; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.k-rep { background: var(--info-bg); color: var(--info); } .k-req { background: var(--warn-bg); color: var(--warn); } .k-gap { background: var(--bad-bg); color: var(--bad); }
.q-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.q-u { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-main small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-n { flex: none; font-size: 16px; font-weight: 800; }
.qpane { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.q-back { display: none; align-self: flex-start; }

/* ---------- report head + sticky decision bar ---------- */
.rhead .bd { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.rh-main { flex: 1; min-width: 200px; }
.rh-t { margin: 0 0 2px; font-size: 18px; font-weight: 800; color: var(--u-text); }
.rh-t .muted { font-weight: 600; font-size: 15px; }
.more-menu { position: relative; }
.more-menu > summary { list-style: none; }
.more-menu > summary::-webkit-details-marker { display: none; }
.mm-pop { position: absolute; top: calc(100% + 6px); inset-inline-end: 0; z-index: 40; min-width: 210px; }
.dbar { position: sticky; bottom: 12px; z-index: 15; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--ug-line-2); border-radius: 16px; background: var(--ug-glass-solid); box-shadow: var(--ug-shadow-pop); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.dbar .sp { flex: 1; }
.dbar .keys { white-space: nowrap; }

/* ---------- bottom tabs + more sheet (phone) ---------- */
.btabs { display: none; }
.sheet-bg { position: fixed; inset: 0; z-index: 70; background: var(--ug-scrim); }
.sheet { position: fixed; z-index: 75; inset-inline: 10px; bottom: calc(72px + env(safe-area-inset-bottom)); }

/* ---------- empty states, tables as cards ---------- */
.es { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 34px 20px; text-align: center; color: var(--ink-2); }
.es p { margin: 0; max-width: 520px; }
.kanban { align-items: start; }
.kcol { min-height: 0; }

/* ---------- compare: one-line data source note ---------- */
.src-note { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }

/* ---------- settings: native file + colour inputs as kit controls ---------- */
input[type="file"].inp, .content input[type="file"] { min-height: 44px; padding: 6px; border: 1px dashed var(--ug-line-2); border-radius: 12px; background: var(--ug-soft); color: var(--ink-2); font: inherit; max-width: 100%; }
.content input[type="file"]::file-selector-button { margin-inline-end: 10px; padding: 7px 14px; border: 0; border-radius: 10px; background: var(--ug-gold-btn); color: var(--ug-on-gold); font: inherit; font-weight: 700; cursor: pointer; }
.content input[type="color"] { width: 54px; height: 40px; padding: 3px; border: 1px solid var(--ug-line-2); border-radius: 12px; background: var(--ug-soft); cursor: pointer; }
.content input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.content input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 9px; }

/* ---------- tablet ---------- */
@media (max-width: 1100px) {
  .home-grid { grid-template-columns: minmax(0, 1fr); }
  .queue { grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); }
  .dbar .keys { display: none; }
}
/* ---------- phone ---------- */
@media (max-width: 760px) {
  .app.ck { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .app.ck .top { padding: 8px 14px; min-height: 56px; }
  .ttl .crumb, .um-name { display: none; }
  .um-btn, [dir="rtl"] .um-btn { padding: 3px 8px 3px 3px; }
  [dir="rtl"] .um-btn { padding: 3px 3px 3px 8px; }
  .top [data-program-accounts] { display: none; }
  .pbar { padding: 8px 14px; gap: 8px; }
  .pdue { width: 100%; }
  .subtabs { margin: 10px 14px 0; max-width: calc(100% - 28px); }
  .app.ck .content { padding: 12px 14px calc(96px + env(safe-area-inset-bottom)); }
  .kstrip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .k b { font-size: 21px; }
  .mx-wrap { display: none; }
  .mx-acc { display: block; }
  .mx-legend { display: none; }
  .queue { grid-template-columns: minmax(0, 1fr); }
  .queue .qpane { display: none; }
  .queue.show-detail .qlist { display: none; }
  .queue.show-detail .qpane { display: flex; }
  .qlist { position: static; max-height: none; }
  .q-back { display: inline-flex; }
  .dbar { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .dbar .btn { flex: 1 1 auto; }
  .dbar .sp { display: none; }
  .btabs { position: fixed; z-index: 50; inset-inline: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: var(--ug-glass-solid); border-top: 1px solid var(--ug-line-2); box-shadow: 0 -8px 24px rgb(0 0 0 / .18); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
  .btabs button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 52px; padding: 4px 2px; border: 0; border-radius: 12px; background: none; color: var(--ink-2); font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }
  .btabs button.active { color: var(--ug-gold-text); background: var(--ug-pill-on); }
  html[data-theme="dark"] .btabs button.active { color: #FFD48A; }
  .btabs .rc { top: 2px; inset-inline-end: calc(50% - 22px); }
  .drawer { width: 100%; }
  .hstrip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .rhead .bd { flex-wrap: nowrap; }
  .rh-main { min-width: 0; }
  .grid.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 12px 14px; }
  .stat .val { font-size: 24px; }
  /* tables become cards */
  table.tbl-cards thead { display: none; }
  table.tbl-cards, table.tbl-cards tbody, table.tbl-cards tr, table.tbl-cards td { display: block; width: 100%; }
  table.tbl-cards tr { padding: 10px 14px; border-bottom: 1px solid var(--ug-line); }
  table.tbl-cards td { padding: 3px 0; border: 0; text-align: start; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
  table.tbl-cards td[data-label]::before { content: attr(data-label); min-width: 92px; font-size: 12px; font-weight: 700; color: var(--ink-3); }
  table.tbl-cards td.num { justify-content: flex-start; }
  table.tbl-cards td.empty { display: block; }
}
details.fold > summary { cursor: pointer; list-style: none; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary h3::before { content: "▸ "; color: var(--ink-3); }
details.fold[open] > summary h3::before { content: "▾ "; }
[dir="rtl"] details.fold:not([open]) > summary h3::before { content: "◂ "; }
details.fold:not([open]) > summary { border-bottom: 0; }
.qpane table td:first-child, .qpane table th:first-child { min-width: 150px; }

.tpl-grid { grid-template-columns: 240px minmax(0, 1fr); }
@media (max-width: 760px) {
  .tpl-grid { grid-template-columns: minmax(0, 1fr); }
  .dbar { gap: 6px; padding: 8px; }
  .dbar .btn { min-height: 40px; padding: 6px 10px; }
  .dbar [data-qprev] { display: none; }
  .dbar [data-qnext] { flex: 0 0 auto; }
  .rhead ~ .grid .stat .ft { display: none; }
}
@media (max-width: 760px) {
  table.tbl-cards tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 12px; }
  table.tbl-cards td:first-child, table.tbl-cards td.empty { grid-column: 1 / -1; }
  table.tbl-cards td[data-label] { flex-direction: column; align-items: flex-start; gap: 0; font-size: 12.5px; }
  table.tbl-cards td[data-label]::before { min-width: 0; font-size: 11px; }
}
/* contrast (WCAG AA) on stacked glass layers */
.pdue { color: var(--ink-2); }
.q-row small.muted, .kcard .m { color: var(--ink-2); }
html[data-theme="dark"] .badge.b-bad, html[data-theme="dark"] .k-gap, html[data-theme="dark"] .q-n.tx-bad { color: #FFC9C9; }
html[data-theme="dark"] .badge.b-warn, html[data-theme="dark"] .k-req { color: #FFD9B0; }

/* =================== round 2 =================== */
/* ---------- Ask AI: top-bar button + slide-over panel ---------- */
.ai-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 4px 14px; margin-inline-end: 8px; border: 1px solid var(--ug-gold-line); border-radius: 999px; background: var(--ug-gold-soft); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; }
.ai-btn .ic { width: 18px; height: 18px; color: var(--ug-gold-text); }
html[data-theme="light"] .ai-btn .ic { color: #8A5A00; }
.ai-btn:hover, .ai-btn.active { border-color: var(--ug-hover); background: var(--ug-pill-on); box-shadow: var(--ug-pill-on-shadow); }
.ai-panel { position: fixed; z-index: 65; top: calc(var(--u-shell-h, 0px) + 10px); bottom: 10px; inset-inline-end: 10px; width: min(420px, calc(100vw - 20px)); display: flex; flex-direction: column; border: 1px solid var(--ug-line-2); border-radius: 20px; background: var(--ug-glass-solid); box-shadow: var(--ug-shadow-pop); color: var(--ink); -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px); overflow: hidden; animation: ai-in .18s ease-out; }
@keyframes ai-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .ai-panel { animation: none; } }
.ai-hd { display: flex; align-items: center; gap: 8px; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--ug-line); }
[dir="rtl"] .ai-hd { padding: 12px 16px 12px 12px; }
.ai-hd .ic { color: var(--ug-gold-text); }
html[data-theme="light"] .ai-hd .ic { color: #8A5A00; }
.ai-hd h2 { margin: 0; font-size: 16px; }
.ai-hd .sp { flex: 1; }
.ai-hd .ai-x .ic { color: var(--ink-2); width: 18px; height: 18px; }
.ai-ctx { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px 16px; border-bottom: 1px solid var(--ug-line); }
.ai-ctx .ic { width: 14px; height: 14px; }
.ai-chip { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--ug-gold-line); background: var(--ug-gold-soft); font-size: 12.5px; font-weight: 700; }
.ai-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ai-body .msgs { padding: 14px; }
.ai-body .msg { max-width: 92%; font-size: 14px; }
.ai-body .sugs { padding: 0 14px 12px; }
.ai-body .composer { padding: 10px 12px; }
.ai-body .composer .inp { min-width: 0; }
.ai-na, .chat .ai-na { padding: 0 14px 12px; }
/* keep page content readable beside the panel on wide screens */
@media (min-width: 1600px) { .app.ck.ai-on .main { padding-inline-end: 436px; } }

/* ---------- templates: compact field list + field drawer ---------- */
.tf-h { margin: 0 0 8px; font-size: 13px; color: var(--ink-2); }
.tf-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tf-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--ug-line); border-radius: 14px; background: var(--ug-soft); }
.tf-row:hover, .tf-row.on { border-color: var(--ug-hover); }
.tf-i { flex: none; width: 26px; text-align: center; font-size: 12px; font-weight: 800; color: var(--ink-2); }
.tf-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; padding: 6px 4px; border: 0; background: none; color: var(--ink); font: inherit; text-align: start; cursor: pointer; }
.tf-open > b { flex: 1 1 200px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-meta { display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.tf-m i { font-style: normal; font-weight: 700; color: var(--ink-3); margin-inline-end: 3px; }
.tf-mv { flex: none; display: flex; gap: 2px; }
.tf-mv .btn { min-width: 34px; padding-inline: 8px; }
.tf-drawer .field { margin-bottom: 10px; }
.tf-drawer .dr-sec > .field:last-child { margin-bottom: 0; }
.chk { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; margin-top: 4px; }
.chk input { width: 18px; height: 18px; accent-color: var(--ug-gold-text); }
@media (max-width: 760px) {
  .tf-open > b { flex-basis: 100%; white-space: normal; }
  .tf-mv { flex-direction: column; }
}

/* ---------- problems heat-map: countries × categories ---------- */
.is-dep { margin-bottom: 12px; max-width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: thin; }
.is-dep button { white-space: nowrap; }
.hm-wrap { overflow-x: auto; }
.hm-t { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 4px; }
.hm-t th, .hm-t td { padding: 0; border: 0; background: none; text-align: center; vertical-align: middle; }
.hm-t thead th { font-size: 12px; font-weight: 700; color: var(--ink-2); line-height: 1.25; padding-bottom: 4px; vertical-align: bottom; }
.hm-t thead th span { display: block; overflow-wrap: anywhere; }
.hm-t .hm-c0 { width: 128px; text-align: start; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-t .hm-sum { width: 52px; font-size: 14px; }
.hm { display: grid; place-items: center; width: 100%; min-height: 42px; border: 1px solid var(--ug-line); border-radius: 10px; background: var(--ug-soft); color: var(--ink); font: inherit; font-weight: 800; font-size: 15px; }
button.hm { cursor: pointer; transition: transform .12s, border-color .12s; }
button.hm:hover { border-color: var(--ug-hover); transform: translateY(-1px); }
button.hm.sel { outline: 2px solid var(--ug-gold-text); outline-offset: 1px; }
.hm.h0 { opacity: .55; }
.hm.h1 { background: rgb(232 93 93 / .16); border-color: rgb(232 93 93 / .35); }
.hm.h2 { background: rgb(232 93 93 / .38); border-color: rgb(232 93 93 / .55); }
.hm.h3 { background: #B4232B; border-color: #D9434B; color: #fff; }
html[data-theme="light"] .hm.h1 { background: #FDECEB; border-color: #F3C1BD; color: #5A1712; }
html[data-theme="light"] .hm.h2 { background: #F6B8B3; border-color: #E68D86; color: #4A0F0A; }
.legend i.hm { width: 14px; height: 14px; min-height: 0; border-radius: 4px; display: inline-block; }
.hm-tot td, .hm-tot th { font-size: 13px; font-weight: 700; color: var(--ink-2); padding-top: 4px; }
.is-active { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
@media (max-width: 760px) {
  .hm-t { border-spacing: 2px; }
  .hm-t .hm-c0 { width: 40px; }
  .hm-cn { display: none; }
  .hm-t .hm-sum { width: 30px; font-size: 12px; }
  .hm-t thead th { height: 112px; padding-bottom: 6px; }
  .hm-t thead th span { writing-mode: vertical-rl; transform: rotate(180deg); margin: 0 auto; max-height: 108px; overflow: hidden; font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
  [dir="rtl"] .hm-t thead th span { transform: none; }
  .hm { min-height: 34px; font-size: 13px; border-radius: 8px; }
}

/* ---------- settings › integrations (Gemini) ---------- */
.gm-grid { align-items: start; }
.gm-form { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--ug-line); }
.gm-form .field { margin-bottom: 8px; }
.gm-form [data-gmmsg]:empty { display: none; }
@media (max-width: 760px) { .gm-grid { grid-template-columns: minmax(0, 1fr); } .ai-btn span { display: none; } .ai-btn { padding: 4px 10px; } }

/* ---------- shared Uranus top bar (uranus-shell, mounted above #root) ---------- */
html.has-shell .rail { top: var(--u-shell-h, 0px); height:calc(100vh - var(--u-shell-h, 0px));height:calc(100dvh - var(--u-shell-h, 0px)); }
html.has-shell .app.ck { min-height:calc(100vh - var(--u-shell-h, 0px));min-height:calc(100dvh - var(--u-shell-h, 0px)); }
html.has-shell .qlist { top: calc(76px + var(--u-shell-h, 0px)); max-height:calc(100vh - 96px - var(--u-shell-h, 0px));max-height:calc(100dvh - 96px - var(--u-shell-h, 0px)); }
html.has-shell .rail-brand { display: none; }
@media (min-width: 761px) { html.has-shell .um-pref { display: none; } }
.um-gm { display: none; }
/* with the shared bar (which has its own account menu) the cockpit menu becomes a compact Gemini/role chip on desktop */
@media (min-width: 761px) { html.has-shell .um-btn .av, html.has-shell .um-name { display: none; } html.has-shell .um-gm { display: inline; } html.has-shell .um-btn, html.has-shell [dir="rtl"] .um-btn { padding: 4px 14px; } }
/* ==== admin-hub:2026-11-11 BEGIN — the system's admin hub (display rule 8): grouped cards, alerts strip, breadcrumb.
   Same look as Admission #/admin (values measured from its computed styles, dark + light). Copied into each app;
   only the LIGHT selector changes per app. Light crumb colours are one step darker than
   Admission's (#5A3900 / #4D4156 instead of #7A4E00 / #574A5F) to pass AA over the light glow. Rules sit under .uah so they beat app-wide resets
   such as `html[data-theme] * { border-color: var(--color-border) }`. ==== */
.uah, .uah-crumb { --uah-text: #EEE7F4; --uah-hi: #F6F0FA; --uah-sub: #C3B6D3; --uah-muted: #C3B6D3; --uah-line: rgb(255 255 255 / .1);
  --uah-gold: #FFD285; --uah-chip: #FFC766; --uah-chip-bg: rgb(252 172 50 / .14); --uah-al-bg: rgb(252 172 50 / .14); --uah-al-bd: rgb(252 172 50 / .35);
  --uah-card: linear-gradient(160deg, rgb(255 255 255 / .067), rgb(255 255 255 / .024)); --uah-card-bd: rgb(255 255 255 / .1);
  --uah-shadow: inset 0 1px 0 rgb(255 255 255 / .06), 0 14px 40px rgb(5 2 10 / .35); --uah-crumb-b: #F1ECF6;
  --uah-ok: #9BE7BC; --uah-ok-bg: rgb(52 168 83 / .16); --uah-warn: #FFD9B0; --uah-warn-bg: rgb(252 172 50 / .16); }
html[data-theme="light"] :is(.uah, .uah-crumb) { --uah-text: #2E1338; --uah-hi: #2E1338; --uah-sub: #4D4156; --uah-muted: #4D4156; --uah-line: rgb(59 26 80 / .12);
  --uah-gold: #5A3900; --uah-chip: #5A3900; --uah-chip-bg: rgb(252 172 50 / .2); --uah-al-bg: rgb(252 172 50 / .16); --uah-al-bd: rgb(233 151 29 / .5);
  --uah-card: linear-gradient(160deg, rgb(255 255 255 / .82), rgb(255 255 255 / .6)); --uah-card-bd: rgb(59 26 80 / .12);
  --uah-shadow: inset 0 1px 0 #fff, 0 12px 30px rgb(59 26 80 / .1); --uah-crumb-b: #1E1726;
  --uah-ok: #17613A; --uah-ok-bg: rgb(52 168 83 / .14); --uah-warn: #7A4300; --uah-warn-bg: rgb(252 172 50 / .2); }
.uah { color: var(--uah-text); }
.uah-head { margin: 0 0 20px; }
.uah-head h1 { margin: 0; font-size: clamp(22px, 2vw, 26px); font-weight: 700; line-height: 1.5; color: var(--uah-hi); }
.uah-head p { margin: 3px 0 0; font-size: 14px; font-weight: 500; line-height: 1.5; color: var(--uah-sub); }
.uah .uah-alerts { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; padding-block: 8px; padding-inline: 14px 10px;
  border-radius: 12px; border: 1px solid var(--uah-al-bd); background: var(--uah-al-bg); color: var(--uah-text); font-size: 12.5px; line-height: 1.5; }
.uah .uah-alerts > b { font-weight: 700; }
.uah .uah-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 0; border-radius: 999px; background: var(--uah-chip-bg);
  color: var(--uah-chip); font: inherit; font-size: 12px; font-weight: 700; line-height: 18px; text-decoration: none; cursor: pointer; }
.uah .uah-chip:hover, .uah .uah-chip:focus-visible { text-decoration: underline; }
.uah-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.uah .uah-card { min-width: 0; margin: 0; padding: 0; border-radius: 18px; border: 1px solid var(--uah-card-bd); background: var(--uah-card); box-shadow: var(--uah-shadow); color: var(--uah-text); }
.uah .uah-card > .uah-hd { display: flex; align-items: center; gap: 8px; padding: 15px 18px; border-bottom: 1px solid var(--uah-line); }
.uah .uah-card > .uah-hd h3 { margin: 0; font-size: 15.5px; font-weight: 700; line-height: 1.5; color: var(--uah-hi); }
.uah .uah-card > .uah-bd { padding: 4px 18px 18px; }
.uah .uah-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 10px 2px; border: 0; border-bottom: 1px solid var(--uah-line);
  background: none; color: var(--uah-text); font: inherit; font-size: 14px; font-weight: 600; line-height: 21px; text-align: start; text-decoration: none; cursor: pointer; }
.uah .uah-link:last-child { border-bottom: 0; }
.uah .uah-link:hover, .uah .uah-link:focus-visible { color: var(--uah-gold); }
.uah .uah-link > .uah-l { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uah .uah-link > svg { flex: none; }
[dir=rtl] .uah .uah-link > svg { transform: scaleX(-1); }
.uah .uah-n, .uah .uah-st { flex: none; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; line-height: 20px; white-space: nowrap; }
.uah .uah-n { min-width: 22px; text-align: center; background: var(--uah-chip-bg); color: var(--uah-chip); font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.uah .uah-st.ok { background: var(--uah-ok-bg); color: var(--uah-ok); }
.uah .uah-st.warn { background: var(--uah-warn-bg); color: var(--uah-warn); }
.uah-crumb { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; font-size: 12.5px; line-height: 19px; color: var(--uah-muted); }
.uah-crumb a { color: var(--uah-gold); font-weight: 700; text-decoration: none; }
.uah-crumb a:hover, .uah-crumb a:focus-visible { text-decoration: underline; }
.uah-crumb b { color: var(--uah-crumb-b); font-weight: 700; }
.uah-crumb .uah-sep { opacity: .7; }
/* ==== admin-hub:2026-11-11 END ==== */
/* =================== round 3 (2026-11-11): one layout system for every Command page ===================
   Page frame (max 1920, centred) · one-row page header (breadcrumb + title | period control | Ask AI) · sub-tabs ·
   content. Overview: KPI strip (6 → 3 → 2 equal cards) · 12-column grid (side column 4 + matrix 8; 3 + 9 on wide
   screens) · calm status-tinted matrix. Marker: round3:2026-11-11. */
.app.ck { --k3-gold: #FFD285; --k3-gap: 16px; }
html[data-theme="light"] .app.ck { --k3-gold: #7A4E00; }

/* ---------- page frame: full-height column, footer (if any) after the content (rule 10) ---------- */
.app.ck > .main { min-width: 0; }
/* header too narrow for one row: title + «اسأل الذكاء» on the first line, the period control on its own line */
/* (viewport widths: content = viewport − 276px panel − 48px padding above 1100px; − 148px on tablet; − 28px on phone) */
@media (max-width: 1315px) {
  html[data-theme] .app.ck .phead .ph-end { display: contents; }
  html[data-theme] .app.ck .phead .ttl { flex: 1 1 0; }
  html[data-theme] .app.ck .phead .ai-btn { order: 1; }
  html[data-theme] .app.ck .phead .pbar { order: 2; width: 100%; }
}
.app.ck .page { width: 100%; max-width: 1920px; margin-inline: auto; min-height: calc(100dvh - var(--u-shell-h, 0px)); display: flex; flex-direction: column; gap: var(--k3-gap); padding: 16px 24px 48px; }
.app.ck .page > .content { flex: 1 1 auto; padding: 0; gap: var(--k3-gap); min-width: 0; }

/* ---------- one-row page header ---------- */
html[data-theme] .app.ck .top.phead { position: static; z-index: auto; display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; min-height: 48px; padding: 0;
  background: none !important; border: 0 !important; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.phead .ttl { flex: 0 1 auto; min-width: 0; gap: 2px; }
.phead .crumb { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12.5px; font-weight: 600; line-height: 1.4; color: var(--ink-2); white-space: nowrap; }
.phead .crumb .sep { opacity: .75; }
[dir="rtl"] .phead .crumb .sep { transform: scaleX(-1); display: inline-block; }
.phead .crumb-a { padding: 0; border: 0; background: none; color: var(--k3-gold); font: inherit; font-weight: 700; cursor: pointer; }
.phead .crumb-a:hover, .phead .crumb-a:focus-visible { text-decoration: underline; }
html[data-theme="light"] .phead .crumb-a { color: #5A3900; }
/* counts inside an active segment / an alert chip: outlined in the text colour (AA on any glass) */
html[data-theme] .app.ck .seg button.active .n, html[data-theme] .uah .uah-chip .uah-n { background: none; box-shadow: inset 0 0 0 1px currentColor; color: inherit; }
.phead .ttl h1 { font-size: 19px; font-weight: 700; line-height: 1.3; }
.phead .ph-end { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px 12px; margin-inline-start: auto; min-width: 0; }
/* period control, inline in the header */
html[data-theme] .phead .pbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; padding: 0; border: 0; background: none; }
.phead .pbar .seg { flex: none; }
.phead .pstep { gap: 4px; }
.phead .pbtn { width: 32px; height: 32px; }
.phead .plabel { font-size: 14.5px; font-weight: 700; white-space: nowrap; padding-inline: 4px; }
html[data-theme] .phead .pdue { display: inline-flex; align-items: center; min-height: 28px; padding: 2px 10px; border: 1px solid var(--ug-line); border-radius: 999px; background: var(--ug-soft); color: var(--ink-2); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
/* «اسأل الذكاء»: secondary (glass) button at the end of the row */
html[data-theme] .app.ck .ai-btn { min-height: 40px; margin: 0; padding: 4px 14px; border: 1px solid var(--ug-line-2); background: var(--ug-soft); box-shadow: none; color: var(--ink); }
html[data-theme] .app.ck .ai-btn .ic { color: var(--k3-gold); }
html[data-theme] .app.ck .ai-btn:hover, html[data-theme] .app.ck .ai-btn.active { border-color: var(--ug-hover); background: var(--ug-pill-on); }
/* sub-tabs: their own row, aligned with the content; wrap instead of scrolling sideways (rule 9) */
html[data-theme] .app.ck .page > .subtabs { margin: 0; max-width: 100%; flex-wrap: wrap; overflow: visible; }

/* ---------- cards: one anatomy ---------- */
.app.ck .card > .hd { min-height: 52px; padding: 12px 18px; gap: 8px 10px; flex-wrap: wrap; }
html[data-theme] .app.ck .card > .hd h3 { font-size: 16px; font-weight: 700; line-height: 1.4; color: var(--u-text); }
.app.ck .card > .bd { padding: 16px 18px; }
.app.ck .card > .bd.flush, .app.ck .card > .bd.mx-flush { padding: 0; }
.hd-n { display: inline-block; min-width: 22px; padding: 0 8px; border-radius: 999px; background: rgb(252 172 50 / .16); color: var(--k3-gold); font-size: 11.5px; font-weight: 700; line-height: 20px; text-align: center; font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
html[data-theme="light"] .hd-n { background: rgb(252 172 50 / .22); }
.app.ck .grid { gap: var(--k3-gap); }
.app.ck .sec-h { margin: 8px 0 0; font-size: 16px; font-weight: 700; color: var(--u-text); }
/* stat tiles on the other pages (requests, problems, report): same anatomy as the KPI cards */
.app.ck .stat { gap: 4px; padding: 14px 16px; }
.app.ck .stat .lbl { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.app.ck .stat .val { font-size: 24px; font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; }
.app.ck .stat .ft { font-size: 12.5px; color: var(--ink-2); }

/* ---------- KPI strip: six equal cards ---------- */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--k3-gap); }
.kp { display: grid; grid-template-rows: auto auto auto 4px; align-content: start; gap: 4px; min-width: 0; height: 100%; padding: 14px 16px; border: 1px solid var(--ug-line); border-radius: 16px;
  background: var(--ug-glass); box-shadow: var(--ug-shadow); color: var(--ink); font: inherit; text-align: start; -webkit-backdrop-filter: var(--ug-blur); backdrop-filter: var(--ug-blur); }
button.kp { cursor: pointer; transition: border-color .15s; }
button.kp:hover { border-color: var(--ug-hover); }
.kp-l { font-size: 12.5px; font-weight: 700; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kp-v { font-size: 24px; font-weight: 800; line-height: 1.2; color: var(--u-text); font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; text-align: start; }
[dir="rtl"] .kp-v { text-align: right; }
.kp-v small { font-size: 13.5px; font-weight: 600; color: var(--ink-2); margin-inline-start: 2px; }
.kp-c { font-size: 11.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kp-bar { display: block; height: 4px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.kp-bar.none { background: none; }
.kp-bar i { display: block; height: 100%; border-radius: 99px; background: var(--ug-gold-btn); }
.kp-att .kp-v { color: var(--k3-gold); }
.kp-good .kp-v { color: var(--good); } .kp-warn .kp-v { color: var(--warn); } .kp-bad .kp-v { color: var(--bad); }
@media (max-width: 1223px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } .kp { padding: 12px 14px; } .kp-v { font-size: 19px; } }

/* ---------- overview grid: side column (4) beside the matrix (8); tops aligned, equal height ---------- */
.dgrid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--k3-gap); align-items: stretch; }
.d-side { grid-column: span 4; min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: var(--k3-gap); contain: size; }
.d-matrix { grid-column: span 8; min-width: 0; display: flex; flex-direction: column; }
.d-matrix > .card { flex: 1 1 auto; }
.d-side > .card { display: flex; flex-direction: column; min-height: 0; }
.d-side > .card > .bd { flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.d-side > .card:first-child { flex: 0 1 auto; }
.d-side > .card:last-child:not(:first-child) { flex: 1 1 0; min-height: 168px; }
@media (min-width: 1804px) { .d-side { grid-column: span 3; } .d-matrix { grid-column: span 9; } }
@media (max-width: 1223px) {
  .d-side { grid-column: 1 / -1; contain: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
  .d-matrix { grid-column: 1 / -1; }
  .d-side > .card > .bd { overflow: visible; }
  .d-side > .card:last-child:not(:first-child) { min-height: 0; }
}
@media (max-width: 588px) { .d-side { grid-template-columns: minmax(0, 1fr); } }

/* «محتاجك» rows: one list, hairlines between rows, fixed row height (rule 5) */
.needs .nlist { gap: 0; }
.needs .nlist li + li { border-top: 1px solid var(--ug-line); }
html[data-theme] .needs .nitem { min-height: 46px; padding: 6px 8px; border: 0; border-radius: 10px; background: none; gap: 10px; }
html[data-theme] .needs .nitem:hover, html[data-theme] .needs .nitem:focus-visible { background: var(--ug-soft); }
.needs > .bd { padding-block: 8px; }
.hd-go { min-width: 32px; min-height: 32px; padding: 0 !important; }
[dir="rtl"] .hd-go .nchev { transform: scaleX(-1); }
.needs .nitem .nn { min-width: 30px; font-size: 19px; color: var(--k3-gold); font-variant-numeric: tabular-nums; }
html[data-theme] .needs .nl { font-size: 14px; font-weight: 700; color: var(--u-text); line-height: 1.35; }
.needs .nl small { font-size: 12.5px; font-weight: 400; color: var(--ink-2); }
/* top open problems */
.plist { list-style: none; margin: 0; padding: 0; }
.plist li + li { border-top: 1px solid var(--ug-line); }
.prow { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 8px 2px; border: 0; background: none; color: var(--ink); font: inherit; text-align: start; cursor: pointer; }
.prow:hover .pt b, .prow:focus-visible .pt b { color: var(--k3-gold); }
.prow .pt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
html[data-theme] .prow .pt b { font-size: 14px; font-weight: 700; color: var(--u-text); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; unicode-bidi: plaintext; }
.prow .pt small { font-size: 12.5px; font-weight: 400; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sev { flex: none; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; line-height: 20px; white-space: nowrap; }
.sev-high { background: var(--bad-bg); color: var(--bad); } .sev-medium { background: var(--warn-bg); color: var(--warn); } .sev-low { background: var(--line-2); color: var(--ink-2); }
html[data-theme="dark"] .sev-high { color: #FFC9C9; } html[data-theme="dark"] .sev-medium { color: #FFD9B0; }

/* ---------- matrix: uniform cells, one fill tint per status, legend chips above ---------- */
.tn-ok { --mx-fill: rgb(74 222 128 / .2); --mx-edge: rgb(74 222 128 / .45); }
.tn-late { --mx-fill: rgb(253 186 116 / .17); --mx-edge: rgb(253 186 116 / .4); }
.tn-miss { --mx-fill: rgb(248 113 113 / .2); --mx-edge: rgb(248 113 113 / .45); }
.tn-rev { --mx-fill: rgb(96 165 250 / .18); --mx-edge: rgb(96 165 250 / .42); }
.tn-none { --mx-fill: rgb(255 255 255 / .035); --mx-edge: rgb(255 255 255 / .14); }
html[data-theme="light"] .tn-ok { --mx-fill: #E3F4EC; --mx-edge: #9FD3B7; }
html[data-theme="light"] .tn-late { --mx-fill: #FFF1D6; --mx-edge: #EDC27A; }
html[data-theme="light"] .tn-miss { --mx-fill: #FCE9E8; --mx-edge: #EBA9A4; }
html[data-theme="light"] .tn-rev { --mx-fill: #E6EFFB; --mx-edge: #A9C4EC; }
html[data-theme="light"] .tn-none { --mx-fill: rgb(59 26 80 / .035); --mx-edge: rgb(59 26 80 / .16); }
.mx-card .mx-bd { display: flex; flex-direction: column; gap: 12px; container-type: inline-size; }
.mx-chipbar { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.mx-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 3px 10px 3px 12px; border: 1px solid var(--ug-line); border-radius: 999px; background: var(--ug-soft); color: var(--ink); font: inherit; font-size: 12.5px; font-weight: 700; white-space: nowrap; cursor: pointer; }
[dir="rtl"] .mx-chip { padding: 3px 12px 3px 10px; }
.mx-chip:hover { border-color: var(--ug-hover); }
.mx-chip.active { border-color: var(--ug-gold-line); background: var(--ug-pill-on); box-shadow: var(--ug-pill-on-shadow); color: var(--k3-gold); }
.mx-chip .n { min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--line-2); color: var(--u-text); font-size: 11.5px; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.sw { display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 4px; background: var(--mx-edge); border: 1px solid var(--mx-edge); color: var(--u-text); font-size: 9px; font-style: normal; font-weight: 800; line-height: 1; }
.mx-card .mx-wrap { overflow-x: auto; }
table.mx { width: 100%; min-width: 540px; table-layout: fixed; border-collapse: separate; border-spacing: 6px; }
table.mx col.mx-c0 { width: 118px; }
table.mx :is(th, td) { padding: 0; border: 0; background: none; text-align: center; vertical-align: middle; }
table.mx thead th { height: 38px; padding-bottom: 2px; vertical-align: bottom; font-size: 12.5px; font-weight: 700; line-height: 1.25; color: var(--u-text); white-space: normal; }
table.mx thead th > span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
table.mx .mx-h0 { position: sticky; inset-inline-start: 0; z-index: 1; width: auto; text-align: start; }
table.mx thead .mx-h0 { color: var(--ink-2); }
table.mx tbody .mx-h0 b { display: block; font-size: 14px; font-weight: 700; color: var(--u-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mx-code { display: block; font-size: 11.5px; font-weight: 600; color: var(--ink-2); direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] .mx-code { text-align: right; }
.mx-card .mx-cell { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: 52px; min-height: 0; padding: 0; border: 1px solid var(--mx-edge); border-radius: 12px;
  background: var(--mx-fill); box-shadow: none; color: var(--u-text); font: inherit; cursor: pointer; transform: none; transition: border-color .15s, opacity .2s; }
.mx-card .mx-cell:hover, .mx-card .mx-cell:focus-visible { border-color: var(--ug-hover); transform: none; }
.mx-card .mx-v { font-size: 16px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.mx-card .tn-miss .mx-v { color: var(--bad); }
.mx-card .tn-none .mx-v { color: var(--ink-2); font-weight: 700; }
.mx-card .mx-m { position: absolute; top: 4px; inset-inline-end: 6px; font-size: 11.5px; font-weight: 800; line-height: 1; color: var(--warn); }
.mx-card .mx-cell.dim { opacity: .25; }
.mx-hint { margin: 0; font-size: 12.5px; color: var(--ink-2); }
@media (min-width: 1804px) { .mx-card .mx-cell { height: 56px; } }
@container (max-width: 545px) { table.mx .mx-h0 { background: var(--ug-glass-solid); } }
/* phone accordion (one row per country) uses the same tints */
.mx-row .dot[class*="tn-"] { background: var(--mx-edge); border-color: var(--mx-edge); }
.mx-chips .mx-cell { height: auto; min-height: 56px; flex-direction: column; gap: 4px; }
.mx-chips .mx-d { font-size: 11.5px; font-weight: 700; color: var(--u-text); margin: 0; }
/* unit drawer: the 8-period strip uses the same tints */
.hcell[class*="tn-"] { background: var(--mx-fill); border-color: var(--mx-edge); color: var(--u-text); }
.hcell.tn-miss > span { color: var(--bad); }

/* ---------- reports table: unit and period never wrap word-by-word ---------- */
.app.ck td.rp-u { white-space: nowrap; }
html[data-theme] .app.ck td.rp-u b { font-size: 14px; font-weight: 700; color: var(--u-text); }
.app.ck td.rp-p { white-space: nowrap; }
.app.ck td.rp-p b { display: block; font-weight: 700; }
.app.ck td.rp-p small { display: block; font-size: 12.5px; color: var(--ink-2); }
@media (min-width: 761px) { .app.ck table.tbl-cards :is(th, td) { padding-inline: 10px; } }
.app.ck table.tbl-cards th { white-space: normal; line-height: 1.3; vertical-align: bottom; }
.app.ck table.tbl-cards td .small.muted { display: block; white-space: nowrap; }
/* tablet: secondary columns (achievement, AI score) step aside instead of a sideways scroll (rule 9); both stay in the report */
@media (761px <= width <= 1100px) { .app.ck table.tbl-cards :is(th, td):is(:nth-child(6), :nth-child(8)) { display: none; } }
/* follow-up cards: meta line at AA on stacked glass */
html[data-theme="dark"] .app.ck .kcard .m, html[data-theme="dark"] .app.ck .kcard .m span { color: var(--ink-2) !important; }

/* ---------- review queue: list sticks under the shared bar ---------- */
html.has-shell .app.ck .qlist { top: calc(16px + var(--u-shell-h, 0px)); max-height: calc(100dvh - 32px - var(--u-shell-h, 0px)); }
.app.ck .queue { gap: var(--k3-gap); }
html[data-theme] .app.ck .q-hd .seg { display: flex; flex-wrap: wrap; border-radius: 18px; }

/* ---------- tablet / phone ---------- */
@media (max-width: 760px) {
  .app.ck .page { padding: 12px 14px calc(96px + env(safe-area-inset-bottom)); gap: 12px; min-height: 0; }
  .app.ck .page > .content { gap: 12px; }
  html[data-theme] .app.ck .top.phead { gap: 8px 12px; }
  .phead .ttl h1 { font-size: 19px; }
  .phead .pbar .seg { flex: 1 1 100%; }
  .phead .pbar .seg button { flex: 1; }
  .phead .pstep { flex: 1 1 auto; }
  .phead .plabel { flex: 1; text-align: center; font-size: 13.5px; }
  html[data-theme] .phead .pdue { font-size: 11.5px; }
  html[data-theme] .app.ck .page > .subtabs { border-radius: 22px; }
}
/* =================== end round 3 =================== */

/* ---------- wave 2-3 (2026-11-12) ---------- */
/* CMD-013: the side column never squeezes «محتاجك» below one full row (a 1×1 matrix made the row ~90 px). */
@media (min-width: 1101px) { .d-side { min-height: 340px; } .d-side > .card.needs { min-height: 132px; } }
/* CMD-015 / rule 3: counts are neutral pills, not danger red. */
.rc, .subtabs .tab.active .count { background: var(--usb-count-bg, #FCAC32); color: var(--usb-count-text, #2A1336); }
/* CMD-018 / rule 1: nothing under 11.5 px. */
html[data-theme] :is(.comment .when, .comment.small, .tnav .count, span.count, .hm-t th span, .hm-t thead th) { font-size: 11.5px; }
/* CMD-020: light theme muted text reaches 4.5:1 on the glass. */
html[data-theme="light"] { --u-muted: #4A3E52; --ink-3: #4A3E52; }
/* CMD-017: tables stack into cards up to tablet width (the 760 px rules above already shape them on phones) */
@media (max-width: 900px) {
  table.tbl-cards thead { display: none; }
  table.tbl-cards, table.tbl-cards tbody, table.tbl-cards tr, table.tbl-cards td { display: block; width: 100%; }
  table.tbl-cards tr { padding: 10px 14px; border-bottom: 1px solid var(--ug-line); }
  table.tbl-cards td { padding: 3px 0; border: 0; text-align: start; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
  table.tbl-cards td[data-label]::before { content: attr(data-label); min-width: 92px; font-size: 12px; font-weight: 700; color: var(--ink-3); }
}
/* CMD-017: filter chips wrap to a second line instead of scrolling (rule 9) */
html[data-theme] :is(.row > .seg, .seg.is-dep) { flex-wrap: wrap; width: auto; max-width: 100%; overflow: visible; border-radius: 18px; }
/* CMD-017: "More ▾" for tab bars that do not fit */
.tabs { position: relative; }
.tabs .tab[hidden] { display: none; }
.tab-more-wrap { position: relative; display: inline-flex; }
.tab-more-menu { position: absolute; top: calc(100% + 6px); inset-inline-end: 0; z-index: 30; min-width: 200px; display: grid; gap: 2px; padding: 6px; border-radius: 14px; border: 1px solid var(--ug-line-2); background: var(--ug-pop, var(--ug-bar)); box-shadow: 0 12px 32px rgb(0 0 0 / .28); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.tab-more-menu[hidden] { display: none; }
.tabs:has(.tab-more-wrap) { overflow: visible; }
/* CMD-018: the late marker in the matrix legend */
html[data-theme] .sw { width: 16px; height: 16px; font-size: 11.5px; }

/* ---------- feature review (2026-11-12) ---------- */
/* Queue filters and sort: one wrapping row under the type segments (rule 9: no sideways strip) */
.q-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.q-tools .inp { width: auto; flex: 1 1 120px; min-width: 0; padding: 6px 8px; font-size: 12.5px; }
.q-tools .btn { flex: 1 1 100%; white-space: normal; }
/* Bulk approve list */
.bk-list { display: grid; gap: 4px; max-height: 50vh; overflow: auto; }
.bk-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--ug-line); border-radius: 12px; cursor: pointer; }
.bk-row:hover { border-color: var(--ug-hover); }
.bk-u { font-weight: 700; overflow-wrap: anywhere; }
.bk-s { font-variant-numeric: tabular-nums; }
/* Filter rows on follow-up, reminders, reports (wrap, never scroll) */
.fx-tools, .rm-tools, .sv-bar { flex-wrap: wrap; gap: 8px; }
.sv-bar { display: inline-flex; align-items: center; }
.rm-tools { margin: 0; }
/* KPI trends: units × periods. A genuine 2-D grid, so it may scroll sideways inside its card on small screens only. */
.tx-wrap { overflow-x: auto; }
.tx-t { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tx-t th, .tx-t td { padding: 6px 8px; border-bottom: 1px solid var(--ug-line); white-space: nowrap; font-size: 12.5px; }
.tx-t thead th { font-weight: 700; color: var(--ink-3); }
.tx-t th.tx-u { text-align: start; font-weight: 700; }
.tx-t tr.tx-tot th, .tx-t tr.tx-tot td { border-top: 2px solid var(--ug-line-2, var(--ug-line)); }
.tx-v, .linkish { border: 0; background: none; padding: 2px 4px; border-radius: 8px; color: inherit; font: inherit; cursor: pointer; }
.tx-v:hover, .linkish:hover, .tx-v:focus-visible, .linkish:focus-visible { background: var(--ug-soft); color: var(--k3-gold, var(--brand-2)); }
.linkish { font-weight: 700; text-align: start; }
.tx-good { color: var(--good); }
.tx-chart { height: 240px; }
@media (min-width: 1101px) { .tx-wrap { overflow-x: visible; } }
/* Keyboard shortcuts list */
.kb-list { display: grid; gap: 6px; }
.kb-row { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; align-items: center; }
kbd { display: inline-block; min-width: 22px; padding: 1px 6px; border: 1px solid var(--ug-line-2, var(--ug-line)); border-radius: 6px; background: var(--ug-soft); font-family: inherit; font-size: 12.5px; font-weight: 600; line-height: 1.6; text-align: center; }
/* Touch: fields at 16 px so iOS does not zoom (rule 14) */
@media (pointer: coarse) { .q-tools .inp, .fx-tools .inp, .sv-bar .inp { font-size: 16px; } }
/* Print-friendly pages: only the content prints (meetings, reports list, matrix, trends…) */
@media print {
  uranus-shell, .rail, .rail-scrim, .btabs, .ai-panel, .ai-btn, .pbar, .subtabs, .dbar, .q-tools, .fx-tools, .sv-bar, .rm-tools, .more-menu, .drawer, .drawer-bg, button.btn, .toast { display: none !important; }
  html, body, .app.ck, .main, .page, .content { background: #fff !important; color: #000 !important; }
  .app.ck { display: block !important; }
  .card { box-shadow: none !important; break-inside: avoid; border-color: #ccc !important; background: #fff !important; }
  * { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; color: #000 !important; }
}
@media (max-width: 760px) { .tx-t th, .tx-t td { padding: 6px 4px; } .tx-chart { height: 200px; } }

/* ---- round 2 (2026-11-12) ---- */
/* R2-CMD-005: "⋯" menu in the task dialog footer; Delete lives inside it as red text on glass (no semantic fill, rule 3) */
.r2-more { position: relative; }
.r2-more > summary { list-style: none; min-width: 40px; }
.r2-more > summary::-webkit-details-marker { display: none; }
.r2-more-pop { position: absolute; bottom: calc(100% + 6px); inset-inline-start: 0; z-index: 5; display: flex; flex-direction: column; gap: 4px; padding: 6px; min-width: 180px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.btn.r2-danger-text, .btn.r2-danger-text:hover { background: var(--surface); border-color: var(--line); color: var(--bad); }
html[data-theme="dark"] .btn.r2-danger-text { color: #ff9b94; }
/* R2-CMD-004: task cards are keyboard targets */
.kcard[role="button"] { cursor: pointer; }
.kcard[role="button"]:focus-visible, [data-act][role="button"]:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; }
/* R2-CMD-007: incomplete network totals are greyed with "n/N units" */
.tx-t .tx-part { color: var(--ink-3); font-weight: 400; }
.tx-t .tx-part small { font-size: 11.5px; margin-inline-start: 2px; }

/* schedule-hierarchy 2026-11-12: follow-up board — the done column is quiet and folded */
.kcol-done .kcard{background:transparent;border-style:dashed;box-shadow:none}
.kcol-done .kcard .t{font-weight:600;color:var(--muted)}
.kcol-hint{margin-inline-start:auto;font-weight:400}
.kcol-more{width:100%;margin-top:4px}
