/* unifyaccess store dashboard. A dark forest sidebar with the sections (it slides in on a phone),
   the open section's page beside it. Colours, type, radii and shadows are the tokens below; every
   component uses them, and dark mode only swaps the tokens. */
:root {
  --bg: #f4f6f5;
  --surface: #ffffff;
  --surface-alt: #eff3f1;
  --surface-hover: #f7f9f8;
  --border: #e2e8e5;
  --border-strong: #cfd8d3;
  --text: #0f1a15;
  --muted: #5d6d66;
  --faint: #8a9791;
  --green: #12b76a;
  --green-deep: #0b7a47;
  --green-soft: #e6f6ee;
  /* Buttons and badges with white text on them (5.4:1). */
  --accent: #0b7a47;
  --accent-hover: #09673c;
  --lime: #d4f65c;
  --danger: #d92d20;
  --warning: #b54708;
  --chart-prev: #cfdad4;
  /* Outlook: actual vs projected, one hue (validated: dataviz ordinal check, light and dark) */
  --ol-actual: #0b7a47;
  --ol-projected: #4fc38d;
  --sidebar: #0b1a13;
  --sidebar-hover: rgba(255, 255, 255, 0.06);
  --sidebar-active: rgba(255, 255, 255, 0.1);
  --sidebar-text: #c2d0c9;
  --sidebar-muted: #7d9288;
  --sidebar-w: 256px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 26, 21, 0.05);
  --shadow: 0 1px 3px rgba(15, 26, 21, 0.07), 0 1px 2px rgba(15, 26, 21, 0.04);
  --shadow-lg: 0 18px 44px rgba(15, 26, 21, 0.16);
  --focus: 0 0 0 3px color-mix(in srgb, var(--green) 26%, transparent);
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235d6d66' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0f0d;
    --surface: #111815;
    --surface-alt: #18201c;
    --surface-hover: #151d19;
    --border: #222d28;
    --border-strong: #2e3b35;
    --text: #e8f0ec;
    --muted: #93a29b;
    --faint: #6c7a74;
    --green-soft: #11281d;
    --accent-hover: #0d8a51;
    --danger: #f97066;
    --warning: #fdb022;
    --chart-prev: #2b3833;
    --ol-actual: #3fd08a;
    --ol-projected: #1f7a52;
    --sidebar: #070c0a;
    --shadow-sm: none;
    --shadow: none;
    --shadow-lg: 0 18px 44px rgba(0, 0, 0, 0.55);
    --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2393a29b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 { margin: 0; letter-spacing: -0.012em; font-weight: 650; }
h1 { font-size: 24px; }
h2 { font-size: 16px; }
h3 { font-size: 15px; }
a { color: var(--green-deep); text-underline-offset: 2px; }
@media (prefers-color-scheme: dark) { a { color: var(--green); } }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 4px 0 12px; }
.error { color: var(--danger); font-size: 13.5px; font-weight: 500; margin: 8px 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Icons: the sprite at the top of the page, drawn at the size of the text around them. */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ─── Brand ─────────────────────────────────────────────────────────────── */
.brand { display: flex; align-items: center; gap: 10px; }
.mark { width: 30px; height: 30px; display: block; }
.wordmark { font-weight: 800; font-size: 18px; letter-spacing: -0.5px; }
.wordmark span { color: var(--green); }

/* ─── Controls ──────────────────────────────────────────────────────────── */
input, select, textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover:not(:disabled), select:hover:not(:disabled), textarea:hover:not(:disabled) { border-color: color-mix(in srgb, var(--border-strong) 55%, var(--muted)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: var(--focus); }
select { appearance: none; -webkit-appearance: none; padding-right: 34px; background: var(--surface) var(--select-chevron) no-repeat right 10px center / 16px; }
select:disabled { opacity: 0.7; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }
textarea { resize: vertical; min-height: 44px; line-height: 1.45; }

button {
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.35;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  padding: 8px 14px;
  cursor: pointer;
  color: var(--text);
  background: var(--surface-alt);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, color 0.15s;
}
/* Plain buttons only, and below any component's own rules (calendar days, cards, the sidebar,
   segmented controls), which keep their look on hover. */
:where(button:not([class])):hover:not(:disabled) { background: color-mix(in srgb, var(--surface-alt) 70%, var(--border-strong)); }
button:focus-visible { outline: none; box-shadow: var(--focus); }
button:disabled { opacity: 0.5; cursor: default; }
button.primary, button.ghost, button.danger, button.small, .icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
button.primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.08); }
button.primary:hover:not(:disabled) { background: var(--accent-hover); }
button.ghost { background: var(--surface); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
button.ghost:hover:not(:disabled) { background: var(--surface-hover); border-color: color-mix(in srgb, var(--border-strong) 55%, var(--muted)); }
button.danger { background: var(--surface); border-color: var(--border-strong); color: var(--danger); box-shadow: var(--shadow-sm); }
button.danger:hover:not(:disabled) { background: color-mix(in srgb, var(--danger) 7%, var(--surface)); border-color: color-mix(in srgb, var(--danger) 35%, var(--border-strong)); }
button.small { padding: 6px 11px; font-size: 13px; border-radius: 9px; }
button.small .ico { width: 16px; height: 16px; }
button.icon { width: 32px; height: 32px; padding: 0; font-size: 18px; line-height: 1; }
button.block { width: 100%; }
.icon-btn { width: 36px; height: 36px; padding: 0; flex: none; border: 0; border-radius: 9px; background: transparent; color: var(--muted); }
.icon-btn:hover:not(:disabled) { background: var(--surface-alt); color: var(--text); }

.field { display: grid; gap: 6px; margin-bottom: 14px; font-weight: 600; font-size: 13.5px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 14px; }
.check input { width: auto; }
.row-inline { display: flex; gap: 8px; align-items: center; }
.row-inline input { min-width: 0; }

.segmented { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: var(--surface-alt); border: 1px solid var(--border); border-radius: 11px; }
.segmented button { background: transparent; border: 0; padding: 6px 12px; font-size: 13.5px; border-radius: 8px; color: var(--muted); }
.segmented button:not([aria-pressed="true"]):hover:not(:disabled) { background: transparent; color: var(--text); }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(15, 26, 21, 0.1), 0 0 0 1px var(--border); }
.segmented.small button { padding: 4px 10px; font-size: 13px; }

