/* The platform's typeface: IBM Plex Sans Arabic, served from the platform itself (static/fonts, SIL Open Font License 1.1). */
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/IBMPlexSansArabic-Regular.891662a6e9d2.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/IBMPlexSansArabic-Medium.ab75df621fac.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/IBMPlexSansArabic-SemiBold.452ddb9edea6.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/IBMPlexSansArabic-Bold.8640fa458316.woff2") format("woff2"); }
/* RADCO | رادكو design system (docs/BRAND.md, docs/brand/README.md). RTL-first, logical properties. */
:root {
  /* the colour guide approved on 2026-11-29: primary slate #293E53, interactive #55758D, bronze accent #B18B61,
     secondary #E8EDF2, page #F5F6F8, cards #FFFFFF, text #25313D. A value that differs from the guide is a darker
     step of the same hue, chosen to reach WCAG AA where the guide's own value does not (docs/BRAND.md) */
  --ink: #25313d; --ink-2: #4a5a6e; --ink-3: #5d6c81;  /* muted text: 4.5:1 on --bg, --surface and --muted-bg (apps/web/test_a11y.py) */
  --ink-disabled: #9aa5b1;  /* 2.5:1 on white: truly disabled controls only, never hints or dates */
  --bg: #f5f6f8; --surface: #ffffff; --line: #dde3e9;
  --brand: #293e53; --brand-2: #55758d; --brand-soft: #e8edf2;  /* primary; hover of the primary button; secondary surface */
  --interactive: #55758d; --link: #4d6a7f;  /* the guide's interactive blue; links inside text are a darker step of it */
  --sand: #b18b61; --sand-soft: #f4eee6; --accent-strong: #8f6c47; --on-accent: #ffffff;  /* bronze: decorative; filled buttons use --accent-strong */
  --focus: #ab8254;  /* 3:1 on the page, the cards and the side menu */
  --ok: #1d7a46; --ok-soft: #e4f4ea; --warn: #9a6200; --warn-soft: #fbf0d9;
  --danger: #b3261e; --danger-soft: #fbe6e4; --info: #1f5b9a; --info-soft: #e5eef8;
  --radius: 14px; --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(37,49,61,.06), 0 2px 10px rgba(37,49,61,.04);
  --shadow-pop: 0 2px 6px rgba(37,49,61,.08), 0 12px 32px rgba(37,49,61,.16); --shadow-btn: 0 1px 2px rgba(37,49,61,.12), 0 6px 16px rgba(37,49,61,.14); --scrim: rgba(15,24,34,.5);
  --font: "IBM Plex Sans Arabic", "SF Arabic", "Geeza Pro", "Segoe UI", "Noto Sans Arabic", Tahoma, system-ui, sans-serif;
  /* the shell's own surfaces and lines (docs/CONSOLE_UI.md): every colour of the chrome is a token, so a new identity
     or the dark set below changes these lines only */
  --on-brand: #ffffff; --on-sand: #1c2631;  /* text on --brand, --danger, --ok; text on --sand (#25313D on bronze is 4.25:1) */
  --side-bg: #293e53; --side-text: #e8edf2; --side-strong: #ffffff; --side-muted: #b4c3d0; --side-label: #a9b9c7; --side-active: #55758d;
  --side-ws: rgba(255,255,255,.07); --side-hover: rgba(255,255,255,.08); --side-line: rgba(255,255,255,.14);
  --field-bg: #ffffff; --field-line: #c3cdd7; --row-line: #edf0f3; --hover-bg: #e8edf2; --muted-bg: #e8edf2; --code-bg: #eef1f5; --subtle-bg: #eef1f5;
  --ok-line: #c6e6d2; --danger-line: #f1c7c3; --warn-line: #f0dcae; --info-line: #c9dbef;
  --good: #006300; --bad: #d03b3b;  /* a change for the better or the worse in the reports */
  --chart-cur: #55758d; --chart-cmp: #8c98a5; --chart-grid: #e3e8ee; --chart-axis: #c3cdd7; --chart-accent: #b18b61;
  /* the wordmark (templates/_brand.html): the original artwork on light surfaces, its light copy on dark ones */
  --mark-ink: inline-block; --mark-paper: none;
  /* motion (docs/CONSOLE_UI.md): every transition reads these; reduced motion sets them to 0 */
  --dur-fast: 120ms; --dur-base: 180ms; --dur-slow: 260ms;
  --ease-out: cubic-bezier(.2, .7, .2, 1); --ease-in-out: cubic-bezier(.4, 0, .2, 1);
  --press-scale: .98; --enter-shift: 4px;
  color-scheme: light;
}
/* The dark set (apps.core.theme): chosen on the profile ([data-theme="dark"]), or the device's own setting when the
   person chose neither. Screen only: printing, and the printed documents, stay light. The two copies must stay equal
   (apps/web/test_a11y.py checks it and the contrast of each pair). Derived from the guide's hues; waits for the
   owner's approval (docs/BRAND.md). */
@media screen {
  :root[data-theme="dark"] {
    --ink: #e6ebf0; --ink-2: #c3cdd7; --ink-3: #9eacba; --ink-disabled: #66768a; --bg: #0f1822; --surface: #17222e; --line: #2a3847;
    --brand: #8fb0c9; --brand-2: #a9c4d9; --brand-soft: #1f3144; --interactive: #8fb0c9; --link: #a9c4d9;
    --sand: #d1ae85; --sand-soft: #3a2f23; --accent-strong: #d1ae85; --on-accent: #1c2631; --focus: #d9b88f;
    --ok: #6fd69a; --ok-soft: #12301f; --warn: #f0bf63; --warn-soft: #33270f; --danger: #ff9b91; --danger-soft: #3d1b19; --info: #94c2f2; --info-soft: #14263a;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3);
    --shadow-pop: 0 2px 6px rgba(0,0,0,.4), 0 14px 36px rgba(0,0,0,.5); --shadow-btn: 0 1px 2px rgba(0,0,0,.4), 0 6px 16px rgba(0,0,0,.4); --scrim: rgba(0,0,0,.6);
    --on-brand: #0f1822; --on-sand: #1c2631;
    --side-bg: #0b131b; --side-text: #e8edf2; --side-strong: #ffffff; --side-muted: #a9b9c7; --side-label: #94a6b6; --side-active: #3e5a73;
    --side-ws: rgba(255,255,255,.06); --side-hover: rgba(255,255,255,.08); --side-line: rgba(255,255,255,.12);
    --field-bg: #111b25; --field-line: #3a4a5a; --row-line: #223040; --hover-bg: #223142; --muted-bg: #243444; --code-bg: #1f2d3b; --subtle-bg: #1a2733;
    --ok-line: #2a5e40; --danger-line: #6e2c27; --warn-line: #5f4818; --info-line: #27496d;
    --good: #72d68f; --bad: #ff9b91;
    --chart-cur: #8fb0c9; --chart-cmp: #8c98a5; --chart-grid: #2a3847; --chart-axis: #4a5a6b; --chart-accent: #d1ae85;
    --mark-ink: none; --mark-paper: inline-block;
    color-scheme: dark;
  }
}
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #e6ebf0; --ink-2: #c3cdd7; --ink-3: #9eacba; --ink-disabled: #66768a; --bg: #0f1822; --surface: #17222e; --line: #2a3847;
    --brand: #8fb0c9; --brand-2: #a9c4d9; --brand-soft: #1f3144; --interactive: #8fb0c9; --link: #a9c4d9;
    --sand: #d1ae85; --sand-soft: #3a2f23; --accent-strong: #d1ae85; --on-accent: #1c2631; --focus: #d9b88f;
    --ok: #6fd69a; --ok-soft: #12301f; --warn: #f0bf63; --warn-soft: #33270f; --danger: #ff9b91; --danger-soft: #3d1b19; --info: #94c2f2; --info-soft: #14263a;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3);
    --shadow-pop: 0 2px 6px rgba(0,0,0,.4), 0 14px 36px rgba(0,0,0,.5); --shadow-btn: 0 1px 2px rgba(0,0,0,.4), 0 6px 16px rgba(0,0,0,.4); --scrim: rgba(0,0,0,.6);
    --on-brand: #0f1822; --on-sand: #1c2631;
    --side-bg: #0b131b; --side-text: #e8edf2; --side-strong: #ffffff; --side-muted: #a9b9c7; --side-label: #94a6b6; --side-active: #3e5a73;
    --side-ws: rgba(255,255,255,.06); --side-hover: rgba(255,255,255,.08); --side-line: rgba(255,255,255,.12);
    --field-bg: #111b25; --field-line: #3a4a5a; --row-line: #223040; --hover-bg: #223142; --muted-bg: #243444; --code-bg: #1f2d3b; --subtle-bg: #1a2733;
    --ok-line: #2a5e40; --danger-line: #6e2c27; --warn-line: #5f4818; --info-line: #27496d;
    --good: #72d68f; --bad: #ff9b91;
    --chart-cur: #8fb0c9; --chart-cmp: #8c98a5; --chart-grid: #2a3847; --chart-axis: #4a5a6b; --chart-accent: #d1ae85;
    --mark-ink: none; --mark-paper: inline-block;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }  /* author display rules must never defeat the hidden attribute */
