/*
 * Dalabtire Admin.
 *
 * The palette is the one the till and the phone already share
 * (containers/customer/customers.theme.js, lib/view/components/shared/app_ui.dart),
 * so the two products look like they were made by the same people. The only
 * thing added is a dark sidebar: this panel does something the till never
 * does — it reaches across every restaurant at once — and a dark rail is a
 * standing reminder of which window you are in before you click something
 * that locks somebody's business.
 */

:root {
  --canvas: #f4f5f7;
  --surface: #ffffff;
  --sunk: #fafafb;
  --hover: #f5f6f8;
  --border: #e6e8ec;
  --border-strong: #d8dce2;
  --hairline: #f0f1f4;

  --ink: #15181d;
  --ink-soft: #6b7280;
  --ink-faint: #9aa1ac;
  --ink-ghost: #c2c7cf;

  --brand: #f64829;
  --brand-ink: #c3341a;
  --brand-tint: #ffebe6;

  --ok: #16a34a;
  --ok-tint: #e9f7ef;
  --warn-ink: #b87409;
  --warn-tint: #fdf3e2;
  --warn-border: #e3c892;
  --bad: #dc2626;
  --bad-tint: #fdecec;
  --bad-border: #f0b0ab;
  --info-ink: #1d4ed8;
  --info-tint: #dbeafe;

  --rail: #15181d;
  --rail-soft: #9aa1ac;
  --rail-line: #262a31;
  --rail-hover: #1e222a;

  --r-panel: 10px;
  --r-control: 8px;
  --r-pill: 999px;
  --shadow: 0 12px 32px rgba(21, 24, 29, 0.1);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Figures line up in columns wherever they are stacked. */
.mono, .table td.right, .tile-value, .bar-value {
  font-variant-numeric: tabular-nums;
}

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.2px; }
p { margin: 0; }
code.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

/* ── signing in ─────────────────────────────────────────────────────────── */

body.is-out { background: var(--rail); }

.login {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 40px 20px;
}

.login-card {
  width: 380px;
  padding: 34px 34px 30px;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.36);
}

.login-mark {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: var(--ink-soft);
}

.logo-dot {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: var(--brand);
  flex: none;
}

.login h1 { margin-top: 16px; font-size: 26px; }
.login-sub { margin-top: 4px; font-size: 13.5px; color: var(--ink-soft); }

.login-form { margin-top: 24px; display: flex; flex-direction: column; gap: 14px; }

.login-error {
  padding: 10px 13px;
  background: var(--bad-tint);
  border: 1px solid var(--bad-border);
  border-radius: var(--r-control);
  font-size: 13px;
  font-weight: 600;
  color: var(--bad);
}


/* ── the shell ──────────────────────────────────────────────────────────── */

.shell { display: flex; min-height: 100vh; }

.side {
  width: 236px;
  flex: none;
  display: flex;
  flex-direction: column;
  background: var(--rail);
  color: #fff;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--rail-line);
}

.brand strong { display: block; font-size: 15px; letter-spacing: -0.2px; }
.brand span { display: block; font-size: 12px; color: var(--rail-soft); }

.nav { flex: 1; padding: 14px 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 0 12px;
  height: 40px;
  background: transparent;
  border: none;
  border-radius: var(--r-control);
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--rail-soft);
  cursor: pointer;
  text-align: left;
}

