@font-face { font-family: 'Plex Arabic'; font-weight: 400; font-display: swap; src: url('/fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Plex Arabic'; font-weight: 500; font-display: swap; src: url('/fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Plex Arabic'; font-weight: 700; font-display: swap; src: url('/fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Plex Arabic'; font-weight: 400; font-display: swap; src: url('/fonts/ibm-plex-sans-arabic-latin-400-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'Plex Arabic'; font-weight: 500; font-display: swap; src: url('/fonts/ibm-plex-sans-arabic-latin-500-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'Plex Arabic'; font-weight: 700; font-display: swap; src: url('/fonts/ibm-plex-sans-arabic-latin-700-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F; }

:root {
  --blue-900: #0a4478;
  --blue-700: #0e5ca8;
  --blue-600: #1570c4;
  --blue-100: #e3effa;
  --ink: #15212e;
  --ink-2: #4d5c6c;
  --ink-3: #66748a;
  --line: #e1e7ee;
  --bg: #f3f6f9;
  --panel: #fff;
  --green: #0b7a54;
  --green-bg: #e2f5ee;
  --amber: #96600a;
  --amber-bg: #fcf1d9;
  --red: #bf2c25;
  --red-bg: #fde8e6;
  --radius: 10px;
  --field: #fff;
  --soft: #eef2f6;
  --hover: #f6f9fc;
  --line-soft: #edf1f5;
  --field-line: #c9d3de;
  --pick: #f9d84a;
  --pick-ink: #1d1b2e;
  --pick-soft: #fff6cf;
}
html[data-theme=dark] {
  color-scheme: dark;
  --ink: #e7edf4;
  --ink-2: #b7c3cf;
  --ink-3: #94a3b3;
  --line: #2b3847;
  --bg: #0f1720;
  --panel: #17212c;
  --field: #101922;
  --soft: #1d2935;
  --hover: #1f2c39;
  --line-soft: #233141;
  --field-line: #3b4b5c;
  --blue-100: #17324d;
  --green: #62d6aa;
  --green-bg: #123a2c;
  --amber: #f1c46b;
  --amber-bg: #3a2c0e;
  --red: #ff9a91;
  --red-bg: #43201e;
  --pick-soft: #3a3313;
}
html[data-theme=dark] .tag.blue { color: #a9d3f7; }
html[data-theme=dark] .toast { background: #2b3847; }
html[data-theme=dark] :is(.alert-bar.red, .big-warning, .toast.err, .nav-badge, .tool-badge) { background: #bf2c25; color: #fff; }
html[data-theme=dark] kbd { background: #ffffff1f; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.55 'Plex Arabic', Tahoma, sans-serif;
  font-variant-numeric: tabular-nums;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 700; }
a { color: var(--blue-700); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--blue-600); outline-offset: 2px; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.nowrap { white-space: nowrap; }

/* shell */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side {
  background: linear-gradient(180deg, var(--blue-700), var(--blue-900));
  color: #fff; display: flex; flex-direction: column; padding: 18px 12px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { padding: 0 8px 16px; border-bottom: 1px solid #ffffff26; margin-bottom: 12px; }
.brand strong { display: block; font-size: 18px; }
.menu-toggle { display: none; background: #ffffff24; border: 1px solid #ffffff55; color: #fff; border-radius: 8px; padding: 7px 16px; font-weight: 500; cursor: pointer; }
.brand span { font-size: 13px; color: #d6e6f5; }
.nav { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.nav > *, .nav-head { min-width: 0; }
.side { overflow-x: hidden; }
.nav-home { display: grid; }
.nav-group { display: grid; gap: 2px; padding: 4px; border-radius: 12px; background: #ffffff0f; border: 1px solid #ffffff1f; transition: background .2s, border-color .2s; }
.nav-group.here { background: #ffffff17; border-color: #ffffff3d; }
.nav-head { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 9px; border: 0; border-radius: 8px; background: none; color: #fff; font: inherit; font-weight: 700; cursor: pointer; text-align: start; }
.nav-head:hover { background: #ffffff14; }
.nav-head:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.nav-title { flex: 1; min-width: 0; font-size: 14px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-count { min-width: 22px; padding: 0 6px; border-radius: 10px; background: #ffffff24; font-size: 11px; font-weight: 500; text-align: center; color: #e6f0fa; }
.nav-chevron { width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .2s; opacity: .85; margin-inline: 2px 4px; }
html[dir=rtl] .nav-chevron { transform: rotate(135deg); }
.nav-group.open .nav-chevron { transform: rotate(45deg); }
.nav-items { display: none; gap: 2px; padding: 2px 0 4px; border-top: 1px solid #ffffff1a; margin-top: 2px; }
.nav-group.open .nav-items { display: grid; }
.nav-items a { font-size: 14px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 8px;
  color: #e6f0fa; text-decoration: none; font-weight: 500;
}
.nav a:hover { background: #ffffff1a; }
.nav a.on { background: var(--pick); color: var(--pick-ink); font-weight: 700; box-shadow: inset -4px 0 0 var(--pick-ink); }
html[dir=ltr] .nav a.on { box-shadow: inset 4px 0 0 var(--pick-ink); }
.nav a.on svg { color: var(--pick-ink); }
.nav svg, .btn svg { width: 18px; height: 18px; flex: none; }
.side-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid #ffffff26; }
.side-foot strong { display: block; font-weight: 500; }
.side-foot div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.side-foot div button { padding-inline: 4px; white-space: nowrap; }
.side-foot button { margin-top: 8px; font-size: 13px; background: none; border: 1px solid #ffffff55; color: #fff; border-radius: 7px; padding: 4px 12px; cursor: pointer; }
.main { min-width: 0; display: flex; flex-direction: column; }
.demo-bar { background: var(--amber-bg); color: var(--amber); padding: 5px 24px; font-size: 13px; font-weight: 500; }
.top {
  background: var(--panel); border-bottom: 1px solid var(--line); padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.top p { color: var(--ink-3); font-size: 13px; }
.content { padding: 20px 24px 40px; display: grid; gap: 16px; align-content: start; }

/* parts */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; min-width: 0; }
.panel > h2 { margin-bottom: 10px; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.head-row h2 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px;
  border-radius: 8px; border: 1px solid var(--line); background: var(--panel); cursor: pointer;
  font-weight: 500; text-decoration: none; color: var(--ink); white-space: nowrap;
}
.btn.small { padding: 4px 10px; }
.btn:hover:not(:disabled) { border-color: var(--blue-600); }
.btn.primary { background: var(--blue-700); border-color: var(--blue-700); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--blue-900); }
.btn.danger { color: var(--red); border-color: #f0bdb9; }
.btn.big { padding: 12px 16px; font-size: 16px; width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
kbd { font: inherit; font-size: 12px; padding: 0 5px; border-radius: 4px; background: #00000014; }
.btn.primary kbd { background: #ffffff2e; }

label.field { display: grid; gap: 4px; font-size: 13px; font-weight: 500; color: var(--ink-2); min-width: 0; }
input, select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--field-line); border-radius: 8px; background: var(--field);
  font-size: 15px; font-weight: 400; color: var(--ink);
}
input[type=checkbox] { width: 17px; height: 17px; }
.check { display: inline-flex; align-items: center; gap: 7px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; align-items: end; }
.stack { display: grid; gap: 12px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: start; font-size: 13px; font-weight: 500; color: var(--ink-3); padding: 7px 9px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.link { cursor: pointer; }
tr.link:hover td { background: var(--hover); }
td.num, th.num { text-align: end; white-space: nowrap; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 13px; font-weight: 500; white-space: nowrap; margin-inline-end: 4px; }
.tag.red { background: var(--red-bg); color: var(--red); }
.tag.amber { background: var(--amber-bg); color: var(--amber); }
.tag.green { background: var(--green-bg); color: var(--green); }
.tag.blue { background: var(--blue-100); color: var(--blue-900); }
.tag.grey { background: var(--line-soft); color: var(--ink-2); }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs a { padding: 5px 13px; border-radius: 8px; border: 1px solid var(--line); text-decoration: none; color: var(--ink-2); font-weight: 500; }
.tabs a.on { background: var(--pick); border-color: var(--pick); color: var(--pick-ink); font-weight: 700; }

.empty { padding: 26px 12px; text-align: center; color: var(--ink-3); }
.error-box { background: var(--red-bg); color: var(--red); border-radius: 8px; padding: 8px 12px; font-weight: 500; }
.ddi-box { border-radius: 8px; padding: 8px 12px; margin-bottom: 8px; display: grid; gap: 4px; border-inline-start: 4px solid; }
.ddi-box.red { background: var(--red-bg); border-color: var(--red); }
.ddi-box.amber { background: var(--amber-bg); border-color: var(--amber); }
.ddi-box.grey { background: var(--soft); border-color: var(--ink-3); }
.ddi-note { font-size: 14px; color: var(--ink); overflow-wrap: anywhere; }
.ddi-ack { display: flex; gap: 8px; align-items: center; font-weight: 700; color: var(--red); margin-bottom: 10px; }
.ddi-ack input { width: 20px; height: 20px; }
.password-box { position: relative; display: block; }
/* the box is typed left-to-right, so the eye side is set by the page direction */
.password-box input { width: 100%; }
html[dir=rtl] .password-box input { padding-left: 44px; }
html[dir=ltr] .password-box input { padding-right: 44px; }
.eye-btn { position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--ink-3); cursor: pointer; }
.eye-btn:hover { background: var(--soft); color: var(--ink); }
.eye-btn svg { width: 20px; height: 20px; }
.note-box { background: var(--amber-bg); color: var(--amber); border-radius: 8px; padding: 8px 12px; font-weight: 500; }

/* dashboard */
.hero {
  background: linear-gradient(120deg, var(--blue-700), var(--blue-900)); color: #fff;
  border-radius: 14px; padding: 22px 24px;
}
.hero-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.hero h1 { font-size: 26px; }
.hero-date { background: #ffffff24; border-radius: 8px; padding: 3px 12px; font-size: 13px; }
.hero-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.hero-stat { background: #ffffff1c; border: 1px solid #ffffff30; border-radius: 10px; padding: 12px 14px; }
.hero-stat b { display: block; font-size: 24px; line-height: 1.35; font-weight: 700; }
.hero-stat span { font-size: 13px; color: #dbe9f6; }
.alerts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.alert-card {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 8px; background: var(--panel);
  border: 1px solid var(--line); border-inline-start: 4px solid var(--c, var(--line)); border-radius: var(--radius);
  padding: 11px 14px; text-decoration: none; color: inherit;
}
.alert-card:hover { border-color: var(--blue-600); }
.alert-card b { font-size: 24px; grid-row: span 2; color: var(--c, var(--ink)); }
.alert-card span { font-weight: 500; }
.alert-card small { color: var(--ink-3); font-size: 13px; }
.bar-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) 96px; gap: 10px; align-items: center; padding: 4px 0; font-size: 14px; }
.bar { height: 22px; background: var(--soft); border-radius: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--blue-700); border-radius: 6px; }
html[dir=ltr] [style*="text-align: right"] { text-align: left !important; }
.hide-money .hero-stat b, .hide-money .bar-row > span:last-child, .hide-money td.num, .hide-money .money { filter: blur(7px); }

/* dashboard: laptop = wide grid, tablet = two columns, phone = one column */
.dash { display: grid; gap: 16px; }
.dash-sub { color: #d6e6f5; font-size: 14px; margin-top: 2px; }
.dash-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.dash-tile { display: flex; align-items: center; gap: 12px; background: #ffffff1c; border: 1px solid #ffffff30; border-radius: 12px; padding: 14px; min-width: 0; }
.dash-tile > div { min-width: 0; display: grid; }
.dash-tile b { font-size: 24px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-tile span { font-size: 13px; color: #dbe9f6; }
.dash-tile-icon { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: #ffffff26; }
.dash-tile-icon svg { width: 22px; height: 22px; }
.dash-trend { justify-self: start; margin-top: 4px; padding: 1px 8px; border-radius: 999px; font-size: 12px !important; font-weight: 700; color: #fff !important; }
.dash-trend.up { background: #0b7a54; }
.dash-trend.down { background: #bf2c25; }

.dash-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.cols-empty { position: relative; }
.cols-note { position: absolute; z-index: 1; margin: 0; padding: 0 12px; text-align: center; inset: 0 0 28px; display: grid; place-items: center; color: var(--ink-3); font-weight: 500; }
.dash-actions a { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 700; transition: transform .15s, border-color .15s; }
.dash-actions a:hover { border-color: var(--blue-600); transform: translateY(-1px); }
.dash-actions a span { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--blue-100); color: var(--blue-700); flex: none; }
.dash-actions a.first { background: var(--pick); border-color: var(--pick); color: var(--pick-ink); }
.dash-actions a.first span { background: #ffffff8c; color: var(--pick-ink); }
.dash-actions svg { width: 20px; height: 20px; }

.dash-checks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.dash-check { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; color: inherit; text-decoration: none; min-width: 0; }
.dash-check:hover { border-color: var(--c); }
.dash-check > div { flex: 1; min-width: 0; display: grid; }
.dash-check-label { font-weight: 700; }
.dash-check small { color: var(--ink-3); font-size: 13px; }
.dash-check b { font-size: 26px; color: var(--c); }
.dash-check-icon { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.dash-check-icon svg { width: 20px; height: 20px; }
.dash-check.ok b { opacity: .7; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.dash-chart { grid-column: 1 / -1; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.cols { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; align-items: end; height: 220px; padding-top: 8px; }
.col { display: grid; grid-template-rows: auto 1fr auto; gap: 6px; height: 100%; text-align: center; min-width: 0; }
.col-value { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 18px; }
.col-track { position: relative; background: var(--soft); border-radius: 8px; overflow: hidden; }
.col-track i { position: absolute; inset: auto 0 0; background: color-mix(in srgb, var(--blue-600) 55%, transparent); border-radius: 8px 8px 0 0; transition: height .5s ease; }
.col.today .col-track i { background: var(--blue-700); }
.col.today .col-day { color: var(--ink); font-weight: 700; }
.col-day { font-size: 13px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.dash-top { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.dash-top a { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px; border-radius: 10px; color: inherit; text-decoration: none; }
.dash-top a:hover { background: var(--hover); }
.dash-top .rank { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--blue-100); color: var(--blue-900); font-weight: 700; font-size: 13px; }
.dash-top li:first-child .rank { background: var(--pick); color: var(--pick-ink); }
.dash-top bdi { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-top .meter { height: 6px; border-radius: 3px; background: var(--soft); margin-top: 5px; overflow: hidden; }
.dash-top .meter i { display: block; height: 100%; background: var(--blue-600); border-radius: 3px; }
.dash-top .num { display: grid; text-align: end; }
.dash-top small { font-size: 12px; }

.dash-feed ul { list-style: none; margin: 0; padding: 0; display: grid; }
.dash-feed li { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.dash-feed li:last-child { border-bottom: 0; }
.dash-feed li > div { display: grid; min-width: 0; }
.dash-feed small { font-size: 12px; }
.feed-icon { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--blue-100); color: var(--blue-700); }
.feed-icon svg { width: 17px; height: 17px; }
.kind-return .feed-icon { background: var(--red-bg); color: var(--red); }
.kind-purchase .feed-icon { background: var(--green-bg); color: var(--green); }
.kind-audit .feed-icon { background: var(--amber-bg); color: var(--amber); }

@media (max-width: 1100px) {
  .nav-count { display: none; }
  .dash-tiles, .dash-checks, .dash-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .dash { gap: 12px; }
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .dash-tiles, .dash-checks { gap: 8px; }
  .dash-tile { padding: 10px; gap: 8px; }
  .dash-tile-icon { width: 34px; height: 34px; border-radius: 10px; }
  .dash-tile b { font-size: 19px; }
  .dash-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .dash-actions a { padding: 10px; font-size: 14px; }
  .dash-check { padding: 10px; gap: 8px; }
  .dash-check-icon { display: none; }
  .dash-check b { font-size: 22px; }
  .cols { height: 170px; gap: 6px; }
  .col-value { font-size: 10px; }
  .col-day { font-size: 11px; }
}
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 16px; max-height: 50vh; overflow-y: auto; }
.perm-row { align-items: center; }
.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stat-card { display: grid; gap: 4px; }
.stat-card b { font-size: 26px; }
.kanban { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
.kanban-col { background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: grid; gap: 10px; min-width: 0; }
.kanban-col .empty { border: 1px dashed var(--field-line); border-radius: 8px; }
.kanban-col h2 { display: flex; align-items: center; gap: 7px; }
.dot { width: 9px; height: 9px; border-radius: 50%; }
.dot.red { background: var(--red); }
.dot.blue { background: var(--blue-600); }
.dot.amber { background: #e08a00; }
.order-card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: grid; gap: 5px; }
.order-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.order-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.order-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 10px 24px; background: var(--panel); border-bottom: 1px solid var(--line); }
.quick-search { position: relative; flex: 1; max-width: 560px; }
.quick-search input { padding-inline-end: 62px; background: var(--soft); border-color: transparent; }
.quick-search kbd { position: absolute; inset-inline-end: 9px; top: 9px; color: var(--ink-3); }
.quick-search .result { grid-template-columns: minmax(0, 1fr) auto; }
.tools { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.tool { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink-2); cursor: pointer; }
.tool:hover { border-color: var(--blue-600); }
.tool svg { width: 18px; height: 18px; }
.tool-badge { position: absolute; top: -6px; inset-inline-end: -6px; background: var(--red); color: #fff; border-radius: 999px; min-width: 19px; padding: 0 5px; font-size: 12px; text-align: center; }
.branch-select, .branch-chip { width: auto; max-width: 210px; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font-weight: 500; font-size: 14px; }
.branch-chip { display: inline-flex; align-items: center; white-space: nowrap; }
.bell-wrap { position: relative; }
.notif-panel { position: absolute; top: calc(100% + 8px); inset-inline-end: -90px; z-index: 40; width: min(340px, calc(100vw - 24px)); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px #15212e33; }
.notif-head { padding: 11px 14px; border-bottom: 1px solid var(--line); }
#notif-list { max-height: 60vh; overflow-y: auto; }
.notif-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); color: inherit; text-decoration: none; }
.notif-row:hover, .notif-item:hover { background: var(--hover); }
.notif-block { display: grid; gap: 4px; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); }
.notif-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 4px 0; color: inherit; text-decoration: none; }
.notif-foot { padding: 7px 14px; text-align: center; border-top: 1px solid var(--line); }
.support-link { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.support-grid { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
.support-list { display: grid; gap: 6px; max-height: 70vh; overflow-y: auto; }
.support-row { display: grid; gap: 3px; padding: 9px 10px; border-radius: 8px; color: inherit; text-decoration: none; border: 1px solid var(--line-soft); }
.support-row:hover { background: var(--hover); }
.support-row.on { background: var(--pick-soft); border-color: var(--pick); }
.support-last { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.support-room { display: grid; gap: 10px; min-height: 420px; align-content: start; }
.chat-thread { display: flex; flex-direction: column; gap: 8px; height: 46vh; overflow-y: auto; padding: 10px; background: var(--soft); border-radius: 8px; }
.bubble { max-width: 78%; padding: 7px 11px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); overflow-wrap: anywhere; }
.bubble small { display: block; color: var(--ink-3); font-size: 12px; }
.bubble.customer { align-self: flex-start; background: var(--blue-100); border-color: transparent; }
.bubble.staff { align-self: flex-end; }
.bubble.bot { align-self: flex-end; background: var(--line-soft); }
.chat-send { display: flex; gap: 8px; }
.chat-send input { flex: 1; min-width: 0; }
.chat-page { min-height: 100vh; display: grid; place-items: center; padding: 12px; background: linear-gradient(120deg, var(--blue-700), var(--blue-900)); }
.chat-card { width: min(480px, 100%); background: var(--panel); border-radius: 14px; overflow: hidden; }
.chat-head { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.chat-head p { color: var(--ink-3); font-size: 13px; }
.chat-start, .chat-room { padding: 14px 16px; }
.chat-room { display: grid; gap: 10px; }
[hidden] { display: none !important; }
.receipt-qr { display: grid; justify-items: center; gap: 4px; margin-top: 10px; text-align: center; }
.receipt-qr img { width: 120px; height: 120px; background: #fff; }
.page-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.page-icon { display: inline-flex; padding: 9px; border-radius: 10px; background: var(--blue-100); color: var(--blue-700); }
html[data-theme=dark] .page-icon { color: #a9d3f7; }
.page-icon svg { width: 22px; height: 22px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.list-tools { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.list-tools input { flex: 1; min-width: 240px; }
.list-tools .tabs { margin: 0; }
td .small { line-height: 1.5; }
.unit-price { white-space: nowrap; }
.item-name { font-weight: 500; margin-inline-end: 6px; }
.empty-state { display: grid; justify-items: center; gap: 8px; padding: 44px 16px; border: 1px dashed var(--field-line); border-radius: var(--radius); text-align: center; }
.empty-icon { display: inline-flex; padding: 14px; border-radius: 12px; background: var(--blue-100); color: var(--blue-700); }
.empty-icon svg { width: 26px; height: 26px; }
details.help summary { cursor: pointer; font-weight: 500; }
details.help p { margin-top: 8px; }
.help-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.help-grid > div { background: var(--soft); border-radius: 8px; padding: 10px 12px; }
.segmented { display: flex; gap: 4px; flex-wrap: wrap; padding: 4px; background: var(--soft); border-radius: 9px; }
.segmented button { flex: 1; padding: 6px 12px; border: 0; border-radius: 7px; background: none; color: var(--ink-2); font-weight: 500; cursor: pointer; white-space: nowrap; }
.segmented button.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px #15212e33; }
@media (min-width: 761px) {
  html[data-nav=end] .shell { grid-template-columns: minmax(0, 1fr) 232px; }
  html[data-nav=end] .side { order: 2; }
  html[data-nav=top] .shell, html[data-nav=bottom] .shell { display: flex; flex-direction: column; }
  html[data-nav=top] .side, html[data-nav=bottom] .side { position: sticky; z-index: 30; height: auto; flex-direction: row; align-items: center; gap: 14px; padding: 8px 14px; overflow: visible; }
  html[data-nav=bottom] .side { order: 2; top: auto; bottom: 0; }
  html[data-nav=bottom] .main { min-height: calc(100vh - 62px); }
  :is(html[data-nav=top], html[data-nav=bottom]) .brand { border: 0; margin: 0; padding: 0; white-space: nowrap; }
  :is(html[data-nav=top], html[data-nav=bottom]) .nav { display: flex; flex: 1; gap: 2px; overflow-x: auto; scrollbar-width: thin; }
  :is(html[data-nav=top], html[data-nav=bottom]) .nav-group { display: flex; margin: 0; }
  :is(html[data-nav=top], html[data-nav=bottom]) .nav-title { display: none; }
  :is(html[data-nav=top], html[data-nav=bottom]) .nav a { white-space: nowrap; }
  :is(html[data-nav=top], html[data-nav=bottom]) .side-foot { display: none; }
  html[data-collapsed=true]:is([data-nav=start]) .shell { grid-template-columns: 66px minmax(0, 1fr); }
  html[data-collapsed=true]:is([data-nav=end]) .shell { grid-template-columns: minmax(0, 1fr) 66px; }
  html[data-collapsed=true]:is([data-nav=start], [data-nav=end]) :is(.nav-label, .nav-title, .brand, .side-foot, .nav-head) { display: none; }
  html[data-collapsed=true]:is([data-nav=start], [data-nav=end]) .nav-items { display: grid; border: 0; margin: 0; padding: 0; }
  html[data-collapsed=true]:is([data-nav=start], [data-nav=end]) .nav-group { padding: 2px; }
  :is(html[data-nav=top], html[data-nav=bottom]) .nav-head { display: none; }
  :is(html[data-nav=top], html[data-nav=bottom]) :is(.nav-home, .nav-items) { display: flex; gap: 2px; border: 0; margin: 0; padding: 0; }
  :is(html[data-nav=top], html[data-nav=bottom]) .nav-group { background: none; border: 0; padding: 0; border-radius: 0; }
  html[data-collapsed=true]:is([data-nav=start], [data-nav=end]) .nav a { justify-content: center; padding: 10px 0; position: relative; }
  html[data-collapsed=true]:is([data-nav=start], [data-nav=end]) .nav-badge { position: absolute; top: 0; inset-inline-end: 4px; min-width: 16px; font-size: 11px; }
}
.perm td, .perm th { text-align: center; }
.perm td:first-child, .perm th:first-child { text-align: start; }
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 10px; }
.summary div { border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; }
.summary b { display: block; font-size: 19px; }
.summary span { font-size: 13px; color: var(--ink-3); }
.done td { color: var(--ink-3); }
.alert-bar { display: block; padding: 9px 24px; font-weight: 700; text-decoration: none; }
.alert-bar.red { background: var(--red); color: #fff; font-size: 17px; }
.alert-bar.amber { background: var(--amber-bg); color: var(--amber); box-shadow: inset -5px 0 0 #f4b740; }
html[dir=ltr] .alert-bar.amber { box-shadow: inset 5px 0 0 #f4b740; }
.more-btn { display: block; margin: 12px auto 0; min-width: 220px; }
.nav-badge { margin-inline-start: auto; background: var(--red); color: #fff; border-radius: 999px; min-width: 22px; padding: 0 6px; text-align: center; font-size: 13px; }
.big-warning { background: var(--red); color: #fff; border-radius: 10px; padding: 16px; font-size: 20px; font-weight: 700; text-align: center; }
.danger-panel { border-inline-start: 5px solid var(--red); }
.warn-panel { border-inline-start: 5px solid #f4b740; }
.hint-btn { display: block; margin-top: 5px; width: 100%; text-align: start; background: var(--amber-bg); color: var(--amber); border: 1px solid #efd08c; border-radius: 7px; padding: 4px 9px; font-size: 13px; font-weight: 500; cursor: pointer; }
.feed { display: grid; }
.feed div { padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.feed div:last-child { border-bottom: 0; }
.quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

/* point of sale */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.pos-search { position: relative; }
.pos-search input { font-size: 18px; padding: 11px 14px; border-color: var(--blue-600); }
.results {
  position: absolute; inset-inline: 0; top: calc(100% + 4px); z-index: 20; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 24px #15212e22; max-height: 380px; overflow-y: auto;
}
.result { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; align-items: center; width: 100%; padding: 9px 13px; cursor: pointer; border-bottom: 1px solid var(--line-soft); }
.result:hover { background: var(--blue-100); }
.result.on { background: var(--pick-soft); box-shadow: inset -3px 0 0 var(--pick); }
.result:last-child { border-bottom: 0; }
.cart-qty { width: 76px; text-align: center; }
.cart-unit { width: 92px; }
.icon-btn { background: none; border: 0; cursor: pointer; color: var(--ink-3); padding: 4px 8px; border-radius: 6px; }
.icon-btn:hover { background: var(--red-bg); color: var(--red); }
.total-box { position: sticky; top: 16px; display: grid; gap: 10px; }
.total { font-size: 34px; font-weight: 700; line-height: 1.2; }
.change { display: flex; justify-content: space-between; font-weight: 500; }
.keys { color: var(--ink-3); font-size: 13px; }

/* dialogs */
dialog { background: var(--panel); border: 0; border-radius: 12px; padding: 20px; width: min(480px, calc(100vw - 32px)); box-shadow: 0 20px 50px #15212e55; color: var(--ink); }
dialog.wide { width: min(720px, calc(100vw - 32px)); }
dialog::backdrop { background: #15212e73; }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }

/* sign in */
.login { position: relative; isolation: isolate; overflow: hidden; min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 16px; background: var(--blue-900); }
.login-card { position: relative; background: var(--panel); border-radius: 14px; padding: 26px; width: min(400px, 100%); display: grid; gap: 14px; box-shadow: 0 24px 60px #00000047; }
.login-badge { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; color: #fff; background: var(--blue-700); transition: background .6s; }
.login-badge-icon { display: grid; }
.login-badge svg { width: 32px; height: 32px; display: block; }
.sky { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.float { position: absolute; left: var(--x); top: var(--y); width: var(--size); height: var(--size); color: #fff; opacity: .24; }
.float svg { display: block; width: 100%; height: 100%; }
.heart-line { position: absolute; inset: 50% 0 auto; height: 200px; transform: translateY(-50%); color: #fff; opacity: .4; }
.heart-line svg { display: block; width: 100%; height: 100%; }
.heart-line path { stroke-dasharray: .3 .7; }
@media (prefers-reduced-motion: no-preference) {
  .sky { animation: sky-in .7s ease-out; }
  .login-card { animation: card-in .55s cubic-bezier(.2, .8, .3, 1); }
  .login-badge-icon { animation: badge-bob 3.6s ease-in-out infinite; }
  .sky-rise .float { top: 0; animation: float-rise var(--duration) linear var(--delay) infinite; }
  .sky-fall .float { top: 0; animation: float-fall var(--duration) ease-in-out var(--delay) infinite; }
  .sky-drift .float { animation: float-drift var(--duration) ease-in-out var(--delay) infinite alternate; }
  .sky-twinkle .float { animation: float-twinkle var(--duration) ease-in-out var(--delay) infinite alternate; }
  .sky-beat .float { animation: float-beat var(--duration) ease-in-out var(--delay) infinite; }
  .heart-line path { animation: heart-run 4.5s linear infinite; }
}
@keyframes sky-in { from { opacity: 0; } }
@keyframes card-in { from { opacity: 0; transform: translateY(18px) scale(.97); } }
@keyframes badge-bob { 50% { transform: translateY(-3px) rotate(-6deg); } }
@keyframes float-rise { from { transform: translate3d(0, 112vh, 0) rotate(0); } to { transform: translate3d(var(--sway), -16vh, 0) rotate(var(--turn)); } }
@keyframes float-fall { 0% { transform: translate3d(0, -16vh, 0) rotate(0); } 50% { transform: translate3d(var(--sway), 48vh, 0) rotate(calc(var(--turn) / 2)); } 100% { transform: translate3d(0, 112vh, 0) rotate(var(--turn)); } }
@keyframes float-drift { to { transform: translate3d(var(--sway), var(--lift), 0) rotate(var(--turn)); } }
@keyframes float-twinkle { from { transform: scale(.75); opacity: .12; } to { transform: scale(1.12); opacity: .55; } }
@keyframes float-beat { 0%, 45%, 100% { transform: scale(1); } 15% { transform: scale(1.2); } 30% { transform: scale(1.08); } }
@keyframes heart-run { from { stroke-dashoffset: 1.3; } to { stroke-dashoffset: 0; } }
.demo-users { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }

#toasts { position: fixed; bottom: 18px; inset-inline-start: 18px; display: grid; gap: 8px; z-index: 100; }
.toast { background: var(--ink); color: #fff; padding: 9px 15px; border-radius: 8px; font-weight: 500; }
.toast.err { background: var(--red); }

.receipt { font-size: 14px; }
.receipt h2 { text-align: center; }
.receipt table td, .receipt table th { padding: 3px 2px; }

@media (max-width: 1100px) {
  .support-grid { grid-template-columns: minmax(0, 1fr); }
  .kanban { grid-template-columns: minmax(0, 1fr); }
  .shell { grid-template-columns: 196px minmax(0, 1fr); }
  .hero-stats, .alerts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main, .grid-2, .pos { grid-template-columns: minmax(0, 1fr); }
  .total-box { position: static; }
}
@media (max-width: 760px) {
  .shell { display: block; }
  .side { position: sticky; z-index: 30; height: auto; padding: 8px 14px; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; overflow: visible; }
  .brand { padding: 0; margin: 0; border: 0; }
  .brand strong { font-size: 16px; }
  .brand span { display: none; }
  .menu-toggle { display: block; }
  .nav, .side-foot { display: none; width: 100%; }
  .side.open { max-height: 100vh; overflow-y: auto; }
  .side.open .nav { display: grid; margin-top: 10px; }
  .side.open .side-foot { display: block; margin-top: 8px; }
  .content { padding: 12px 12px 32px; }
  .top { padding: 10px 14px; }
  .top .btn { width: 100%; }
  .demo-bar, .alert-bar { padding-inline: 14px; }
  .topbar { flex-wrap: wrap; padding: 8px 12px; gap: 8px; }
  .quick-search { flex-basis: 100%; max-width: none; }
  .quick-search kbd { display: none; }
  .tools { width: 100%; margin: 0; flex-wrap: wrap; }
  .branch-select, .branch-chip { flex: 1 1 100%; max-width: none; }
  .notif-panel { position: fixed; top: 110px; inset-inline: 12px; width: auto; }
  .tools .btn { flex: 1; }
  .help-grid { grid-template-columns: minmax(0, 1fr); }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .stat-row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .stat-card b { font-size: 21px; }
  .hero { padding: 16px; }
  .hero h1 { font-size: 21px; }
  .hero-stats, .alerts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .hero-stat { padding: 10px 12px; }
  .hero-stat b { font-size: 19px; }
  .panel { padding: 12px; }
  .bar-row { grid-template-columns: 62px minmax(0, 1fr) 76px; gap: 6px; }
  .result { grid-template-columns: minmax(0, 1fr) auto; }
  input, select, textarea { font-size: 16px; }
  .btn { min-height: 44px; }
  .btn.small { min-height: 40px; flex: 1; }
  .tabs a { min-height: 38px; display: inline-flex; align-items: center; }
  kbd, .keys { display: none; }

  /* Tables become one card per row. */
  .table-wrap { overflow: visible; }
  table.stacked thead { display: none; }
  table.stacked, table.stacked tbody { display: block; width: 100%; }
  table.stacked tr { display: block; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin-bottom: 10px; background: var(--panel); }
  table.stacked tr:last-child { margin-bottom: 0; }
  table.stacked td {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
    border: 0; padding: 5px 0; white-space: normal; text-align: start;
  }
  table.stacked td:empty { display: none; }
  table.stacked td[data-label]::before { content: attr(data-label); color: var(--ink-3); font-size: 13px; flex: none; max-width: 48%; }
  table.stacked td:first-child { display: block; font-weight: 500; font-size: 16px; }
  table.stacked td:first-child::before { display: none; }
  table.stacked td:first-child select, table.stacked td:first-child input { font-weight: 400; }
  table.stacked td.empty { display: block; text-align: center; font-weight: 400; }
  table.stacked td:not([data-label]) { flex-wrap: wrap; justify-content: flex-start; gap: 8px; }
  table.stacked td input:not([type=checkbox]), table.stacked td select { flex: 1; width: auto; min-width: 0; }
  table.stacked td:first-child input:not([type=checkbox]), table.stacked td:first-child select { width: 100%; }
  table.stacked .small.ltr { text-align: start !important; }
  .perm td { min-height: 0; padding: 3px 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print {
  html[data-theme=dark] { --ink: #000; --panel: #fff; --bg: #fff; --line: #ccc; --ink-3: #333; }
  body * { visibility: hidden; }
  .receipt, .receipt * { visibility: visible; }
  .receipt { position: absolute; inset: 0 0 auto 0; width: 76mm; }
  .print-a4 .receipt { width: 100%; font-size: 16px; }
  dialog { box-shadow: none; }
  .no-print { display: none !important; }
}

/* avatars */
.avatar { display: inline-grid; place-items: center; border-radius: 50%; overflow: hidden; flex: none; color: #fff; font-weight: 700; background: linear-gradient(135deg, var(--blue-600), #6b4bd8); }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.big { width: 112px; height: 112px; font-size: 42px; box-shadow: 0 0 0 4px var(--panel), 0 0 0 6px var(--line); }
.avatar.small { width: 38px; height: 38px; font-size: 16px; box-shadow: 0 0 0 2px #ffffff55; }
.side-me { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; border-radius: 10px; padding: 4px; margin: -4px; }
.side-me:hover { background: #ffffff14; }
.side-me > span:last-child { display: grid; min-width: 0; }
.side-me strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* my account */
.acc { display: grid; gap: 16px; }
.acc-warning { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: 12px; background: var(--amber-bg); color: var(--amber); font-weight: 700; border: 1px solid #f4b74066; }
.acc-warning svg { width: 22px; height: 22px; flex: none; }
.acc-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: 16px; align-items: start; }
.acc-head { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.acc-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--blue-100); color: var(--blue-700); flex: none; }
.acc-icon svg { width: 20px; height: 20px; }
.acc-focus { box-shadow: 0 0 0 2px var(--pick); }
.acc-card { display: grid; justify-items: center; text-align: center; gap: 8px; position: sticky; top: 16px; }
.acc-photo { position: relative; margin-top: 6px; }
.acc-camera { position: absolute; bottom: 2px; inset-inline-start: 2px; width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--panel); background: var(--ink); color: #fff; display: grid; place-items: center; cursor: pointer; }
.acc-camera svg { width: 16px; height: 16px; }
.acc-photo-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.acc-name { margin-top: 6px; font-size: 20px; }
.acc-infos { width: 100%; display: grid; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; }
.acc-info { display: flex; justify-content: space-between; gap: 8px; padding: 7px 0; font-size: 14px; }
.acc-info > span { display: flex; align-items: center; gap: 6px; color: var(--ink-2); }
.acc-info svg { width: 16px; height: 16px; }
.acc-look { width: 100%; border-top: 1px solid var(--line); padding-top: 10px; text-align: start; display: grid; gap: 8px; }
.acc-toggle { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
input.switch { appearance: none; -webkit-appearance: none; padding: 0; border: 0; min-height: 0; margin: 0; width: 46px; height: 26px; border-radius: 13px; background: var(--field-line); position: relative; cursor: pointer; flex: none; transition: background .2s; }
input.switch::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: inset-inline-start .2s; box-shadow: 0 1px 3px #0003; }
input.switch:checked { background: var(--blue-700); }
input.switch:checked::after { inset-inline-start: 23px; }
.acc-devices { display: grid; gap: 8px; }
.acc-device { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.acc-device .tag { margin-inline-start: 6px; }
html[data-big=true] body { zoom: 1.12; }

/* driver */
.drv { display: grid; gap: 14px; max-width: 760px; }
.drv-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.drv-stats > div { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; text-align: center; }
.drv-stats b { font-size: 24px; }
.drv-stats span { font-size: 13px; color: var(--ink-3); }
.drv-list { display: grid; gap: 12px; }
.drv-card { background: var(--panel); border: 1px solid var(--line); border-inline-start: 5px solid var(--blue-600); border-radius: 14px; padding: 14px; display: grid; gap: 10px; }
.drv-card.out { border-inline-start-color: #f4b740; }
.drv-card h2 { font-size: 20px; }
.drv-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.drv-address { display: flex; gap: 10px; align-items: flex-start; font-size: 16px; }
.drv-address svg { width: 22px; height: 22px; flex: none; color: var(--blue-700); margin-top: 2px; }
.drv-cash { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--green-bg); color: var(--green); }
.drv-cash b { font-size: 22px; }
.drv-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.drv-links .btn { display: flex; justify-content: center; align-items: center; gap: 6px; min-height: 46px; }
.drv-links svg { width: 18px; height: 18px; }
.drv-card .btn.big { min-height: 54px; font-size: 18px; }
.drv-issue { justify-self: center; }
.drv-done { list-style: none; margin: 0; padding: 0; display: grid; }
.drv-done li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.drv-done li:last-child { border-bottom: 0; }
@media (max-width: 900px) {
  .acc-grid { grid-template-columns: minmax(0, 1fr); }
  .acc-card { position: static; order: -1; }
}
@media (max-width: 760px) {
  .drv-stats { gap: 6px; }
  .drv-stats > div { padding: 10px 6px; }
  .drv-stats b { font-size: 19px; }
  .acc-device { flex-wrap: wrap; }
}

/* staff contact and new-device alerts */
.contact-links { display: flex; gap: 6px; margin-top: 6px; }
.contact-links .btn { display: inline-flex; align-items: center; gap: 4px; }
.contact-links svg { width: 14px; height: 14px; }
.btn.wa { background: #e7f8ee; border-color: #25d36655; color: #0f7a3d; }
html[data-theme=dark] .btn.wa { background: #123a26; color: #7ee2a8; }
.login-alerts { border-inline-start: 4px solid #f4b740; }
.login-alert { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line-soft); flex-wrap: wrap; }
.login-alert-actions { display: flex; gap: 6px; align-items: center; }

/* order messages */
.msg-list { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; min-height: 160px; overflow-y: auto; padding: 10px; background: var(--soft); border-radius: 12px; }
.msg { max-width: 80%; padding: 8px 12px; border-radius: 14px; display: grid; gap: 2px; }
.msg.mine { align-self: flex-start; background: var(--blue-700); color: #fff; border-end-start-radius: 4px; }
.msg.theirs { align-self: flex-end; background: var(--panel); border: 1px solid var(--line); border-end-end-radius: 4px; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-meta { font-size: 11px; opacity: .75; }
.msg-quick { display: flex; gap: 6px; flex-wrap: wrap; }
.msg-compose { display: flex; gap: 8px; align-items: stretch; }
.msg-compose textarea { flex: 1; resize: none; }
.btn.has-unread { background: var(--pick); border-color: var(--pick); color: var(--pick-ink); font-weight: 700; }
.drv-extra { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* dispatch: driver states, suggested driver, lines */
.assign-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.cand-list { display: grid; gap: 8px; max-height: 50vh; overflow-y: auto; }
.cand { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: inherit; font: inherit; text-align: start; cursor: pointer; }
.cand:hover:not(:disabled) { border-color: var(--blue-600); }
.cand:disabled { opacity: .55; cursor: not-allowed; }
.cand.best { border-color: var(--blue-600); box-shadow: 0 0 0 2px var(--blue-100); }
.cand .tag { margin-inline-start: 6px; }
.cand-side { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.zone-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.driver-strip { display: flex; gap: 8px; flex-wrap: wrap; }
.driver-chip { display: flex; gap: 8px; align-items: center; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); font-size: 14px; }
.driver-chip::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--ink-3); }
.driver-chip.free::before { background: var(--green); }
.driver-chip.busy::before { background: #f4b740; }
.driver-chip.off { opacity: .6; }
.drv-available { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--green-bg); border: 1px solid var(--line); cursor: pointer; }
.drv-available.off { background: var(--soft); }
.drv-route { display: flex; justify-content: center; align-items: center; gap: 8px; min-height: 48px; font-weight: 700; }
.drv-route svg { width: 18px; height: 18px; }

/* phone notifications card */
.push-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }
.push-card > svg, .push-card > span:first-child svg { width: 24px; height: 24px; }
.push-card > div:nth-child(2) { flex: 1; min-width: 180px; }
.push-card.off { border-color: var(--pick); background: var(--pick-soft); }
.push-card.on { background: var(--green-bg); }
.push-card.denied, .push-card.ios-install, .push-card.unsupported { background: var(--amber-bg); }
.push-actions { display: flex; gap: 6px; }
