@font-face {
  font-family: Inter;
  src: url(/fonts/inter.woff2) format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* DashPlay admin: a night-drive cockpit. Deep navy glass, amber gauge accent, cyan for "live". */
:root {
  color-scheme: dark;
  --bg: #07090f;
  --bg-2: #0a0d16;
  --sidebar: #0b0e18;
  --panel: #10141f;
  --panel-2: #141a28;
  --panel-hover: #161c2b;
  --raised: #1b2233;
  --line: rgba(148, 170, 214, 0.09);
  --line-strong: rgba(148, 170, 214, 0.17);
  --text: #eef1f7;
  --text-2: #a7b0c4;
  --text-3: #6f7a91;
  --accent: #f0a93e;
  --accent-hover: #f7bd62;
  --accent-wash: rgba(240, 169, 62, 0.13);
  --accent-line: rgba(240, 169, 62, 0.35);
  --on-accent: #1a1204;
  --cyan: #45c8e6;
  --cyan-wash: rgba(69, 200, 230, 0.13);
  --green: #4cc38a;
  --green-wash: rgba(76, 195, 138, 0.13);
  --red: #f2766b;
  --red-wash: rgba(242, 118, 107, 0.13);
  --yt: #ff5a4f;
  --yt-wash: rgba(255, 90, 79, 0.13);
  --radius: 14px;
  --radius-small: 9px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 12px 32px rgba(0, 0, 0, 0.28);
  --sidebar-w: 248px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(240, 169, 62, 0.07), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(69, 200, 230, 0.05), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 400 14px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "cv11", "ss03";
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
}

h1, h2, p, ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
strong { font-weight: 600; }
.sprite { position: absolute; width: 0; height: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* the gauge mark (same drawing as the app icon) */
.g-arc { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; }
.g-ticks { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; opacity: 0.75; }
.g-play { fill: currentColor; }

.icon {
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* controls */
label { display: block; margin-bottom: 6px; color: var(--text-2); font-size: 13px; font-weight: 500; }

input, textarea, select {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  background: var(--bg-2);
  color: var(--text);
  font: inherit;
  letter-spacing: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:hover, textarea:hover, select:hover { border-color: rgba(148, 170, 214, 0.28); }
input:focus, textarea:focus, select:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-wash); }
textarea { display: block; resize: vertical; }
select { padding: 0 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  background: var(--raised);
  color: var(--text);
  font: 600 14px Inter, system-ui, sans-serif;
  letter-spacing: inherit;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s, box-shadow 0.15s;
}
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { cursor: default; opacity: 0.45; }
.btn-block { width: 100%; }
.btn-large { min-height: 46px; font-size: 15px; }
.btn-primary {
  border-color: transparent;
  background: linear-gradient(180deg, #f6b85a, var(--accent));
  color: var(--on-accent);
  box-shadow: 0 6px 20px rgba(240, 169, 62, 0.22);
}
.btn-primary:hover:not(:disabled) { background: linear-gradient(180deg, #fac778, var(--accent-hover)); box-shadow: 0 8px 26px rgba(240, 169, 62, 0.32); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--raised); color: var(--text); }
.btn-danger { border-color: rgba(242, 118, 107, 0.3); background: var(--red-wash); color: var(--red); }
.btn-danger:hover:not(:disabled) { background: rgba(242, 118, 107, 0.22); }

.btn-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius-small);
  background: none;
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-icon:hover { background: var(--raised); border-color: var(--line); color: var(--text); }
.btn-icon.spinning .icon { animation: spin 0.6s linear; }
@keyframes spin { to { transform: rotate(360deg); } }

.form-error { color: var(--red); font-size: 13px; }
.link { color: var(--accent); font-size: 13px; font-weight: 600; }
.link:hover { color: var(--accent-hover); }

/* sign-in: brand story on the left, form on the right */
.signin { display: grid; min-height: 100vh; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.signin-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px 48px;
  overflow: hidden;
  background:
    radial-gradient(700px 420px at 30% 40%, rgba(240, 169, 62, 0.14), transparent 70%),
    linear-gradient(160deg, #0d1222, #07090f 70%);
  border-right: 1px solid var(--line);
}
.brand-mark { display: flex; align-items: center; gap: 10px; font-size: 17px; }
.brand-mark svg { width: 34px; height: 34px; color: var(--text); }
.brand-hero { max-width: 460px; }
.hero-gauge { width: 132px; height: 132px; margin-bottom: 28px; color: var(--text); filter: drop-shadow(0 12px 40px rgba(240, 169, 62, 0.35)); }
.hero-title { font-size: clamp(28px, 3.4vw, 42px); font-weight: 700; letter-spacing: -0.035em; line-height: 1.1; }
.hero-text { margin-top: 14px; color: var(--text-2); font-size: 16px; }
.hero-stats { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats li { padding: 12px 16px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); border-radius: 12px; backdrop-filter: blur(6px); }
.hero-stats span { display: block; color: var(--text-3); font-size: 12px; }
.hero-stats strong { font-size: 14px; }

.signin-card { display: grid; align-content: center; width: min(100%, 420px); margin: 0 auto; padding: 40px 28px; }
.signin-logo { display: none; width: 48px; height: 48px; margin-bottom: 20px; color: var(--text); }
.signin-card h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.2; }
.signin-card > p:not(.form-error) { margin: 6px 0 28px; color: var(--text-2); }
.signin-card .form-error { margin-top: 4px; }
.signin-card .btn { margin-top: 16px; }
.stack { margin-bottom: 16px; }

/* frame */
.shell { display: grid; min-height: 100vh; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }

.sidebar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 16px 12px;
  background: linear-gradient(180deg, rgba(14, 18, 31, 0.96), rgba(9, 12, 21, 0.96));
  border-right: 1px solid var(--line);
}
.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 14px; }
.workspace { display: flex; min-width: 0; align-items: center; gap: 11px; }
.logo {
  display: grid;
  flex: none;
  width: 38px;
  height: 38px;
  place-items: center;
  background: linear-gradient(160deg, #1a2440, #0f1528);
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  color: var(--text);
}
.logo svg { width: 28px; height: 28px; }
.workspace strong, .workspace small { display: block; line-height: 1.25; white-space: nowrap; }
.workspace strong { font-size: 15px; letter-spacing: -0.015em; }
.workspace small { color: var(--text-3); font-size: 12px; }
.menu-close { display: none; }

.sidebar nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-label { padding: 16px 12px 6px; color: var(--text-3); font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--text-2);
  font: 500 14px Inter, system-ui, sans-serif;
  letter-spacing: inherit;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.045); color: var(--text); }
.nav-item[aria-current="page"] { background: linear-gradient(90deg, var(--accent-wash), rgba(240, 169, 62, 0.02)); color: var(--text); }
.nav-item[aria-current="page"]::before {
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: -12px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
  content: "";
}
.nav-item[aria-current="page"] .icon { color: var(--accent); }
.signout { margin-top: auto; }
.signout:hover { color: var(--red); }
.scrim { display: none; }

.main { display: flex; min-width: 0; flex-direction: column; }
.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 60px;
  padding: 0 28px;
  background: rgba(7, 9, 15, 0.72);
  backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}