.nav-item:hover { background: var(--rail-hover); color: #fff; }

.nav-item.is-on {
  background: var(--brand);
  color: #fff;
  font-weight: 600;
}

.nav-item .icon { display: flex; flex: none; }
.nav-label { white-space: nowrap; }

.side-foot { padding: 14px 12px 16px; border-top: 1px solid var(--rail-line); }

.who { display: flex; align-items: center; gap: 10px; padding: 4px 4px 12px; }
.who-text { min-width: 0; }
.who-name {
  display: block; font-size: 13px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.who-role { display: block; font-size: 11.5px; color: var(--rail-soft); }

.btn-side {
  width: 100%;
  height: 38px;
  gap: 9px;
  background: transparent;
  border: 1px solid var(--rail-line);
  color: var(--rail-soft);
  font-size: 13px;
}
.btn-side:hover { background: var(--rail-hover); color: #fff; border-color: #343a43; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 30px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar h1 { font-size: 21px; }
.page-sub { margin-top: 4px; font-size: 13.5px; color: var(--ink-soft); }

.content { flex: 1; padding: 22px 30px 40px; min-width: 0; }

/* ── buttons ────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 17px;
  border: none;
  border-radius: var(--r-control);
  font: inherit;
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn .icon { display: flex; }

.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-ink); }

.btn-ghost { background: var(--surface); border: 1px solid var(--border-strong); color: var(--ink); }
.btn-ghost:hover:not(:disabled) { background: var(--hover); }

.btn-danger { background: var(--bad); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }

.btn-danger-ghost { background: var(--surface); border: 1px solid var(--bad-border); color: var(--bad); }
.btn-danger-ghost:hover:not(:disabled) { background: var(--bad-tint); }

.btn-small { height: 34px; padding: 0 13px; font-size: 12.5px; }
.btn-block { width: 100%; height: 46px; font-size: 14.5px; }

.icon-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; border-radius: var(--r-control);
  font-size: 15px; color: var(--ink-faint); cursor: pointer;
}
.icon-btn:hover { background: var(--hover); color: var(--ink); }

/* ── toolbar, filters ───────────────────────────────────────────────────── */

.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; row-gap: 10px; margin-bottom: 14px; flex-wrap: wrap;
}
/* Businesses carries five filters and a search box. They wrap onto a second
   line rather than the last one sliding off the right-hand edge. */
.toolbar-left {
  /* A small basis, so this block can shrink below its content and the action
     button stays on the first line instead of being pushed to a third. */
  flex: 1 1 320px; min-width: 0;
  display: flex; align-items: center; gap: 10px; row-gap: 10px; flex-wrap: wrap;
}
.toolbar-right { display: flex; gap: 10px; flex: none; margin-left: auto; }

/* Picking a restaurant by name beats hoping you spell it the way it was
   entered, so this is a list rather than more typing.
   Two classes on purpose: `.input` sets width:100% further down this file and
   would otherwise win on source order and let the list eat the whole row. */
.toolbar-left .select-business { flex: 0 0 260px; width: 260px; cursor: pointer; }

.search-wrap { position: relative; flex: 0 1 360px; min-width: 220px; max-width: 360px; }
.search-wrap .icon {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--ink-faint); pointer-events: none; display: flex;
}
.search-wrap .search { padding-left: 38px; }

.filters { display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 16px; }
.filter-group { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.filter-label {
  font-size: 11px; font-weight: 800; letter-spacing: 0.6px;
  text-transform: uppercase; color: var(--ink-faint); margin-right: 2px;
}

.chip {
  height: 30px; padding: 0 13px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink-soft);
  cursor: pointer; white-space: nowrap;
}
.chip:hover { border-color: var(--border-strong); color: var(--ink); }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ── inputs ─────────────────────────────────────────────────────────────── */

.input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-control);
  font: inherit;
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  outline: none;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
textarea.input { height: auto; padding: 11px 14px; line-height: 1.55; resize: vertical; }
select.input { cursor: pointer; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field-label { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.field-hint { font-size: 12px; color: var(--ink-faint); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }

/* ── panels and tables ──────────────────────────────────────────────────── */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-panel);
  overflow: hidden;
}

.table-wrap { overflow-x: auto; }

.table { width: 100%; border-collapse: collapse; }

.table th {
  position: sticky; top: 0; z-index: 1;
  padding: 11px 16px;
  background: var(--sunk);
  border-bottom: 1px solid var(--border);
  font-size: 11px; font-weight: 800; letter-spacing: 0.6px;
  text-transform: uppercase; color: var(--ink-faint);
  text-align: left; white-space: nowrap;
}

.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--ink-soft); }
.sort-mark { margin-left: 5px; color: var(--brand); }