html { font-size: 16px; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.65; -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .5rem; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.02rem; }
.num, td.num, .tabular { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--ink-3); } .small { font-size: .86rem; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.skip-link { position: absolute; inset-inline-start: .5rem; inset-block-start: -3rem; z-index: 100; background: var(--surface); color: var(--ink); padding: .5rem .9rem; border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.skip-link:focus { inset-block-start: .5rem; }

/* ---- Shell ---- */
.shell { display: grid; grid-template-columns: 268px 1fr; min-height: 100vh; }
.side { background: var(--side-bg); color: var(--side-text); padding: 1rem .75rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; scrollbar-width: thin; scrollbar-color: var(--side-line) transparent; }
.brandmark { display: flex; align-items: center; gap: .6rem; color: var(--side-strong); font-weight: 700; font-size: 1.08rem; padding: .2rem .5rem .9rem; }
/* the RADCO wordmark (docs/BRAND.md): the approved artwork on light surfaces, its light copy on the side menu and in the dark set */
.brandmark img { block-size: 42px; inline-size: auto; max-inline-size: 100%; }
.brandmark .mark-ink { display: var(--mark-ink); } .brandmark .mark-paper { display: var(--mark-paper); }
.side { --mark-ink: none; --mark-paper: inline-block; }
.ws { background: var(--side-ws); border-radius: var(--radius-sm); padding: .6rem .7rem; margin-bottom: 1rem; }
.ws b { display: block; color: var(--side-strong); } .ws span { font-size: .8rem; color: var(--side-muted); }
.nav-label { font-size: .74rem; color: var(--side-label); margin: 1rem .5rem .3rem; letter-spacing: .02em; }
.nav { display: grid; gap: 2px; }
.nav a { position: relative; display: flex; align-items: center; gap: .5rem; min-block-size: 38px; color: var(--side-text); padding: .4rem .75rem; border-radius: 9px; font-size: .93rem; line-height: 1.4; }
.nav a:hover { background: var(--side-hover); text-decoration: none; }
.nav a.active { background: var(--side-active); color: var(--side-strong); font-weight: 600; }
.nav a.active::before { content: ""; position: absolute; inset-block: 9px; inset-inline-start: 0; inline-size: 3px; border-radius: 3px; background: var(--sand); }
.main { padding: 0 1.8rem 3rem; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; position: sticky; inset-block-start: 0; z-index: 25; margin: 0 -1.8rem 1.4rem; padding: .65rem 1.8rem; background: color-mix(in srgb, var(--bg) 86%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px); border-block-end: 1px solid var(--line); }
.topbar h1 { font-size: 1.3rem; margin: 0; }
.topbar > .actions { flex-wrap: nowrap; min-inline-size: 0; }
.topbar .user { display: flex; gap: .2rem; align-items: center; font-size: .92rem; }
.gsearch { position: relative; flex: 1 1 14rem; max-inline-size: 30rem; }
.gsearch > .icon { position: absolute; inset-inline-start: .8rem; inset-block-start: 50%; translate: 0 -50%; color: var(--ink-3); pointer-events: none; }
.gsearch > kbd { position: absolute; inset-inline-end: .65rem; inset-block-start: 50%; translate: 0 -50%; padding: 0 .4rem; border: 1px solid var(--line); border-radius: 6px; background: var(--subtle-bg); color: var(--ink-3); font: inherit; font-size: .74rem; line-height: 1.5; pointer-events: none; }
.gsearch:focus-within > kbd { display: none; }
.gsearch input { inline-size: 100%; min-height: 40px; padding: .45rem 2.5rem; border: 1px solid var(--line); border-radius: 11px; font: inherit; background: var(--field-bg); color: var(--ink); }
.gsearch input:focus { border-color: var(--brand); outline: 3px solid var(--brand-soft); }
.gviews { position: relative; } .gviews > summary { list-style: none; cursor: pointer; } .gviews > summary::-webkit-details-marker { display: none; }
.gviews-menu { position: absolute; inset-inline-end: 0; inset-block-start: calc(100% + .5rem); z-index: 40; box-shadow: var(--shadow-pop); min-inline-size: 17rem; display: grid; gap: .5rem; }
@media print { .gsearch, .gviews { display: none !important; } }
.menu-toggle, .btn.menu-toggle { display: none; }

/* ---- Components ---- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); }
.card + .card { margin-top: 1rem; }
.grid > .card + .card { margin-top: 0; }  /* the grid gap spaces cards in a grid */
.grid { display: grid; gap: 1rem; }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat .label { color: var(--ink-3); font-size: .85rem; } .stat .value { font-size: 1.7rem; font-weight: 700; }
.btn { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid transparent; background: var(--brand); color: var(--on-brand); padding: .5rem 1rem; border-radius: 10px; font: inherit; font-size: .94rem; font-weight: 600; line-height: 1.4; cursor: pointer; min-height: 42px; justify-content: center; }
.btn:hover { background: var(--brand-2); text-decoration: none; }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.secondary:hover { background: var(--hover-bg); }
.btn.danger { background: var(--danger); } .btn.small { padding: .3rem .75rem; min-height: 34px; font-size: .87rem; border-radius: 8px; }
.btn[disabled], .btn.is-loading { opacity: .65; cursor: progress; }
.btn.accent { background: var(--accent-strong); color: var(--on-accent); } .btn.accent:hover { background: var(--accent-strong); text-decoration: underline; }
.field input:disabled, .field select:disabled, .field textarea:disabled { color: var(--ink-disabled); }
.btn.is-loading::before { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-inline-end-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.badge { display: inline-block; padding: .12rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); } .badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); } .badge.info { background: var(--info-soft); color: var(--info); }
.badge.muted { background: var(--muted-bg); color: var(--ink-2); }
.badge.accent { background: var(--sand); color: var(--on-sand); }  /* plans and offers: bronze, never a status */
.alert { border-radius: var(--radius-sm); padding: .75rem 1rem; margin-bottom: .7rem; display: flex; justify-content: space-between; gap: 1rem; align-items: center; border: 1px solid transparent; }
.alert.success { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.alert.error, .alert.danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.alert.warn, .alert.warning { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.alert.info { background: var(--info-soft); color: var(--info); border-color: var(--info-line); }
.banner-readonly { background: var(--danger); color: var(--on-brand); padding: .6rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.banner-readonly a { color: var(--on-brand); text-decoration: underline; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .94rem; }
th { text-align: start; color: var(--ink-2); font-weight: 600; font-size: .82rem; padding: .6rem .75rem; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--subtle-bg); }
thead th:first-child { border-start-start-radius: 9px; } thead th:last-child { border-start-end-radius: 9px; }
td { padding: .75rem .75rem; border-bottom: 1px solid var(--row-line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.empty { text-align: center; padding: 2.4rem 1rem; color: var(--ink-2); }
.empty .icon { display: block; margin: 0 auto .6rem; color: var(--ink-3); opacity: .65; }

/* ---- Forms ---- */
.form { display: grid; gap: .95rem; max-width: 640px; }
.form.wide { max-width: none; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form .full { grid-column: 1 / -1; }
.field label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .3rem; }
.field input[type=text], .field input[type=email], .field input[type=password], .field input[type=number], .field input[type=date], .field input[type=datetime-local], .field input[type=time], .field input[type=tel], .field input[type=search], .field input[type=url], .field input:not([type]), .field select, .field textarea {
  width: 100%; padding: .65rem .8rem; border: 1px solid var(--field-line); border-radius: 10px; font: inherit; background: var(--field-bg); min-height: 44px; color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); outline: 3px solid var(--brand-soft); }
.field .help { color: var(--ink-3); font-size: .82rem; margin-top: .25rem; }
.field .errors { color: var(--danger); font-size: .85rem; margin: .25rem 0 0; padding: 0; list-style: none; }
.field.has-error input, .field.has-error select { border-color: var(--danger); }
.field ul.checks, .field div.checks { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .35rem; }
.field input[type=checkbox] { width: 18px; height: 18px; vertical-align: middle; margin-inline-end: .35rem; accent-color: var(--brand); }
.form-errors { background: var(--danger-soft); color: var(--danger); padding: .7rem 1rem; border-radius: var(--radius-sm); }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: .8rem; margin-bottom: 1rem; flex-wrap: wrap; }
.search { display: flex; gap: .4rem; flex-wrap: wrap; } .search input { padding: .5rem .75rem; border: 1px solid var(--field-line); border-radius: 10px; font: inherit; min-height: 42px; }
.lookup { display: flex; flex-direction: column; gap: .3rem; } .lookup input[type=search] { padding: .45rem .6rem; border: 1px solid var(--field-line); border-radius: 8px; font: inherit; }
.copybox { display: flex; gap: .5rem; } .copybox input { flex: 1; direction: ltr; font-family: ui-monospace, monospace; font-size: .85rem; padding: .5rem; border: 1px solid var(--line); border-radius: 8px; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86em; direction: ltr; unicode-bidi: isolate; background: var(--code-bg); padding: .05rem .35rem; border-radius: 5px; }
.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; }
.steps li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem 0; border-bottom: 1px solid var(--row-line); }
.steps li::before { counter-increment: s; content: counter(s); width: 28px; height: 28px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; flex: none; }
.steps li.done::before { content: "✓"; background: var(--ok); color: var(--on-brand); }
.steps li span { flex: 1; }
.pagination { display: flex; gap: .4rem; justify-content: center; margin-top: 1rem; }