.topbar-left { display: flex; min-width: 0; align-items: center; gap: 8px; }
.menu-open { display: none; }
.crumbs { display: flex; min-width: 0; align-items: center; gap: 6px; color: var(--text-3); white-space: nowrap; }
.crumbs strong { overflow: hidden; color: var(--text); font-weight: 600; text-overflow: ellipsis; }
.crumbs .icon { width: 14px; height: 14px; }
.topbar-side { display: flex; align-items: center; gap: 10px; }
.admin-badge {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  background: linear-gradient(160deg, #f6b85a, #d98a1e);
  border-radius: 50%;
  color: var(--on-accent);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 0 0 3px rgba(240, 169, 62, 0.15);
}

.content { flex: 1; padding: 32px 28px 64px; }
.page { max-width: 1240px; margin: 0 auto; animation: rise 0.25s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

.page-head { margin-bottom: 24px; }
.page-head h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.2; }
.page-head p { margin-top: 4px; color: var(--text-2); }
.page-head-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; }

/* panels */
.panel {
  padding: 20px 22px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel-flush { padding: 0; overflow: hidden; }
.panel-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 16px; margin-bottom: 18px; }
.panel-head h2 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.panel-head p { color: var(--text-3); font-size: 13px; }
.panel-head p strong { color: var(--text); font-weight: 600; }
.empty { padding: 44px 16px; color: var(--text-3); text-align: center; }