.table td { padding: 12px 16px; border-bottom: 1px solid var(--hairline); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover { background: var(--hover); }
.table .right, .table th.right { text-align: right; }

.cell-lead { display: flex; align-items: center; gap: 11px; min-width: 0; }
.cell-title { display: block; font-size: 13.5px; font-weight: 600; }
.cell-sub { display: block; font-size: 12px; color: var(--ink-faint); }
.cell-sub.is-bad { color: var(--bad); font-weight: 600; }
.cell-stack { display: flex; flex-direction: column; }
.cell-clip {
  display: block; max-width: 340px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--ink-soft);
}
.muted { color: var(--ink-ghost); }
.is-ok { color: var(--ok); font-weight: 600; }

.avatar {
  width: 38px; height: 38px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-tint); color: var(--brand-ink);
  border-radius: var(--r-control);
  font-size: 13px; font-weight: 700; letter-spacing: 0.3px;
}
.avatar-small { width: 30px; height: 30px; font-size: 11.5px; border-radius: 7px; }

.pager {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 11px 16px; border-top: 1px solid var(--border); background: var(--sunk);
}
.pager-count { font-size: 12.5px; color: var(--ink-faint); }
.pager-buttons { display: flex; align-items: center; gap: 8px; }
.pager-page { font-size: 12.5px; color: var(--ink-soft); min-width: 54px; text-align: center; }

/* ── badges ─────────────────────────────────────────────────────────────── */

.badge {
  display: inline-flex; align-items: center;
  height: 24px; padding: 0 10px;
  border-radius: var(--r-pill);
  font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
.badge-ok { background: var(--ok-tint); color: var(--ok); }
.badge-warn { background: var(--warn-tint); color: var(--warn-ink); }
.badge-bad { background: var(--bad-tint); color: var(--bad); }
.badge-info { background: var(--info-tint); color: var(--info-ink); }
.badge-brand { background: var(--brand-tint); color: var(--brand-ink); }
.badge-muted { background: var(--hairline); color: var(--ink-soft); }

/* ── overview ───────────────────────────────────────────────────────────── */

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }

.tile {
  padding: 17px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: var(--r-panel);
}
.tile-label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.tile-value { display: block; margin-top: 6px; font-size: 26px; font-weight: 700; letter-spacing: -0.5px; }
.tile-note { display: block; margin-top: 3px; font-size: 12px; color: var(--ink-faint); }
.tile-brand { border-left-color: var(--brand); }
.tile-ok { border-left-color: var(--ok); }
.tile-warn { border-left-color: var(--warn-ink); }
.tile-bad { border-left-color: var(--bad); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-panel);
  padding: 18px 20px 20px;
}
.card-head { margin-bottom: 14px; }
.card-head h3 { font-size: 15px; }
.card-head p { margin-top: 4px; font-size: 12.5px; color: var(--ink-soft); }
.card-empty { font-size: 13px; color: var(--ink-faint); padding: 8px 0; }

.bars { display: flex; flex-direction: column; gap: 11px; }
.bar-row { display: grid; grid-template-columns: 88px 1fr 40px; align-items: center; gap: 12px; }
.bar-label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.bar-track { height: 9px; background: var(--hairline); border-radius: var(--r-pill); overflow: hidden; }
.bar-fill { height: 100%; border-radius: var(--r-pill); min-width: 2px; transition: width 220ms ease; }
.bar-ok { background: var(--ok); }
.bar-warn { background: var(--warn-ink); }
.bar-bad { background: var(--bad); }
/* The tier breakdown uses these three, and a bar with no colour is a bar
   nobody can see. */
.bar-muted { background: var(--ink-ghost); }
.bar-info { background: var(--info-ink); }
.bar-brand { background: var(--brand); }
.bar-value { font-size: 13px; font-weight: 700; text-align: right; }

.mini-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.mini-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 10px 0; border-bottom: 1px solid var(--hairline);
}
.mini-row:last-child { border-bottom: none; }
.mini-title { display: block; font-size: 13.5px; font-weight: 600; }
.mini-sub { display: block; font-size: 12px; color: var(--ink-faint); }
.mini-right { display: flex; align-items: center; gap: 10px; flex: none; }
.mini-flag { font-size: 12.5px; font-weight: 700; color: var(--bad); }

