@import url("fonts/ibm-plex-sans-arabic/400.css");
@import url("fonts/ibm-plex-sans-arabic/500.css");
@import url("fonts/ibm-plex-sans-arabic/600.css");
@import url("fonts/ibm-plex-sans-arabic/700.css");
@import url("fonts/ibm-plex-mono/500.css");
@import url("fonts/ibm-plex-mono/600.css");

@import url("fonts/readex-pro/index.css");

/* SHA7N — one design, two themes (نهاري / ليلي). Theme is set on <html data-theme> by common.js. */
:root {
  --bg: #f4f8f8; --surface: #ffffff; --sunken: #f3f7f8; --soft: #e3f2f0; --ink: #10313a; --muted: #5f7b83; --line: #e1eaec;
  --accent: #0f4c5c; --accent-ink: #ffffff; --brand: #0f4c5c; --brand-ink: #ffffff;
  --kraft: #b8782f; --kraft-soft: #f8ecdb; --kraft-fill: #e2a85e;
  --ok: #1f8a57; --ok-soft: #e2f4ea; --warn: #a15c00; --warn-soft: #fdf0dc; --bad: #c0392b; --bad-soft: #fbe7e4; --info-soft: #e3eff3;
  --nav: #ffffff; --nav-ink: #5f7b83; --nav-on: #e3f2f0; --nav-on-ink: #10313a;
  --hero: linear-gradient(135deg, #0f4c5c, #165d6e); --hero-ink: #ffffff; --hero-num: #f3c98d;
  --scrim: rgba(8,24,30,.45);
  --focus: #2a8fa8; --shadow: 0 1px 2px rgba(16,49,58,.04), 0 8px 24px rgba(16,49,58,.06);
  --font-ui: "Readex Pro", "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --font-num: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --r: 16px; --r-sm: 12px; color-scheme: light;
}
html[data-theme="dark"] {
  --bg: #072830; --surface: #0c3a46; --sunken: #0a3240; --soft: #0f4553; --ink: #e6f0f2; --muted: #8fb3bc; --line: #1a5664;
  --accent: #e2a85e; --accent-ink: #1d1408; --brand: #0b3540; --brand-ink: #e6f0f2;
  --kraft: #e9b673; --kraft-soft: #2a3a2e; --kraft-fill: #e2a85e;
  --ok: #43d17a; --ok-soft: #0f3d33; --warn: #f0b45c; --warn-soft: #3a3320; --bad: #ff7a6b; --bad-soft: #43262a; --info-soft: #0f4553;
  --nav: #06232a; --nav-ink: #8fb3bc; --nav-on: #0f4553; --nav-on-ink: #e6f0f2;
  --hero: linear-gradient(135deg, #145565, #0c3a46); --hero-ink: #e6f0f2; --hero-num: #e2a85e;
  --scrim: rgba(0,0,0,.6);
  --focus: #e2a85e; --shadow: 0 1px 2px rgba(0,0,0,.2), 0 10px 28px rgba(0,0,0,.25);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body { direction: rtl; background: var(--bg); color: var(--ink); font-family: var(--font-ui); font-size: 15px; line-height: 1.6; transition: background-color .2s, color .2s; }
a { color: var(--accent); }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
h1, h2, h3 { text-wrap: balance; margin: 0; font-weight: 600; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--nav); color: var(--nav-ink); border-inline-start: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; padding: 22px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 22px; }
.side .brand img { width: 40px; height: 40px; border-radius: 10px; }
.side .brand b { display: block; font-size: 1.2rem; letter-spacing: .06em; color: var(--ink); direction: ltr; text-align: right; }
.side .brand small { color: var(--muted); font-size: .76rem; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { color: var(--nav-ink); text-decoration: none; padding: 10px 12px; border-radius: 12px; font-weight: 500; display: flex; align-items: center; gap: 12px; }
.side nav a svg { width: 20px; height: 20px; flex: none; }
.side nav a:hover { background: var(--sunken); color: var(--ink); }
.side nav a[aria-current="page"] { background: var(--nav-on); color: var(--nav-on-ink); font-weight: 600; }
.side nav a[aria-current="page"] svg { color: var(--accent); }
.side nav a .badge { margin-inline-start: auto; background: var(--bad); color: #fff; border-radius: 999px; font-size: .72rem; padding: 0 7px; }
.side .who { margin-top: auto; border-top: 1px solid var(--line); padding: 14px 8px 0; font-size: .85rem; display: flex; flex-direction: column; gap: 8px; }
.side .who b { color: var(--ink); display: block; }
.side .who button { width: 100%; }
.main { min-width: 0; padding: 26px max(16px, 2.6vw) 44px; display: flex; flex-direction: column; gap: 18px; }
.topbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.topbar h1 { font-size: 1.55rem; }
.btn.menu-btn { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; right: 0; width: 270px; z-index: 40; transform: translateX(100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: -10px 0 30px rgba(0,0,0,.25); }
  .btn.menu-btn { display: inline-flex; }
}

/* theme switch (نهاري / ليلي) */
.theme-switch { display: inline-flex; background: var(--sunken); border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; font-size: .82rem; }
.theme-switch button { border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 500; padding: 6px 12px; border-radius: 999px; cursor: pointer; flex: 1; }
.theme-switch button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.side .theme-switch { display: flex; }

/* ---------- surfaces ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px 22px; min-width: 0; }
.panel-title { margin: 0 0 14px; font-size: 1rem; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .cols-3, .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; } }

.stat { display: flex; flex-direction: column; gap: 2px; }
.stat small { color: var(--muted); font-weight: 400; font-size: .88rem; }
.stat b { font-family: var(--font-ui); font-variant-numeric: tabular-nums; font-weight: 600; font-size: 2.3rem; line-height: 1.15; color: var(--ink); }
.stat span { color: var(--muted); font-size: .8rem; }
.stat.kraft b { color: var(--kraft); }
.stat.hero { background: var(--hero); color: var(--hero-ink); border: 0; }
.stat.hero small, .stat.hero span { color: color-mix(in srgb, var(--hero-ink) 72%, transparent); }
.stat.hero b { color: var(--hero-num); font-size: 2.8rem; }
.trend { font-size: .8rem; color: var(--ok); }
.trend.down { color: var(--bad); }

/* ---------- forms ---------- */
label.f { display: flex; flex-direction: column; gap: 7px; min-width: 0; font-size: .9rem; font-weight: 500; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 10px 14px; min-width: 0; width: 100%; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent); outline: none; }
textarea { min-height: 110px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
input.ltr { direction: ltr; text-align: right; font-family: var(--font-num); }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .9rem; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.hint { color: var(--muted); font-size: .8rem; font-weight: 400; }
.err { color: var(--bad); font-weight: 600; min-height: 1.2em; font-size: .9rem; }

.btn { font: inherit; font-weight: 600; border-radius: var(--r-sm); padding: 10px 18px; cursor: pointer; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; text-decoration: none; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.kraft { background: var(--kraft-fill); border-color: var(--kraft-fill); color: #1d1408; }
.btn.danger { color: var(--bad); }
.btn.ok { color: var(--ok); }
.btn.sm { padding: 5px 10px; font-size: .85rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn svg { width: 17px; height: 17px; flex: none; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions .spacer { flex: 1; }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-sm); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 14px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: var(--sunken); font-size: .8rem; color: var(--muted); font-weight: 500; }
tbody tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--sunken); }
tr.open td { background: var(--kraft-soft); }
td.sub { padding: 0; background: var(--sunken); }
td.sub table { background: var(--surface); }
.empty { padding: 30px 16px; text-align: center; color: var(--muted); white-space: normal; }
.empty strong { display: block; color: var(--ink); font-size: 1.02rem; margin-bottom: 4px; }

/* ---------- chips / pills ---------- */
.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--sunken); border: 1px solid var(--line); }
.chip.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.chip.info { background: var(--info-soft); color: var(--accent); border-color: transparent; }
.chip.kraft { background: var(--kraft-soft); color: var(--kraft); border-color: transparent; }
.pbadge { font-family: var(--font-num); padding: 1px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--sunken); }
.pbadge.multi { background: var(--kraft-soft); border-color: var(--kraft); color: var(--kraft); }

.banner { border-radius: var(--r-sm); padding: 12px 16px; font-weight: 600; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.banner.ok { background: var(--ok-soft); color: var(--ok); }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.bad { background: var(--bad-soft); color: var(--bad); }
.banner.info { background: var(--info-soft); color: var(--accent); }

/* ---------- modal / toast ---------- */
.scrim { position: fixed; inset: 0; background: var(--scrim); backdrop-filter: blur(2px); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; max-width: 520px; width: 100%; padding: 20px; box-shadow: 0 20px 50px rgba(0,0,0,.3);
  display: flex; flex-direction: column; gap: 14px; max-height: calc(100vh - 32px); overflow: auto; }
.modal.wide { max-width: 860px; }
.modal h3 { font-size: 1.1rem; }
.toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px;
  border-radius: var(--r-sm); font-weight: 600; z-index: 60; max-width: calc(100% - 32px); }

/* ---------- tickets ---------- */
.thread { display: flex; flex-direction: column; gap: 10px; }
.msg { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; background: var(--sunken); max-width: 85%; }
.msg.platform { background: var(--info-soft); border-color: var(--line); align-self: flex-end; }
.msg .meta { font-size: .75rem; color: var(--muted); margin-bottom: 4px; }
.msg .body { white-space: pre-wrap; }
.msg img { max-width: 220px; border-radius: 6px; border: 1px solid var(--line); margin-top: 6px; cursor: zoom-in; }
.prio-urgent { border-inline-start: 4px solid var(--bad); }
.prio-important { border-inline-start: 4px solid var(--kraft); }
.prio-normal { border-inline-start: 4px solid transparent; }

/* ---------- auth pages ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 16px; }
.auth-brand { display: flex; align-items: center; gap: 12px; justify-content: center; }
.auth-brand img { width: 52px; height: 52px; border-radius: 12px; }
.auth-brand b { font-size: 1.8rem; letter-spacing: .06em; color: var(--ink); direction: ltr; }
/* split login (form | product scene) */
.split { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.split-form { display: flex; flex-direction: column; padding: 36px clamp(24px, 7vw, 120px); gap: 18px; }
.split-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.split-top .auth-brand { justify-content: flex-start; }
.split-body { margin: auto 0; display: flex; flex-direction: column; gap: 18px; max-width: 460px; width: 100%; }
.split-body h1 { font-size: clamp(2rem, 3.2vw, 2.8rem); line-height: 1.3; }
.split-body .lead { color: var(--muted); margin: -8px 0 6px; font-size: 1.05rem; font-weight: 300; }
.split-art { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #e9f5f3 0%, #d7ecea 55%, #f7e7cf 100%); }
html[data-theme="dark"] .split-art { background: radial-gradient(ellipse at 50% 40%, #0f4c5c 0%, #072830 75%); }
.split-art .map { position: absolute; inset: 0; width: 100%; height: 100%; direction: ltr; }
.split-art .map .gridline { stroke: #cfe3e1; } html[data-theme="dark"] .split-art .map .gridline { stroke: #12495a; }
.phone { position: relative; width: 300px; height: 600px; border-radius: 44px; background: #0b1f25; padding: 11px; box-shadow: 0 30px 70px rgba(15,76,92,.28); border: 1px solid rgba(255,255,255,.08); }
.phone .scr { width: 100%; height: 100%; border-radius: 34px; background: #eef4f5; overflow: hidden; display: flex; flex-direction: column; color: #10313a; }
.phone .pbar { background: #0f4c5c; color: #fff; padding: 30px 18px 14px; display: flex; align-items: center; gap: 10px; }
.phone .pbar img { width: 28px; height: 28px; border-radius: 8px; } .phone .pbar small { display: block; color: #a9cfd8; font-size: .7rem; }
.phone .pbody { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.phone .scan { background: #fff; border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 6px 18px rgba(15,76,92,.08); }
.phone .frame { height: 100px; border-radius: 10px; position: relative; opacity: .85;
  background: repeating-linear-gradient(90deg, #10313a 0 3px, transparent 3px 6px, #10313a 6px 7px, transparent 7px 11px); }
.phone .frame::after { content: ""; position: absolute; inset: auto 0 50% 0; height: 2px; background: #e2a85e; box-shadow: 0 0 12px #e2a85e; animation: scanline 2.4s ease-in-out infinite; }
@keyframes scanline { 0%, 100% { transform: translateY(-38px); } 50% { transform: translateY(38px); } }
.phone .okline { background: #e3f6ec; color: #17784a; border-radius: 10px; padding: 9px 11px; font-size: .78rem; font-weight: 600; }
.phone .prow { background: #fff; border-radius: 10px; padding: 9px 12px; display: flex; justify-content: space-between; font-size: .78rem; }
.phone .prow span:first-child { direction: ltr; font-weight: 600; font-family: var(--font-num); }
.float { position: absolute; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 18px; box-shadow: var(--shadow); font-size: .88rem; display: flex; flex-direction: column; gap: 2px; }
html[data-theme="dark"] .float { background: rgba(12,58,70,.85); backdrop-filter: blur(8px); }
.float b { font-size: 1.4rem; color: var(--accent); } .float small { color: var(--muted); display: flex; align-items: center; gap: 6px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #2fbf6b; box-shadow: 0 0 0 4px rgba(47,191,107,.2); }
.float.f1 { top: 14%; inset-inline-end: 7%; } .float.f2 { bottom: 15%; inset-inline-start: 7%; } .float.f2 b { color: var(--kraft-fill); }
@media (max-width: 960px) { .split { grid-template-columns: 1fr; } .split-art { display: none; } }
.tabs { display: inline-flex; background: var(--sunken); border: 1px solid var(--line); border-radius: 999px; padding: 4px; gap: 4px; align-self: center; }
.tabs button { border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600; padding: 7px 16px; border-radius: 999px; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }

/* ---------- bar chart ---------- */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding-top: 8px; }
.bars div { flex: 1; background: color-mix(in srgb, var(--accent) 30%, var(--surface)); border-radius: 6px 6px 2px 2px; min-height: 2px; position: relative; }
.bars div.today, .bars div:last-child { background: var(--kraft-fill); }
.bars div:hover { background: var(--kraft-fill); }
.bars-x { display: flex; justify-content: space-between; color: var(--muted); font-size: .72rem; margin-top: 4px; }

/* ---------- report (paper) ---------- */
#report-host { position: absolute; top: 0; left: 0; width: 794px; z-index: -1; pointer-events: none; }
.rep { width: 794px; background: #fff; color: #1a1a1a; font-family: var(--font-ui); direction: rtl; padding: 34px 38px; font-size: 13px; }
.rep-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding-bottom: 14px; border-bottom: 3px solid #0f4c5c; }
.rep-side { display: flex; align-items: center; gap: 10px; }
.rep-side.app { justify-content: flex-end; }
.rep-side img { max-width: 92px; max-height: 62px; display: block; }
.rep-side.app img { width: 52px; height: 52px; border-radius: 10px; }
.rep-side .nm { font-size: 17px; font-weight: 700; color: #14232e; line-height: 1.3; }
.rep-side .sub { font-size: 11px; color: #777; }
.rep-title { text-align: center; }
.rep-title h2 { margin: 0; color: #0f4c5c; font-size: 20px; }
.rep-title .serial { font-family: var(--font-num); font-size: 15px; font-weight: 600; color: #b8782f; margin-top: 2px; direction: ltr; }
.rep-title .meta { color: #777; font-size: 11px; margin-top: 2px; }
.rep .info { display: grid; grid-template-columns: repeat(4, 1fr); margin: 16px 0; border: 1px solid #d5dde1; border-radius: 6px; overflow: hidden; }
.rep .info div { padding: 8px 10px; border-left: 1px solid #d5dde1; background: #f5f8f9; }
.rep .info div:last-child { border-left: 0; }
.rep .info small { display: block; color: #777; font-size: 11px; }
.rep .info strong { font-size: 14px; color: #14232e; }
.rep table { border: 1px solid #b8c4ca; }
.rep th { background: #0f4c5c; color: #fff; font-size: 12px; text-align: center; }
.rep td { text-align: center; border-bottom: 1px solid #d5dde1; }
.rep tr:nth-child(even) td { background: #f5f8f9; }
.rep .total { margin-top: 12px; font-weight: 700; }
.rep .sign { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 50px; text-align: center; }
.rep .sign div { border-top: 1px dotted #555; padding-top: 8px; }

@media print {
  body * { visibility: hidden !important; }
  #print-host, #print-host * { visibility: visible !important; }
  #print-host { position: absolute; inset: 0 auto auto 0; width: 100%; }
  #print-host .rep { width: auto; padding: 0; }
  #print-host thead { display: table-header-group; }
  #print-host tr { break-inside: avoid; }
  @page { size: A4; margin: 8mm; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- home dashboard ---------- */
.hello { font-size: 1.7rem; }
.kpi-row { display: grid; grid-template-columns: 1.35fr 1fr 1fr 1fr; gap: 16px; }
.kpi-row .stat { padding: 18px 22px; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.side-col { display: flex; flex-direction: column; gap: 18px; }
.week { height: 250px; display: flex; align-items: flex-end; gap: clamp(8px, 1.6vw, 20px); border-bottom: 1px solid var(--line); }
.wk { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); font-size: .8rem; }
.wk i { width: 100%; border-radius: 10px 10px 4px 4px; background: color-mix(in srgb, var(--accent) 28%, var(--surface)); }
html[data-theme="dark"] .wk i { background: #1f6476; }
.wk.today i { background: var(--kraft-fill); }
.wk b { color: var(--ink); font-size: .8rem; font-weight: 500; }
.carrier-bar { display: grid; grid-template-columns: 76px 1fr 40px; align-items: center; gap: 12px; font-size: .9rem; margin-bottom: 12px; }
.carrier-bar:last-child { margin-bottom: 0; }
.carrier-bar i { height: 9px; border-radius: 6px; background: var(--soft); overflow: hidden; display: block; }
.carrier-bar em { display: block; height: 100%; background: var(--accent); border-radius: 6px; margin-inline-start: 0; }
.carrier-bar b { text-align: left; font-weight: 500; }
.recent { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.recent:last-child { border-bottom: 0; }
.recent .cnt { width: 40px; height: 40px; border-radius: 12px; background: var(--soft); display: grid; place-items: center; color: var(--accent); font-weight: 600; flex: none; }
.recent div { flex: 1; min-width: 0; } .recent small { display: block; color: var(--muted); font-size: .8rem; }
.recent .hint { font-size: .78rem; }
@media (max-width: 1100px) { .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } .home-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .kpi-row { grid-template-columns: 1fr; } }
html[data-theme="dark"] .bars div { background: #1f6476; }
html[data-theme="dark"] .bars div.today, html[data-theme="dark"] .bars div:last-child, html[data-theme="dark"] .bars div:hover { background: var(--kraft-fill); }
/* space between stacked blocks on every page */
.main > #view { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.main > #view > .grid + .panel, .main > #view > .panel + .panel { margin-top: 0; }

/* ================= motion (subtle, purposeful) ================= */
.btn, .side nav a, .theme-switch button, .tabs button, input, select, textarea, tr.click td, .panel, .chip, .hcard {
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .22s ease, transform .18s ease; }
.btn:hover:not([disabled]) { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(16,49,58,.10); }
.btn:active:not([disabled]) { transform: translateY(0) scale(.98); box-shadow: none; }
/* gold buttons glow */
.btn.kraft:hover:not([disabled]),
html[data-theme="dark"] .btn.primary:hover:not([disabled]) { box-shadow: 0 0 0 4px rgba(226,168,94,.18), 0 8px 26px rgba(226,168,94,.45); filter: brightness(1.05); }
html:not([data-theme="dark"]) .btn.primary:hover:not([disabled]) { box-shadow: 0 0 0 4px rgba(15,76,92,.10), 0 8px 22px rgba(15,76,92,.28); }
.btn.kraft, html[data-theme="dark"] .btn.primary { position: relative; overflow: hidden; }
.btn.kraft::after, html[data-theme="dark"] .btn.primary::after {
  content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.45) 50%, transparent 70%);
  transform: translateX(120%); transition: transform .7s ease; pointer-events: none; }
.btn.kraft:hover::after, html[data-theme="dark"] .btn.primary:hover::after { transform: translateX(-120%); }
/* nav: active marker slides in, icons nudge on hover */
.side nav a { position: relative; }
.side nav a::before { content: ""; position: absolute; inset-inline-start: -14px; top: 22%; bottom: 22%; width: 3px; border-radius: 0 3px 3px 0; background: var(--kraft-fill); transform: scaleY(0); transition: transform .25s ease; }
.side nav a[aria-current="page"]::before { transform: scaleY(1); }
.side nav a svg { transition: transform .2s ease; }
.side nav a:hover svg { transform: translateX(-2px); }
/* cards lift a little when they can be clicked; stat cards react softly */
.stat:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(16,49,58,.10); }
html[data-theme="dark"] .stat:hover { box-shadow: 0 12px 30px rgba(0,0,0,.35); border-color: #2a6c7c; }
.stat.hero:hover { box-shadow: 0 14px 34px rgba(15,76,92,.35); }
.recent { transition: background-color .15s; border-radius: 10px; }
.recent:hover { background: var(--sunken); }
/* page change: content fades in */
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.main > #view > * { animation: viewIn .35s ease backwards; }
.main > #view > *:nth-child(2) { animation-delay: .04s; } .main > #view > *:nth-child(3) { animation-delay: .08s; } .main > #view > *:nth-child(4) { animation-delay: .12s; }
/* charts grow */
@keyframes growUp { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes growSide { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.wk i, .bars div { transform-origin: bottom; animation: growUp .7s cubic-bezier(.2,.8,.2,1) both; }
.wk:nth-child(2) i { animation-delay: .05s; } .wk:nth-child(3) i { animation-delay: .1s; } .wk:nth-child(4) i { animation-delay: .15s; }
.wk:nth-child(5) i { animation-delay: .2s; } .wk:nth-child(6) i { animation-delay: .25s; } .wk:nth-child(7) i { animation-delay: .3s; }
.carrier-bar em { transform-origin: right; animation: growSide .8s cubic-bezier(.2,.8,.2,1) both .15s; }
.wk.today i { box-shadow: 0 0 0 0 rgba(226,168,94,.5); animation: growUp .7s cubic-bezier(.2,.8,.2,1) both .3s, todayPulse 2.6s ease-in-out 1.2s infinite; }
@keyframes todayPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(226,168,94,0); } 50% { box-shadow: 0 0 18px 2px rgba(226,168,94,.45); } }
/* modals and toasts */
@keyframes scrimIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
.scrim { animation: scrimIn .2s ease both; } .modal { animation: modalIn .25s cubic-bezier(.2,.8,.2,1) both; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
.toast { animation: toastIn .25s ease both; }
/* live dot breathes */
@keyframes breathe { 0%, 100% { box-shadow: 0 0 0 4px rgba(47,191,107,.2); } 50% { box-shadow: 0 0 0 8px rgba(47,191,107,.05); } }
.live-dot { animation: breathe 2s ease-in-out infinite; }
/* login scene: phone floats, cards arrive */
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes cardIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.split-art .phone { animation: floatY 6s ease-in-out infinite; }
.split-art .float { animation: cardIn .6s cubic-bezier(.2,.8,.2,1) both .3s; } .split-art .float.f2 { animation-delay: .55s; }
.split-art .map path { stroke-dashoffset: 0; animation: dash 30s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -600; } }
/* theme change: colours ease instead of jumping */
html.theme-anim, html.theme-anim * { transition: background-color .35s ease, color .35s ease, border-color .35s ease !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
html[data-theme="dark"] .wk.today i { background: var(--kraft-fill); }