/* metrics: each its own card with an icon chip */
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.metric {
  position: relative;
  min-width: 0;
  padding: 18px 20px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color 0.2s, transform 0.2s;
}
.metric:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.metric-icon {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text-2);
}
.metric-accent { border-color: var(--accent-line); background: radial-gradient(400px 160px at 100% 0, rgba(240, 169, 62, 0.14), transparent 70%), linear-gradient(180deg, var(--panel-2), var(--panel)); }
.metric-accent .metric-icon { background: var(--accent-wash); border-color: var(--accent-line); color: var(--accent); }
.metric p { padding-right: 44px; color: var(--text-2); font-size: 13px; font-weight: 500; }
.metric strong { display: block; margin: 10px 0 4px; overflow: hidden; font-size: 32px; font-weight: 700; letter-spacing: -0.035em; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.metric-note { display: flex; align-items: center; gap: 4px; min-height: 20px; color: var(--text-3); font-size: 13px; }
.delta { display: inline-flex; align-items: center; gap: 2px; padding: 0 6px; border-radius: 999px; font-weight: 600; }
.delta .icon { width: 13px; height: 13px; stroke-width: 2.4; }
.delta-up { background: var(--green-wash); color: var(--green); }
.delta-down { background: var(--red-wash); color: var(--red); }

.overview-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 16px; }

.segmented { display: inline-flex; padding: 3px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; }
.segmented button {
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--text-3);
  font: 600 13px Inter, system-ui, sans-serif;
  letter-spacing: inherit;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.segmented button:hover { color: var(--text); }
.segmented button[aria-pressed="true"] { background: var(--raised); color: var(--text); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 2px 8px rgba(0, 0, 0, 0.3); }
.segmented-full { display: flex; width: 100%; }
.segmented-full button { flex: 1; min-height: 36px; }

.chart { position: relative; height: 290px; touch-action: pan-y; }
.chart svg { display: block; width: 100%; height: 100%; }
.chart text { fill: var(--text-3); font-family: inherit; font-size: 12px; }
.chart .grid { stroke: var(--line); stroke-dasharray: 3 4; shape-rendering: crispEdges; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 4px 10px rgba(240, 169, 62, 0.35)); }
.chart .cross { stroke: var(--line-strong); shape-rendering: crispEdges; }
.chart .dot { fill: var(--accent); stroke: var(--panel); stroke-width: 3; }

.tooltip {
  position: fixed;
  z-index: 60;
  padding: 7px 11px;
  background: var(--raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  color: var(--text-2);
  font-size: 12px;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 12px));
  white-space: nowrap;
}
.tooltip strong { display: block; color: var(--text); font-size: 13px; }

.recent li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; }
.recent li + li { border-top: 1px solid var(--line); }
.recent time { flex: none; color: var(--text-3); font-size: 13px; }