/* ── states ─────────────────────────────────────────────────────────────── */

.state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 64px 28px; text-align: center;
}
.state h3 { font-size: 15.5px; }
.state p { font-size: 13.5px; color: var(--ink-soft); max-width: 460px; line-height: 1.6; }
.state-note {
  margin-top: 6px; padding: 11px 14px;
  background: var(--sunk); border: 1px solid var(--border);
  border-radius: var(--r-control);
  font-size: 12.5px; color: var(--ink-faint); max-width: 560px;
}
.state-mark {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: var(--hairline); border-radius: 50%; color: var(--ink-faint);
}
.state-bad .state-mark { background: var(--bad-tint); color: var(--bad); }
.state-bad h3 { color: var(--bad); }
.state-pending .state-mark { background: var(--warn-tint); color: var(--warn-ink); }
.state-pending h3 { color: var(--warn-ink); }

.spinner {
  width: 26px; height: 26px;
  border: 2.5px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 620ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── dialog ─────────────────────────────────────────────────────────────── */

.backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(21, 24, 29, 0.44);
  display: flex; align-items: center; justify-content: center;
  padding: 28px;
  animation: fade 120ms ease;
}
@keyframes fade { from { opacity: 0; } }

.dialog {
  width: 560px; max-width: 100%; max-height: 88vh;
  display: flex; flex-direction: column;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.dialog.is-busy { pointer-events: none; opacity: 0.75; }

.dialog-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 20px 20px 14px;
}
.dialog-head h2 { font-size: 17px; }
.dialog-head p { margin-top: 3px; font-size: 13px; color: var(--ink-soft); }

.dialog-body { padding: 0 20px 4px; overflow-y: auto; }
.dialog-text { font-size: 13.5px; line-height: 1.65; color: var(--ink-soft); }
.dialog-aside {
  margin-top: 16px; padding: 14px;
  background: var(--sunk); border: 1px solid var(--border); border-radius: var(--r-control);
  display: flex; flex-direction: column; gap: 10px; align-items: flex-start;
}

.dialog-error {
  margin: 12px 20px 0; padding: 10px 13px;
  background: var(--bad-tint); border: 1px solid var(--bad-border);
  border-radius: var(--r-control);
  font-size: 13px; font-weight: 600; color: var(--bad);
}

.dialog-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 18px 20px 20px;
}

/* ── drawer ─────────────────────────────────────────────────────────────── */

.backdrop-drawer { justify-content: flex-end; padding: 0; align-items: stretch; }

.drawer {
  width: 460px; max-width: 100%; height: 100%;
  display: flex; flex-direction: column;
  background: var(--surface);
  box-shadow: -18px 0 46px rgba(21, 24, 29, 0.16);
  overflow-y: auto;
  animation: slide 180ms ease;
}
@keyframes slide { from { transform: translateX(26px); opacity: 0.4; } }
.drawer.is-busy { pointer-events: none; opacity: 0.7; }

.drawer-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: 22px 22px 14px;
}
.drawer-title { display: flex; align-items: center; gap: 13px; min-width: 0; }
.drawer-title h2 { font-size: 18px; }
.drawer-title p { margin-top: 2px; font-size: 12.5px; color: var(--ink-faint); }

.drawer-badges { display: flex; gap: 8px; padding: 0 22px 18px; }

.drawer-section { padding: 18px 22px; border-top: 1px solid var(--hairline); }
.drawer-section h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--ink-faint); }
.drawer-help { margin-top: 5px; font-size: 12.5px; color: var(--ink-soft); }

.choice-row { display: flex; flex-direction: column; gap: 9px; margin-top: 13px; }