/* ---- Auth & marketing ---- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; background: radial-gradient(1200px 600px at 100% 0%, var(--brand-soft), transparent), var(--bg); }
.auth .card { width: 100%; max-width: 460px; padding: 1.8rem; }
.auth.wide .card { max-width: 760px; }
.auth .brandmark { color: var(--ink); justify-content: center; padding-bottom: 1.2rem; } .auth .brandmark img { block-size: 64px; }
.site-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 2rem; max-width: 1180px; margin: 0 auto; }
.site-header .brandmark { color: var(--ink); padding: 0; }
.hero { max-width: 1180px; margin: 0 auto; padding: 3rem 2rem 2rem; display: grid; grid-template-columns: 1.1fr .9fr; gap: 2.5rem; align-items: center; }
.hero h1 { font-size: 2.35rem; } .hero p.lead { font-size: 1.12rem; color: var(--ink-2); }
.flow { background: var(--side-bg); color: var(--side-text); border-radius: 20px; padding: 1.4rem; }
.flow .node { background: var(--side-hover); border-radius: 12px; padding: .6rem .8rem; margin: .4rem 0; display: flex; justify-content: space-between; }
.flow .node.lead { background: var(--brand); color: var(--on-brand); font-weight: 700; }
.section { max-width: 1180px; margin: 0 auto; padding: 2rem; }
.feature h3 { display: flex; align-items: center; gap: .5rem; }
.site-footer { text-align: center; color: var(--ink-3); padding: 2rem; font-size: .88rem; }

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset-block: 0; inset-inline-start: 0; width: 280px; z-index: 30; transform: translateX(100%); transition: transform var(--dur-slow) var(--ease-out); }
  [dir=ltr] .side { transform: translateX(-100%); }
  #nav-open:checked ~ .shell .side { transform: none; }
  .menu-toggle, .btn.menu-toggle { display: inline-flex; }
  .main { padding: 0 1rem 2rem; }
  .topbar { margin: 0 -1rem 1rem; padding: .55rem 1rem; gap: .5rem; }
  .topbar h1 { font-size: 1.12rem; }
  .gsearch { order: 3; flex-basis: 100%; max-inline-size: none; }
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cols-3, .grid.cols-2, .form.wide, .hero { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.8rem; }
}
@media (max-width: 520px) { .grid.cols-4 { grid-template-columns: 1fr 1fr; } .stat .value { font-size: 1.35rem; } }
@media (prefers-reduced-motion: reduce) {
  :root { --dur-fast: 0ms; --dur-base: 0ms; --dur-slow: 0ms; --press-scale: 1; --enter-shift: 0px; }
  *, ::before, ::after { animation: none !important; transition: none !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  @view-transition { navigation: none; }
}
td.mono, td.num, div.mono { background: none; padding-inline: .75rem; }
/* a short code stays on one line; a long value in a code cell (a rule's JSON, a list of tools) wraps inside its
   column instead of pushing the table off the page (found on the compliance register: 15,000px of overflow) */