.avatar {
  display: grid;
  flex: none;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 700;
}
.avatar-large { width: 52px; height: 52px; border-radius: 15px; font-size: 17px; }
.tint-0 { background: rgba(240, 169, 62, 0.16); color: #f4bd6e; }
.tint-1 { background: rgba(99, 148, 255, 0.16); color: #93b4ff; }
.tint-2 { background: rgba(76, 195, 138, 0.16); color: #7fd9ad; }
.tint-3 { background: rgba(190, 130, 255, 0.16); color: #cca5ff; }
.tint-4 { background: rgba(255, 128, 170, 0.16); color: #ffa5c3; }
.tint-5 { background: rgba(70, 200, 215, 0.16); color: #80dbe6; }

.person { display: flex; min-width: 0; align-items: center; gap: 11px; }
.person > div { min-width: 0; }
.person strong { display: block; overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.person small { display: block; color: var(--text-3); font-size: 12px; line-height: 1.3; }

/* tables */
.table-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.filters { display: flex; flex-wrap: wrap; gap: 4px; }
.filters button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: none;
  color: var(--text-2);
  font: 600 13px Inter, system-ui, sans-serif;
  letter-spacing: inherit;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.filters button:hover { background: rgba(255, 255, 255, 0.045); color: var(--text); }
.filters button[aria-pressed="true"] { background: var(--accent-wash); border-color: var(--accent-line); color: var(--accent); }
.filters span { padding: 0 6px; background: rgba(255, 255, 255, 0.06); border-radius: 999px; color: var(--text-2); font-size: 12px; line-height: 18px; }

.search { position: relative; width: min(100%, 300px); }
.search .icon { position: absolute; top: 11px; left: 12px; width: 16px; height: 16px; color: var(--text-3); }
.search input { min-height: 38px; padding: 6px 12px 6px 36px; border-radius: 999px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 11px 18px; background: rgba(255, 255, 255, 0.015); color: var(--text-3); font-size: 12px; font-weight: 600; letter-spacing: 0.03em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 12px 18px; border-top: 1px solid var(--line); color: var(--text-2); white-space: nowrap; }
td:first-child { color: var(--text); }
td.chevron { width: 40px; padding-left: 0; color: var(--text-3); }
tbody tr { cursor: pointer; transition: background 0.12s; }
tbody tr:hover { background: var(--panel-hover); }
tbody tr:hover td.chevron { color: var(--accent); }
.row-open { display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-align: left; cursor: pointer; }
tbody tr.row-static { cursor: default; }
td.actions { width: 1%; text-align: right; }
.row-action { min-height: 32px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--text-2); font: 600 13px Inter, system-ui, sans-serif; letter-spacing: inherit; cursor: pointer; }
.row-action:hover { background: var(--raised); color: var(--text); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 20px; white-space: nowrap; }
.pill::before { width: 6px; height: 6px; background: currentColor; border-radius: 50%; content: ""; }
.pill-good { background: var(--green-wash); color: var(--green); }
.pill-bad { background: var(--red-wash); color: var(--red); }
.pill-live { background: var(--accent-wash); color: var(--accent); }
.pill-off { background: rgba(255, 255, 255, 0.06); color: var(--text-2); }
.pill-yt { background: var(--yt-wash); color: var(--yt); }

.notice { margin-bottom: 16px; padding: 12px 16px; background: var(--accent-wash); border: 1px solid var(--accent-line); border-radius: var(--radius-small); color: var(--accent-hover); }

.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 13px; }
.pager div { display: flex; gap: 6px; }
.pager .btn { min-height: 34px; padding: 0 12px; font-size: 13px; }

/* forms in dialogs */
.plan-form { display: grid; gap: 16px; }
.plan-form .confirm-actions { margin-top: 4px; }
.plan-form select { width: 100%; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: flex-start; gap: 12px; margin: 0; cursor: pointer; }
.check input { width: 18px; min-height: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); }
.check strong { display: block; color: var(--text); }
.check small { color: var(--text-3); font-size: 13px; font-weight: 400; }
.check-card { padding: 14px; background: var(--bg-2); border: 1px solid var(--line-strong); border-radius: var(--radius-small); transition: border-color 0.15s, background 0.15s; }
.check-card:has(input:checked) { background: var(--yt-wash); border-color: rgba(255, 90, 79, 0.35); }

/* updates */
.updates-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.release-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.release-form .wide { grid-column: 1 / -1; }
#apk-file { padding: 8px; }
#apk-file::file-selector-button { margin-right: 10px; padding: 6px 12px; border: 0; border-radius: 7px; background: var(--raised); color: var(--text); font: 600 13px Inter, system-ui, sans-serif; cursor: pointer; }
.apk-info { padding: 10px 14px; background: var(--green-wash); border-radius: var(--radius-small); color: var(--green); }

.timeline li { position: relative; margin-left: 5px; padding: 0 0 22px 22px; border-left: 1px solid var(--line-strong); }
.timeline li:last-child { padding-bottom: 0; border-left-color: transparent; }
.timeline li::before {
  position: absolute;
  top: 5px;
  left: -6px;
  width: 11px;
  height: 11px;
  background: var(--panel);
  border: 2px solid var(--text-3);
  border-radius: 50%;
  content: "";
}
.timeline li:first-child::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-wash); }
.timeline-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.timeline-head .row-action { margin-left: auto; }
.timeline .code { color: var(--text-3); font-size: 12px; }
.timeline .note { margin-top: 2px; color: var(--text-2); white-space: pre-line; }
.timeline time { display: block; margin-top: 2px; color: var(--text-3); font-size: 12px; }

/* coupons and orders */
.code { padding: 3px 8px; background: var(--raised); border: 1px solid var(--line); border-radius: 6px; color: var(--text); font: 600 13px ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: 0.03em; }
.order-coupon { display: block; color: var(--text-3); font-size: 12px; }

/* drawer and dialogs */
dialog { padding: 0; border: 0; color: var(--text); }
dialog::backdrop { background: rgba(3, 5, 10, 0.62); backdrop-filter: blur(4px); }

.drawer {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(100%, 420px);
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border-left: 1px solid var(--line-strong);
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.45);
}
.drawer[open] { display: flex; flex-direction: column; animation: slide-in 0.25s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes slide-in { from { transform: translateX(32px); opacity: 0; } }
.drawer header { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 12px 22px; border-bottom: 1px solid var(--line); }
.drawer-title { font-size: 15px; font-weight: 600; }
.drawer-body { flex: 1; overflow-y: auto; }
.drawer-person { display: flex; align-items: center; gap: 14px; padding: 22px; }
.drawer-person div { min-width: 0; }
.drawer-person strong { display: block; overflow: hidden; font-size: 18px; letter-spacing: -0.015em; text-overflow: ellipsis; white-space: nowrap; }
.drawer-person p { color: var(--text-2); }
.drawer dl { margin: 0 22px; padding: 4px 16px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; }
.drawer dl div { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 0; }
.drawer dl div + div { border-top: 1px solid var(--line); }
.drawer dt { color: var(--text-3); }
.drawer dd { text-align: right; }
.yt-box { margin: 16px 22px 0; padding: 16px; background: radial-gradient(300px 120px at 100% 0, rgba(255, 90, 79, 0.1), transparent 70%), var(--bg-2); border: 1px solid var(--line); border-radius: 12px; }
.yt-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.yt-icon { display: grid; width: 38px; height: 38px; place-items: center; background: var(--yt-wash); border-radius: 10px; color: var(--yt); }
.yt-head strong { display: block; }
.yt-head p { color: var(--text-3); font-size: 13px; }
.yt-box [data-youtube][aria-pressed="true"] { color: var(--text); }
.yt-box [data-youtube="on"][aria-pressed="true"] { background: var(--green-wash); color: var(--green); }
.yt-box [data-youtube="off"][aria-pressed="true"] { background: var(--red-wash); color: var(--red); }
.gift { padding: 18px 22px 0; }
.gift > div { display: flex; gap: 8px; }
.gift select { flex: 1; min-width: 0; }
.drawer .form-error { padding: 12px 22px 0; }
.drawer-foot { padding: 16px 22px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }

.confirm {
  width: min(calc(100% - 32px), 440px);
  padding: 24px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}
.confirm[open] { animation: pop 0.2s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes pop { from { opacity: 0; transform: scale(0.97); } }
.confirm h2 { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.confirm p { margin-top: 6px; color: var(--text-2); }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

.toast {
  position: fixed;
  z-index: 70;
  right: 24px;
  bottom: 24px;
  max-width: calc(100% - 48px);
  padding: 12px 16px 12px 14px;
  background: var(--raised);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-small);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5);
  font-weight: 600;
  animation: rise 0.2s ease-out;
}

/* live map */
.page-wide { max-width: 1440px; }
.map-count { display: flex; align-items: center; gap: 6px; padding: 8px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; color: var(--text-2); }
.map-count strong { color: var(--green); }
.live-dot { width: 8px; height: 8px; background: var(--green); border-radius: 50%; animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(76, 195, 138, 0.6); } 70% { box-shadow: 0 0 0 8px rgba(76, 195, 138, 0); } 100% { box-shadow: 0 0 0 0 rgba(76, 195, 138, 0); } }
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; height: calc(100vh - 210px); min-height: 460px; }
.map-canvas { height: 100%; overflow: hidden; background: #0d0f15; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.map-canvas .leaflet-tile-pane { filter: invert(1) hue-rotate(195deg) brightness(0.92) contrast(0.88) saturate(0.45); }
.map-list { overflow-y: auto; }
.driver-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 12px 16px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--text); font: inherit; letter-spacing: inherit; text-align: left; cursor: pointer; }
.driver-row:hover { background: var(--panel-hover); }
.dot { flex: none; width: 8px; height: 8px; background: var(--text-3); border-radius: 50%; }
.dot-on { background: var(--green); box-shadow: 0 0 0 3px var(--green-wash); }
.driver-marker { background: none; border: 0; }
.driver-pin { position: relative; display: block; width: 40px; height: 40px; --pin: #b97a1d; }
.driver-car { display: grid; width: 40px; height: 40px; place-items: center; background: var(--pin); border: 2px solid #fff; border-radius: 12px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55); }
.driver-car svg { width: 24px; height: 24px; fill: #fff; }
.driver-car .car-glass { fill: var(--pin); }
.driver-pin::after { position: absolute; bottom: -6px; left: 50%; width: 10px; height: 10px; background: var(--pin); border-right: 2px solid #fff; border-bottom: 2px solid #fff; content: ""; transform: translateX(-50%) rotate(45deg); }
.driver-name { position: absolute; top: 46px; left: 50%; padding: 1px 8px; background: rgba(11, 12, 16, 0.88); border-radius: 999px; color: #fff; font: 600 11px/18px Inter, system-ui, sans-serif; white-space: nowrap; transform: translateX(-50%); }
.driver-pin.tint-0 { --pin: #b97a1d; }
.driver-pin.tint-1 { --pin: #3b66c9; }
.driver-pin.tint-2 { --pin: #24895c; }
.driver-pin.tint-3 { --pin: #7c4fc2; }
.driver-pin.tint-4 { --pin: #c04877; }
.driver-pin.tint-5 { --pin: #1f8d9c; }
.driver-pin.is-offline { --pin: #4a4c57; }
.driver-pin.is-offline .driver-car { border-color: #9a9dab; }
.leaflet-container { font: inherit; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--raised); color: var(--text); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); }
.leaflet-popup-content { margin: 10px 14px; }
.leaflet-container a.leaflet-popup-close-button { color: var(--text-2); }
.driver-popup strong, .driver-popup span { display: block; }
.driver-popup span { color: var(--text-2); font-size: 12px; }
.leaflet-control-attribution { background: rgba(11, 12, 16, 0.75) !important; color: var(--text-3); }
.leaflet-control-attribution a { color: var(--text-2); }
.leaflet-bar a { background: var(--raised); border-color: var(--line-strong); color: var(--text); }
.leaflet-bar a:hover { background: var(--panel-hover); color: var(--text); }

/* ---- responsive ---- */

/* laptops: metrics in two rows of three stay; side panels stack */
@media (max-width: 1180px) {
  .overview-grid, .updates-grid { grid-template-columns: minmax(0, 1fr); }
}

/* tablets: the sidebar becomes an icon rail */
@media (max-width: 1024px) and (min-width: 761px) {
  :root { --sidebar-w: 76px; }
  .sidebar { padding: 16px 10px; }
  .sidebar-top { justify-content: center; padding: 0 0 14px; }
  .workspace-text, .nav-item span, .nav-label { display: none; }
  .sidebar nav { gap: 4px; }
  .sidebar nav::before { display: block; height: 1px; margin: 4px 8px 10px; background: var(--line); content: ""; }
  .nav-item { justify-content: center; padding: 0; min-height: 46px; }
  .nav-item[aria-current="page"]::before { left: -10px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .map-layout { grid-template-columns: minmax(0, 1fr) 260px; }
}

/* phones: off-canvas menu, cards instead of tables */
@media (max-width: 760px) {
  .shell { display: block; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(84vw, 300px);
    height: 100%;
    padding-top: calc(16px + env(safe-area-inset-top));
    box-shadow: 24px 0 60px rgba(0, 0, 0, 0.5);
    transform: translateX(-105%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .sidebar.open { transform: none; }
  .menu-close { display: grid; }
  .scrim { position: fixed; z-index: 15; inset: 0; display: block; background: rgba(3, 5, 10, 0.6); backdrop-filter: blur(2px); animation: fade 0.2s; }
  @keyframes fade { from { opacity: 0; } }
  .menu-open { display: grid; margin-left: -8px; }
  .topbar { height: 56px; padding: 0 16px; padding-top: env(safe-area-inset-top); }
  .crumbs span, .crumbs .icon { display: none; }
  .content { padding: 20px 14px 48px; }
  .page-head { margin-bottom: 18px; }
  .page-head h1 { font-size: 24px; }
  .page-head-row { align-items: stretch; }
  .page-head-row > .btn { width: 100%; }

  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .metric { padding: 14px; }
  .metric-icon { top: 12px; right: 12px; width: 30px; height: 30px; border-radius: 9px; }
  .metric-icon .icon { width: 15px; height: 15px; }
  .metric p { padding-right: 34px; font-size: 12px; }
  .metric strong { font-size: 24px; }
  .metric-note { font-size: 12px; }
  .panel { padding: 16px; }
  .panel-flush { padding: 0; }
  .chart { height: 220px; }

  .table-tools { padding: 12px; }
  .filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .search { width: 100%; }

  /* every table row becomes a card; labels come from the header (see app.js) */
  .cards-on-phone thead { display: none; }
  .cards-on-phone, .cards-on-phone tbody { display: block; }
  .cards-on-phone tr { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; padding: 14px 16px; border-top: 1px solid var(--line); }
  .cards-on-phone tr:first-child { border-top: 0; }
  .cards-on-phone td { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0; border: 0; white-space: normal; grid-column: 1 / -1; }
  .cards-on-phone td::before { color: var(--text-3); font-size: 12px; font-weight: 600; content: attr(data-label); }
  .cards-on-phone td:first-child { grid-column: 1; padding-bottom: 4px; }
  .cards-on-phone td:first-child::before { display: none; }
  .cards-on-phone td.chevron { display: grid; grid-column: 2; grid-row: 1; width: auto; place-items: center; }
  .cards-on-phone td.chevron::before { display: none; }
  .cards-on-phone td.actions { width: auto; justify-content: flex-end; gap: 4px; padding-top: 6px; border-top: 1px dashed var(--line); }
  .cards-on-phone td.actions::before { display: none; }

  .pager { justify-content: center; text-align: center; }
  .pager div { width: 100%; }
  .pager .btn { flex: 1; }

  .map-layout { grid-template-columns: minmax(0, 1fr); height: auto; }
  .map-canvas { height: 58vh; }
  .map-list { max-height: 320px; }
  .release-form, .two { grid-template-columns: 1fr; }
  .drawer { width: 100%; border-left: 0; }
  .confirm { padding: 20px; }
  .confirm-actions .btn { flex: 1; }
  .toast { right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); left: 14px; max-width: none; }

  .signin { grid-template-columns: 1fr; }
  .signin-brand { display: none; }
  .signin-logo { display: block; }
  .signin-card { padding: 32px 20px; }
}

@media (max-width: 330px) {
  .metrics { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