.choice {
  position: relative;
  display: flex; flex-direction: column; gap: 3px;
  padding: 12px 40px 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-control);
  font: inherit; text-align: left; cursor: pointer;
}
.choice:hover { border-color: var(--ink-ghost); background: var(--hover); }
.choice-label { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.choice-help { font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; }
.choice-tick { position: absolute; right: 14px; top: 13px; font-weight: 800; }

.choice.is-current { cursor: default; }
.choice-ok.is-current { background: var(--ok-tint); border-color: var(--ok); }
.choice-ok.is-current .choice-tick { color: var(--ok); }
.choice-warn.is-current { background: var(--warn-tint); border-color: var(--warn-border); }
.choice-warn.is-current .choice-tick { color: var(--warn-ink); }
.choice-bad.is-current { background: var(--bad-tint); border-color: var(--bad-border); }
.choice-bad.is-current .choice-tick { color: var(--bad); }

.detail-list { display: flex; flex-direction: column; margin-top: 12px; }
.detail-row {
  display: grid; grid-template-columns: 136px 1fr; gap: 14px; align-items: baseline;
  padding: 8px 0; border-bottom: 1px solid var(--hairline);
}
.detail-row:last-child { border-bottom: none; }
.detail-label { font-size: 12.5px; color: var(--ink-faint); }
.detail-value { font-size: 13.5px; word-break: break-word; }

.drawer-foot {
  margin-top: auto;
  display: flex; gap: 10px;
  padding: 18px 22px;
  border-top: 1px solid var(--border);
  background: var(--sunk);
  position: sticky; bottom: 0;
}

/* ── toasts ─────────────────────────────────────────────────────────────── */

.toasts {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}

.toast {
  padding: 11px 18px;
  border-radius: var(--r-pill);
  font-size: 13px; font-weight: 600; color: #fff;
  background: var(--ink);
  box-shadow: var(--shadow);
  animation: rise 160ms ease;
}
.toast-bad { background: var(--bad); }
.toast-going { opacity: 0; transform: translateY(6px); transition: opacity 240ms, transform 240ms; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }


/* ── filters in the toolbar ─────────────────────────────────────────────── */

/* Two classes on purpose: `.input` sets width:100% further down this file and
   would otherwise win on source order and let one list eat the whole row. */
.toolbar-left .select-filter { flex: 0 0 172px; width: 172px; cursor: pointer; }
.toolbar-left .select-business { flex: 0 0 260px; width: 260px; cursor: pointer; }

.date-range {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.date-range .date-input { width: 170px; }
.date-sep { font-size: 12.5px; color: var(--ink-faint); }

/* ── forms in dialogs ───────────────────────────────────────────────────── */

.form-heading {
  margin: 18px 0 12px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.6px;
  text-transform: uppercase; color: var(--ink-faint);
}
.form-heading:first-child { margin-top: 4px; }

.dialog-aside-row { display: flex; gap: 10px; flex-wrap: wrap; }

.drawer-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

/* ── a ticket's own words, and a log entry's ────────────────────────────── */

.ticket-body {
  padding: 14px 16px; margin-bottom: 18px;
  background: var(--sunk); border: 1px solid var(--border);
  border-radius: var(--r-control);
  font-size: 13.5px; line-height: 1.65; color: var(--ink);
  white-space: pre-wrap; max-height: 220px; overflow-y: auto;
}

.code-block {
  margin: 0; padding: 13px 15px;
  background: var(--rail); color: #e6e8ec;
  border-radius: var(--r-control);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
  max-height: 260px; overflow-y: auto;
}

/* ── a breakdown row that goes somewhere ────────────────────────────────── */

.bar-link { cursor: pointer; border-radius: 6px; padding: 2px 4px; margin: -2px -4px; }
.bar-link:hover { background: var(--hover); }
.bar-link:hover .bar-label { color: var(--ink); }

/* ── a row of plain counts ──────────────────────────────────────────────── */

.count-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.count-cell {
  flex: 1 1 96px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 7px;
  padding: 13px 14px;
  background: var(--sunk); border: 1px solid var(--border);
  border-radius: var(--r-control);
}
.count-value { font-size: 21px; font-weight: 700; letter-spacing: -0.4px; font-variant-numeric: tabular-nums; }

/* The sidebar is taller now, so the tab list scrolls rather than the page. */
.side-foot { flex: none; }

/* A narrow window still gets a usable panel rather than a broken one. */
@media (max-width: 1120px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