a.mono, td .mono { white-space: nowrap; }
td.mono { white-space: normal; overflow-wrap: anywhere; min-inline-size: 12rem; max-inline-size: 26rem; line-height: 1.7; }
/* a cell of prose never collapses to one word a line (found on the plans, providers and agent-template tables) */
td.small:not(.num):not(.mono) { min-inline-size: 9rem; } td:has(> div.small.muted) { min-inline-size: 13rem; }
td .btn, .btn.small { white-space: nowrap; }

/* ---- Performance dashboard: filters, tiles and charts. Colours from the validated chart palette (docs/PERFORMANCE.md). ---- */
.sr-only { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.table-wrap { position: relative; }  /* keeps visually hidden text inside the scrolling table on small screens */
.filters { display: flex; flex-wrap: wrap; gap: .7rem 1rem; align-items: end; margin-bottom: 1rem; }
.filters .field { flex: 1 1 130px; max-inline-size: 280px; }
.filters .field input[type=date], .filters .field select { min-height: 44px; }
.field-label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .3rem; }
.filter-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-inline-start: auto; }
.filter-help { flex-basis: 100%; margin: 0; }
.picker { position: relative; }
.picker summary { list-style: none; cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: .5rem; padding: .5rem .8rem; border: 1px solid var(--field-line); border-radius: 10px; background: var(--field-bg); max-inline-size: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker summary::-webkit-details-marker { display: none; }
.picker summary::after { content: "▾"; margin-inline-start: auto; color: var(--ink-3); }
.picker-menu { position: absolute; inset-inline-start: 0; inset-block-start: calc(100% + 4px); z-index: 20; background: var(--field-bg); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: .7rem .9rem; min-inline-size: 260px; display: grid; gap: .4rem; }
.picker-menu label { display: flex; align-items: center; gap: .45rem; }
.picker-menu input[type=checkbox] { inline-size: 18px; block-size: 18px; accent-color: var(--brand); }
.picker-menu p { margin: .2rem 0 0; }
.period-caption { margin: 0 0 1rem; }
.section-title { font-size: 1.05rem; margin: 0 0 .8rem; }
section + section, section + .card, .card + section, .grid + section, section + .grid, .grid + .grid, .grid + .card, .card + .grid { margin-top: 1rem; }
.tiles { margin: 0; }
.kpi .value { font-size: 1.5rem; }
.kpi .value small { font-size: .85rem; font-weight: 600; color: var(--ink-2); }
.kpi.kpi-hero { border-block-start: 3px solid var(--brand); }
.kpi.kpi-hero .value { font-size: 2rem; }
.delta { font-size: .85rem; font-weight: 600; margin-top: .15rem; white-space: nowrap; }
.delta.good { color: var(--good); } .delta.bad { color: var(--bad); } .delta.neutral { color: var(--ink-3); }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: .4rem 1rem; flex-wrap: wrap; margin-bottom: .4rem; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin: 0; padding: 0; font-size: .84rem; color: var(--ink-2); }
.legend li { display: flex; align-items: center; gap: .4rem; }
.legend .key.line { display: inline-block; inline-size: 20px; block-size: 0; border-block-start: 2px solid var(--chart-cur); }
.legend .key.line.cmp { border-block-start: 2px dashed var(--chart-cmp); }
.key.box { display: inline-block; inline-size: 12px; block-size: 12px; border-radius: 3px; flex: none; }
.legend.stacked { flex-direction: column; flex-wrap: nowrap; gap: .35rem; margin-top: .9rem; }
.legend.stacked li { display: grid; grid-template-columns: 14px 1fr auto 3.6rem; gap: .5rem; align-items: center; }
.legend.stacked li.total { font-weight: 700; color: var(--ink); border-block-start: 1px solid var(--line); padding-block-start: .35rem; }
.chart { position: relative; overflow-x: auto; }
.chart svg { display: block; inline-size: 100%; block-size: auto; min-inline-size: 560px; direction: ltr; font-family: var(--font); }
.chart .gridline { stroke: var(--chart-grid); stroke-width: 1; }
.chart .axis, .chart .zero { stroke: var(--chart-axis); stroke-width: 1; }
.chart .tick { fill: var(--ink-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .series { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .series.cur { stroke: var(--chart-cur); } .chart .series.cmp { stroke: var(--chart-cmp); stroke-dasharray: 5 4; }
.chart .end, .chart .hover { stroke: var(--surface); stroke-width: 2; }
.chart .end.cur, .chart .hover.cur { fill: var(--chart-cur); } .chart .end.cmp, .chart .hover.cmp { fill: var(--chart-cmp); }
.chart .end-label { fill: var(--ink-2); font-size: 12px; font-weight: 600; }
.chart .crosshair { stroke: var(--chart-axis); stroke-width: 1; }
.chart .tip, .perf-tip { background: var(--field-bg); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: .45rem .7rem; font-size: .82rem; line-height: 1.55; color: var(--ink); pointer-events: none; z-index: 40; white-space: nowrap; }
.chart .tip { position: absolute; } .perf-tip { position: fixed; }
.table-view { margin-top: .6rem; }
.table-view summary { cursor: pointer; color: var(--brand); font-size: .88rem; font-weight: 600; }
.bars { list-style: none; margin: 0 0 .9rem; padding: 0; display: grid; gap: .5rem; }
.bars li { display: grid; grid-template-columns: minmax(90px, 34%) 1fr; align-items: center; gap: .7rem; }
.bar-name { font-size: .9rem; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.bar-track { display: flex; align-items: center; gap: .45rem; min-inline-size: 0; }
.bar { flex: none; block-size: 16px; inline-size: calc((100% - 6.5rem) * var(--f, 0)); background: var(--chart-cur); border-start-end-radius: 4px; border-end-end-radius: 4px; }
.bar-value { font-size: .84rem; color: var(--ink-2); white-space: nowrap; }
.seg { display: flex; gap: 2px; block-size: 40px; border-radius: 6px; overflow: hidden; }
.seg-part { display: flex; align-items: center; justify-content: center; min-inline-size: 3px; font-size: .84rem; font-weight: 700; font-variant-numeric: tabular-nums; }
table.heat { border-collapse: separate; border-spacing: 2px; inline-size: auto; min-inline-size: 100%; font-size: .78rem; }
.heat th { padding: .2rem .3rem; font-size: .76rem; text-align: center; border: 0; }
.heat tbody th { text-align: start; white-space: nowrap; color: var(--ink-2); }
.heat td { padding: 0; block-size: 30px; min-inline-size: 30px; text-align: center; border: 0; border-radius: 4px; font-weight: 600; font-variant-numeric: tabular-nums; }
.heat td.zero { background: var(--subtle-bg); }
.heat td.total { color: var(--ink-2); font-weight: 600; padding-inline: .5rem; }
.heat-legend { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: .7rem; }
.key-step { display: inline-flex; align-items: center; gap: .25rem; }
table.compare tr.strong td { font-weight: 700; }
.defs summary { cursor: pointer; font-weight: 600; }
.defs ul { margin: .6rem 0 0; padding-inline-start: 1.2rem; }
.defs li { margin-bottom: .3rem; }
@media (max-width: 960px) { .filter-actions { margin-inline-start: 0; } .bars li { grid-template-columns: minmax(70px, 34%) 1fr; } }

/* ---- Restaurant: tables, order screen, kitchen display ---- */
.rtables { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem; }
.rtable { display: flex; flex-direction: column; gap: .25rem; min-block-size: 118px; padding: .8rem; border-radius: 14px; background: var(--field-bg); border: 2px solid var(--line); color: var(--ink); }
.rtable:hover { text-decoration: none; }
.rtable.free { border-color: var(--ok-line); } .rtable.busy { border-color: var(--brand); background: var(--brand-soft); } .rtable.billed { border-color: var(--warn); background: var(--warn-soft); }
.rtable .lbl { font-size: 1.3rem; font-weight: 800; }
.guests { inline-size: 64px; padding: .3rem; border: 1px solid var(--field-line); border-radius: 8px; font: inherit; }
.rorder { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.rorder > .card + .card { margin-top: 0; }
.rmenu { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; margin-top: .7rem; }
.rmenu form { margin: 0; }
.ritem { inline-size: 100%; min-block-size: 72px; display: flex; flex-direction: column; align-items: flex-start; gap: .2rem; padding: .6rem .7rem; border-radius: 12px; border: 1px solid var(--line); background: var(--field-bg); font: inherit; color: var(--ink); cursor: pointer; text-align: start; }
.ritem:hover { border-color: var(--brand); background: var(--brand-soft); }
/* a dish the branch does not offer now: stopped as «غير متوفر الآن», or outside the hours of its menu */
.ritem.off, .ritem.off:hover { box-sizing: border-box; background: var(--subtle-bg); border-style: dashed; border-color: var(--line); color: var(--ink-2); cursor: default; }
.ritem.off > span:first-child { text-decoration: line-through; }
.kpause .actions { gap: .4rem; }
/* the expediter's line on how full the kitchen's current slot is */
.kload { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .7rem; margin: 0; } .kload progress { inline-size: 160px; max-inline-size: 40vw; accent-color: var(--brand); }
.rlines { list-style: none; margin: 0 0 .8rem; padding: 0; }
.rlines li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem .8rem; align-items: center; padding: .55rem 0; border-block-end: 1px solid var(--row-line); }
.rlines li.void { opacity: .6; } .rlines li.void b { text-decoration: line-through; }
.rnote { flex: 1; min-inline-size: 140px; padding: .4rem .6rem; border: 1px solid var(--field-line); border-radius: 8px; font: inherit; }
.rtotal { font-size: 1.05rem; margin: .6rem 0; }
.ropts { border: 1px solid var(--line); border-radius: 12px; padding: .6rem .8rem; margin: 0 0 .8rem; }
.ropt { display: flex; align-items: center; gap: .5rem; padding: .4rem 0; }
.ropt .num { margin-inline-start: auto; }
.kds { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.kcol h2 { font-size: 1.1rem; }
.kcol { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); align-content: start; }
.kcol > h2, .kcol > h3, .kcol > .empty, .kcol > div.small { grid-column: 1 / -1; }
.kt { background: var(--field-bg); border: 2px solid var(--line); border-radius: 14px; padding: .7rem .8rem; box-shadow: var(--shadow); }
.kt.tone-info { border-color: var(--info); } .kt.tone-ok { border-color: var(--ok); } .kt.tone-warn { border-color: var(--warn); } .kt.tone-danger { border-color: var(--danger); }
.kt.over.tone-info { background: var(--info-soft); } .kt.over.tone-ok { background: var(--ok-soft); } .kt.over.tone-warn { background: var(--warn-soft); } .kt.over.tone-danger { background: var(--danger-soft); }
.kt.fresh { animation: kt-fresh 1.2s ease-in-out 4; } @keyframes kt-fresh { 50% { box-shadow: 0 0 0 5px var(--info-soft), var(--shadow); } }
@media (prefers-reduced-motion: reduce) { .kt.fresh { animation: none; } }
.kt .kmove { margin-block-start: .5rem; } .kt .kmove summary { cursor: pointer; font-size: .88rem; color: var(--ink-2); } .kt .kmove form { margin-block-start: .4rem; }
.kt .kmove select { flex: 1; min-inline-size: 110px; min-height: 38px; padding: .35rem .6rem; border: 1px solid var(--field-line); border-radius: 8px; font: inherit; background: var(--field-bg); color: var(--ink); }
.krecent { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.kt header { display: flex; justify-content: space-between; font-size: 1.1rem; margin-block-end: .4rem; }
.kt ul { list-style: none; margin: 0 0 .6rem; padding: 0; font-size: 1.05rem; }
.kt li { padding: .25rem 0; border-block-end: 1px dashed var(--line); } .kt li.void { text-decoration: line-through; opacity: .6; }
.kt .mods { font-size: .88rem; color: var(--ink-2); } .kt .knote { font-weight: 800; color: var(--danger); }
.kt form { display: flex; gap: .4rem; flex-wrap: wrap; }
@media (max-width: 960px) { .rorder, .kds { grid-template-columns: 1fr; } }

/* Printing / saving a page as PDF from the browser: the page content only, with a header. */
.print-header { display: none; }
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff !important; }
  .topbar { position: static !important; margin: 0 !important; padding: 0 !important; border: 0 !important; background: none !important; }
  .side, .menu-toggle, .topbar .user, .toolbar, form.search, .actions, .btn, #messages, .messages, nav, .no-print { display: none !important; }
  .shell { display: block !important; }
  .main { padding: 0 !important; }
  .topbar > .actions { display: block !important; } /* keep the page title */
  .topbar h1 { font-size: 15pt; margin: 0 0 .4rem; }
  .print-header { display: flex !important; justify-content: space-between; gap: 1rem; border-bottom: 2px solid #15212b; padding-bottom: .4rem; margin-bottom: .8rem; font-size: 10pt; }
  .card { box-shadow: none !important; border: 1px solid #d9d5cb !important; break-inside: avoid; }
  .table-wrap { overflow: visible !important; }
  table { font-size: 9.5pt; } th, td { border-bottom: 1px solid #e3dfd5; }
  a { color: inherit !important; text-decoration: none !important; }
  .grid { gap: .5rem !important; }
  .filters, .table-view, .perf-tip, .chart .tip, details.defs { display: none !important; }
  .chart { overflow: visible !important; } .chart svg { min-inline-size: 0 !important; }
  .bar, .seg-part, .heat td, .key, .kpi.kpi-hero { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
/* recipes: an option's ingredients, each with its remove button */
.opt-ing { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; margin-block-start: .3rem; }
.opt-ing form { display: inline; }
.nowrap { white-space: nowrap; }
.form.narrow { max-inline-size: 32rem; }
/* targets and alerts */
.month-nav { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.goal-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 1rem; margin-block-end: 1rem; }
.goal { display: flex; flex-direction: column; gap: .4rem; }
.goal.mini { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .7rem .8rem; }
.goal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.goal-figures .big { font-size: 1.35rem; font-weight: 700; }
.goal-actions { margin-block-start: auto; }
.meter { position: relative; block-size: .55rem; border-radius: 999px; background: var(--muted-bg); }
.meter > span { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 999px; background: var(--brand); }
.goal.bad .meter > span { background: var(--danger); }
/* subscription: usage against the plan's limits (warning from 80%, full at the limit) */
.meter.warn > span { background: var(--warn); }
.meter.full > span { background: var(--danger); }
details > summary { cursor: pointer; }
.meter > i { position: absolute; inset-block: -.2rem; inline-size: 2px; margin-inline-start: -1px; background: var(--ink); border-radius: 1px; }
.alert-list { display: flex; flex-direction: column; gap: .8rem; }
.alert-item { border-inline-start: 4px solid var(--warn); }
.alert-item.critical { border-inline-start-color: var(--danger); }
.alert-item.cleared, .alert-item.seen { border-inline-start-color: var(--line); }
.alert-item.cleared { opacity: .8; }
.alert-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.alert-title { margin: .45rem 0 .2rem; font-size: 1.02rem; }
.alert-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; }
.nav .nav-count { display: inline-block; min-inline-size: 1.3rem; margin-inline-start: .35rem; padding: 0 .35rem; border-radius: 999px; background: var(--sand); color: var(--on-sand); font-size: .75rem; font-weight: 700; text-align: center; }
/* variants */
.attr-row { display: grid; grid-template-columns: minmax(8rem, 1fr) minmax(12rem, 2fr); gap: .6rem; }
.cell-input { padding: .35rem .45rem; border: 1px solid var(--field-line); border-radius: 8px; font: inherit; background: var(--field-bg); }
@media (max-width: 640px) { .attr-row { grid-template-columns: 1fr; } }
/* support */
.thread { display: flex; flex-direction: column; gap: .6rem; margin-block-end: 1rem; }
.msg.from-platform { border-inline-start: 4px solid var(--brand); background: var(--brand-soft); }
.msg-body { margin-block-start: .3rem; white-space: normal; }

/* drive-through lanes: one column per window (templates/restaurant/lane.html) */
.kcols { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); align-items: start; }
.kcols > .kcol { grid-template-columns: 1fr; }
/* combo meals: the chosen components under their combo (apps/restaurant/combos.py) */
.rlines .combo-parts { list-style: none; margin: .2rem 0 0; padding-inline-start: 1rem; }
.rlines .combo-parts li { display: block; padding: 0; border: 0; }
.combo-slot { border: 1px solid var(--line); border-radius: 8px; padding: .6rem .8rem; margin-block-end: .8rem; }
/* pictures of an item and of a store (apps/core/images.py) */
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; }
.thumbs figure { margin: 0; border: 1px solid var(--line); border-radius: 10px; padding: .5rem; background: var(--field-bg); }
.thumbs img { display: block; inline-size: 100%; block-size: 120px; object-fit: contain; background: var(--subtle-bg); border-radius: 6px; }
.thumbs figcaption { display: flex; flex-wrap: wrap; gap: .3rem; margin-block-start: .4rem; }
.thumbs form { margin: 0; }
.swatch { display: inline-block; inline-size: 1.2rem; block-size: 1.2rem; border-radius: 4px; vertical-align: middle; border: 1px solid var(--field-line); }

/* Audit log: before/after values of an edit */
table.changes { width: auto; min-width: 240px; margin: 0; font-size: .82rem; }
table.changes caption { text-align: start; padding-block-end: .2rem; }
table.changes th, table.changes td { padding: .2rem .45rem; }
.clip { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* In-screen help: the «؟» panel beside the page heading (apps/web/help.py) */
.help-panel { position: relative; }
.help-panel > summary { list-style: none; }
.help-panel > summary::-webkit-details-marker { display: none; }
.help-panel .help-body { position: absolute; inset-inline-start: 0; inset-block-start: calc(100% + .4rem); z-index: 30; width: min(360px, 80vw); padding: .8rem 1rem; font-size: .9rem; line-height: 1.7; }

/* Small screens: nothing may push the page wider than the phone. A table or a long row scrolls inside its own
   card (found by opening every page at 375px: audit log, stock balances, price review, API keys). */
@media (max-width: 720px) {
  .card { max-inline-size: 100%; overflow-x: auto; }
  .card > table, .card > form > table { min-inline-size: max-content; }
  main input, main select, main textarea { max-inline-size: 100%; }
}

/* a honeypot field (public forms): out of sight, never filled by a person */
.hp{position:absolute;inset-inline-start:-9999px;inline-size:1px;block-size:1px;overflow:hidden}

/* The console's side menu (apps/console/menu.py): labelled groups that open and close without a script */
.side-head { justify-content: space-between; flex-wrap: nowrap; }
.nav-group > summary.nav-label { list-style: none; display: flex; align-items: center; gap: .6rem; min-block-size: 40px; margin: 0; padding: .4rem .75rem; border-radius: 9px; font-size: .9rem; font-weight: 600; letter-spacing: 0; color: var(--side-text); cursor: pointer; transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.nav-group > summary.nav-label::-webkit-details-marker { display: none; }
.nav-group > summary.nav-label > .icon { flex: none; color: var(--side-muted); }
.nav-group > summary.nav-label > .nav-text { flex: 1; }
.nav-group > summary.nav-label::after { content: ""; flex: none; inline-size: 7px; block-size: 7px; margin-inline: 2px; border-right: 1.5px solid var(--side-muted); border-bottom: 1.5px solid var(--side-muted); transform: rotate(45deg) translate(-1px, -1px); transition: transform var(--dur-fast) var(--ease-out); }
.nav-group:not([open]) > summary.nav-label::after { transform: rotate(135deg); }
[dir=ltr] .nav-group:not([open]) > summary.nav-label::after { transform: rotate(-45deg); }
.nav-group > summary.nav-label:hover { background: var(--side-hover); color: var(--side-strong); }
.nav-group[open] > summary.nav-label { color: var(--side-strong); } .nav-group[open] > summary.nav-label > .icon { color: var(--sand); }
.nav-links { display: grid; gap: 2px; margin: 2px 0 8px; margin-inline-start: 1.25rem; padding-inline-start: .6rem; border-inline-start: 1px solid var(--side-line); }
.nav-links a { min-block-size: 36px; font-size: .9rem; color: var(--side-muted); }
.nav-links a:hover, .nav-links a.active { color: var(--side-strong); }
.nav-links a.active::before { inset-inline-start: calc(-.6rem - 2px); }
.side-foot { display: flex; align-items: center; gap: .6rem; margin: auto 0 0; }
.side-foot > .icon { flex: none; color: var(--sand); } .side-foot b { font-size: .86rem; } .side-foot span { display: block; }
.console-nav { margin-block-end: 1rem; }
/* the light / dark switch in the top bar (apps/core/theme.py) */
.theme-switch { position: relative; } .theme-switch > summary { list-style: none; } .theme-switch > summary::-webkit-details-marker { display: none; }
.theme-menu { position: absolute; inset-inline-end: 0; inset-block-start: calc(100% + .5rem); z-index: 40; min-inline-size: 12rem; padding: .4rem; box-shadow: var(--shadow-pop); }
.theme-menu fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 2px; } .theme-menu legend { padding: .3rem .65rem; }
.menu-item[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
@media print { .theme-switch { display: none !important; } }

/* ---- Motion (docs/CONSOLE_UI.md): visual only, never a delay on an action. Opacity and transform move; colours
   fade on hover. Durations and curves are the tokens of :root; prefers-reduced-motion sets them to 0. ---- */
.btn, .icon-btn, .menu-item, .nav a, .gsearch input, .field input, .field select, .field textarea, .search input, .rnote, .cell-input {
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
/* a button answers the hand: it rises a little under the pointer, sinks when pressed, and a soft ring spreads from
   the point that was touched (static/js/page.js sets --rx/--ry). Colour and transform only, never a delay. */
.btn { position: relative; overflow: hidden; isolation: isolate; -webkit-tap-highlight-color: transparent; }
.btn:hover:not([disabled]):not(.is-loading) { transform: translateY(-1px); box-shadow: var(--shadow-btn); }
.btn:active:not([disabled]):not(.is-loading) { transform: translateY(0) scale(var(--press-scale)); box-shadow: none; transition-duration: calc(var(--dur-fast) / 2); }
.btn::after { content: ""; position: absolute; z-index: -1; left: var(--rx, 50%); top: var(--ry, 50%); inline-size: 14px; block-size: 14px; border-radius: 50%; background: currentColor; opacity: 0; transform: translate(-50%, -50%) scale(0); pointer-events: none; }
.btn.rippling::after { animation: ripple calc(var(--dur-slow) * 2) var(--ease-out); }
@keyframes ripple { from { opacity: .2; transform: translate(-50%, -50%) scale(0); } to { opacity: 0; transform: translate(-50%, -50%) scale(30); } }
/* an arrow or a plus inside a button leans the way it points */
.btn > .icon { transition: transform var(--dur-base) var(--ease-out); }
.btn:hover > .icon { transform: translateX(-2px); } [dir=ltr] .btn:hover > .icon { transform: translateX(2px); }
/* icon buttons, menu rows and tabs press too */
.icon-btn:hover > .icon { transform: scale(1.08); } .icon-btn > .icon, .menu-item > .icon { transition: transform var(--dur-base) var(--ease-out); }
.menu-item:active, :is(nav.toolbar, nav.tabs, main nav[aria-label]) > a:active { transform: scale(var(--press-scale)); }
.nav a:hover { transform: translateX(-2px); } [dir=ltr] .nav a:hover { transform: translateX(2px); } .nav a.active:hover { transform: none; }
/* a card that is a link rises with the pointer */
a.card:hover, .card.link:hover { transform: translateY(-2px); box-shadow: var(--shadow-pop); text-decoration: none; }
a.card, .card.link { transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out); }
.btn[disabled], .btn.is-loading { transition: none; transform: none; box-shadow: none; }  /* no flicker while it waits */
.nav a.active { transition: background-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out); }
/* a group of the side menu opening, the drop-down menus and the help panel appearing, a message arriving */
@keyframes enter { from { opacity: 0; transform: translateY(calc(-1 * var(--enter-shift))); } to { opacity: 1; transform: none; } }
details[open] > .gviews-menu, details[open] > .theme-menu, details[open] > .user-menu-body, details[open] > .help-body, details[open] > .picker-menu,
dialog[open], .alert[role="status"], .alert[role="alert"] { animation: enter var(--dur-base) var(--ease-out) both; }
/* rows answer the pointer */
tbody tr { transition: background-color var(--dur-fast) var(--ease-out); }
.card > table tbody tr:hover, .card table tbody tr:hover { background: var(--hover-bg); }
table.heat tbody tr:hover { background: none; }
.card { transition: box-shadow var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out); }
/* page to page: a cross-fade of the content only (View Transitions, same-origin navigation). The side menu and the
   top bar are their own transition groups without animation, so they do not flash; a browser without the API
   navigates as before. */
@view-transition { navigation: auto; }
.side { view-transition-name: shell-side; }
.topbar { view-transition-name: shell-top; }
.main { view-transition-name: shell-main; }
::view-transition-old(root), ::view-transition-new(root),
::view-transition-old(shell-side), ::view-transition-new(shell-side),
::view-transition-old(shell-top), ::view-transition-new(shell-top) { animation: none; }
::view-transition-group(shell-side), ::view-transition-group(shell-top) { animation-duration: 0s; }
::view-transition-old(shell-main) { animation: leave var(--dur-fast) var(--ease-in-out) both; }
::view-transition-new(shell-main) { animation: enter var(--dur-base) var(--ease-out) both; }
::view-transition-group(shell-main) { animation-duration: var(--dur-base); }
@keyframes leave { to { opacity: 0; } }
/* without the API, the content still eases in on arrival */
@supports not (view-transition-name: none) { .main > .card, .main > .grid { animation: enter var(--dur-base) var(--ease-out) both; } }
@media print { .side, .topbar, .main { view-transition-name: none; } }

/* the «قريباً» page (PUBLIC_COMING_SOON) */
.soon{min-block-size:100vh;display:grid;place-items:center;padding:24px;background:var(--bg)}
.soon-card{inline-size:min(520px,100%);background:var(--surface);border:1px solid var(--line);border-radius:18px;padding:40px 32px;text-align:center}
.soon-card h1{font-size:2.2rem;margin-block:18px 8px;color:var(--brand)}
.soon-card .brandmark{display:flex;justify-content:center}
.soon-card .brandmark img{inline-size:117px;block-size:auto}
.soon-actions{justify-content:center;margin-block-start:24px}

/* ---- The shell's controls (docs/CONSOLE_UI.md): drawn icons, never an emoji or a letter standing in for one ---- */
.icon { flex: none; display: inline-block; vertical-align: middle; }
.icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-inline-size: 40px; block-size: 40px; padding: 0 .6rem; border: 1px solid transparent; border-radius: 10px; background: none; color: var(--ink-2); font: inherit; font-size: .86rem; font-weight: 600; cursor: pointer; list-style: none; }
.icon-btn::-webkit-details-marker { display: none; }
.icon-btn:hover, details[open] > summary.icon-btn { background: var(--hover-bg); color: var(--ink); text-decoration: none; }
.icon-btn:active { transform: scale(var(--press-scale)); }
.icon-btn .nav-count { position: absolute; inset-block-start: 3px; inset-inline-end: 3px; min-inline-size: 1.1rem; margin: 0; padding: 0 .28rem; border-radius: 999px; background: var(--danger); color: var(--on-brand); font-size: .68rem; font-weight: 700; line-height: 1.1rem; text-align: center; box-shadow: 0 0 0 2px var(--bg); }
.side .icon-btn { color: var(--side-text); } .side .icon-btn:hover { background: var(--side-hover); color: var(--side-strong); }
.icon-btn.menu-toggle { display: none; }
@media (max-width: 960px) { .icon-btn.menu-toggle { display: inline-flex; } .icon-btn.lang > span { display: none; } }
.user-menu { position: relative; margin-inline-start: .35rem; }
.user-menu > summary.avatar { list-style: none; display: grid; place-items: center; inline-size: 36px; block-size: 36px; border-radius: 50%; background: var(--brand); color: var(--on-brand); font-weight: 700; font-size: .95rem; cursor: pointer; transition: box-shadow var(--dur-fast) var(--ease-out); }
.user-menu > summary.avatar::-webkit-details-marker { display: none; }
.user-menu > summary.avatar:hover, .user-menu[open] > summary.avatar { box-shadow: 0 0 0 3px var(--brand-soft); }
.user-menu-body { position: absolute; inset-inline-end: 0; inset-block-start: calc(100% + .5rem); z-index: 40; min-inline-size: 15rem; padding: .4rem; display: grid; gap: 2px; box-shadow: var(--shadow-pop); }
.user-menu-body form { margin: 0; }
.user-id { display: grid; padding: .5rem .65rem .65rem; margin-block-end: .3rem; border-block-end: 1px solid var(--line); line-height: 1.45; }
.user-id span { text-align: start; overflow: hidden; text-overflow: ellipsis; }
.menu-item { display: flex; align-items: center; gap: .6rem; inline-size: 100%; min-block-size: 38px; padding: .4rem .65rem; border: 0; border-radius: 8px; background: none; color: var(--ink); font: inherit; font-size: .92rem; text-align: start; cursor: pointer; }
.menu-item:hover { background: var(--hover-bg); text-decoration: none; }
.menu-item > .icon { color: var(--ink-3); }
@media print { .icon-btn, .user-menu { display: none !important; } }

/* A centre's own pages (agents, automation, sales…): one segmented row under the heading, the open page raised.
   Any row made only of small secondary links is drawn this way; static/js/page.js marks the open page. */
:is(nav.toolbar, nav.tabs, main nav[aria-label]:has(> a.btn.secondary:nth-child(3)), .toolbar:not(:has(> :not(a.btn.secondary.small))):has(> a:nth-child(3))) { display: flex; justify-content: flex-start; flex-wrap: nowrap; gap: .2rem; inline-size: fit-content; max-inline-size: 100%; overflow-x: auto; margin-block-end: 1rem; padding: .28rem; border-radius: 12px; background: var(--muted-bg); scrollbar-width: none; }
:is(nav.toolbar, nav.tabs, main nav[aria-label]:has(> a.btn.secondary:nth-child(3)), .toolbar:not(:has(> :not(a.btn.secondary.small))):has(> a:nth-child(3))) > a { flex: none; display: inline-flex; align-items: center; min-height: 34px; padding: .3rem .85rem; border: 0; border-radius: 9px; background: none; box-shadow: none; color: var(--ink-2); font-size: .88rem; font-weight: 600; white-space: nowrap; transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
:is(nav.toolbar, nav.tabs, main nav[aria-label]:has(> a.btn.secondary:nth-child(3)), .toolbar:not(:has(> :not(a.btn.secondary.small))):has(> a:nth-child(3))) > a:hover { color: var(--ink); background: color-mix(in srgb, var(--surface) 55%, transparent); text-decoration: none; box-shadow: none; }
:is(nav.toolbar, nav.tabs, main nav[aria-label]:has(> a.btn.secondary:nth-child(3)), .toolbar:not(:has(> :not(a.btn.secondary.small))):has(> a:nth-child(3))) > a:is([aria-current], .active) { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.filters .field :is(input, select) { min-height: 42px; }

/* Fields that are not inside a .form grid keep their distance from each other and from their buttons */
:not(.form):not(.filters) > .field + .field, :not(.form):not(.filters) > .field + .actions, :not(.form) > .field + .btn, :not(.form) > .field + button,
.card > table + .actions, .card > .table-wrap + .actions, .card > p + .actions { margin-block-start: .95rem; }
.actions > a:not(.btn) { padding: .3rem .5rem; font-weight: 600; font-size: .92rem; }
.card fieldset:not([class]) { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem 1.1rem; margin: 0 0 1rem; }
.card fieldset:not([class]) > legend { padding-inline: .45rem; font-weight: 700; font-size: .95rem; }
.empty { border-radius: var(--radius-sm); }
.toolbar > .muted { flex: 1 1 20rem; max-inline-size: 60rem; }

/* The question before an action that cannot be undone (static/js/page.js): the platform's own window */
dialog.confirm { inline-size: min(27rem, calc(100vw - 2rem)); padding: 0; border: 0; border-radius: 16px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-pop); }
dialog.confirm::backdrop { background: var(--scrim); }
.confirm-body { display: flex; gap: .9rem; align-items: flex-start; padding: 1.4rem 1.4rem .5rem; }
.confirm-mark { flex: none; display: grid; place-items: center; inline-size: 40px; block-size: 40px; border-radius: 50%; background: var(--warn-soft); color: var(--warn); }
.confirm-text { margin: .45rem 0 0; font-size: 1rem; font-weight: 600; line-height: 1.6; }
.confirm-actions { display: flex; justify-content: flex-end; gap: .6rem; padding: 1rem 1.4rem 1.3rem; }

/* Plans (console): one card a plan */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr)); gap: 1rem; align-items: start; }
.plan-grid > .card + .card { margin-top: 0; }
.plan { display: grid; gap: .9rem; }
.plan-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .6rem; }
.plan-head h2 { margin: 0; font-size: 1.15rem; } .plan-tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-block-start: .3rem; }
.plan-price { display: flex; align-items: baseline; gap: .4rem; flex-wrap: wrap; }
.plan-price strong { font-size: 1.9rem; line-height: 1.1; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); gap: .5rem; margin: 0; }
.facts > div { padding: .5rem .65rem; border-radius: 9px; background: var(--subtle-bg); }
.facts dt { font-size: .78rem; color: var(--ink-3); } .facts dd { margin: 0; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-block-start: .6rem; }
.plan-foot { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding-block-start: .8rem; border-block-start: 1px solid var(--row-line); }