/* ─── Sign in ───────────────────────────────────────────────────────────── */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.login-aside {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  padding: 40px 56px;
  color: #dbe7e1;
  background:
    radial-gradient(70% 55% at 85% 100%, rgba(18, 183, 106, 0.32), transparent 70%),
    radial-gradient(45% 40% at 0% 0%, rgba(212, 246, 92, 0.12), transparent 70%),
    var(--sidebar);
}
.login-aside .wordmark { color: #fff; }
.login-pitch { max-width: 440px; }
.login-pitch h2 { font-size: 36px; line-height: 1.12; letter-spacing: -0.025em; font-weight: 750; color: #fff; }
.login-pitch p { margin: 14px 0 22px; font-size: 16px; line-height: 1.55; color: #b4c6bd; }
.login-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.login-points li { position: relative; padding-left: 30px; font-weight: 500; color: #e6efea; }
.login-points li::before { content: "✓"; position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: rgba(212, 246, 92, 0.16); color: var(--lime); font-size: 11px; font-weight: 800; }
.login-foot { margin: 0; font-size: 12.5px; color: #7d9288; }
.login-main { display: grid; place-items: center; padding: 40px 24px; }
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 34px 30px 26px;
  box-shadow: var(--shadow-lg);
}
.login-card-brand { display: none; margin-bottom: 22px; }
.login-card h1 { font-size: 26px; letter-spacing: -0.02em; margin-bottom: 4px; }
.login-card .muted { margin: 0 0 22px; }
.login-card .hint { margin: 16px 0 0; }
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login-aside { display: none; }
  .login-card-brand { display: flex; }
  .login-main { padding: 24px 16px; }
  .login-card { padding: 28px 22px 22px; box-shadow: var(--shadow); }
}

/* ─── Shell: the sidebar, and the page with its header ──────────────────── */
.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  background: var(--sidebar);
  color: var(--sidebar-text);
  color-scheme: dark;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 18px 16px 14px 20px; }
.sidebar .wordmark { color: #fff; }
.sidebar .icon-btn { color: var(--sidebar-muted); }
.sidebar .icon-btn:hover:not(:disabled) { background: var(--sidebar-hover); color: #fff; }
.nav-close { display: none; }

.store-picker { display: block; margin: 2px 14px 12px; }
.store-picker-label { display: block; margin: 0 4px 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--sidebar-muted); }
.store-picker-box { position: relative; display: flex; align-items: center; }
.store-picker-box .ico { position: absolute; left: 11px; width: 16px; height: 16px; color: var(--sidebar-muted); pointer-events: none; }
.store-picker-box .ico.chev { left: auto; right: 10px; }
.store-picker select {
  padding: 9px 32px 9px 35px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-weight: 600;
  font-size: 13.5px;
}
.store-picker select:hover:not(:disabled) { border-color: rgba(255, 255, 255, 0.2); }
.store-picker select:disabled { opacity: 1; cursor: default; }
.store-picker select:disabled + .chev { display: none; }

.tabs { flex: 1; overflow-y: auto; padding: 4px 12px 16px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.15) transparent; }
.nav-group + .nav-group { margin-top: 16px; }
.nav-label { margin: 0 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--sidebar-muted); }
.tabs button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  margin: 1px 0;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--sidebar-text);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
}
.tabs button .ico { color: var(--sidebar-muted); transition: color 0.15s; }
.tabs button:not([aria-selected="true"]):hover:not(:disabled) { background: var(--sidebar-hover); color: #fff; }
.tabs button:hover .ico { color: #d9e5df; }
.tabs button[aria-selected="true"] { background: var(--sidebar-active); color: #fff; font-weight: 600; }
.tabs button[aria-selected="true"] .ico { color: var(--green); }
.tabs button[aria-selected="true"]::before { content: ""; position: absolute; left: -12px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--green); }
.tabs button:focus-visible { box-shadow: inset 0 0 0 2px var(--green); }
.tab-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sidebar-foot { display: flex; align-items: center; gap: 10px; padding: 12px 12px 14px 16px; border-top: 1px solid rgba(255, 255, 255, 0.07); }
.avatar { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #1d3a2c; color: var(--lime); font-size: 12px; font-weight: 750; letter-spacing: 0.02em; }
.user-name { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; color: #e3ece7; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { margin-left: var(--sidebar-w); min-width: 0; min-height: 100vh; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 66px;
  padding: 12px 32px;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.page-title { flex: 1; min-width: 0; }
.page-title h1 { font-size: 19px; font-weight: 700; letter-spacing: -0.018em; line-height: 1.25; }
.page-title p { margin: 1px 0 0; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-title p:empty { display: none; }
.nav-open { display: none; position: relative; }
.nav-open.alert::after { content: ""; position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px var(--bg); }
.scrim { position: fixed; inset: 0; z-index: 35; background: rgba(5, 12, 9, 0.5); backdrop-filter: blur(2px); }

.content { max-width: 1240px; margin: 0 auto; padding: 24px 32px 72px; }
.tab { display: grid; gap: 18px; }
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.section-head input[type="search"] { max-width: 320px; }

/* Tablets and phones: the sidebar is a menu that slides in over the page. */
@media (max-width: 1024px) {
  .sidebar { width: min(296px, 86vw); transform: translateX(-102%); transition: transform 0.22s ease; }
  body.nav-open { overflow: hidden; }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .nav-close { display: inline-flex; }
  .main { margin-left: 0; }
  .nav-open { display: inline-flex; margin-left: -6px; }
  .topbar { min-height: 60px; padding: 10px 20px; }
  .content { padding: 20px 20px 64px; }
}
@media (max-width: 640px) {
  .topbar { gap: 8px; padding: 8px 12px; }
  .page-title h1 { font-size: 17px; }
  .page-title p { font-size: 12px; }
  #unlock-btn { padding: 8px 10px; }
  #unlock-btn span { display: none; }
  .content { padding: 16px 14px 56px; }
}

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow-sm); }
.card.flush { padding: 0; overflow: hidden; }
.card h2 { font-size: 15.5px; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head .hint { margin-bottom: 0; }
.note { background: var(--green-soft); border: 1px solid color-mix(in srgb, var(--green) 22%, transparent); border-radius: 12px; padding: 12px 16px; margin: 0; font-size: 14px; }
@media (max-width: 640px) { .card { padding: 16px; } }

/* ─── Overview ──────────────────────────────────────────────────────────── */
.period-nav { display: flex; align-items: center; gap: 10px; }
.period-nav strong { min-width: 180px; text-align: center; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.kpi { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.kpi .label, .mini .label { color: var(--muted); font-size: 13px; font-weight: 600; padding-right: 4px; }
.kpi .label > .stat-action, .mini-actions { position: absolute; top: 8px; right: 8px; }
.kpi .value { font-size: 28px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; margin: 6px 0 5px; }
.kpi .change, .mini .change { font-size: 13px; font-weight: 600; }
.change.up { color: var(--green-deep); }
.change.down { color: var(--danger); }
.change.flat { color: var(--muted); }
@media (prefers-color-scheme: dark) { .change.up { color: var(--green); } }

.stat-action { width: 26px; height: 26px; padding: 0; display: inline-grid; place-items: center; font-size: 12px; color: var(--muted); opacity: 0; transition: opacity 0.15s; }
.stat-action svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.stat-action.on { color: var(--green-deep); }
.stat-action.on svg { fill: currentColor; }
.kpi:hover .stat-action, .mini:hover .stat-action, .stat-action:focus-visible { opacity: 1; }
@media (hover: none) { .stat-action { opacity: 1; } }
.mini-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.mini { position: relative; border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px; }
.mini .value { font-size: 18px; font-weight: 700; letter-spacing: -0.015em; margin: 2px 0; }
.mini .change { font-size: 12px; }
.mini-actions { display: inline-flex; gap: 2px; background: var(--surface); border-radius: 8px; }
.stats-panel { border: 1px solid var(--border); background: var(--surface-alt); border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0 24px; }
.stats-panel > p, .stats-panel > button { grid-column: 1 / -1; }
.stats-panel p { margin: 0 0 6px; font-size: 13px; }
.stats-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 16px; align-items: center; font-size: 14px; padding: 4px 0; border-bottom: 1px solid var(--border); }
.stats-row label { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; cursor: pointer; }
.stats-panel > button { justify-self: start; margin-top: 6px; }

.chart-sub { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.chart-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.chart { height: 260px; position: relative; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart .bar { fill: var(--green); transition: opacity 0.1s; }
.chart .bar.prev { fill: var(--chart-prev); }
.chart .bar.active { fill: var(--green-deep); }
.chart .line { fill: none; stroke: var(--green); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .line.prev { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 4 4; opacity: 0.7; }
.chart .area { fill: url(#area-fill); }
.chart .area-stop-top { stop-color: var(--green); stop-opacity: 0.28; }
.chart .area-stop-bottom { stop-color: var(--green); stop-opacity: 0; }
.chart .dot { fill: var(--surface); stroke: var(--green); stroke-width: 2; }
.chart .guide { stroke: var(--muted); stroke-dasharray: 3 3; opacity: 0.6; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .grid-line { stroke: var(--border); }
.chart .grid-line.base { stroke: var(--muted); opacity: 0.4; }
.chart-tip { position: absolute; top: -6px; transform: translate(-50%, -100%); background: var(--surface); border: 1px solid var(--border); box-shadow: 0 8px 24px rgba(12, 42, 29, 0.14); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; white-space: nowrap; pointer-events: none; z-index: 2; display: grid; gap: 2px; font-variant-numeric: tabular-nums; }
.chart-tip[hidden] { display: none; }
.chart-tip strong { font-size: 12px; }
.legend { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin: 10px 0 0; }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.swatch.cur { background: var(--green); }
.swatch.prev { background: var(--chart-prev); }
.legend .swatch.prev { margin-left: 10px; }

.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)) minmax(0, 0.9fr); grid-template-rows: auto; grid-auto-rows: minmax(74px, auto); gap: 6px; }
.calendar > .cal-dow { min-height: 0; align-self: end; }
.cal-dow { font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; padding-bottom: 2px; }
.cal-day { position: relative; min-height: 74px; border-radius: 12px; border: 1px solid var(--border); padding: 7px 8px; text-align: left; display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; gap: 1px; font: inherit; color: var(--text); cursor: pointer;
  background: color-mix(in srgb, var(--green) calc(var(--heat, 0%) * 0.5), var(--surface)); }
.cal-day:not(.future):not(.blank):hover { border-color: var(--green); }
.cal-day:focus-visible { outline: 2px solid var(--green); outline-offset: 1px; }
.cal-day.blank { border: none; background: none; cursor: default; }
.cal-day.future { background: var(--surface-alt); opacity: 0.55; cursor: default; }
.cal-day.zero .cal-val { color: var(--muted); font-weight: 600; }
.cal-day.today { border: 2px solid var(--green); padding: 6px 7px; }
.cal-day.selected { outline: 2px solid var(--text); outline-offset: 1px; }
.cal-num { font-size: 12px; color: var(--muted); font-weight: 600; }
.cal-val { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-sub { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-week { border-radius: 12px; background: var(--surface-alt); display: grid; place-items: center; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; min-height: 74px; }
.cal-loading { grid-column: 1 / -1; text-align: center; padding: 40px 0; }
.cal-foot { margin: 12px 0 0; font-size: 13px; color: var(--muted); }

/* ─── Lists (events, team) ──────────────────────────────────────────────── */
.list { display: grid; gap: 8px; }
.item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 10px 14px 10px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  text-align: left;
  width: 100%;
  font-weight: 400;
}
button.item:hover:not(:disabled) { background: var(--surface); border-color: color-mix(in srgb, var(--green) 55%, var(--border)); box-shadow: var(--shadow); }
.thumb { width: 64px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--surface-alt); display: grid; place-items: center; color: var(--muted); font-size: 20px; }
.item .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .sub { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .amount { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.item .amount small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; line-height: 1.45; background: var(--surface-alt); color: var(--muted); box-shadow: inset 0 0 0 1px var(--border); }
.pill.green { background: var(--green-soft); color: var(--green-deep); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--green) 25%, transparent); }
.pill.red { background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 25%, transparent); }
.pill.amber { background: color-mix(in srgb, var(--warning) 11%, transparent); color: var(--warning); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warning) 25%, transparent); }
@media (prefers-color-scheme: dark) { .pill.green { color: var(--green); } }
button.spaced { margin-left: 8px; }
.empty { text-align: center; color: var(--muted); padding: 44px 16px; }

/* ─── Stock table ───────────────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--surface-alt); white-space: nowrap; }
.table td { padding: 11px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:hover td { background: var(--surface-hover); }
.table tr:last-child td { border-bottom: none; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table .prod { display: flex; align-items: center; gap: 10px; }
.table .prod img, .table .prod .ph { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; background: var(--surface-alt); flex: none; }
.table .sub { color: var(--muted); font-size: 12px; }
/* Customers: long names and emails wrap so the table fits a phone */
#customer-table td:first-child { overflow-wrap: anywhere; }
#customer-table .pill { white-space: nowrap; }
#customer-table .sub a { color: inherit; }
@media (max-width: 400px) { #customer-table th, #customer-table td { padding: 10px 8px; } }

/* Points: the rates and prices sit under their switch's text; long names and emails wrap */
.rewards { display: grid; gap: 16px; }
.rewards-rates { margin: -8px 0 18px 58px; color: var(--muted); font-size: 13px; }
#rewards-prices { margin-left: 58px; }
@media (max-width: 640px) { .rewards-rates, #rewards-prices { margin-left: 0; } }
#rewards-table td:nth-child(2) { overflow-wrap: anywhere; }
#rewards-table .sub a { color: inherit; }
#rewards-table .rank { width: 1%; color: var(--muted); font-weight: 700; }
#rewards-table .pill { white-space: nowrap; }
@media (max-width: 400px) { #rewards-table th, #rewards-table td { padding: 10px 8px; } }
#top-table td:nth-child(2) { overflow-wrap: anywhere; }
#top-table .rank { width: 1%; color: var(--muted); font-weight: 700; }
#top-table th.num { white-space: nowrap; }
@media (max-width: 400px) { #top-table th, #top-table td { padding: 10px 8px; } }

/* ─── Cameras ───────────────────────────────────────────────────────────── */
.status-line { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 600; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.on { background: var(--green); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.cam { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.cam .frame { position: relative; aspect-ratio: 16 / 9; background: #000; cursor: pointer; }
.cam .frame img,
.cam .frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.cam .frame img[hidden] { display: none; }
.cam .frame video { opacity: 0; transition: opacity 0.3s; }
.cam.playing .frame video { opacity: 1; }
.cam .frame .video-status { font-size: 13px; padding: 8px 12px; }
.cam .frame .video-status:empty { display: none; }
.cam .meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; }
.cam .meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dori { border-top: 1px solid var(--border); padding: 8px 12px 10px; font-size: 13px; }
.dori summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.dori-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.dori-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 4px 0; }
.dori-table td { padding: 5px 0; border-top: 1px solid var(--border); vertical-align: top; }
.dori-table td small { display: block; color: var(--muted); font-size: 11px; }
.dori-table .num { text-align: right; padding-left: 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dori .hint { margin: 8px 0 0; font-size: 12px; }

/* ─── Dialogs ───────────────────────────────────────────────────────────── */
dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}
dialog.wide { width: min(1000px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(7, 14, 10, 0.5); backdrop-filter: blur(4px); }
.dialog-head h2 { font-size: 17px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.detail-photos { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; margin-bottom: 14px; }
.detail-photos img { width: 100%; border-radius: 12px; object-fit: cover; aspect-ratio: 4 / 3; background: var(--surface-alt); }
.replay-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.replay-card { display: flex; flex-direction: column; text-align: left; padding: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; box-shadow: var(--shadow); }
.replay-card:hover { border-color: var(--green); }
.replay-thumb { position: relative; aspect-ratio: 16 / 9; background: #000; }
.replay-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.replay-thumb .play { position: absolute; inset: 0; margin: auto; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 16px; }
.replay-thumb .duration { position: absolute; right: 8px; bottom: 8px; padding: 1px 6px; border-radius: 6px; background: rgba(0, 0, 0, 0.7); color: #fff; font-size: 12px; font-variant-numeric: tabular-nums; }
.replay-info { padding: 10px 12px 12px; display: grid; gap: 3px; min-width: 0; }
.replay-info .title { font-weight: 700; }
.replay-info .sub { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.replay.flush { margin-top: 0; padding-top: 0; border-top: 0; margin-bottom: 14px; }
.replay { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.replay h3 { margin: 0 0 4px; font-size: 16px; }
.replay-stage { position: relative; margin-top: 8px; border-radius: 12px; overflow: hidden; background: #000; container-type: inline-size; }
.replay-frame { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: #000; }
.replay-stage:fullscreen { border-radius: 0; display: flex; align-items: center; }
.replay-stage:fullscreen .replay-frame { height: 100%; aspect-ratio: auto; }

/* Overlays over the replay: clock, basket with running total, scan pop-up, PAID stamp */
.ov { position: absolute; inset: 0; pointer-events: none; color: #fff; font-size: clamp(10px, 1.55cqw, 17px); line-height: 1.3; }
.ov[hidden] { display: none; }
.ov-stamp { position: absolute; left: 2.2cqw; top: 2cqw; padding: 0.3em 0.7em; border-radius: 0.5em; background: rgba(0, 0, 0, 0.6); font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: 0.02em; }
.ov-basket { position: absolute; right: 2cqw; top: 2cqw; width: 36%; max-height: calc(100% - 4cqw); display: flex; flex-direction: column; border-radius: 0.8em; background: rgba(8, 14, 11, 0.72); backdrop-filter: blur(4px); overflow: hidden; }
.ov-head { padding: 0.55em 0.8em 0.35em; font-size: 0.78em; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--lime, #d4f65c); }
.ov-lines { padding: 0 0.8em; display: grid; gap: 0.15em; overflow: hidden; }
.ov-line { display: grid; grid-template-columns: auto 1fr auto; gap: 0.5em; padding: 0.18em 0.3em; margin: 0 -0.3em; border-radius: 0.35em; font-variant-numeric: tabular-nums; transition: background 0.4s; }
.ov-line .q { color: #b7c9c0; }
.ov-line .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-line.fresh { background: rgba(18, 183, 106, 0.45); }
.ov-empty, .ov-more { color: #b7c9c0; font-size: 0.9em; padding: 0.2em 0; }
.ov-totals { margin-top: 0.45em; padding: 0.5em 0.8em 0.6em; border-top: 1px solid rgba(255, 255, 255, 0.18); display: grid; gap: 0.2em; font-variant-numeric: tabular-nums; }
.ov-totals > div { display: flex; justify-content: space-between; gap: 0.6em; }
.ov-totals b { font-size: 1.15em; }
.ov-tax { color: #b7c9c0; font-size: 0.9em; }
.ov-total b { color: var(--lime, #d4f65c); }
.ov-pop { position: absolute; left: 2.2cqw; bottom: 2.2cqw; max-width: 55%; display: grid; gap: 0.1em; padding: 0.6em 0.9em; border-radius: 0.8em; background: rgba(8, 14, 11, 0.8); border-left: 0.35em solid #12b76a; animation: ov-in 0.25s ease-out; }
.ov-pop[hidden] { display: none; }
.ov-pop b { font-size: 0.82em; letter-spacing: 0.04em; text-transform: uppercase; color: #7ee2b0; }
.ov-pop .name { font-size: 1.25em; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-pop.voided { border-left-color: #ff6369; }
.ov-pop.voided b { color: #ff9a9e; }
.ov-pop.sale { border-left-color: #d4f65c; }
.ov-pop.sale b { color: #d4f65c; }
.ov-pop.sale span { font-size: 1.4em; font-weight: 800; }
.ov-pop.paying { border-left-color: #6ea8ff; }
.ov-pop.paying b { color: #a9c9ff; }
.ov-pop.paying span { font-size: 1.4em; font-weight: 800; }
.ov-pop.payfail { border-left-color: #f5a524; max-width: 70%; }
.ov-pop.payfail b { color: #ffc861; }
.ov-pop.payfail .name { white-space: normal; }
.ov-head { display: flex; justify-content: space-between; align-items: center; }
.ov-paid { padding: 0.1em 0.55em; border-radius: 1em; background: #d4f65c; color: #0b1410; letter-spacing: 0.04em; }
.ov-paid[hidden] { display: none; }
@keyframes ov-in { from { opacity: 0; transform: translateY(0.6em); } to { opacity: 1; transform: none; } }
.replay-controls { flex-wrap: wrap; }
.replay-track { position: relative; margin-top: 10px; }
.replay-slider { width: 100%; accent-color: var(--green); margin: 0; }
.replay-ticks { position: relative; height: 8px; pointer-events: none; }
.replay-ticks .tick { position: absolute; top: 0; width: 3px; height: 8px; margin-left: -1px; border-radius: 2px; background: var(--green); }
.replay-ticks .tick.item_voided { background: var(--danger); }
.replay-ticks .tick.sale { background: var(--text); }
.replay-ticks .tick.payment_started { background: #4f8cf7; }
.replay-ticks .tick.payment_failed { background: var(--warning); }
.replay-markers .marker.payment_failed { color: var(--warning); font-weight: 600; }
.replay-controls { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.replay-time { margin-left: auto; font-variant-numeric: tabular-nums; font-size: 13px; }
.replay-markers { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; max-height: 180px; overflow: auto; }
.replay-markers .marker { text-align: left; background: none; border: 0; padding: 5px 6px; border-radius: 8px; color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.replay-markers .marker:hover { background: var(--surface-alt); }
.receipt { width: 100%; border-collapse: collapse; font-size: 14px; }
.receipt td { padding: 6px 0; border-bottom: 1px dashed var(--border); }
.receipt td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.receipt tr.voided td { color: var(--muted); text-decoration: line-through; }
.receipt tr.total td { font-weight: 800; border-bottom: none; padding-top: 10px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; font-size: 14px; margin: 0 0 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.video-wrap { position: relative; background: #000; border-radius: 14px; overflow: hidden; aspect-ratio: 16 / 9; }
.video-wrap video { width: 100%; height: 100%; object-fit: contain; display: block; }
.video-status { position: absolute; inset: auto 0 0 0; margin: 0; padding: 10px 14px; color: #fff; font-size: 14px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.6)); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 11px 18px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  z-index: 60;
  max-width: calc(100vw - 32px);
  box-shadow: var(--shadow-lg);
}

/* ─── Branding ──────────────────────────────────────────────────────────── */
.branding { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr); gap: 16px; align-items: start; }
.branding-form h2, .branding-side h2 { margin-bottom: 12px; }
.branding-side { display: grid; gap: 16px; }
.color-picker { width: 46px; height: 42px; padding: 3px; flex: none; cursor: pointer; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.swatches button { width: 26px; height: 26px; padding: 0; border-radius: 8px; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border); }
.swatches button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--text); }
.pic-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.pic { background: var(--surface-alt) center / cover no-repeat; border: 1px solid var(--border); display: grid; place-items: center; color: var(--muted); font-size: 12px; flex: none; }
.pic.logo { width: 72px; height: 72px; border-radius: var(--radius); background-size: contain; background-color: var(--surface); }
.pic.cover { width: 128px; height: 72px; border-radius: 12px; }
.pic-actions { display: grid; gap: 6px; justify-items: start; max-width: 320px; }
.file-btn { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 10px; padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer; }
.file-btn:hover { background: var(--surface-alt); }
.row-inline.wrap { flex-wrap: wrap; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.phone { width: 230px; height: 440px; margin: 0 auto; border-radius: 32px; border: 8px solid #101614; overflow: hidden; position: relative; background: #07130e; color: #fff; display: flex; flex-direction: column; justify-content: flex-end; }
.phone .cover { position: absolute; inset: 0; background: center / cover no-repeat; opacity: 0.55; }
.phone .shade { position: absolute; inset: 0; background: linear-gradient(transparent 20%, rgba(7, 19, 14, 0.92) 72%); }
.phone .content { position: relative; padding: 18px 16px 20px; display: grid; gap: 8px; }
.phone .logo { width: 54px; height: 54px; border-radius: 12px; background: #fff center / contain no-repeat; display: grid; place-items: center; font-weight: 800; font-size: 22px; color: #07130e; }
.phone .name { font-size: 20px; font-weight: 800; letter-spacing: -0.4px; }
.phone .tag { font-size: 12.5px; opacity: 0.8; }
.phone .btn { border-radius: 12px; padding: 10px; text-align: center; font-weight: 700; font-size: 13px; }
.phone .btn.primary { color: #fff; }
.phone .btn.ghost { border: 1px solid rgba(255, 255, 255, 0.35); }
.phone .powered { font-size: 10.5px; text-align: center; opacity: 0.6; }
.qr-box { display: grid; place-items: center; padding: 8px; background: #fff; border-radius: 14px; width: 180px; margin: 0 auto 12px; }
.qr-box svg { width: 164px; height: 164px; display: block; }
#branding-link { flex: 1; min-width: 200px; }
@media (max-width: 900px) { .branding { grid-template-columns: 1fr; } }

/* ─── Sales & events: date picker and grid ─────────────────────────────── */
.event-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.event-dates { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.event-dates select { width: auto; padding: 7px 10px; }
.event-dates input[type="date"] { width: auto; padding: 6px 10px; }
.event-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.ev-hour { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 8px; margin: 10px 2px 0; font-weight: 700; font-size: 14px; }
.ev-hour:first-child { margin-top: 0; }
.ev-hour span { color: var(--muted); font-weight: 500; font-size: 13px; }
.ev-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; text-align: left; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; font-weight: 400; cursor: pointer; box-shadow: var(--shadow); }
.ev-card:hover, .ev-card:focus-visible { border-color: var(--green); }
.ev-shot { position: relative; aspect-ratio: 16 / 10; background: #1b2420; display: grid; place-items: center; color: rgba(255, 255, 255, 0.45); font-size: 28px; }
.ev-shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ev-badge { position: absolute; top: 8px; padding: 2px 8px; border-radius: 8px; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 12px; font-weight: 700; }
.ev-badge.time { left: 8px; font-variant-numeric: tabular-nums; }
.ev-badge.kind { right: 8px; }
.ev-info { padding: 10px 12px 12px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; min-width: 0; }
.ev-title { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-weight: 800; }
.ev-sub { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-hist .card-head { margin-bottom: 4px; }
.ev-hist-chart { height: 170px; }
.ev-hist-chart .bar { cursor: pointer; }
.ev-hist-chart .prev-area { fill: var(--chart-prev); opacity: 0.55; }
.ev-hist-chart .prev-line { fill: none; stroke: var(--muted); stroke-width: 1.5; opacity: 0.6; }
.ev-hist-chart .now-line { stroke: var(--danger); stroke-width: 1.5; }
.ev-hist-chart .now-label { fill: var(--danger); font-size: 11px; font-weight: 700; }
.ev-hist.collapsed #event-hist-body { display: none; }
.ev-hist.collapsed .card-head { margin-bottom: 0; }
#event-type button .count { margin-left: 5px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
#event-type button .chg { margin-left: 4px; font-size: 12px; font-weight: 600; }
#event-type button .chg.up { color: var(--green-deep); }
#event-type button .chg.down { color: var(--danger); }
.ev-hour.flash { animation: ev-flash 1.2s ease-out; border-radius: 8px; }
@keyframes ev-flash { from { background: var(--green-soft); } to { background: transparent; } }
.ev-play { position: absolute; right: 8px; bottom: 8px; padding: 3px 9px; border-radius: 8px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 800; }
.ev-badge.term { left: 8px; top: auto; bottom: 8px; }
.ev-receipt { margin: 6px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--surface-alt); font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11.5px; line-height: 1.45; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; min-width: 0; overflow: hidden; }
.ev-receipt .ln { min-width: 0; }
.ev-receipt .ln { display: flex; justify-content: space-between; gap: 8px; }
.ev-receipt .ln span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-receipt .ln span:last-child { flex: none; font-variant-numeric: tabular-nums; }
.ev-receipt .void { text-decoration: line-through; color: var(--muted); }
.ev-receipt .disc { color: var(--green-deep); }
.ev-receipt .more { color: var(--muted); }
.ev-receipt .tot { border-top: 1px dashed var(--border); margin-top: 3px; padding-top: 3px; font-weight: 700; }
@media (max-width: 560px) { .event-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .ev-info { padding: 8px 10px 10px; } .ev-receipt { display: none; } }

/* ─── Outlook ───────────────────────────────────────────────────────────── */
.chart.short { height: 200px; }
.chart.is-empty { height: auto; }
.chart .ol-bar.actual { fill: var(--ol-actual); }
.chart .ol-bar.projected { fill: var(--ol-projected); }
.chart .ol-bar.active { opacity: 0.8; }
.chart .ol-range { stroke: var(--muted); stroke-width: 1.5; stroke-linecap: round; }
.chart .ol-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .ol-line.actual { stroke: var(--ol-actual); }
.chart .ol-line.projected { stroke: var(--ol-projected); stroke-dasharray: 5 4; }
.chart .ol-band { fill: var(--ol-projected); opacity: 0.16; }
.chart .ol-dot { fill: var(--ol-actual); stroke: var(--surface); stroke-width: 2; }
.chart .ol-label { fill: var(--text); font-size: 12px; font-weight: 700; }
.chart .ol-today { stroke: var(--muted); opacity: 0.5; }
.swatch.ol-actual { background: var(--ol-actual); }
.swatch.ol-projected { background: var(--ol-projected); margin-left: 10px; }
.swatch.ol-band { background: color-mix(in srgb, var(--ol-projected) 30%, transparent); margin-left: 10px; }
.key-line { display: inline-block; width: 16px; height: 0; border-top: 2px solid var(--ol-actual); vertical-align: middle; }
.key-line.ol-projected { border-top: 2px dashed var(--ol-projected); margin-left: 10px; }
.key-range { display: inline-block; width: 2px; height: 12px; background: var(--muted); margin-left: 12px; vertical-align: middle; border-radius: 1px; }
.outlook-empty { text-align: center; padding: 36px 24px; color: var(--muted); }
.outlook-empty strong { display: block; color: var(--text); font-size: 17px; margin-bottom: 6px; }
.outlook-table { margin-top: 10px; font-size: 14px; }
.outlook-table summary { cursor: pointer; color: var(--green-deep); font-weight: 600; }
.outlook-table .table-wrap { overflow-x: auto; margin-top: 10px; }
.outlook-table td.num, .outlook-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.kpi .range { color: var(--muted); font-size: 13px; }
.outlook-how { max-width: 780px; }

/* ─── Days left out of the stats ────────────────────────────────────────── */
.excluded-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border-radius: 14px; background: var(--surface-alt); color: var(--muted); font-size: 14px; }
.excluded-row.on { background: color-mix(in srgb, var(--warning) 14%, var(--surface)); color: var(--text); }
.cal-day.excluded { background: repeating-linear-gradient(135deg, var(--surface-alt) 0 6px, transparent 6px 12px); }
.cal-day.excluded .cal-val { color: var(--muted); font-size: 12px; font-weight: 600; }

/* ─── Store terms ───────────────────────────────────────────────────────── */
.terms-banner { margin: 16px 32px 0; padding: 11px 16px; border-radius: 12px; background: color-mix(in srgb, var(--warning) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warning) 28%, transparent); font-size: 14px; }
@media (max-width: 1024px) { .terms-banner { margin: 14px 20px 0; } }
@media (max-width: 640px) { .terms-banner { margin: 12px 14px 0; } }
#store-terms { width: min(620px, calc(100vw - 32px)); }
#store-terms p { margin: 0 0 12px; }
.terms-points { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; }
#store-terms .check { align-items: flex-start; }
#store-terms .check input { margin-top: 4px; }

/* ─── Flagged sales and visits ──────────────────────────────────────────── */
.tab-count { display: inline-block; min-width: 18px; margin-left: 4px; padding: 0 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; vertical-align: 1px; }
.flag-box { border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; margin: 0 0 14px; background: var(--surface); }
.flag-box.flagged { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); background: color-mix(in srgb, var(--danger) 4%, var(--surface)); }
.flag-box.flagged.cleared { border-color: var(--border); background: var(--surface); }
.flag-box h3 { font-size: 15px; }
.flag-box .hint { margin: 4px 0 8px; }
.flag-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.flag-reasons { margin: 2px 0 12px; }
.flag-thread { display: grid; gap: 10px; margin: 6px 0 12px; }
.flag-by { font-size: 13px; }
.flag-comment p { margin: 2px 0 0; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.flag-event { margin: 0; font-size: 13px; color: var(--muted); font-style: italic; }
.flag-reply { display: flex; gap: 8px; align-items: flex-end; }
.flag-reply textarea { flex: 1; min-width: 0; }
.flag-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.flag-item .sub + .sub { margin-top: 1px; }

/* ─── Small screens ─────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calendar { grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: minmax(54px, auto); gap: 4px; }
  .calendar .wk { display: none; }
}
@media (max-width: 640px) {
  .section-head input[type="search"] { max-width: none; }
  .period-nav strong { min-width: 0; }
  .kpi .value { font-size: 22px; }
  .stat-action { opacity: 1; }
  .cal-day { min-height: 54px; padding: 4px 3px; border-radius: 9px; }
  .cal-day.today { padding: 3px 2px; }
  .cal-val { font-size: 11px; letter-spacing: -0.4px; text-overflow: clip; }
  .cal-day.zero .cal-val { visibility: hidden; }
  .mini-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .mini { padding: 34px 10px 10px; }
  .mini .value { font-size: 16px; }
  .cal-sub { display: none; }
  .stats-row { grid-template-columns: 1fr auto; gap: 4px 12px; }
  .stats-row > span { grid-column: 1 / -1; }
  .item { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 10px; }
  .thumb { width: 48px; height: 40px; }
  .table .hide-sm { display: none; }
  .detail-photos { grid-template-columns: 1fr; }
}

/* ─── Scanning and the product form ─────────────────────────────────────── */
.scan-card { padding: 16px 18px; }
.scan-card .hint { margin-bottom: 0; }
.scan-icon { flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--green-soft); display: grid; place-items: center; }
.scan-icon svg { width: 22px; height: 22px; fill: none; stroke: var(--green-deep); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#scan-input { font-size: 16px; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover td { background: var(--surface-alt); }
.product-top { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; min-height: 24px; }
.product-top img { width: 72px; height: 72px; border-radius: 14px; object-fit: cover; background: var(--surface-alt); }
.product-top .hint { margin: 2px 0 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.money-input { position: relative; display: block; }
.money-input span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; }
.money-input input { padding-left: 28px; font-variant-numeric: tabular-nums; }
/* Shop categories: headings in the item list, and the Categories dialog */
.shop-cat-head { margin: 14px 0 6px; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }
.shop-cat-head:first-child { margin-top: 0; }
.cat-list { display: grid; gap: 8px; margin: 12px 0; }
.cat-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto auto; gap: 6px; align-items: center; }
.cat-row .cat-count { font-size: 12px; white-space: nowrap; }
.cat-add { display: flex; gap: 8px; }
@media (max-width: 480px) { .cat-row { grid-template-columns: minmax(0, 1fr) auto auto auto; } .cat-row .cat-count { display: none; } }
/* Shop: profit per item (dialog and list) and if everything sells (team only) */
.profit-line { margin: -4px 0 14px; font-size: 13px; font-weight: 600; color: var(--green-deep); }
@media (prefers-color-scheme: dark) { .profit-line { color: var(--green); } }
.profit-line.loss, .shop-item .sub.profit.loss, .shop-profit .loss { color: var(--danger); }
.shop-item .sub.profit { color: var(--text); }
.shop-profit { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface-alt); display: grid; gap: 2px; }
.shop-profit-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-weight: 700; }
.shop-profit-head strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.shop-profit-head.next { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
/* Shop shipping: the summary under its two fields */
.ship-summary { margin: 8px 0 0; font-weight: 600; font-size: 13px; }
.ship-charge { display: flex; gap: 8px; }
.ship-charge .money-input { flex: 1; min-width: 0; }
.ship-charge select { width: auto; padding: 7px 10px; }
.ship-until { margin: 12px 0 0; max-width: 420px; }
.ship-until .two .field { margin-bottom: 6px; font-weight: 500; }
/* Shop: "Orders close every [Thursday] at [5:00 PM]" rows */
.cutoff { display: grid; gap: 8px; margin-bottom: 4px; }
.cutoff-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 500; }
.cutoff-row select, .cutoff-row input { width: auto; padding: 7px 10px; }
.shop-order .sub .pill { margin-left: 6px; }
/* Shop: supplier order sheet */
.sheet-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; font-weight: 600; }
.sheet-pick select { width: auto; max-width: 100%; padding: 7px 10px; }
.sheet-status { margin: 0 0 10px; font-size: 13px; }
.sheet-status .pill { margin-right: 6px; }
.sheet-table { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.sheet-table:has(td.empty) { border: none; }
.sheet-table td:first-child { overflow-wrap: anywhere; }
.sheet-table .cat td { background: var(--surface-alt); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted); padding-top: 6px; padding-bottom: 6px; }
.sheet-table tfoot td { border-top: 1px solid var(--border); border-bottom: none; font-weight: 700; }
.sheet-table .units { font-size: 16px; font-weight: 700; }
/* Pickup list: one row per customer, their items listed down the row. */
#shop-pickups-table td { vertical-align: top; }
#shop-pickups-table td .sub { margin-top: 2px; overflow-wrap: anywhere; }
.sheet-note { margin: 8px 0 0; }
@media (max-width: 400px) { .sheet-table th, .sheet-table td { padding: 10px 8px; } }
/* Requests have no picture: text, then the buttons (below the text on phones), and nothing cut off */
.shop-request { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
.shop-request .title, .shop-request .sub { white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .shop-request { grid-template-columns: minmax(0, 1fr); }
  .shop-request .member-actions { flex-direction: row; justify-content: flex-start; }
}
.shop-request .title .pill, .shop-request .sub .pill { margin-left: 6px; }
.shop-request .request-details { white-space: pre-wrap; color: var(--text); }
.shop-request .sub a { color: inherit; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
#product .note { margin-bottom: 14px; }
@media (max-width: 640px) { .two { grid-template-columns: 1fr; } }
.scan-status { margin: 10px 0 0; font-weight: 600; color: var(--green-deep); }
@media (prefers-color-scheme: dark) { .scan-status { color: var(--green); } }

/* ─── Camera barcode scanner ────────────────────────────────────────────── */
.camera-btn { white-space: nowrap; }
.camera-dialog { width: min(560px, calc(100vw - 24px)); }
.camera-view { width: 100%; min-height: 240px; border-radius: 14px; overflow: hidden; background: #000; }
.camera-view video { width: 100% !important; display: block; border-radius: 14px; }
.camera-status { margin: 10px 0 0; text-align: center; font-weight: 600; color: var(--muted); }
.camera-status.error { color: var(--danger); }
.camera-actions { margin-top: 10px; justify-content: center; }
.camera-actions select { max-width: 320px; }
.replay-info .sub:last-child { white-space: normal; }
@container (max-width: 560px) {
  .ov-basket { width: 50%; }
  .ov-pop { max-width: 48%; }
}

/* A store still being set up */
.setup-pending { max-width: 640px; margin: 48px auto; padding: 0 16px; }
.setup-pending .card { text-align: center; padding: 36px 28px; }
.setup-pending h1 { margin: 10px 0 8px; font-size: 26px; }
.setup-icon { font-size: 40px; }
.setup-steps { text-align: left; max-width: 420px; margin: 22px auto; padding: 0; list-style: none; display: grid; gap: 10px; }
.setup-steps li { position: relative; padding-left: 34px; color: var(--muted); }
.setup-steps li::before { content: ""; position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); }
.setup-steps li.done { color: var(--text); font-weight: 600; }
.setup-steps li.done::before { content: "✓"; display: grid; place-items: center; color: #fff; background: var(--accent); border-color: var(--accent); font-size: 13px; }

/* Guides: optional next steps and how-tos */
.setup-pending .guides-card { text-align: left; margin-top: 16px; padding: 22px 24px; }
.guides-card h2 { margin: 0 0 4px; }
.guide-list { display: grid; gap: 8px; margin-top: 12px; }
.guide-item .title { white-space: normal; }
.guide-item .sub { white-space: normal; }
.guide-buttons { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 12px; }
.guide-button { display: grid; gap: 4px; text-align: left; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); }
.guide-button span { font-size: 13px; color: var(--muted); font-weight: 500; }
.guide-summary { margin: 0 0 10px; }
.guide-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--surface-alt); color: var(--text); font-size: 13px; font-weight: 600; }
.guide-steps { counter-reset: s; list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 12px; }
.guide-steps li { counter-increment: s; position: relative; padding: 16px 18px 16px 62px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.guide-steps li::before { content: counter(s); position: absolute; left: 16px; top: 15px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 800; font-size: 15px; }
.guide-steps h3 { margin: 4px 0 6px; font-size: 16px; }
.guide-steps p { margin: 0 0 10px; color: var(--muted); line-height: 1.5; }
.guide-steps li > :last-child { margin-bottom: 0; }
.guide-steps img { display: block; width: 100%; max-height: 420px; object-fit: contain; background: var(--surface-alt); border-radius: 12px; border: 1px solid var(--border); margin-top: 6px; }
.guide-path { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 10px; }
.guide-path .chip { background: var(--green-soft); color: var(--green-deep); }
.guide-path .sep { color: var(--muted); font-weight: 700; }
.guide-download { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 4px 0 10px; }
.guide-download .hint { margin: 0; }
a.button { display: inline-block; font-weight: 700; border-radius: 12px; padding: 12px 20px; text-decoration: none; }
a.button.primary { background: var(--accent); color: #fff; }
a.button.primary:hover { background: var(--accent-hover); }
.guide-fields { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0; margin: 0 0 10px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.guide-fields dt, .guide-fields dd { margin: 0; padding: 9px 12px; border-top: 1px solid var(--border); }
.guide-fields dt:first-of-type, .guide-fields dt:first-of-type + dd { border-top: 0; }
.guide-fields dt { font-weight: 600; font-size: 14px; background: var(--surface-alt); }
.guide-fields dd { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.guide-fields code { font-family: ui-monospace, Menlo, monospace; font-size: 14px; word-break: break-all; }
.guide-callout { margin: 0 0 10px; padding: 10px 14px; border-radius: 12px; font-size: 14px; color: var(--text) !important; }
.guide-callout.tip { background: var(--green-soft); }
.guide-callout.tip::before { content: '💡 '; }
.guide-callout.warning { background: color-mix(in srgb, var(--warning) 16%, transparent); }
.guide-callout.warning::before { content: '⚠️ '; }
@media (prefers-color-scheme: dark) { .guide-path .chip { color: var(--green); } }
@media (max-width: 640px) {
  .guide-steps li { padding: 14px 14px 14px 54px; }
  .guide-steps li::before { left: 12px; }
  .guide-fields { grid-template-columns: 1fr; }
  .guide-fields dt { border-top: 1px solid var(--border); }
}
.guide-item { grid-template-columns: minmax(0, 1fr) auto; }
.guide-item .sub { overflow: visible; text-overflow: clip; }
.team-invite { margin-top: 12px; display: grid; gap: 6px; }
.team-invite p { margin: 0; }
.invite-link { font-family: ui-monospace, Menlo, monospace; font-size: 12px; word-break: break-all; padding: 8px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }

/* Team: invite form, member roles, role editor */
.team-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 220px) auto; gap: 8px; align-items: center; }
.member-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; font-weight: 400; }
.role-select { width: auto; max-width: 200px; padding: 6px 10px; font-size: 13px; border-radius: 10px; }
#roles-list .item .amount { display: grid; gap: 2px; font-weight: 600; font-size: 13px; }
#role { width: min(560px, calc(100vw - 24px)); }
.perm-list { border: 0; padding: 0; margin: 0 0 14px; }
.perm-list legend { font-weight: 600; font-size: 14px; margin-bottom: 8px; padding: 0; }
.perm { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 6px; cursor: pointer; }
.perm:has(input:checked) { border-color: var(--green); background: var(--green-soft); }
.perm input { width: auto; margin: 3px 0 0; }
.perm strong { display: block; font-size: 14px; }
.perm small { display: block; color: var(--muted); font-size: 13px; }
.perm.unavailable { opacity: 0.5; cursor: not-allowed; }
.dialog-actions .spacer { flex: 1; }
@media (max-width: 640px) {
  .team-form { grid-template-columns: 1fr; }
  .member-actions { flex-direction: column; align-items: flex-end; }
}

/* Open Hours */
.hours-status { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); margin-bottom: 12px; font-size: 15px; }
.hours-status .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.hours-status.open { background: var(--green-soft); border-color: transparent; }
.hours-status.open .dot { background: var(--green); }
.hours-week, .hours-special { display: grid; gap: 4px; }
.hours-day { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.hours-day:last-child { border-bottom: 0; }
.hours-day.special { grid-template-columns: minmax(0, 1fr); }
.special-head { display: flex; gap: 8px; flex-wrap: wrap; }
.special-head input[type=text] { flex: 1; min-width: 140px; }
.periods { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.period { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 8px; border-radius: 12px; background: var(--surface-alt); }
.period input[type=time] { width: 118px; padding: 6px 8px; }
.hours-copy { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.hours-save { position: sticky; bottom: 12px; z-index: 5; display: flex; gap: 12px; align-items: center; justify-content: flex-end; margin: 12px 0; padding: 12px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.hours-save .error { margin: 0 auto 0 0; }
.history-row { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.history-row:last-child { border-bottom: 0; }
@media (max-width: 720px) {
  .hours-day { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .hours-copy { justify-content: flex-start; }
}
.period input[type=time] { width: 136px; }
#hours-door { background: color-mix(in srgb, var(--warning) 14%, var(--surface)); color: var(--text); border: 1px solid color-mix(in srgb, var(--warning) 35%, transparent); }
.special-head input[type=date] { width: 170px; flex: none; }
.hours-day.special > button { justify-self: start; width: auto; }
@media (max-width: 720px) {
  .period input[type=time] { width: 112px; padding: 6px; }
  .period { gap: 4px; }
}

/* ─── Time clock ────────────────────────────────────────────────────────── */
#tab-time .card + .card { margin-top: 16px; }
.clock-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.clock-state { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.4px; }
.clock-state::before { content: ''; display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--muted); margin-right: 10px; vertical-align: 2px; }
.clock-state.on::before { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.clock-since { margin: 4px 0 0; color: var(--muted); }
.clock-btn { min-width: 180px; padding: 16px 28px; font-size: 18px; border-radius: 12px; }
.clock-btn.out { background: var(--text); color: var(--surface); }
.clock-btn.out:hover:not(:disabled) { background: var(--text); opacity: 0.85; }
.my-week-head { margin: 18px 0 10px; }
.my-week-head h2 { margin: 0; }
.thumb.day { font-size: 14px; font-weight: 700; color: var(--text); }
.shift-row .sub .pill { margin-left: 6px; }
.ts-kpis { margin-bottom: 14px; }
.ts-kpis .kpi .hint { margin: 0; }
.ts-people { display: grid; gap: 8px; }
.ts-person { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.ts-person[open] { border-color: var(--green); }
.ts-person summary { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 10px 14px 10px 10px; cursor: pointer; list-style: none; }
.ts-person summary::-webkit-details-marker { display: none; }
.ts-person .thumb { width: 48px; height: 48px; }
.ts-name .title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts-name .sub { color: var(--muted); font-size: 13px; }
.spaced-left { margin-left: 8px; }
.ts-num { text-align: right; min-width: 84px; font-variant-numeric: tabular-nums; }
.ts-num strong { display: block; font-size: 17px; }
.ts-num small { color: var(--muted); font-size: 12px; }
.ts-body { padding: 4px 14px 14px; border-top: 1px solid var(--border); }
.ts-rate { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 12px 0; font-weight: 600; font-size: 14px; }
.ts-rate .money-input { width: 120px; }
.ts-rate .hint { margin: 0; font-weight: 400; }
.ts-shifts td { vertical-align: top; }
.ts-shifts small { display: block; font-size: 12px; }
.shift-flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.empty.small { padding: 16px; }
@media (max-width: 640px) {
  .clock-btn { width: 100%; }
  .ts-person summary { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .ts-person summary .ts-num:last-child { display: none; }
  .ts-person .thumb { width: 40px; height: 40px; }
  .ts-shifts small { display: none; }
}

/* ─── Finances ──────────────────────────────────────────────────────────── */
#tab-finances > * + * { margin-top: 14px; }
#tab-finances .section-head { margin-bottom: 4px; }
.fin-kpis .kpi .hint { margin: 2px 0 0; font-size: 12.5px; }
.fin-kpis .kpi.profit .value { color: var(--green-deep); }
.fin-kpis .kpi.loss .value { color: var(--danger); }
@media (prefers-color-scheme: dark) { .fin-kpis .kpi.profit .value { color: var(--green); } }
.fin-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 14px; }
.fin-grid .card { margin: 0; }
.fin-split { display: grid; gap: 12px; }
.fin-row-top { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.fin-row-top strong { font-variant-numeric: tabular-nums; }
.fin-row small { color: var(--muted); font-size: 12px; }
.fin-bar { height: 8px; border-radius: 99px; background: var(--surface-alt); overflow: hidden; margin: 5px 0 2px; }
.fin-bar span { display: block; height: 100%; border-radius: 99px; background: var(--muted); opacity: 0.55; }
.fin-row.wages .fin-bar span { background: var(--warning); opacity: 0.8; }
.fin-row.profit { padding-top: 10px; border-top: 1px solid var(--border); }
.fin-row.profit .fin-bar span { background: var(--green); opacity: 1; }
.fin-row.loss { padding-top: 10px; border-top: 1px solid var(--border); }
.fin-row.loss .fin-bar span { background: var(--danger); opacity: 1; }
.fin-row.loss strong { color: var(--danger); }
.fin-chart svg { width: 100%; height: auto; display: block; }
.fin-chart .bar.cur { fill: var(--green); }
.fin-chart .bar.fin-cost { fill: var(--chart-prev); }
.fin-chart .fin-hit { fill: transparent; }
.fin-chart .fin-month:hover .fin-hit { fill: var(--surface-alt); }
.fin-chart .fin-month.current text { font-weight: 800; fill: var(--text); }
.fin-chart .fin-month.future { opacity: 0.35; }
.swatch.fin-cost { background: var(--chart-prev); }
.fin-expense.upcoming { opacity: 0.6; }
.fin-expense .thumb.day { font-size: 13px; text-align: center; line-height: 1.1; }
.fin-foot { margin-top: 18px; }
@media (max-width: 860px) { .fin-grid { grid-template-columns: 1fr; } }
.fin-chart .axis { fill: var(--muted); font-size: 11px; }
.fin-chart .grid-line { stroke: var(--border); }
.fin-chart .grid-line.base { stroke: var(--muted); opacity: 0.4; }

/* ─── Discounts ─────────────────────────────────────────────────────────── */
#tab-discounts .card + .card { margin-top: 14px; }
.disc-search { margin: 4px 0 10px; }
.disc-search input { flex: 1; }
.disc-results { max-height: 420px; overflow-y: auto; }
.disc-results .item .amount small, .sale-row .amount small { display: block; color: var(--green-deep); font-weight: 700; }
img.thumb { object-fit: cover; }
.disc-form-card { border-color: var(--green); }
.disc-form-card #disc-selected .item { margin-bottom: 14px; }
.disc-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.disc-quick button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.pct-input { position: relative; display: block; }
.pct-input input { padding-right: 32px; font-variant-numeric: tabular-nums; }
.pct-input span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; }
.disc-preview { margin: 0 0 12px; font-size: 16px; }
.disc-preview strong { color: var(--green-deep); font-size: 18px; }
#disc-replaces { margin-bottom: 12px; }
.sale-row .sub s, .disc-preview s { opacity: 0.8; }
.sale-row.ending { border-color: var(--warning); }
.sale-row.ended { opacity: 0.75; }
.disc-ended summary { cursor: pointer; list-style: none; }
.disc-ended summary::-webkit-details-marker { display: none; }
.disc-ended summary h2 { display: inline; }
.disc-ended summary::after { content: ' ▾'; color: var(--muted); }
.disc-ended[open] summary { margin-bottom: 12px; }
@media (prefers-color-scheme: dark) { .disc-preview strong, .disc-results .item .amount small, .sale-row .amount small { color: var(--green); } }
@media (max-width: 640px) { .disc-search { flex-wrap: wrap; } .disc-search input { flex-basis: 100%; } }

/* ─── Timeline (one day, 12 AM to 12 AM) ───────────────────────────────────── */
.tl-day-picker { display: flex; align-items: center; gap: 6px; }
.tl-day-picker input[type="date"] { width: auto; }
.tl-day-picker button { min-width: 36px; }
.tl-heading { margin: 18px 0 0; font-size: 22px; letter-spacing: -0.01em; }
.tl { margin-top: 10px; }
.tl-hour { display: grid; grid-template-columns: 64px minmax(0, 1fr); }
.tl-label { padding: 12px 14px 0 0; text-align: right; font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tl-events { position: relative; display: grid; gap: 8px; padding: 6px 0 12px 24px; border-left: 2px solid var(--border); }
/* A tick on the line where each hour starts. */
.tl-events::before { content: ""; position: absolute; left: -2px; top: 18px; width: 12px; height: 2px; background: var(--border); }
.tl-hour.quiet .tl-events, .tl-hour.end .tl-events { padding-top: 10px; padding-bottom: 10px; font-size: 13px; color: var(--muted); }
.tl-hour.quiet .tl-events { border-left-style: dashed; }
.tl-hour.end .tl-events { border-left-color: transparent; }

.tl-item {
  position: relative;
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  text-align: left;
  font-weight: 400;
}
button.tl-item:hover { border-color: var(--green); }
.tl-time { font-size: 13px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* The item's icon sits on the timeline's line. */
.tl-dot {
  position: absolute; left: -39px; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--border); font-size: 13px; line-height: 1;
}
.tl-item.entry .tl-dot { border-color: #4f8cf7; }
.tl-item.visit .tl-dot, .tl-item.sale .tl-dot { border-color: var(--green); }
.tl-item.clock_in .tl-dot, .tl-item.clock_out .tl-dot { border-color: var(--warning); }
.tl-body { min-width: 0; }
.tl-body .title { font-weight: 700; line-height: 1.3; }
.tl-body .sub { margin-top: 2px; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-item .thumb { width: 56px; height: 42px; }
.tl-now { position: relative; padding-top: 4px; border-top: 2px solid var(--danger); font-size: 12px; font-weight: 700; color: var(--danger); }
.tl-now::before { content: ""; position: absolute; left: -31px; top: -7px; width: 12px; height: 12px; border-radius: 50%; background: var(--danger); }

@media (max-width: 640px) {
  .tl-hour { grid-template-columns: 46px minmax(0, 1fr); }
  .tl-label { padding-right: 8px; font-size: 11px; }
  .tl-events { padding-left: 20px; }
  .tl-item { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; }
  .tl-time { grid-column: 1 / -1; }
  .tl-dot { left: -35px; width: 26px; height: 26px; }
  .tl-now::before { left: -27px; }
}

/* ─── Kiosk flyers ─────────────────────────────────────────────────────────── */
label.button.primary { display: inline-flex; align-items: center; flex: none; padding: 9px 16px; border-radius: var(--radius-sm); background: var(--accent); color: #fff; font-weight: 600; cursor: pointer; box-shadow: var(--shadow-sm); }
label.button.primary:hover { background: var(--accent-hover); }
#tab-flyers .section-head .hint { flex: 1; min-width: 240px; margin: 0; }
.flyer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-top: 4px; }
.flyer { margin: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
.flyer img { display: block; width: 100%; aspect-ratio: 2 / 1; object-fit: contain; background: var(--surface-alt); }
.flyer figcaption { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; font-size: 13px; color: var(--muted); }

/* ─── Shop: member preorders ───────────────────────────────────────────────── */
.shop { display: grid; gap: 16px; }
.shop > .hint { margin: 0; }
.shop-counts { font-size: 14px; font-weight: 600; color: var(--muted); }
.shop-counts.busy { color: var(--warning); }
.switch { position: relative; display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; cursor: pointer; }
.switch input { position: absolute; width: 1px; height: 1px; opacity: 0; margin: 0; padding: 0; }
.switch-track { position: relative; flex: none; width: 46px; height: 28px; border-radius: 999px; background: color-mix(in srgb, var(--muted) 45%, var(--surface-alt)); transition: background 0.15s; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.15s; }
.switch input:checked + .switch-track { background: var(--green); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 30%, transparent); }
.switch strong { display: block; font-size: 15px; line-height: 1.35; padding-top: 3px; }
.switch small { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; }
#shop-settings .field small { font-weight: 400; font-size: 13px; }
.thumb.no-image { font-size: 11px; font-weight: 600; text-align: center; line-height: 1.15; }
.shop-item .title, .shop-item .sub { white-space: normal; }
.shop-item .title .pill { vertical-align: 1px; }
.shop-item .sub.sold-out { color: var(--warning); font-weight: 600; }
.shop-item.unlisted .thumb { opacity: 0.6; }
.pic.shop-pic { width: 96px; height: 96px; border-radius: 12px; }
#shop-item .field small { font-weight: 400; font-size: 13px; }
#shop-tax { justify-self: start; }
.shop-orders { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 12px; margin: 14px 0 4px; align-items: start; }
.shop-orders > .empty { grid-column: 1 / -1; }
.shop-order { display: grid; gap: 6px; min-width: 0; padding: 12px 14px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.shop-order.placed { border-color: color-mix(in srgb, var(--warning) 45%, var(--border)); }
.shop-order.ready { border-color: color-mix(in srgb, var(--green) 45%, var(--border)); }
.shop-order.cancelled, .shop-order.picked_up { background: color-mix(in srgb, var(--surface-alt) 45%, var(--surface)); }
.shop-order-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.shop-order-title strong { font-size: 17px; letter-spacing: -0.3px; }
.shop-order-total { font-size: 17px; font-variant-numeric: tabular-nums; }
.shop-order .sub { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.shop-order .sub b { color: var(--text); }
.shop-order .sub a { color: inherit; }
.shop-order .hint { margin: 0; }
.shop-lines { list-style: none; margin: 4px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--surface-alt); display: grid; gap: 3px; font-size: 14px; }
.shop-lines li { display: flex; justify-content: space-between; gap: 10px; }
.shop-lines li > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.shop-lines li > span:last-child { flex: none; font-variant-numeric: tabular-nums; }
.shop-lines .tax { color: var(--muted); border-top: 1px dashed var(--border); margin-top: 3px; padding-top: 4px; }
.shop-lines .tax + .tot { border-top: 0; margin-top: 0; padding-top: 0; }
.shop-lines .tot { font-weight: 700; border-top: 1px dashed var(--border); margin-top: 3px; padding-top: 4px; }
.shop-order-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
#tab-shop .segmented { max-width: 100%; }
@media (max-width: 640px) {
  .shop-order-actions button { flex: 1; }
  .shop-item { grid-template-columns: 48px minmax(0, 1fr); align-items: start; }
  .shop-item .member-actions { grid-column: 2; flex-direction: row; justify-content: flex-start; }
}
