/* منصة تفويج الشاحنات — design tokens, layout and components (RTL first). */

@font-face { font-family: "Elm"; font-style: normal; font-weight: 300; font-display: swap; src: url("../fonts/Elm-Light.woff2") format("woff2"); }
@font-face { font-family: "Elm"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/Elm-Regular.woff2") format("woff2"); }
@font-face { font-family: "Elm"; font-style: normal; font-weight: 500 600; font-display: swap; src: url("../fonts/Elm-Medium.woff2") format("woff2"); }
@font-face { font-family: "Elm"; font-style: normal; font-weight: 700 800; font-display: swap; src: url("../fonts/Elm-Bold.woff2") format("woff2"); }

:root {
  color-scheme: light;
  --font: "Elm", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --page: #f3f5f7;
  --surface: #fcfcfb;
  --surface-2: #f6f7f8;
  --ink: #0b1626;
  --ink-2: #4a5566;
  --muted: #7d8592;
  --line: #e1e4e8;
  --line-strong: #c9ced6;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --accent: #1c5cab;
  --accent-ink: #184f95;
  --accent-soft: #e6effa;
  --side: #0d2440;
  --side-2: #12314f;
  --side-3: #1d4068;
  --side-ink: #dbe6f3;
  --side-muted: #8fa4bd;
  --side-line: rgba(255, 255, 255, .07);
  --brand-1: #2a78d6; --brand-2: #104281;      /* logo tile */
  --nav-on: #5598e7; --nav-on-icon: #86b6ef;   /* active menu item */
  --box-1: #2a78d6; --box-2: #eb6834; --box-3: #1baf7a; --box-4: #8a95a3;  /* containers in the illustration */
  --art-sky-1: #dfe9f5; --art-sky-2: #f6f8fb; --art-ground: #cfd7e1; --art-sea: #1c5cab; --art-steel: #0d2440;
  --shadow: 0 1px 2px rgba(11, 22, 38, .05), 0 4px 16px rgba(11, 22, 38, .05);
  --radius: 14px;

  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100;
  --series-5: #e87ba4; --series-6: #008300; --series-7: #6250d6; --series-8: #e34948;
  --ref: #898781;

  --good: #0ca30c; --warning: #fab219; --serious: #ec835a; --critical: #d03b3b;
  --good-ink: #006300; --warning-ink: #8a5a00; --serious-ink: #9a3d17; --critical-ink: #b02a2a;
  --good-soft: #e7f6e7; --warning-soft: #fff4dc; --serious-soft: #fdece4; --critical-soft: #fbe9e9;

  --seq-1: #cde2fb; --seq-2: #9ec5f4; --seq-3: #6da7ec; --seq-4: #3987e5; --seq-5: #256abf; --seq-6: #184f95;
  --seq-ink-light: #0b0b0b; --seq-ink-dark: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d; --surface: #1a1a19; --surface-2: #222220;
    --ink: #f0efec; --ink-2: #c3c2b7; --muted: #8f8d86;
    --line: #2c2c2a; --line-strong: #3a3a37; --grid: #2c2c2a; --axis: #383835;
    --accent: #5598e7; --accent-ink: #86b6ef; --accent-soft: #1b2a3d;
    --side: #101418; --side-2: #1a2028; --side-ink: #e1e6ec; --side-muted: #8b96a3;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
    --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
    --good-ink: #0ca30c; --warning-ink: #fab219; --serious-ink: #ec835a; --critical-ink: #e66767;
    --good-soft: #13261a; --warning-soft: #2c2410; --serious-soft: #2d1c14; --critical-soft: #2e1616;
    --seq-1: #104281; --seq-2: #184f95; --seq-3: #1c5cab; --seq-4: #2a78d6; --seq-5: #5598e7; --seq-6: #86b6ef;
    --seq-ink-light: #ffffff; --seq-ink-dark: #0b0b0b;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d; --surface: #1a1a19; --surface-2: #222220;
  --ink: #f0efec; --ink-2: #c3c2b7; --muted: #8f8d86;
  --line: #2c2c2a; --line-strong: #3a3a37; --grid: #2c2c2a; --axis: #383835;
  --accent: #5598e7; --accent-ink: #86b6ef; --accent-soft: #1b2a3d;
  --side: #101418; --side-2: #1a2028; --side-ink: #e1e6ec; --side-muted: #8b96a3;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
  --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
  --good-ink: #0ca30c; --warning-ink: #fab219; --serious-ink: #ec835a; --critical-ink: #e66767;
  --good-soft: #13261a; --warning-soft: #2c2410; --serious-soft: #2d1c14; --critical-soft: #2e1616;
  --seq-1: #104281; --seq-2: #184f95; --seq-3: #1c5cab; --seq-4: #2a78d6; --seq-5: #5598e7; --seq-6: #86b6ef;
  --seq-ink-light: #ffffff; --seq-ink-dark: #0b0b0b;
}

/* =============================================================== brands (visual identities)
   Chosen with BRAND (server default) or the admin's «التصميم» picker (this browser only).
   Each sets the shell colours, the logo tile, the illustration's containers, and one signature detail. */

/* --- ميناء: navy chrome, container-orange brand, blue for actions (orange stays clear of status colours) */
:root[data-brand="harbor"] {
  --page: #edf1f5; --surface: #ffffff; --surface-2: #f4f6f9; --ink: #0b1b2e; --ink-2: #44546a; --muted: #7a8698;
  --line: #dde3ea; --line-strong: #c5ced9;
  --accent: #1d4f8f; --accent-ink: #1a4782; --accent-soft: #e4ecf7;
  --side: #0b1f3a; --side-2: #132c4f; --side-3: #1b3a63; --side-ink: #dce6f2; --side-muted: #8ea3bd;
  --brand-1: #f07a2b; --brand-2: #c4470e; --nav-on: #f07a2b; --nav-on-icon: #ffab72;
  --box-1: #e8641b; --box-2: #1d4f8f; --box-3: #8d9cb0; --box-4: #b23a2a;
  --art-sky-1: #d7e3f0; --art-sky-2: #f3f6fa; --art-ground: #c3cdd9; --art-sea: #1d4f8f; --art-steel: #0b1f3a;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) { :root[data-brand="harbor"]:not([data-theme="light"]) {
  --page: #08111e; --surface: #0f1b2b; --surface-2: #142335; --ink: #eaf0f7; --ink-2: #b6c2d1; --muted: #8494a8;
  --line: #1f2f45; --line-strong: #2b3f5b; --accent: #6aa3e8; --accent-ink: #92bdf0; --accent-soft: #15283f;
  --side: #060d18; --side-2: #0f2038; --side-3: #173054;
  --art-sky-1: #0c1a2e; --art-sky-2: #08111e; --art-ground: #1a2a40; --art-sea: #0d2848; --art-steel: #9fb4cc; } }
:root[data-brand="harbor"][data-theme="dark"] {
  --page: #08111e; --surface: #0f1b2b; --surface-2: #142335; --ink: #eaf0f7; --ink-2: #b6c2d1; --muted: #8494a8;
  --line: #1f2f45; --line-strong: #2b3f5b; --accent: #6aa3e8; --accent-ink: #92bdf0; --accent-soft: #15283f;
  --side: #060d18; --side-2: #0f2038; --side-3: #173054;
  --art-sky-1: #0c1a2e; --art-sky-2: #08111e; --art-ground: #1a2a40; --art-sea: #0d2848; --art-steel: #9fb4cc; }
:root[data-brand="harbor"] .top { box-shadow: inset 0 3px 0 var(--brand-1); }

/* --- ساحة الحاويات: concrete and graphite, container red and teal, boxy cards with corner castings */
:root[data-brand="yard"] {
  --page: #ebecea; --surface: #fbfbfa; --surface-2: #f2f3f1; --ink: #1b1f22; --ink-2: #4b5157; --muted: #80878d;
  --line: #dcdedb; --line-strong: #c4c8c4;
  --accent: #1f6f78; --accent-ink: #17595f; --accent-soft: #dfeeef;
  --side: #23282c; --side-2: #2f363b; --side-3: #3b4349; --side-ink: #e3e6e8; --side-muted: #9aa3aa;
  --brand-1: #c4472f; --brand-2: #8e2d1c; --nav-on: #d1573d; --nav-on-icon: #f0957f;
  --box-1: #c4472f; --box-2: #1f6f78; --box-3: #d9a21b; --box-4: #5b6670;
  --art-sky-1: #e3e6e3; --art-sky-2: #f4f5f3; --art-ground: #c7cbc6; --art-sea: #2c5560; --art-steel: #23282c;
  --corner: #8e969c; --radius: 5px;
}
@media (prefers-color-scheme: dark) { :root[data-brand="yard"]:not([data-theme="light"]) {
  --page: #111315; --surface: #191c1f; --surface-2: #212528; --ink: #eceeef; --ink-2: #b9bec2; --muted: #8c949a;
  --line: #2a2f33; --line-strong: #383f45; --accent: #4fb3bd; --accent-ink: #80cbd2; --accent-soft: #15343a;
  --side: #0d0f11; --side-2: #1a1e21; --side-3: #252a2e; --corner: #4c555b;
  --art-sky-1: #1a1d20; --art-sky-2: #111315; --art-ground: #2a2e31; --art-sea: #18363e; --art-steel: #aeb6bc; } }
:root[data-brand="yard"][data-theme="dark"] {
  --page: #111315; --surface: #191c1f; --surface-2: #212528; --ink: #eceeef; --ink-2: #b9bec2; --muted: #8c949a;
  --line: #2a2f33; --line-strong: #383f45; --accent: #4fb3bd; --accent-ink: #80cbd2; --accent-soft: #15343a;
  --side: #0d0f11; --side-2: #1a1e21; --side-3: #252a2e; --corner: #4c555b;
  --art-sky-1: #1a1d20; --art-sky-2: #111315; --art-ground: #2a2e31; --art-sea: #18363e; --art-steel: #aeb6bc; }
:root[data-brand="yard"] :is(.card, .stat, .kpi, .team-card, .tl-item) {
  background-image: linear-gradient(var(--corner), var(--corner)), linear-gradient(var(--corner), var(--corner)),
                    linear-gradient(var(--corner), var(--corner)), linear-gradient(var(--corner), var(--corner));
  background-size: 7px 7px; background-repeat: no-repeat; background-position: 0 0, 100% 0, 0 100%, 100% 100%; }
:root[data-brand="yard"] .map-card { background-image: none; }
:root[data-brand="yard"] .nav a.on { box-shadow: inset -4px 0 0 var(--nav-on); border-radius: 3px; }

/* --- غرفة التحكم: one dark look for the control-room screens, radar cyan, hazard stripe */
:root[data-brand="control"], :root[data-brand="control"][data-theme="light"], :root[data-brand="control"][data-theme="dark"] {
  color-scheme: dark;
  --page: #0d1013; --surface: #151a1f; --surface-2: #1c2228; --ink: #e8edf2; --ink-2: #b2bcc7; --muted: #84909c;
  --line: #252c34; --line-strong: #323b45; --grid: #252c34; --axis: #323b45;
  --accent: #22b8cf; --accent-ink: #62d1e2; --accent-soft: #0e2e35;
  --side: #090c0f; --side-2: #131920; --side-3: #1c242c; --side-ink: #dfe6ed; --side-muted: #7e8a96;
  --brand-1: #f2c200; --brand-2: #a88400; --nav-on: #22b8cf; --nav-on-icon: #62d1e2;
  --box-1: #22b8cf; --box-2: #f2c200; --box-3: #59656f; --box-4: #d0563f;
  --art-sky-1: #111820; --art-sky-2: #0d1013; --art-ground: #1d242c; --art-sea: #0f3a44; --art-steel: #8e9aa6;
  --shadow: 0 1px 2px rgba(0, 0, 0, .45);
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
  --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
  --good-ink: #2fbf4f; --warning-ink: #fab219; --serious-ink: #ec835a; --critical-ink: #ef6f6f;
  --good-soft: #13261a; --warning-soft: #2c2410; --serious-soft: #2d1c14; --critical-soft: #2e1616;
  --seq-1: #104281; --seq-2: #184f95; --seq-3: #1c5cab; --seq-4: #2a78d6; --seq-5: #5598e7; --seq-6: #86b6ef;
  --seq-ink-light: #ffffff; --seq-ink-dark: #0b0b0b; --radius: 10px;
}
:root[data-brand="control"] .brand-mark { color: #111; }
:root[data-brand="control"] .top { border-top: 4px solid #f2c200;
  border-image: repeating-linear-gradient(-45deg, #f2c200 0 10px, #111 10px 20px) 4 / 4px 0 0 0; }
:root[data-brand="control"] .login-art .art-text { color: #e8edf2; }

/* --- البحر الأحمر: sea teal chrome, sand accents, a wave under the header */
:root[data-brand="redsea"] {
  --page: #f1f5f4; --surface: #ffffff; --surface-2: #f4f8f7; --ink: #0d2226; --ink-2: #43575b; --muted: #7a8e91;
  --line: #dbe5e4; --line-strong: #c1d1cf;
  --accent: #0f7c84; --accent-ink: #0b646b; --accent-soft: #ddf0f0;
  --side: #0b3a42; --side-2: #11505a; --side-3: #186570; --side-ink: #dcefef; --side-muted: #8fb7b9;
  --brand-1: #d8a75e; --brand-2: #a5732f; --nav-on: #e0b874; --nav-on-icon: #f2d6a6;
  --box-1: #0f7c84; --box-2: #d8a75e; --box-3: #c0533a; --box-4: #2d4f6b;
  --art-sky-1: #d5ecec; --art-sky-2: #f3f8f7; --art-ground: #e2d3b4; --art-sea: #0f7c84; --art-steel: #0b3a42;
  --radius: 16px;
}
@media (prefers-color-scheme: dark) { :root[data-brand="redsea"]:not([data-theme="light"]) {
  --page: #07171a; --surface: #0e2125; --surface-2: #13292e; --ink: #e5f1f0; --ink-2: #b2c9ca; --muted: #809ea0;
  --line: #1c383d; --line-strong: #27474d; --accent: #3cb7bf; --accent-ink: #74cfd5; --accent-soft: #113a3e;
  --side: #051316; --side-2: #0c282d; --side-3: #13363c;
  --art-sky-1: #0c2428; --art-sky-2: #07171a; --art-ground: #2a271f; --art-sea: #0b4a50; --art-steel: #a9c6c7; } }
:root[data-brand="redsea"][data-theme="dark"] {
  --page: #07171a; --surface: #0e2125; --surface-2: #13292e; --ink: #e5f1f0; --ink-2: #b2c9ca; --muted: #809ea0;
  --line: #1c383d; --line-strong: #27474d; --accent: #3cb7bf; --accent-ink: #74cfd5; --accent-soft: #113a3e;
  --side: #051316; --side-2: #0c282d; --side-3: #13363c;
  --art-sky-1: #0c2428; --art-sky-2: #07171a; --art-ground: #2a271f; --art-sea: #0b4a50; --art-steel: #a9c6c7; }
:root[data-brand="redsea"] .top { background-image: linear-gradient(90deg, var(--brand-1), var(--accent));
  background-size: 100% 3px; background-repeat: no-repeat; background-position: 0 100%; }


* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--page); color: var(--ink); font-size: 15.5px; line-height: 1.6;
       -webkit-font-smoothing: antialiased; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 700; line-height: 1.35; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8;
        stroke-linecap: round; stroke-linejoin: round; }
.num { font-variant-numeric: tabular-nums; unicode-bidi: isolate; direction: ltr; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ------------------------------------------------------------- shell */
.shell { display: flex; min-height: 100vh; }
.side { width: 248px; flex: none; background: var(--side); color: var(--side-ink); display: flex; flex-direction: column;
        position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; gap: 12px; align-items: center; padding: 20px 18px 16px; border-bottom: 1px solid var(--side-line); }
.brand-mark { width: 42px; height: 42px; border-radius: 11px; background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
              display: grid; place-items: center; color: #fff; flex: none; }
.brand-mark svg { width: 28px; height: 28px; stroke-width: 1.6; }
.brand-name { font-weight: 700; font-size: 17px; color: #fff; }
.brand-en { font-size: 12px; font-weight: 700; letter-spacing: .14em; opacity: .7; margin-inline-start: 4px; }
.brand-site { font-size: 13.5px; color: var(--side-muted); }
.nav { padding: 10px 10px 18px; display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 12.5px; color: var(--side-muted); padding: 14px 10px 6px; letter-spacing: .02em; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; color: var(--side-ink);
         font-weight: 500; }
.nav a:hover { background: var(--side-2); text-decoration: none; }
.nav a.on { background: var(--side-2); color: #fff; box-shadow: inset -3px 0 0 var(--nav-on); }
.nav a svg.i { color: var(--side-muted); }
.nav a.on svg.i { color: var(--nav-on-icon); }
.side-foot { margin-top: auto; padding: 14px 16px 18px; border-top: 1px solid var(--side-line); font-size: 13.5px; }
.who { font-weight: 600; color: #fff; font-size: 14.5px; }
.who-role { color: var(--side-muted); }
.side-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.side-actions a, .side-actions button { font: inherit; font-size: 13.5px; color: var(--side-ink); background: var(--side-2);
         border: 0; border-radius: 8px; padding: 6px 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.side-actions a:hover, .side-actions button:hover { background: var(--side-3); text-decoration: none; }
.side-actions svg.i { width: 15px; height: 15px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { background: var(--surface); border-bottom: 1px solid var(--line); padding: 16px 28px; display: flex; gap: 16px;
       align-items: center; justify-content: space-between; flex-wrap: wrap; position: sticky; top: 0; z-index: 20; }
.top h1 { font-size: 21.5px; }
.top .sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.top-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.content { padding: 24px 28px 40px; max-width: 1480px; width: 100%; margin: 0 auto; flex: 1; }
.foot { color: var(--muted); font-size: 13.5px; padding: 16px 28px 24px; text-align: center;
  display: flex; align-items: center; justify-content: space-between; gap: 10px 24px; flex-wrap: wrap; }
/* «تصميم وتطوير» — in the footer, at the foot of the phone menu, and on the sign-in page */
.credit { display: inline-flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--muted); line-height: 1.3; flex-wrap: wrap; }
.credit-by { font-weight: 600; opacity: .85; }
.credit-rights { font-weight: 500; }
.credit-team { font-weight: 600; color: var(--ink-2); }
.credit-dot { margin: 0 3px; opacity: .6; }
.credit-sep { width: 1px; height: 18px; background: currentColor; opacity: .35; }
.credit-logo { height: 20px; width: auto; display: block; }
/* Elm's two logos: white on dark grounds (the menu, the sign-in photo), navy on light ones */
.credit .cl-dark { display: none; }
.foot .credit .cl-white { display: none; } .foot .credit .cl-dark { display: block; }
:root[data-theme="dark"] .foot .credit .cl-white { display: block; } :root[data-theme="dark"] .foot .credit .cl-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .foot .credit .cl-white { display: block; } :root:not([data-theme]) .foot .credit .cl-dark { display: none; } }
.side-credit { display: none; }
.side-credit .credit { color: var(--side-muted); } .side-credit .credit-team { color: var(--side-ink); }
@media (max-width: 700px) { .side-credit { display: block; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--side-line); } }
/* the phone menu is narrow: the lines stacked, the logo beneath them */
.side-credit .credit { flex-direction: column; align-items: flex-start; gap: 3px; }
.side-credit .credit-sep { display: none; }
.side-credit .credit-logo { height: 22px; margin-top: 6px; }
.side-credit .credit-rights { order: 9; margin-top: 8px; font-size: 11.5px; }   /* the rights last, under the logo */

/* ------------------------------------------------------------- controls */
.btn { font: inherit; font-weight: 600; font-size: 14.5px; border-radius: 9px; padding: 8px 14px; border: 1px solid var(--line-strong);
       background: var(--surface); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
       line-height: 1.3; white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.small { padding: 5px 10px; font-size: 13.5px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn svg.i { width: 16px; height: 16px; }
.datebar { display: flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--line);
           border-radius: 11px; padding: 4px; }
.datebar a { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: var(--ink-2); }
.datebar a:hover { background: var(--surface); text-decoration: none; }
.datebar input { font: inherit; border: 0; background: transparent; color: var(--ink); padding: 4px 6px; }
.datebar .lbl { font-weight: 600; padding: 0 6px; font-size: 14.5px; }
input[type=text], input[type=search], input[type=password], input[type=date], input[type=time], input[type=datetime-local], input[type=file], select, textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 9px;
  padding: 8px 10px; width: 100%; }
input[type=file] { padding: 7px; }
/* the eye inside password fields (js/reveal.js); on the left, the field's end in Arabic */
.pw { position: relative; display: block; }
.pw input { padding-left: 44px; }
.pw-eye { position: absolute; left: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 34px; padding: 0;
  display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer;
  -webkit-tap-highlight-color: transparent; }
@media (hover: hover) { .pw-eye:hover { color: var(--ink); background: var(--surface-2); } }   /* a phone keeps :hover after a tap */
.pw-eye[aria-pressed="true"] { color: var(--ink); }
.pw-eye:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.pw-eye svg.i { width: 19px; height: 19px; }
.pw-eye[aria-pressed="false"] svg.i:last-child, .pw-eye[aria-pressed="true"] svg.i:first-child { display: none; }
input::-ms-reveal, input::-ms-clear { display: none; }   /* Edge's own eye would show twice */
label { display: block; font-weight: 600; font-size: 14.5px; margin-bottom: 6px; }
.field { margin-bottom: 14px; }
.field .hint { color: var(--muted); font-size: 13.5px; margin-top: 4px; font-weight: 400; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.check input { width: auto; }

/* ------------------------------------------------------------- page sections */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.eyebrow { font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.section { margin-bottom: 26px; }
.section-head { margin-bottom: 12px; }
.section-head h2 { font-size: 21.5px; }
.section-head .subtitle { color: var(--muted); font-size: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.stack > * + * { margin-top: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
        padding: 18px 20px; min-width: 0; }
.card-title { font-size: 17px; font-weight: 700; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.card-help { color: var(--muted); font-size: 13.5px; margin-top: 10px; }
.muted { color: var(--muted); }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; }
.tabs a { padding: 10px 16px; color: var(--ink-2); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--accent-ink); border-bottom-color: var(--accent); }

/* stat tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); gap: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 14px;
        box-shadow: var(--shadow); position: relative; min-width: 0; }
.stat-label { color: var(--ink-2); font-size: 14.5px; font-weight: 600; display: flex; gap: 6px; align-items: flex-start; justify-content: space-between; }
.stat-value { font-size: 28px; font-weight: 700; line-height: 1.2; margin-top: 8px; letter-spacing: -.01em; }
.stat-unit { font-size: 14px; color: var(--muted); font-weight: 500; margin-inline-start: 4px; letter-spacing: 0; }
.stat-sub { font-size: 14px; color: var(--ink-2); margin-top: 4px; }
.stat-status { margin-top: 8px; }
.stat.st-critical { border-color: color-mix(in srgb, var(--critical) 45%, var(--line)); }
.stat.st-warning { border-color: color-mix(in srgb, var(--warning) 55%, var(--line)); }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; padding: 2px 9px 2px 8px; border-radius: 99px; }
.pill svg.i { width: 13px; height: 13px; stroke-width: 2.2; }
.pill.good { background: var(--good-soft); color: var(--good-ink); }
.pill.warning { background: var(--warning-soft); color: var(--warning-ink); }
.pill.serious { background: var(--serious-soft); color: var(--serious-ink); }
.pill.critical { background: var(--critical-soft); color: var(--critical-ink); }
.pill.info { background: var(--accent-soft); color: var(--accent-ink); }
.pill.neutral { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }

.help { position: relative; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; flex: none;
        color: var(--muted); cursor: help; border: 0; background: transparent; padding: 0; }
.help svg.i { width: 16px; height: 16px; }
.help::after { content: attr(data-tip); position: absolute; top: 24px; inset-inline-end: -6px; width: 260px; z-index: 30;
               background: var(--ink); color: var(--surface); font-size: 13.5px; font-weight: 500; line-height: 1.6; padding: 8px 10px;
               border-radius: 8px; opacity: 0; pointer-events: none; transform: translateY(-3px); transition: opacity .12s, transform .12s;
               text-align: start; white-space: normal; }
.help:hover::after, .help:focus::after { opacity: 1; transform: none; }

/* bars */
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: minmax(120px, 34%) 1fr auto; gap: 12px; align-items: center; }
.bar-label { font-size: 14.5px; color: var(--ink); }
.bar-track { height: 12px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: var(--series-1); border-radius: 0 4px 4px 0; transition: width .4s ease; }
[dir=rtl] .bar-fill { border-radius: 4px 0 0 4px; margin-inline-start: 0; }
.bar-fill.critical { background: var(--critical); }
.bar-fill.warning { background: var(--warning); }
.bar-value { font-weight: 700; font-size: 14.5px; min-width: 64px; display: flex; gap: 6px; justify-content: flex-end; align-items: baseline; }
.bar-share { color: var(--muted); font-weight: 500; font-size: 13.5px; }

/* gauges */
.gauges { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.gauge-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.gauge-badge { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink);
               display: grid; place-items: center; font-weight: 700; font-size: 22.5px; }
.gauge-title { font-weight: 700; font-size: 18px; }
.gauge-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 10px; }
.mini { background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; }
.mini-value { font-size: 18px; font-weight: 700; }
.mini-label { font-size: 13.5px; color: var(--muted); }
.meter { margin-top: 14px; }
.meter-row { display: flex; justify-content: space-between; font-size: 14px; color: var(--ink-2); margin-bottom: 6px; }
.meter-track { height: 10px; background: var(--accent-soft); border-radius: 5px; overflow: hidden; }
.meter-fill { height: 100%; width: 0; background: var(--accent); border-radius: 5px; transition: width .4s ease; }
.meter-fill.warning { background: var(--warning); }
.meter-fill.critical { background: var(--critical); }

/* charts */
.chart-box { position: relative; width: 100%; }
.chart-box canvas { display: block; }
details.data-table { margin-top: 10px; font-size: 14px; }
details.data-table summary { cursor: pointer; color: var(--muted); }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 11px; }
table.t { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.t th { background: var(--surface-2); color: var(--ink-2); font-weight: 600; text-align: start; padding: 9px 12px;
             border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; }
table.t td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t td.n { font-variant-numeric: tabular-nums; white-space: nowrap; }
table.t tbody tr:hover td { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.cell-st { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot.critical { background: var(--critical); }
.dot.warning { background: var(--warning); }
.dot.good { background: var(--good); }
.dot.serious { background: var(--serious); }
.dot.neutral { background: var(--muted); }
.table-foot { font-size: 13.5px; color: var(--muted); margin-top: 8px; }

/* heatmap */
.heat { border-collapse: separate; border-spacing: 2px; width: 100%; font-size: 13px; }
.heat th { color: var(--muted); font-weight: 500; padding: 2px; text-align: center; }
.heat th.rowh { text-align: start; white-space: nowrap; padding-inline-end: 8px; color: var(--ink-2); font-weight: 600; font-size: 14px; }
.heat td { height: 30px; min-width: 26px; text-align: center; border-radius: 4px; background: var(--surface-2); color: var(--seq-ink-light);
           font-variant-numeric: tabular-nums; }
.heat td.l1 { background: var(--seq-1); } .heat td.l2 { background: var(--seq-2); } .heat td.l3 { background: var(--seq-3); }
.heat td.l4 { background: var(--seq-4); color: var(--seq-ink-dark); } .heat td.l5 { background: var(--seq-5); color: var(--seq-ink-dark); }
.heat td.l6 { background: var(--seq-6); color: var(--seq-ink-dark); }
.heat-legend { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); margin-top: 10px; }
.heat-legend span.sw { width: 22px; height: 10px; border-radius: 3px; display: inline-block; }
.sw.l1 { background: var(--seq-1); } .sw.l2 { background: var(--seq-2); } .sw.l3 { background: var(--seq-3); }
.sw.l4 { background: var(--seq-4); } .sw.l5 { background: var(--seq-5); } .sw.l6 { background: var(--seq-6); }
.scroll-x { overflow-x: auto; }

/* notes, flashes, alerts */
.note { border-radius: 11px; padding: 12px 14px; background: var(--accent-soft); color: var(--accent-ink); font-size: 14.5px; }
.note.warning { background: var(--warning-soft); color: var(--warning-ink); }
.note.critical { background: var(--critical-soft); color: var(--critical-ink); }
.flash { margin-bottom: 16px; }
.alerts { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.alerts li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.alerts li.critical { background: var(--critical-soft); border-color: transparent; }
.alerts li.warning { background: var(--warning-soft); border-color: transparent; }
.alerts .team-tag { font-size: 13px; color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.alerts .txt { flex: 1; }

.sources { display: flex; gap: 8px; flex-wrap: wrap; margin: -6px 0 18px; }
.source { display: inline-flex; gap: 6px; align-items: center; font-size: 13.5px; color: var(--ink-2); background: var(--surface);
          border: 1px solid var(--line); border-radius: 99px; padding: 3px 10px; }
.source.stale { border-style: dashed; color: var(--muted); }

/* overview team cards */
.team-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 16px; }
.team-card .tc-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.tc-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; }
.tc-name { font-weight: 700; font-size: 17px; }
.tc-mandate { font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.tc-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tc-stats .mini-value { font-size: 17px; display: flex; gap: 6px; align-items: center; }
.checklist { list-style: none; padding: 0; margin: 12px 0 0; font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.checklist li { display: flex; gap: 8px; align-items: center; }
.tc-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }

/* submissions matrix */
.matrix td, .matrix th { text-align: center; }
.matrix td.ds, .matrix th.ds { text-align: start; white-space: nowrap; }
.mx { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; }
.mx svg.i { width: 15px; height: 15px; stroke-width: 2.4; }
.mx.approved { background: var(--good-soft); color: var(--good-ink); }
.mx.accepted { background: var(--accent-soft); color: var(--accent-ink); }
.mx.rejected { background: var(--critical-soft); color: var(--critical-ink); }
.mx.missing { background: var(--surface-2); color: var(--muted); border: 1px dashed var(--line-strong); }
.legend-row { display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; color: var(--ink-2); align-items: center; }
.legend-row > span { display: inline-flex; align-items: center; gap: 6px; }

/* uploads */
.upload-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px; align-items: start; }
.ds-info[hidden] { display: none; }
.ds-cols { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ds-cols span { font-size: 13.5px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 7px; padding: 2px 8px; }
.ds-cols span.req { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); color: var(--accent-ink); font-weight: 600; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 14.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }
.kv dd.num { text-align: right; }
.inline-form { display: inline; }

/* login */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
              background: radial-gradient(1200px 600px at 80% -10%, color-mix(in srgb, var(--accent) 20%, transparent), transparent), var(--page); }
.login-card { width: 100%; max-width: 400px; }
.login-split { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(360px, 1fr); background: var(--page); }
.login-art { position: relative; background: linear-gradient(180deg, var(--art-sky-1), var(--art-sky-2)); overflow: hidden;
             display: flex; flex-direction: column; justify-content: flex-end; }
.login-art svg.port { width: 100%; height: auto; display: block; }
.login-art .art-text { position: absolute; top: 40px; inset-inline-start: 44px; inset-inline-end: 44px; color: var(--art-steel); }
.art-text .art-kicker { font-size: 14px; font-weight: 600; letter-spacing: .02em; opacity: .75; }
.art-text .art-title { font-size: clamp(30px, 3.6vw, 46px); font-weight: 800; line-height: 1.15; margin-top: 6px; }
.art-text .art-sub { font-size: 16px; margin-top: 10px; max-width: 34ch; opacity: .8; }
.login-side { display: grid; place-items: center; padding: 32px 24px; }
.login-split .login-card { box-shadow: none; border: 0; background: transparent; }
.login-split .login-card .brand { padding-bottom: 26px; }
.login-split .login-card .btn.primary { width: 100%; justify-content: center; padding: 11px 14px; }
.port .face { fill: var(--box-4); }
.port .b1 .face { fill: var(--box-1); } .port .b2 .face { fill: var(--box-2); } .port .b3 .face { fill: var(--box-3); }
.port .lid { fill: #fff; fill-opacity: .18; }
.port .corr { stroke: #000; stroke-opacity: .17; stroke-width: 1.3; }
.port .ground { fill: var(--art-ground); } .port .sea { fill: var(--art-sea); }
.port .wave { fill: none; stroke: #fff; stroke-opacity: .22; stroke-width: 1.5; }
.port .steel { fill: var(--art-steel); } .port .glass { fill: var(--art-sky-1); }
.port .frame { fill: none; stroke: var(--art-steel); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.port .cable { fill: none; stroke: var(--art-steel); stroke-width: 1.5; }
.port .far { fill: var(--art-steel); stroke: var(--art-steel); stroke-width: 6; opacity: .1; }
.port .wheel { fill: #1d2125; } .port .hub { fill: #9aa3ab; }
.login-foot { color: var(--muted); font-size: 13px; margin-top: 18px; text-align: center; }
@media (max-width: 900px) {
  .login-split { grid-template-columns: minmax(0, 1fr); }
  .login-art { min-height: 220px; }
  .login-art .art-text { top: 22px; inset-inline-start: 20px; inset-inline-end: 20px; }
  .art-text .art-sub { display: none; }
}
.login-card .brand { border: 0; padding: 0 0 18px; }
.login-card .brand-name { color: var(--ink); font-size: 19px; }
.login-card .brand-site { color: var(--muted); }


/* KPI board: hero index, volume tiles, KPI cards with bullet bars and sparklines */
:root { --band-good: #f0efea; --band-fair: #e2e0d8; --band-poor: #cfccc2; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --band-good: #262624; --band-fair: #30302d; --band-poor: #3d3d39; } }
:root[data-theme="dark"] { --band-good: #262624; --band-fair: #30302d; --band-poor: #3d3d39; }

.hero-row { display: grid; grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.4fr); gap: 16px; align-items: stretch; }
.hero { display: flex; flex-direction: column; gap: 12px; }
.hero.st-good { box-shadow: var(--shadow), inset -4px 0 0 var(--good); }
.hero.st-warning { box-shadow: var(--shadow), inset -4px 0 0 var(--warning); }
.hero.st-critical { box-shadow: var(--shadow), inset -4px 0 0 var(--critical); }
.hero-main { display: flex; gap: 18px; align-items: center; }
.hero-text { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; min-width: 0; }
.hero-title { font-size: 18px; font-weight: 700; display: flex; gap: 6px; align-items: center; }
.hero-counts { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13.5px; color: var(--ink-2); }
.hero-counts > span { display: inline-flex; gap: 6px; align-items: center; }
.hero-target { font-size: 13px; }
.hero-spark { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding-top: 10px; font-size: 13px; }

.volumes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.vol { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; }
.vol-label { color: var(--ink-2); font-size: 14.5px; font-weight: 600; }
.vol-value { font-size: 28px; font-weight: 700; line-height: 1.2; }
.vol .spark { margin-top: auto; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
       padding: 16px 18px 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.kpi.st-good { box-shadow: var(--shadow), inset -3px 0 0 var(--good); }
.kpi.st-warning { box-shadow: var(--shadow), inset -3px 0 0 var(--warning); }
.kpi.st-critical { box-shadow: var(--shadow), inset -3px 0 0 var(--critical); }
.kpi-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.kpi-label { font-size: 15px; font-weight: 600; color: var(--ink-2); }
.kpi-main { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.kpi-value { font-size: 30px; font-weight: 700; line-height: 1.15; letter-spacing: -.01em; }
.bullet-wrap { border-radius: 5px; overflow: hidden; height: 16px; }
svg.bullet { display: block; width: 100%; height: 16px; }
.b-good { fill: var(--band-good); } .b-fair { fill: var(--band-fair); } .b-poor { fill: var(--band-poor); }
.b-val { fill: var(--accent); }
.b-val.st-good { fill: var(--good); } .b-val.st-warning { fill: var(--warning); } .b-val.st-critical { fill: var(--critical); }
.b-tgt { stroke: var(--ink); stroke-width: 2.5; }
.bullet-scale { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-top: -6px; }
.kpi-target { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--ink-2); }
.kpi-target svg.i { width: 15px; height: 15px; color: var(--muted); }
.kpi-foot { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; margin-top: auto; }
.kpi-deltas { display: flex; flex-wrap: wrap; gap: 3px 14px; min-width: 0; }
.delta { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.delta svg.i { width: 14px; height: 14px; stroke-width: 2.4; }
.delta.good { color: var(--good-ink); } .delta.bad { color: var(--critical-ink); } .delta.neutral { color: var(--ink-2); }
.delta-ref { color: var(--muted); font-weight: 400; margin-inline-start: 2px; }
svg.spark { flex: none; overflow: visible; display: block; width: 100%; height: auto; }
.spark { --sp: var(--series-1); }
.spark.st-good { --sp: var(--good); } .spark.st-warning { --sp: var(--warning); } .spark.st-critical { --sp: var(--critical); }
.sp-line { fill: none; stroke: var(--sp); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.sp-area { fill: var(--sp); fill-opacity: .14; stroke: none; }
.sp-dot { fill: var(--sp); stroke: var(--surface); stroke-width: 2; }

/* liquid wave gauge for the composite index */
.wave-gauge { flex: none; --wg: var(--accent); --wg-ink: #ffffff; }
.wave-gauge.st-good { --wg: var(--good); }
.wave-gauge.st-warning { --wg: var(--warning); --wg-ink: #0b0b0b; }
.wave-gauge.st-critical { --wg: var(--critical); }
.wg-ring { fill: none; stroke: var(--wg); stroke-width: 3; }
.wg-bg { fill: color-mix(in srgb, var(--wg) 10%, var(--surface)); }
.wg-water { fill: var(--wg); }
.wg-water-back { fill: var(--wg); fill-opacity: .4; }
.wg-num { font-family: var(--font); font-size: 34px; font-weight: 700; fill: var(--ink); text-anchor: middle; }
.wg-sub { font-family: var(--font); font-size: 13px; fill: var(--muted); text-anchor: middle; }
.wg-num.on-water, .wg-sub.on-water { fill: var(--wg-ink); }
.wave-move { animation: wave-slide 3.6s linear infinite; }
.wave-move.back { animation-duration: 5.4s; animation-direction: reverse; }
@keyframes wave-slide { from { transform: translateX(0); } to { transform: translateX(70px); } }
@media (prefers-reduced-motion: reduce) { .wave-move { animation: none; } }
.sp-tgt { stroke: var(--ref); stroke-width: 1; }
svg.spark.wide { width: 220px; }

.insights { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.insights li { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.7; }
.ins-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent-ink); }
.insights li.warning .ins-icon { background: var(--warning-soft); color: var(--warning-ink); }
.insights li.critical .ins-icon { background: var(--critical-soft); color: var(--critical-ink); }
.insights li.good .ins-icon { background: var(--good-soft); color: var(--good-ink); }


/* ---------------------------------------------------------- engineering department */
.eng-tabs { margin-top: -6px; }
.sub-tabs { margin-bottom: 18px; }
.section-gap { margin-top: 14px; }
.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.module { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; color: var(--ink); transition: transform .15s, box-shadow .15s; }
.module:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(11, 22, 38, .08); }
.module-icon { width: 40px; height: 40px; border-radius: 11px; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; }
.module-icon svg.i { width: 20px; height: 20px; }
.module-label { font-weight: 700; font-size: 16.5px; }
.module-meta { color: var(--muted); font-size: 13.5px; }
.activity { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.activity li { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.activity li:last-child { border-bottom: 0; }
.act-text { flex: 1; min-width: 200px; }
.pill.neutral.st-none { background: var(--surface-2); }

.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; align-items: end; margin-bottom: 18px; }
.filters .field { margin: 0; }
.filter-actions { display: flex; align-items: flex-end; }
.form-narrow { max-width: 760px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 14px; }
.coords { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.coords input { width: 150px; flex: 1 1 120px; }
.inline-coords input { width: 110px; flex: 0 1 110px; }
textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 9px; padding: 8px 10px; width: 100%; resize: vertical; }
.chip { display: inline-block; font-size: 13px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 7px; padding: 1px 8px; margin: 2px; }
.chip.off { opacity: .5; text-decoration: line-through; }

.facility-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.facility { padding: 0; overflow: hidden; display: flex; flex-direction: column; color: var(--ink); }
.facility:hover { text-decoration: none; box-shadow: 0 6px 20px rgba(11, 22, 38, .08); }
.facility.st-critical { box-shadow: var(--shadow), inset 0 3px 0 var(--critical); }
.facility.st-serious { box-shadow: var(--shadow), inset 0 3px 0 var(--serious); }
.facility.st-warning { box-shadow: var(--shadow), inset 0 3px 0 var(--warning); }
.fac-photo { aspect-ratio: 16 / 9; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.fac-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fac-noimg { color: var(--muted); display: grid; place-items: center; }
.fac-noimg svg.i { width: 36px; height: 36px; }
.fac-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; }
.fac-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.fac-code { font-size: 13px; color: var(--muted); }
.fac-name { font-weight: 700; font-size: 16px; }
.fac-meta { font-size: 13px; }
.fac-detail { padding: 0; overflow: hidden; }
.fac-hero { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--surface-2); }
div.fac-hero { display: grid; place-items: center; }
.pill.serious { background: var(--serious-soft); color: var(--serious-ink); }

.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.tl-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; box-shadow: var(--shadow); }
.tl-item.st-critical { box-shadow: var(--shadow), inset -3px 0 0 var(--critical); }
.tl-item.st-serious { box-shadow: var(--shadow), inset -3px 0 0 var(--serious); }
.tl-item.st-warning { box-shadow: var(--shadow), inset -3px 0 0 var(--warning); }
.tl-item.st-good { box-shadow: var(--shadow), inset -3px 0 0 var(--good); }
.tl-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tl-notes { margin-top: 6px; color: var(--ink-2); }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.thumb { position: relative; display: block; width: 104px; height: 78px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbs.small { margin: 0; flex-wrap: nowrap; }
.thumbs.small .thumb { width: 54px; height: 42px; }
.thumb-tag { position: absolute; inset-inline-start: 4px; bottom: 4px; background: rgba(11, 22, 38, .72); color: #fff; font-size: 11px; padding: 0 6px; border-radius: 5px; }

/* field app */
.field-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.field-btn { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; padding: 22px; border-radius: 18px; color: #fff;
             background: linear-gradient(135deg, var(--accent), var(--side)); box-shadow: 0 8px 24px rgba(16, 30, 50, .22); }
.field-btn.alt { background: linear-gradient(135deg, #1baf7a, #0c6d4b); box-shadow: 0 8px 24px rgba(12, 109, 75, .25); }
.field-btn:hover { text-decoration: none; filter: brightness(1.05); }
.fb-icon { width: 46px; height: 46px; border-radius: 13px; background: rgba(255, 255, 255, .18); display: grid; place-items: center; }
.fb-icon svg.i { width: 24px; height: 24px; }
.fb-title { font-size: 21px; font-weight: 700; }
.fb-meta { opacity: .85; }
.field-form .field label { font-size: 15px; }
.field-form select, .field-form input[type=text], .field-form input[type=date] { padding: 11px 12px; font-size: 16px; }
.choice-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.choice { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; cursor: pointer; font-weight: 600; margin: 0; }
.choice input { width: auto; accent-color: var(--accent); }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice.st-good:has(input:checked) { border-color: var(--good); background: var(--good-soft); }
.choice.st-warning:has(input:checked) { border-color: var(--warning); background: var(--warning-soft); }
.choice.st-serious:has(input:checked) { border-color: var(--serious); background: var(--serious-soft); }
.choice.st-critical:has(input:checked) { border-color: var(--critical); background: var(--critical-soft); }
.previews { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 14px; }
.previews img { width: 96px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.previews.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.previews.two > div { display: flex; gap: 8px; }
.btn.big { padding: 12px 22px; font-size: 16px; width: 100%; justify-content: center; }

/* map */
.map-card { padding: 0; overflow: hidden; }
.eng-map { height: 620px; width: 100%; direction: ltr; background: var(--surface-2); font-family: var(--font); }
.pin { background: transparent; border: 0; }
.pin span { display: block; width: 22px; height: 22px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .45); background: var(--accent); }
.pin-good span { background: var(--good); } .pin-warning span { background: var(--warning); }
.pin-serious span { background: var(--serious); } .pin-critical span { background: var(--critical); }
.map-pop { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; font-family: var(--font); font-size: 13.5px; min-width: 200px; }
.map-pop img { width: 100%; height: 120px; object-fit: cover; border-radius: 8px; }
.mp-title { font-weight: 700; font-size: 15px; }
.mp-meta { color: #52514e; }
.leaflet-tooltip.zone-label { background: rgba(255, 255, 255, .88); border: 0; box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
  font-family: var(--font); font-weight: 700; font-size: 12px; color: #0b1626; padding: 1px 8px; border-radius: 6px; }
.leaflet-tooltip.zone-label::before { display: none; }
.leaflet-tooltip.muted-label { font-weight: 600; color: #3d5a4c; }
.exit-pin { background: transparent; border: 0; }
.exit-pin span { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 5px; background: var(--side); color: #fff;
  font-family: var(--font); font-size: 12px; font-weight: 700; box-shadow: 0 1px 4px rgba(0, 0, 0, .45); border: 2px solid #fff; line-height: 1; }
.exit-emergency span { background: #7a1f1f; } .exit-fast span { background: #3b2f8f; } .exit-parking span { background: #5b3a00; }
.leaflet-tooltip.exit-label { font-family: var(--font); font-size: 12.5px; direction: rtl; }
.leaflet-control-layers { font-family: var(--font); direction: rtl; text-align: right; }
.perm-table td, .perm-table th { text-align: center; }
.perm-table td:first-child, .perm-table th:first-child { text-align: start; }
.perm-check { justify-content: center; }
.perm-check input { width: 18px; height: 18px; }

/* ROSN: ticket centre, department forms, field status report */
.nav-count { margin-inline-start: auto; background: #d03b3b; color: #fff; border-radius: 99px; font-size: 12px;
  font-weight: 700; padding: 1px 7px; min-width: 20px; text-align: center; }
.pre { white-space: pre-line; }
.derived { color: var(--accent-ink); }
.with-unit { display: flex; gap: 8px; align-items: center; }
.with-unit input { flex: 1; }
.plate { text-transform: uppercase; letter-spacing: .04em; }
.form-wide { max-width: 1040px; }
.row-flag td { background: var(--critical-soft); }
.tk-history .tl-item { padding: 10px 14px; }

.form-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.form-card { display: flex; flex-direction: column; gap: 10px; }
.fc-head { display: flex; gap: 10px; align-items: flex-start; }
.fc-icon { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-ink); }
.fc-icon svg.i { width: 20px; height: 20px; }
.fc-title { font-weight: 700; font-size: 16px; }
.fc-meta { font-size: 13px; }
.fc-purpose { color: var(--ink-2); font-size: 14px; flex: 1; }
.fc-source { font-size: 13px; color: var(--accent-ink); display: flex; gap: 6px; align-items: center; }
.fc-source svg.i { width: 14px; height: 14px; }
.fc-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap;
  border-top: 1px solid var(--line); padding-top: 10px; }
.fc-actions { display: flex; gap: 6px; }

.checklist-form, .rows-form { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 0 0 16px; }
.checklist-form legend, .rows-form legend { font-weight: 700; padding: 0 6px; }
.ck-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ck-section { font-weight: 700; color: var(--accent-ink); margin-top: 10px; font-size: 14.5px; }
.ck-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center;
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.ck-row.ck-no { border-color: color-mix(in srgb, var(--critical) 50%, var(--line)); background: var(--critical-soft); }
.ck-item { font-size: 14.5px; }
.ck-n { display: inline-block; min-width: 22px; margin-left: 8px; text-align: right; color: var(--muted); font-weight: 600; }
.ck-answers { display: flex; gap: 6px; }
.ck-answers .choice { padding: 5px 9px; font-size: 13.5px; }
.ck-answers .ck-ok:has(input:checked) { border-color: var(--good); background: var(--good-soft); }
.ck-answers .ck-no:has(input:checked) { border-color: var(--critical); background: var(--critical-soft); }
.ck-extra { grid-column: 1 / -1; display: none; gap: 8px; align-items: center; flex-wrap: wrap; }
.ck-row.ck-no .ck-extra { display: flex; }
.ck-extra select { width: auto; }
.ck-extra input { flex: 1; min-width: 180px; }
.ck-team { font-size: 13px; }
.rows-table input, .rows-table select { min-width: 120px; }

.site-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.site-item { --lvl: var(--muted); box-shadow: var(--shadow), inset -4px 0 0 var(--lvl); display: flex; flex-direction: column; gap: 10px; }
.lvl-low { --lvl: #1f6b4a; } .lvl-mid { --lvl: #b08a00; } .lvl-high { --lvl: #c75a05; } .lvl-crit { --lvl: #b3261e; }
.si-head { display: flex; gap: 10px; align-items: flex-start; }
.si-head .pill { margin-inline-start: auto; }
.si-n { font-weight: 700; color: var(--lvl); font-size: 18px; }
.si-title { font-weight: 700; }
.si-level { font-size: 13px; color: var(--lvl); font-weight: 600; }
.si-kv { font-size: 14px; }
.site-item .meter-fill.good { background: var(--good); }
.lvl-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--lvl); }
.site-map-card { min-height: 380px; display: flex; flex-direction: column; }
.site-map-card .card-help { padding: 8px 14px 12px; margin: 0; }
.eng-map.site-map { height: 380px; flex: 1; }
.site-form input, .site-form select { min-width: 90px; }
.area-label { background: transparent; border: 0; box-shadow: none; font-weight: 700; }
.tk-pin span { display: block; width: 14px; height: 14px; transform: rotate(45deg); border-radius: 3px 3px 3px 0;
  border: 2px solid #fff; background: var(--accent); box-shadow: 0 1px 3px rgba(0,0,0,.35); }
.tk-pin.esc-1 span { background: var(--warning); } .tk-pin.esc-2 span { background: var(--critical); }
.legend-tk { display: inline-block; width: 14px; height: 14px; }
.map-facts { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13.5px; color: var(--ink-2); }
@media (max-width: 900px) {
  .ck-row { grid-template-columns: minmax(0, 1fr); }
  .form-cards, .site-items { grid-template-columns: minmax(0, 1fr); }
}

/* ============================================================= quick field report (بلاغ ميداني سريع) */
.qk { display: flex; flex-direction: column; gap: 14px; max-width: 760px; }
.qk-step { display: flex; flex-direction: column; gap: 12px; }
.qk-h { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 17px; }
.qk-n { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff;
  font-size: 14px; font-weight: 700; }
.qk-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.qk-type { position: relative; display: flex; align-items: center; gap: 10px; padding: 13px 14px; border: 1.5px solid var(--line);
  border-radius: 12px; cursor: pointer; font-weight: 600; background: var(--surface); --qc: #475569; }
.qk-type input { position: absolute; opacity: 0; pointer-events: none; }
.qk-type small { margin-inline-start: auto; color: var(--muted); font-weight: 500; font-size: 12.5px; }
.qk-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--qc); flex: none; }
.qk-type:has(input:checked) { border-color: var(--qc); box-shadow: inset 0 0 0 1px var(--qc); background: var(--surface-2); }
.qk-type:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.qk-type.t-violation { --qc: #dc2626; } .qk-type.t-hazard { --qc: #ea580c; } .qk-type.t-damage { --qc: #7c3aed; }
.qk-type.t-cleanliness { --qc: #0891b2; } .qk-type.t-congestion { --qc: #2563eb; } .qk-type.t-other { --qc: #475569; }
.qk-titles { display: flex; flex-wrap: wrap; gap: 6px; }
.qk-titles[hidden] { display: none; }
.qk-chip { font: inherit; font-size: 13.5px; padding: 6px 11px; border-radius: 99px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); cursor: pointer; }
.qk-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.qk-sev { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.qk-sev-b { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px;
  border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; --sc: var(--muted); }
.qk-sev-b input { position: absolute; opacity: 0; pointer-events: none; }
.qk-sev-b b { font-size: 15px; } .qk-sev-b small { color: var(--muted); font-size: 12px; }
.qk-sev-b.sev-1 { --sc: #dc2626; } .qk-sev-b.sev-2 { --sc: #ea580c; } .qk-sev-b.sev-3 { --sc: #ca8a04; } .qk-sev-b.sev-4 { --sc: #16a34a; }
.qk-sev-b:has(input:checked) { border-color: var(--sc); background: var(--sc); color: #fff; }
.qk-sev-b:has(input:checked) small { color: rgba(255,255,255,.85); }
.qk-sev-b:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.qk-where { font-weight: 600; padding: 9px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.qk-where.ok { background: var(--good-soft); color: var(--good-ink); border-color: transparent; }
.qk-where.warn { background: var(--warning-soft); color: var(--warning-ink); border-color: transparent; }
.qk-map { height: 240px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.qk-pin { background: transparent; border: 0; }
.qk-pin::before { content: ""; position: absolute; left: 3px; top: 0; width: 18px; height: 18px; border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg); background: #dc2626; border: 2.5px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.45); }
.qk-send { align-self: stretch; justify-content: center; padding: 14px; font-size: 16.5px; }
.qk-done { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; border-color: var(--good-ink); }
.qk-done-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--good-soft); color: var(--good-ink); }
.qk-done-title { font-size: 17px; font-weight: 700; }
.qk-done .btn { margin-inline-start: auto; }
@media (max-width: 700px) {
  .qk-types { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .qk-type small { display: none; }
  .qk-sev { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

details.people > summary { cursor: pointer; list-style: none; }
details.people > summary::-webkit-details-marker { display: none; }
details.people > summary::after { content: "▾"; color: var(--muted); }
details.people[open] > summary::after { content: "▴"; }

/* ============================================================= ticket map (خريطة البلاغات) */
.cm-filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; margin-bottom: 14px; }
.cm-late { display: flex; align-items: center; gap: 6px; font-weight: 600; padding-bottom: 8px; }
.cm { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; }
.cm-map { height: clamp(460px, 68vh, 760px); padding: 0; overflow: hidden; }
.cm-side { display: flex; flex-direction: column; gap: 10px; max-height: clamp(460px, 68vh, 760px); }
.cm-counts { display: flex; flex-wrap: wrap; gap: 6px; }
.cm-count { font-size: 13px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 2px 8px; }
.cm-count.late b { color: var(--critical-ink); }
.cm-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--ink-2); }
.cm-lg { display: inline-flex; align-items: center; gap: 5px; }
.cm-lg i { width: 11px; height: 11px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line-strong); }
.cm-lg.st-1 i { background: #0ea5e9; } .cm-lg.st-2 i { background: #f59e0b; } .cm-lg.st-3 i { background: #f97316; } .cm-lg.st-4 i { background: #64748b; }
.cm-lg.late i { background: transparent; border-color: #dc2626; border-width: 3px; box-shadow: none; }
.cm-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.cm-item { display: flex; gap: 9px; align-items: flex-start; padding: 7px 6px; border-radius: 8px; cursor: pointer; }
.cm-item:hover, .cm-item:focus-visible { background: var(--surface-2); outline: none; }
.cm-item.late { box-shadow: inset 3px 0 0 #dc2626; }
.cm-item-tx { display: flex; flex-direction: column; min-width: 0; }
.cm-item-tx b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-item-tx span { font-size: 12.5px; }
.cm-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex: none; background: #64748b; }
.cm-dot[data-st="جديد"] { background: #0ea5e9; } .cm-dot[data-st="مُسند"] { background: #f59e0b; }
.cm-dot[data-st="قيد التنفيذ"] { background: #f97316; }
.cm-pop { display: flex; flex-direction: column; gap: 2px; min-width: 200px; font-family: var(--font); direction: rtl; }
.cm-pop-ref { font-weight: 700; } .cm-pop-title { font-weight: 600; } .cm-pop-meta { color: #555; font-size: 12.5px; }
.cm-pop-late { color: #b02a2a; font-weight: 700; font-size: 12.5px; }
.cm-updated { font-size: 12px; }
@media (max-width: 1000px) { .cm { grid-template-columns: minmax(0, 1fr); } .cm-side { max-height: none; } .cm-list { max-height: 360px; } }

/* ============================================================= live yard (الساحة الحية) */
.live { display: flex; flex-direction: column; gap: 16px; }
.lv-stage { position: relative; border-radius: 16px; overflow: hidden; background: #0b1220;
  box-shadow: 0 1px 2px rgba(0,0,0,.2), 0 12px 32px rgba(8, 18, 36, .22); }
.lv-stage:fullscreen { border-radius: 0; display: grid; align-content: center; }
.lv-loading { position: absolute; inset: 0; display: grid; place-items: center; color: #dfe7f2; font-weight: 600;
  background: linear-gradient(180deg, #0d1a33, #1d2c4a); }
.lv-loading[hidden] { display: none; }

.lv-clock { position: absolute; top: 12px; left: 12px; width: 228px; padding: 9px 12px 10px; border-radius: 14px; color: #eef3fa;
  background: rgba(10, 18, 34, .58); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.14); display: flex; flex-direction: column; gap: 5px; }
.lv-clock-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.lv-time { font-size: 32px; font-weight: 700; line-height: 1; letter-spacing: .02em; }
.lv-phase { font-size: 15px; font-weight: 600; color: #ffd38a; }
.lv-sun { display: flex; justify-content: space-between; font-size: 13px; color: #c7d3e3; }
.lv-sun b { color: #fff; font-weight: 600; }
.lv-modes { display: flex; gap: 6px; margin-top: 2px; }
.lv-modes button { flex: 1; font: inherit; font-size: 13px; font-weight: 600; color: #dfe7f2; background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18); border-radius: 8px; padding: 5px 6px; cursor: pointer; }
.lv-modes button.on { background: #ffb000; color: #1b1300; border-color: #ffb000; }
.lv-modes [data-lv-play] { flex: 0 0 40px; }
.lv-slider { width: 100%; accent-color: #ffb000; }
.lv-scale { font-size: 12px; color: #9fb0c6; }

.lv-led { position: absolute; top: 12px; right: 12px; min-width: 200px; padding: 8px 12px; border-radius: 10px;
  background: #0a0b0c; border: 2px solid #2b2e31; box-shadow: inset 0 0 0 1px #000, 0 6px 18px rgba(0,0,0,.35);
  background-image: radial-gradient(rgba(255,176,0,.07) 1px, transparent 1.2px); background-size: 4px 4px;
  display: grid; gap: 4px; }
.lv-led-row { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; color: #b98000; font-size: 13.5px; font-weight: 600; }
.lv-led-row b { color: #ffb000; font-size: 19px; text-shadow: 0 0 8px rgba(255,176,0,.75); letter-spacing: .04em; }

.lv-tip { position: absolute; z-index: 5; max-width: 300px; padding: 8px 11px; border-radius: 10px; pointer-events: none;
  background: rgba(10, 16, 28, .9); color: #eef3fa; font-size: 13.5px; display: flex; flex-direction: column; gap: 2px;
  box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.lv-tip[hidden] { display: none; }
.lv-tip b { font-size: 14.5px; }
.lv-tip span { color: #c4d1e2; }

.lv-under { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.lv-signs { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 12px; }
/* road guide signs: Saudi green / blue / navy panels with a white inner border and a reflector dot */
.rs { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px 12px; border-radius: 10px; color: #fff;
  text-decoration: none; box-shadow: inset 0 0 0 3px var(--rs-bg), inset 0 0 0 5px #fff, 0 3px 10px rgba(0,0,0,.18);
  background: var(--rs-bg); min-height: 106px; transition: transform .15s; }
.rs:hover { text-decoration: none; transform: translateY(-2px); }
.rs-green { --rs-bg: #0d6b3c; } .rs-blue { --rs-bg: #1d4f9c; } .rs-navy { --rs-bg: #10223f; }
.rs-title { font-size: 14px; font-weight: 600; opacity: .95; padding-inline-end: 18px; }
.rs-value { display: flex; align-items: baseline; gap: 6px; margin-top: auto; }
.rs-value b { font-size: 30px; font-weight: 700; line-height: 1.1; }
.rs-value i { font-style: normal; font-size: 13px; opacity: .85; }
.rs-small { font-size: 12px; opacity: .8; min-height: 1em; }
.rs-dot { position: absolute; top: 12px; left: 12px; width: 13px; height: 13px; border-radius: 50%; border: 2px solid #fff;
  background: #8a94a0; box-shadow: 0 0 0 2px rgba(0,0,0,.15); }
.rs-dot.good { background: #22c55e; box-shadow: 0 0 8px #22c55e; }
.rs-dot.warning { background: #fab219; box-shadow: 0 0 8px #fab219; }
.rs-dot.critical { background: #ef4444; box-shadow: 0 0 10px #ef4444; animation: rs-blink 1.4s infinite; }
@keyframes rs-blink { 50% { opacity: .35; } }

/* split-flap board for tickets */
.lv-board { background: #111316; color: #e9edf1; border-radius: 14px; padding: 12px 12px 14px; box-shadow: 0 6px 18px rgba(0,0,0,.2); }
.lv-board-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 16px; padding: 0 4px 8px; }
.lv-board-head a { color: #ffb000; font-size: 13px; font-weight: 600; }
.lv-board-sum { display: flex; gap: 8px; padding: 0 4px 10px; flex-wrap: wrap; }
.lv-sum { font-size: 13px; color: #b9c2cc; background: #1c2025; border-radius: 8px; padding: 3px 9px; }
.lv-sum b { color: #fff; font-size: 15px; }
.lv-sum.late b { color: #fab219; } .lv-sum.esc b { color: #ff6b6b; }
.lv-flaps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; perspective: 600px; }
.flap { background: linear-gradient(180deg, #1d2126 0 49%, #15181c 51%); border-radius: 7px; transform-origin: top;
  animation: flap-in .45s cubic-bezier(.3,.7,.3,1) both; box-shadow: inset 0 -1px 0 #000; }
.flap a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "ref title st" "ref meta st";
  gap: 0 10px; padding: 7px 10px; color: inherit; align-items: center; }
.flap a:hover { text-decoration: none; background: rgba(255,255,255,.04); }
.flap-ref { grid-area: ref; font-weight: 700; color: #ffd166; background: #0b0c0e; border-radius: 4px; padding: 3px 6px; font-size: 13px; }
.flap-title { grid-area: title; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flap-meta { grid-area: meta; font-size: 12px; color: #98a3ae; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flap-st { grid-area: st; font-size: 12px; font-weight: 700; border-radius: 6px; padding: 2px 7px; background: #2a3038; color: #cbd5df; }
.flap.esc-1 .flap-st { background: #4a3a10; color: #ffcf5a; }
.flap.esc-2 .flap-st { background: #4d1717; color: #ff8a8a; }
.flap.empty { color: #98a3ae; padding: 12px; text-align: center; }
@keyframes flap-in { from { transform: rotateX(-88deg); opacity: .2; } to { transform: rotateX(0); opacity: 1; } }
.lv-note { color: var(--muted); font-size: 13px; margin: 0; }

/* events feed (آخر الأحداث) */
.lv-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.lv-feed { background: #111316; color: #e9edf1; border-radius: 14px; padding: 12px 12px 14px; box-shadow: 0 6px 18px rgba(0,0,0,.2); }
.lv-live { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: #8fd18f; }
.lv-live i { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 8px #22c55e; animation: rs-blink 1.6s infinite; }
.lv-feed-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; max-height: 430px; overflow-y: auto; }
.lv-feed-empty { color: #98a3ae; padding: 10px; text-align: center; }
.lv-ev a { display: flex; flex-direction: column; gap: 1px; padding: 7px 10px; border-radius: 8px; color: inherit; background: #181b20;
  border-inline-start: 3px solid #3a4049; }
.lv-ev a:hover { text-decoration: none; background: #1f2329; }
.lv-ev.ev-create a { border-color: #0ea5e9; } .lv-ev.ev-assign a { border-color: #f59e0b; } .lv-ev.ev-status a { border-color: #f97316; }
.lv-ev.ev-close a { border-color: #22c55e; } .lv-ev.ev-transfer a { border-color: #a78bfa; } .lv-ev.ev-reopen a { border-color: #ef4444; }
.lv-ev-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.lv-ev-top .num { color: #ffd166; font-weight: 700; }
.lv-ev-title { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-ev-meta { font-size: 12px; color: #98a3ae; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-ev.is-new a { animation: ev-new 3s ease-out; }
@keyframes ev-new { from { background: #23452d; } }
@media (prefers-reduced-motion: reduce) { .lv-ev.is-new a, .lv-live i { animation: none; } }

/* operations-room screen (شاشة العرض): the whole page fullscreen — map, tickets board and feed side by side */
.live.lv-wall { background: #0b1220; padding: 12px; display: grid; grid-template-columns: minmax(0, 1fr) 410px; gap: 12px;
  height: 100vh; overflow: hidden; }
.live.lv-wall .lv-stage { border-radius: 12px; }
.live.lv-wall .lv-map { height: calc(100vh - 24px); }
.live.lv-wall .lv-under { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow: hidden; }
.live.lv-wall .lv-signs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.live.lv-wall .rs { min-height: 84px; padding: 9px 11px; } .live.lv-wall .rs-value b { font-size: 24px; } .live.lv-wall .rs-small { display: none; }
.live.lv-wall .lv-signs .rs:nth-child(n+5) { display: none; }
.live.lv-wall .lv-col { flex: 1; min-height: 0; gap: 12px; display: grid; grid-template-rows: auto minmax(0, 1fr); }
.live.lv-wall .lv-flaps .flap:nth-child(n+4) { display: none; }
.live.lv-wall .lv-feed { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.live.lv-wall .lv-feed-list { max-height: none; flex: 1; }
.live.lv-wall .lv-note { display: none; }

/* the real-site twin: satellite map in 3D */
.lv-map { width: 100%; height: clamp(540px, 74vh, 860px); background: #2f2e2a; }
.lv-stage:fullscreen .lv-map { height: 100vh; }
.lv-twin .maplibregl-ctrl-group { background: rgba(10, 18, 34, .7); }
.lv-twin .maplibregl-ctrl-group button + button { border-top-color: rgba(255,255,255,.15); }
.lv-twin .maplibregl-ctrl-icon { filter: invert(1); }
.lv-twin .maplibregl-ctrl-attrib { font-size: 11px; }
.lv-views { position: absolute; bottom: 30px; right: 12px; display: flex; gap: 4px; padding: 4px; border-radius: 12px;
  background: rgba(10, 18, 34, .62); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.14); }
.lv-views button { font: inherit; font-size: 13px; font-weight: 600; color: #dfe7f2; background: transparent; border: 0;
  border-radius: 8px; padding: 6px 11px; cursor: pointer; }
.lv-views button:hover { background: rgba(255,255,255,.1); }
.lv-views button.on { background: #ffb000; color: #1b1300; }

.tw-zone { display: flex; flex-direction: column; gap: 3px; pointer-events: none; --zc: #555; }
.tw-zone.z4A { --zc: #c97f0c; } .tw-zone.z4B { --zc: #cf5f12; } .tw-zone.z4C { --zc: #c23529; }
.tw-zone.z9A { --zc: #1f68ab; } .tw-zone.z9B { --zc: #137f73; } .tw-zone.z9C { --zc: #1f8a49; }
.tw-zone-row { display: flex; align-items: center; gap: 4px; padding: 2px; border-radius: 8px; background: rgba(10, 16, 28, .8);
  box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.tw-zone-name { direction: ltr; font-weight: 700; font-size: 13.5px; color: #fff; padding: 1px 8px; border-radius: 6px; background: var(--zc); }
.tw-zone-occ { direction: ltr; font-size: 12.5px; font-weight: 700; color: #fff; padding: 0 3px; font-variant-numeric: tabular-nums; }
.tw-zone-st { font-size: 11.5px; font-weight: 600; padding: 1px 6px; border-radius: 5px; }
.tw-zone-st.on { background: #15803d; color: #fff; } .tw-zone-st.off { background: #3a4049; color: #c9d1da; }
.tw-zone-tk { pointer-events: auto; display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  font-size: 12px; font-weight: 700; color: #fff; text-decoration: none; background: #1d4f9c; }
.tw-zone-tk[hidden] { display: none; }
.tw-zone-tk:hover { text-decoration: none; }
.tw-badge { display: inline-grid; margin-inline-start: 5px; vertical-align: middle; height: 18px; min-width: 18px; font-size: 11.5px; }
.tw-exit .tw-badge { margin: 0 4px; }
.tw-exit .tw-badge, .tw-area .tw-badge { box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.tw-zone-tk.esc-1 { background: #c98a00; } .tw-zone-tk.esc-2 { background: #c62828; }
.tw-mini .tw-zone-occ, .tw-mini .tw-zone-st, .tw-mini .tw-zone-bar { display: none; }
.tw-hide { visibility: hidden; }
.tw-zone-bar { height: 4px; border-radius: 2px; background: rgba(10, 16, 28, .65); overflow: hidden; direction: ltr; }
.tw-zone-bar i { display: block; height: 100%; width: 0; background: #22c55e; transition: width .4s; }
.tw-zone-bar i.warn { background: #fab219; } .tw-zone-bar i.crit { background: #ef4444; }

.tw-exit { position: relative; width: 18px; height: 22px; pointer-events: none; }
.tw-pin { position: absolute; left: 1px; top: 0; width: 16px; height: 16px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: var(--pc); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.45); }
.tw-exit-label { position: absolute; top: -1px; right: 21px; display: flex; align-items: center; }
.tw-exit.east .tw-exit-label { right: auto; left: 21px; }
.tw-exit.green { --pc: #16a34a; } .tw-exit.red { --pc: #dc2626; } .tw-exit.purple { --pc: #7c3aed; }
.tw-exit-text { font-size: 12px; font-weight: 600; color: #fff; background: rgba(10, 16, 28, .8); padding: 1px 7px; border-radius: 6px; white-space: nowrap; }

.tw-led { min-width: 170px; max-width: 240px; padding: 5px 9px 6px; border-radius: 8px; background: #08090a; border: 2px solid #33373b;
  background-image: radial-gradient(rgba(255,176,0,.08) 1px, transparent 1.2px); background-size: 3px 3px; pointer-events: none;
  box-shadow: 0 4px 12px rgba(0,0,0,.5); text-align: center; }
.tw-led-title { font-size: 11px; color: #8fd18f; font-weight: 600; }
.tw-led-text { font-size: 13.5px; color: #ffb000; font-weight: 700; text-shadow: 0 0 7px rgba(255,176,0,.75); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.tw-area { font-size: 12px; font-weight: 600; color: #d8fbe8; background: rgba(8, 40, 28, .72); padding: 2px 8px; border-radius: 6px;
  pointer-events: none; white-space: nowrap; }
.tw-beacon { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: #fff; text-decoration: none;
  background: #1d4f9c; border: 2px solid #fff; box-shadow: 0 0 0 0 rgba(29, 79, 156, .6); animation: tw-ping 2s infinite; }
.tw-beacon:hover { text-decoration: none; }
.tw-beacon b { font-size: 13px; }
.tw-beacon.esc-1 { background: #c98a00; box-shadow: 0 0 0 0 rgba(201, 138, 0, .6); }
.tw-beacon.esc-2 { background: #c62828; box-shadow: 0 0 0 0 rgba(198, 40, 40, .6); }
@keyframes tw-ping { 70% { box-shadow: 0 0 0 12px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .tw-beacon { animation: none; } }
@media (max-width: 700px) {
  .lv-map { height: 520px; }
  .lv-twin { position: relative; }
  .lv-twin .lv-clock { order: -3; } .lv-twin .lv-led { order: -2; grid-template-columns: 1fr 1fr; column-gap: 18px; }
  .lv-twin .lv-led-row b { font-size: 17px; }
  .lv-twin .maplibregl-ctrl-bottom-left { display: none; }
  .lv-views { order: -1; position: static; border-radius: 0; justify-content: space-between; background: #0d1a33; border: 0; }
  .tw-exit-text, .tw-zone-st { display: none; }
  .tw-zone-name { font-size: 12px; padding: 0 6px; } .tw-zone-occ { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) { .flap, .rs-dot.critical { animation: none; } }
@media (max-width: 1100px) { .lv-under { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) {
  .lv-clock { position: static; width: auto; border-radius: 0; background: #0d1a33; }
  .lv-led { position: static; border-radius: 0; }
  .lv-stage { display: flex; flex-direction: column; }
  .lv-time { font-size: 30px; }
}

/* responsive */
@media (max-width: 1100px) {
  .grid2, .upload-grid, .hero-row { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .side { width: 100%; height: auto; position: static; }
  .brand { padding: 14px 16px; }
  .nav { flex-direction: row; overflow-x: auto; padding: 6px 10px 10px; gap: 4px; }
  .nav-label { display: none; }
  .nav a { white-space: nowrap; padding: 7px 10px; }
  .nav a.on { box-shadow: inset 0 -2px 0 var(--nav-on); }
  .side-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; margin: 0; }
  .side-actions { margin: 0; }
  .top { position: static; padding: 14px 16px; }
  .content { padding: 18px 16px 32px; }
  .stats { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .stat { padding: 13px 14px; }
  .stat-value { font-size: 23px; }
  .gauges, .team-cards, .kpi-grid { grid-template-columns: minmax(0, 1fr); }
  .volumes { gap: 10px; }
  .vol { padding: 12px 14px; }
  .vol-value { font-size: 22px; }
  .vol .spark { width: 100%; }
  .hero-main { flex-direction: column; align-items: flex-start; }
  .eng-map { height: 460px; }
  .choice-row { grid-template-columns: minmax(0, 1fr); }
  .bar-row { grid-template-columns: minmax(0, 1fr) auto; }
  .bar-row .bar-track { grid-column: 1 / -1; grid-row: 2; }
  .help::after { width: 200px; }
}
@media print {
  .side, .top-tools, .tabs, .foot { display: none; }
  .tab-panel[hidden] { display: block !important; }
  body { background: #fff; }
}

/* ============================================================= install on the phone (PWA) */
.pwa { position: fixed; z-index: 70; left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); max-width: 520px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 10px; border-radius: 16px; color: #eaf3ff;
  background: rgba(8, 20, 38, .94); border: 1px solid rgba(127, 200, 255, .22); box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.pwa[hidden] { display: none; }
.pwa-icon { width: 46px; height: 46px; border-radius: 11px; flex: none; }
.pwa-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.5; }
.pwa-text b { font-size: 15px; }
.pwa-text span { color: #b9c9de; }
.pwa-go { font: inherit; font-weight: 700; font-size: 14.5px; color: #032420; background: #36d1c4; border: 0; border-radius: 10px;
  padding: 9px 16px; cursor: pointer; flex: none; }
.pwa-go[hidden] { display: none; }
.pwa-x { font: inherit; font-size: 22px; line-height: 1; color: #9fb2cc; background: none; border: 0; padding: 4px 6px; cursor: pointer; flex: none; }
.pwa-share { display: inline-block; width: 16px; height: 18px; vertical-align: -3px; margin: 0 2px;
  border: 2px solid #7fe6dc; border-top: 0; border-radius: 0 0 3px 3px; position: relative; }
.pwa-share::before { content: ""; position: absolute; left: 50%; top: -9px; width: 2px; height: 13px; margin-left: -1px; background: #7fe6dc; }
.pwa-share::after { content: ""; position: absolute; left: 50%; top: -9px; width: 7px; height: 7px; margin-left: -4.5px;
  border-left: 2px solid #7fe6dc; border-top: 2px solid #7fe6dc; transform: rotate(45deg); }
@media (max-width: 700px) {
  :root:not([data-design="classic"]) .pwa { bottom: calc(80px + env(safe-area-inset-bottom)); }
}
/* on the sign-in page the offer sits at the top, never over the form */
:root body.is-login .pwa { top: calc(12px + env(safe-area-inset-top)); bottom: auto !important; }
.side-actions [data-install-open][hidden] { display: none; }

.offline-page { min-height: 100vh; display: grid; place-items: center; background: #06101f; color: #eaf3ff; padding: 20px; }
.offline-box { max-width: 420px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.offline-box img { border-radius: 22px; }
.offline-box h1 { font-size: 22px; }
.offline-box p { color: #b9c9de; margin: 0 0 6px; }