/* a bare control in a page (a filter row, a small inline form) is drawn like a field; any rule above still wins */
:where(main) :where(input:not([type=checkbox], [type=radio], [type=hidden], [type=file], [type=range], [type=color], [type=submit], [type=button]), select, textarea) { min-height: 38px; padding: .4rem .7rem; border: 1px solid var(--field-line); border-radius: 9px; background: var(--field-bg); color: var(--ink); font: inherit; font-size: .93rem; }
:where(main) :where(input, select, textarea):focus { border-color: var(--brand); outline: 3px solid var(--brand-soft); }
:where(main) :where(input[type=checkbox], input[type=radio]) { inline-size: 18px; block-size: 18px; accent-color: var(--brand); vertical-align: middle; }
/* blocks that follow each other directly in a page keep one rhythm */
.main > :is(.grid, .card, .table-wrap) + :is(form, .actions, .toolbar, p, nav), .main > :is(form, .actions, p) + :is(.card, .grid) { margin-block-start: 1rem; }
.main > h2 { margin-block: 1.5rem .7rem; }
/* icons sit on a soft tile of their own (the section icons of the side menu, the empty states, .icon-chip anywhere) */
.nav-group > summary.nav-label > .icon { box-sizing: content-box; padding: 5px; border-radius: 8px; background: var(--side-hover); transition: background-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out); }
.nav-group > summary.nav-label:hover > .icon { transform: scale(1.06); color: var(--side-strong); }
.nav-group[open] > summary.nav-label > .icon { background: color-mix(in srgb, var(--sand) 22%, transparent); }
.empty .icon { box-sizing: content-box; padding: 14px; border-radius: 50%; background: var(--subtle-bg); color: var(--interactive); opacity: 1; }
.icon-chip { display: inline-grid; place-items: center; inline-size: 38px; block-size: 38px; border-radius: 11px; background: var(--brand-soft); color: var(--brand); flex: none; }
.icon-chip.accent { background: var(--sand-soft); color: var(--accent-strong); } .icon-chip.ok { background: var(--ok-soft); color: var(--ok); }
.icon-chip.warn { background: var(--warn-soft); color: var(--warn); } .icon-chip.danger { background: var(--danger-soft); color: var(--danger); } .icon-chip.info { background: var(--info-soft); color: var(--info); }
