/* ============================================================
   FireSign — bright & professional theme
   Light SaaS UI: white surfaces, soft shadows, orange brand
   ============================================================ */
:root {
  /* Canvas & surfaces */
  --bg: #f4f6f9;          /* app canvas */
  --bg-2: #ffffff;        /* cards / surfaces */
  --bg-3: #f2f4f7;        /* subtle fills, hover */
  --sidebar: #ffffff;

  /* Lines */
  --border: #e4e7ec;
  --border-2: #eef1f4;    /* lighter dividers */

  /* Text */
  --text: #0f1728;        /* primary, near-black */
  --text-2: #344054;      /* secondary */
  --muted: #667085;       /* tertiary */

  /* Brand */
  --accent: #ef5f0a;
  --accent-2: #ff8a3d;
  --accent-ink: #ffffff;
  --accent-soft: #fff2e8;
  --accent-soft-2: #ffe4d1;

  /* Status */
  --green: #12b76a;  --green-soft: #e6f7ef;
  --red: #f04438;    --red-soft: #fef2f1;
  --amber: #f79009;  --amber-soft: #fff6e6;
  --blue: #2e90fa;   --blue-soft: #eaf3fe;

  /* Radii */
  --radius: 12px;
  --radius-sm: 9px;
  --radius-lg: 16px;

  /* Shadows (layered, soft) */
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.09), 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 4px 10px -2px rgba(16, 24, 40, 0.10), 0 2px 5px -2px rgba(16, 24, 40, 0.05);
  --shadow-lg: 0 16px 28px -6px rgba(16, 24, 40, 0.14), 0 6px 12px -6px rgba(16, 24, 40, 0.06);

  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ring: 0 0 0 3px var(--accent-soft-2);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--red); min-height: 1.2em; margin: 0; font-size: 0.9rem; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { letter-spacing: -0.02em; }

/* ------------------------------ Buttons ------------------------------ */
.btn {
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text-2);
  padding: 0.55rem 0.95rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.05s;
  box-shadow: var(--shadow-xs);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}
.btn:hover { background: #f9fafb; border-color: #d4d8de; }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  border: 1px solid #e2540a;
  color: var(--accent-ink);
  box-shadow: 0 1px 2px rgba(239, 95, 10, 0.35), var(--shadow-xs);
}
.btn.primary:hover { filter: brightness(1.04); background: linear-gradient(180deg, var(--accent-2), var(--accent)); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
.btn.ghost:hover { background: var(--bg-3); color: var(--text); }
.btn.danger { color: var(--red); border-color: #f3c6c2; background: var(--bg-2); }
.btn.danger:hover { background: var(--red-soft); border-color: #eeaaa4; }
.btn.small { padding: 0.35rem 0.65rem; font-size: 0.8rem; border-radius: 8px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ------------------------------- Inputs ------------------------------ */
input, select, textarea {
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.6rem 0.7rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder { color: #98a2b3; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input[type="checkbox"] {
  width: 18px; height: 18px; min-width: 18px; padding: 0;
  accent-color: var(--accent); cursor: pointer; vertical-align: middle; box-shadow: none;
}
select { cursor: pointer; }
/* inline selects (in card action rows / editor head) should size to content */
.card-actions select, .editor-head select, .selbar select { width: auto; }

.linkbtn { background: none; border: none; color: var(--accent); cursor: pointer; text-decoration: underline; font-size: 0.85rem; font-weight: 600; padding: 0; align-self: center; }
.pw-hints { list-style: none; padding: 0; margin: 0.2rem 0 0; font-size: 0.8rem; }
.pw-hints li { color: var(--muted); padding: 0.1rem 0; }
.pw-hints li.ok { color: var(--green); }
.pw-hints li::before { content: "○ "; }
.pw-hints li.ok::before { content: "✓ "; }
.brand { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.03em; display: flex; align-items: center; gap: 0.5rem; color: var(--text); }
.flame {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(150deg, var(--accent-2), var(--accent));
  color: #fff; font-size: 0.95rem; box-shadow: 0 2px 6px rgba(239, 95, 10, 0.4);
}

/* ------------------------------- Login ------------------------------- */
.login {
  display: grid; place-items: center; height: 100vh;
  background: radial-gradient(1200px 600px at 50% -10%, #fff 0%, var(--bg) 60%);
}
.login-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  padding: 2.2rem;
  border-radius: var(--radius-lg);
  width: 360px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.login-card .brand { font-size: 1.5rem; margin-bottom: 0.2rem; }
.login-card label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.85rem; font-weight: 600; color: var(--text-2); }

/* ----------------------------- App layout ---------------------------- */
.app { display: grid; grid-template-columns: 252px 1fr; height: 100vh; }
.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  padding: 1.3rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}
.sidebar nav { display: flex; flex-direction: column; gap: 0.2rem; }
.nav-item {
  display: flex; align-items: center; gap: 0.7rem;
  background: transparent; border: none; color: var(--muted);
  padding: 0.6rem 0.75rem; border-radius: 10px; cursor: pointer;
  font-size: 0.93rem; font-weight: 600; text-align: left; width: 100%;
  transition: background 0.12s, color 0.12s;
}
.nav-item span { font-size: 1.05rem; width: 1.3rem; text-align: center; }
.nav-item:hover { background: var(--bg-3); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }
.sidebar-footer { margin-top: auto; display: flex; flex-direction: column; gap: 0.5rem; }
.who-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.3rem 0.2rem 0.5rem; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 0.85rem; color: #fff;
  background: linear-gradient(150deg, var(--accent-2), var(--accent));
}
.who-meta { min-width: 0; }
.who-meta .who-name { font-weight: 700; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-meta .who-role { font-size: 0.75rem; color: var(--muted); }

.content { overflow-y: auto; padding: 1.8rem 2.2rem 3rem; }
.view-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 1.5rem; gap: 1rem; flex-wrap: wrap; }
.view-head h1 { margin: 0 0 0.25rem; font-size: 1.6rem; font-weight: 800; }
.view-head p { margin: 0; font-size: 0.92rem; color: var(--muted); }
.head-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* --------------------------- Grids / cards --------------------------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.1rem; }
.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
  position: relative;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-body { padding: 1rem; display: flex; flex-direction: column; gap: 0.7rem; }
.card-title { font-weight: 700; font-size: 1rem; display: flex; align-items: center; gap: 0.5rem; }
.card-row { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; font-size: 0.85rem; }
.card-row > .muted { flex: none; }
.card-row select { max-width: 60%; }
.card-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.1rem; }

.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.dot.online { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.dot.offline { background: #98a2b3; box-shadow: 0 0 0 3px #eceff2; }
.dot.warn { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.pill { font-size: 0.72rem; padding: 0.15rem 0.55rem; border-radius: 999px; background: var(--bg-3); color: var(--muted); border: 1px solid var(--border-2); font-weight: 600; }

/* Media thumbnails */
.thumb { aspect-ratio: 16 / 9; background: #0b0f14; display: grid; place-items: center; position: relative; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; }
.thumb .badge { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); color: #fff; padding: 0.12rem 0.5rem; border-radius: 6px; font-size: 0.68rem; letter-spacing: 0.05em; font-weight: 700; }

.empty {
  text-align: center; color: var(--muted); padding: 3rem 2rem;
  border: 1.5px dashed var(--border); border-radius: var(--radius); grid-column: 1 / -1;
  background: var(--bg-2);
}
.empty .empty-emoji { font-size: 2.4rem; display: block; margin-bottom: 0.6rem; opacity: 0.85; }

/* ---------------------------- Multi-select --------------------------- */
.card-check { position: absolute; top: 10px; right: 10px; z-index: 2; width: 22px; height: 22px; box-shadow: 0 0 0 2px #fff, var(--shadow-sm); background: #fff; }
.card.selected { outline: 2px solid var(--accent); outline-offset: -2px; box-shadow: var(--shadow-md); }
.selbar {
  display: flex; align-items: center; gap: 0.6rem; background: var(--accent-soft);
  border: 1px solid var(--accent-soft-2); border-radius: var(--radius); padding: 0.65rem 0.9rem;
  margin-bottom: 1.1rem; flex-wrap: wrap; box-shadow: var(--shadow-xs);
}
.selbar .count { font-weight: 700; color: var(--accent); }
.selbar .spacer { flex: 1; }
.selbar select { min-width: 130px; }

/* --------------------------- Playlist editor ------------------------- */
.playlist-layout { display: grid; grid-template-columns: 280px 1fr; gap: 1.2rem; align-items: start; }
.playlist-list { display: flex; flex-direction: column; gap: 0.45rem; }
.pl-item {
  padding: 0.8rem 0.9rem; background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 10px; cursor: pointer; display: flex; justify-content: space-between; align-items: center;
  box-shadow: var(--shadow-xs); transition: border-color 0.12s, background 0.12s;
  font-weight: 600;
}
.pl-item:hover { border-color: #d4d8de; }
.pl-item.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.pl-item .count { font-size: 0.75rem; color: var(--muted); font-weight: 600; }
.pl-item.active .count { color: var(--accent); }
.playlist-editor { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; min-height: 320px; box-shadow: var(--shadow-sm); }
.editor-head { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.editor-head h2 { font-size: 1.15rem; }
.editor-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
.list-title { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); margin-bottom: 0.6rem; font-weight: 700; }
.row-item {
  display: flex; align-items: center; gap: 0.65rem; padding: 0.55rem; border: 1px solid var(--border);
  border-radius: 10px; background: var(--bg-2); margin-bottom: 0.5rem; box-shadow: var(--shadow-xs);
}
.row-item .mini { width: 54px; height: 34px; object-fit: cover; border-radius: 6px; background: #0b0f14; flex: none; }
.row-item .grow { flex: 1; min-width: 0; }
.row-item .name { font-size: 0.85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-item input[type=number] { width: 68px; padding: 0.3rem; }
.reorder { display: flex; flex-direction: column; }
.reorder button { background: none; border: none; color: var(--muted); cursor: pointer; line-height: 1; padding: 0 0.2rem; font-size: 0.8rem; }
.reorder button:hover { color: var(--accent); }
.reorder button:disabled { opacity: 0.3; cursor: default; }

/* ------------------------------- Modal ------------------------------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 40, 0.45); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 50; padding: 1rem; }
.modal {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.6rem;
  width: 420px; max-width: 92vw; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 0.9rem;
  max-height: 92vh; overflow-y: auto;
}
.modal h2 { margin: 0; font-size: 1.25rem; }
.modal > p.muted { margin: -0.3rem 0 0.2rem; }
.modal label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.85rem; font-weight: 600; color: var(--text-2); }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 0.5rem; }
.code-hint { font-family: ui-monospace, "SF Mono", monospace; font-size: 1.5rem; letter-spacing: 0.3em; text-align: center; color: var(--accent); font-weight: 700; }

/* ------------------------------- Toast ------------------------------- */
.toast-root { position: fixed; bottom: 1.4rem; right: 1.4rem; display: flex; flex-direction: column; gap: 0.5rem; z-index: 100; }
.toast {
  background: var(--bg-2); border: 1px solid var(--border); border-left: 4px solid var(--accent);
  padding: 0.75rem 1.05rem; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: 0.9rem; max-width: 340px;
  font-weight: 600; color: var(--text); animation: slidein 0.22s ease;
}
.toast.ok { border-left-color: var(--green); }
.toast.err { border-left-color: var(--red); }
@keyframes slidein { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* -------------------------- Upload progress -------------------------- */
.upload-progress { margin-bottom: 1.1rem; display: flex; flex-direction: column; gap: 0.4rem; }
.progress-bar { height: 7px; background: var(--bg-3); border-radius: 999px; overflow: hidden; }
.progress-bar > div { height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); width: 0; transition: width 0.15s; }

/* --------------------------- Store switcher -------------------------- */
.store-pick { display: flex; flex-direction: column; gap: 0.35rem; }
.store-pick-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); padding-left: 0.2rem; font-weight: 700; }
#store-switcher { width: 100%; font-weight: 700; }
.store-name-inline { color: var(--text); font-weight: 700; }

/* App switcher — big app buttons in the sidebar */
.app-switch { display: flex; flex-direction: column; gap: 0.4rem; }
.app-tab { display: flex; align-items: center; gap: 0.6rem; text-align: left; width: 100%; border: 1px solid var(--border); background: var(--bg-2); color: var(--ink, var(--text)); font-weight: 700; padding: 0.55rem 0.65rem; border-radius: 12px; cursor: pointer; transition: box-shadow 0.12s, border-color 0.12s, background 0.12s; }
.app-tab:hover { box-shadow: var(--shadow-xs); border-color: #d0d5dd; }
.app-tab .app-ico { font-size: 1.3rem; line-height: 1; width: 2.15rem; height: 2.15rem; display: grid; place-items: center; background: var(--bg-3); border-radius: 9px; flex: 0 0 auto; }
.app-tab .app-txt { display: flex; flex-direction: column; line-height: 1.12; min-width: 0; }
.app-tab .app-txt b { font-size: 0.9rem; }
.app-tab .app-txt small { font-size: 0.68rem; color: var(--muted); font-weight: 600; }
.app-tab.active { border-color: var(--accent); background: #fff4ec; box-shadow: var(--shadow-xs); }
.app-tab.active .app-ico { background: var(--accent); color: #fff; }
.app-tab.active .app-txt b { color: var(--accent); }

/* Attendance — staff / who's-in rows reuse .user-row; extras: */
.staff-meta { flex: 1; min-width: 0; }
.staff-meta .s-name { font-weight: 700; }
.staff-meta .s-user { font-size: 0.8rem; color: var(--muted); }
.status-pill { font-size: 0.72rem; font-weight: 700; padding: 0.15rem 0.55rem; border-radius: 999px; }
.status-pill.on { background: var(--green-soft); color: #027a48; }
.status-pill.off { background: var(--bg-3); color: var(--muted); }
.status-pill.pending { background: var(--amber-soft); color: #b54708; }
.status-pill.scheduled { background: var(--blue-soft); color: #1849a9; }
.dur { font-weight: 700; color: var(--text); }

/* Attendance — tag cards (with QR) */
.tag-card { padding: 1.1rem; align-items: center; text-align: center; gap: 0.7rem; }
.tag-card .tag-label { font-weight: 700; }
.tag-qr { width: 170px; height: 170px; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 8px; }
.tag-link { font-family: ui-monospace, "SF Mono", monospace; font-size: 0.7rem; color: var(--muted); word-break: break-all; background: var(--bg-3); border-radius: 8px; padding: 0.4rem 0.5rem; }
.tag-geo { font-size: 0.78rem; color: var(--muted); }

/* ------------------------------- Users ------------------------------- */
.users-list { display: flex; flex-direction: column; gap: 0.6rem; max-width: 820px; }
.user-row { display: flex; align-items: center; gap: 0.9rem; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.9rem 1.1rem; box-shadow: var(--shadow-sm); }
.user-row .u-name { font-weight: 700; min-width: 130px; }
.user-row .u-stores { flex: 1; }
.user-row.row-disabled { opacity: 0.55; }
/* Still clocked in past closing — almost certainly a forgotten clock-out. */
.user-row.row-overdue { background: var(--amber-soft); }
.whosin-warn { background: var(--amber-soft); border: 1px solid #f3d6a6; color: #b54708; border-radius: var(--radius); padding: 0.7rem 0.9rem; margin-bottom: 0.7rem; font-size: 0.88rem; font-weight: 600; }
.chips { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.chip { font-size: 0.72rem; padding: 0.18rem 0.55rem; border-radius: 999px; background: var(--accent-soft); border: 1px solid var(--accent-soft-2); color: var(--accent); font-weight: 600; }

/* Multi-store checkbox list (in modals) */
/* Two columns, and it must not be squashed.
 *
 * A modal is a flex column, so this box was being shrunk to a single visible
 * row with a scrollbar — six stores behind a 20px window. `flex: none` stops
 * the shrink; the grid means six fit without scrolling at all. */
.store-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 0.4rem 0.9rem; flex: none; max-height: 260px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.7rem; background: var(--bg); }
.store-checks label { display: flex; flex-direction: row; align-items: center; gap: 0.5rem; color: var(--text); font-size: 0.92rem; font-weight: 500; }
.store-checks input { width: auto; }

/* --------------------------- Takeover banner ------------------------- */
.takeover-active { display: flex; align-items: center; gap: 0.6rem; background: var(--red-soft); border: 1px solid #f6c9c4; color: #b42318; padding: 0.8rem 1.05rem; border-radius: var(--radius); margin-bottom: 1.1rem; font-weight: 600; box-shadow: var(--shadow-xs); }
.takeover-active button { margin-left: auto; }

/* --------------------------- Slide designer -------------------------- */
.designer { display: flex; gap: 1.3rem; flex-wrap: wrap; }
.designer canvas { width: 440px; max-width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--border); background: #000; box-shadow: var(--shadow-sm); }
.designer .fields { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 0.7rem; }
.swatches { display: flex; gap: 0.45rem; flex-wrap: wrap; margin-top: 0.3rem; }
.swatch { width: 30px; height: 30px; border-radius: 8px; border: 2px solid transparent; cursor: pointer; box-shadow: var(--shadow-xs); }
.swatch.sel { border-color: #fff; box-shadow: 0 0 0 2px var(--accent); }

/* ============================ OVERVIEW ============================== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1.1rem; margin-bottom: 1.5rem; }
.stat-card {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.15rem 1.2rem; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 0.55rem;
  transition: box-shadow 0.15s, transform 0.15s;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; }
.stat-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 1.15rem; }
.stat-icon.orange { background: var(--accent-soft); }
.stat-icon.green { background: var(--green-soft); }
.stat-icon.blue { background: var(--blue-soft); }
.stat-icon.amber { background: var(--amber-soft); }
.stat-num { font-size: 2rem; font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.stat-num small { font-size: 1.1rem; font-weight: 700; color: var(--muted); }
.stat-sub { font-size: 0.82rem; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 0.35rem; }
.stat-sub .up { color: var(--green); font-weight: 700; }
.stat-sub .down { color: var(--red); font-weight: 700; }

.ov-cols { display: grid; grid-template-columns: 1.6fr 1fr; gap: 1.2rem; align-items: start; }
.panel { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.2rem; border-bottom: 1px solid var(--border-2); }
.panel-title { font-weight: 700; font-size: 1rem; }
.panel-link { font-size: 0.85rem; font-weight: 600; color: var(--accent); cursor: pointer; background: none; border: none; }
.panel-link:hover { text-decoration: underline; }
.panel-body { padding: 0.5rem 0.6rem; }
.panel-pad { padding: 1.1rem 1.2rem; }

/* Screen status list (overview) */
.scr-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 0.7rem; border-radius: 10px; }
.scr-row:hover { background: var(--bg-3); }
.scr-row + .scr-row { border-top: 1px solid var(--border-2); }
.scr-main { flex: 1; min-width: 0; }
.scr-name { font-weight: 600; font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scr-sub { font-size: 0.78rem; color: var(--muted); }
.status-tag { font-size: 0.72rem; font-weight: 700; padding: 0.2rem 0.6rem; border-radius: 999px; flex: none; }
.status-tag.online { background: var(--green-soft); color: #027a48; }
.status-tag.offline { background: #f2f4f7; color: #667085; }

/* Quick actions (overview side panel) */
.qa-list { display: flex; flex-direction: column; gap: 0.5rem; }
.qa-btn {
  display: flex; align-items: center; gap: 0.75rem; width: 100%; text-align: left;
  padding: 0.75rem 0.85rem; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-2);
  cursor: pointer; font-weight: 600; font-size: 0.9rem; color: var(--text); box-shadow: var(--shadow-xs);
  transition: border-color 0.12s, background 0.12s, transform 0.05s;
}
.qa-btn:hover { border-color: var(--accent-soft-2); background: var(--accent-soft); }
.qa-btn:active { transform: translateY(1px); }
.qa-ic { width: 34px; height: 34px; border-radius: 9px; background: var(--accent-soft); display: grid; place-items: center; font-size: 1.05rem; flex: none; }
.qa-btn .qa-cap { display: block; font-weight: 500; font-size: 0.76rem; color: var(--muted); }

/* Recent media strip (overview) */
.recent-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.recent-thumb { aspect-ratio: 16/9; border-radius: 8px; overflow: hidden; background: #0b0f14; border: 1px solid var(--border); }
.recent-thumb img, .recent-thumb video { width: 100%; height: 100%; object-fit: cover; }

/* ========================== SYSTEM HEALTH =========================== */
.sys-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.2rem; align-items: start; }
.hbadge { font-size: 0.72rem; font-weight: 700; padding: 0.2rem 0.6rem; border-radius: 999px; letter-spacing: 0.02em; }
.hbadge.ok { background: var(--green-soft); color: #027a48; }
.hbadge.warn { background: var(--amber-soft); color: #b54708; }
.hbadge.crit { background: var(--red-soft); color: #b42318; }
.hbadge.neutral { background: var(--bg-3); color: var(--muted); }

.meter { height: 8px; background: var(--bg-3); border-radius: 999px; overflow: hidden; margin: 0.15rem 0 0.1rem; }
.meter > div { height: 100%; border-radius: 999px; transition: width 0.3s; min-width: 2px; }
.meter > div.ok { background: linear-gradient(90deg, #37d67a, var(--green)); }
.meter > div.warn { background: linear-gradient(90deg, #ffc04d, var(--amber)); }
.meter > div.crit { background: linear-gradient(90deg, #ff8a8a, var(--red)); }

.kv { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border-2); font-size: 0.88rem; }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; text-align: right; }
.kv .v.mono { font-family: ui-monospace, "SF Mono", monospace; font-size: 0.82rem; word-break: break-all; }
.kv .v.crit-text { color: var(--red); }
.kv .v.warn-text { color: #b54708; }
/* Email daily-quota warning inside the System health panel. */
.quota-warn { margin-top: 0.8rem; background: var(--amber-soft); border: 1px solid #f3d6a6; color: #b54708; border-radius: var(--radius); padding: 0.7rem 0.85rem; font-size: 0.84rem; line-height: 1.5; }
/* Incoming platform webhook deliveries (FirePantry → Channels). */
.ch-events { display: flex; flex-direction: column; gap: 0.4rem; }
.ch-ev { border: 1px solid var(--border); border-radius: 10px; background: var(--bg-2); }
.ch-ev > summary { cursor: pointer; padding: 0.55rem 0.7rem; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 0.86rem; }
.ch-ev .ev-when { margin-left: auto; color: var(--muted); font-size: 0.78rem; white-space: nowrap; }
.ev-pill { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; padding: 0.12rem 0.45rem; border-radius: 999px; background: #eceff2; color: #475467; }
.ev-pill.processed { background: var(--green-soft); color: #027a48; }
.ev-pill.received { background: var(--amber-soft); color: #b54708; }
.ev-pill.unmapped { background: var(--amber-soft); color: #b54708; }
.ev-pill.error { background: var(--red-soft); color: #b42318; }
.ev-raw-wrap { padding: 0 0.7rem 0.7rem; }
.ev-raw { margin: 0.4rem 0 0; padding: 0.6rem; background: #101828; color: #e4e7ec; border-radius: 8px; font-size: 0.74rem; line-height: 1.45; max-height: 320px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.meter-row { padding: 0.6rem 0; border-bottom: 1px solid var(--border-2); }
.meter-row:last-child { border-bottom: none; }
.meter-row .meter-top { display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 0.35rem; }
.meter-row .meter-top .k { color: var(--muted); }
.meter-row .meter-top .v { font-weight: 700; }

/* ----------------------------- Responsive ---------------------------- */
@media (max-width: 900px) {
  .ov-cols, .sys-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  body { -webkit-tap-highlight-color: transparent; }

  /* Phone layout: the sidebar becomes a sticky app bar; the whole page scrolls. */
  .app { display: block; height: auto; min-height: 100vh; }

  .sidebar {
    position: sticky; top: 0; z-index: 30;
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "brand store foot" "switch switch switch" "nav nav nav";
    align-items: center; gap: 0.45rem 0.7rem;
    padding: 0.55rem 0.8rem calc(0.55rem + env(safe-area-inset-bottom, 0));
    padding-top: calc(0.55rem + env(safe-area-inset-top, 0));
    border-right: none; border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
  }
  .sidebar .brand { grid-area: brand; font-size: 1.05rem; }
  .sidebar .brand .flame { width: 26px; height: 26px; }
  /* Wrap rather than squeeze: with five apps, `flex: 1` shrank every tab until
     the last one was unreadable/clipped. Wrapping keeps every app visible and
     legible, and costs one extra row only when there are more than three. */
  .app-switch { grid-area: switch; flex-direction: row; flex-wrap: wrap; gap: 0.35rem; }
  .app-tab { flex: 1 1 30%; min-width: 5.5rem; padding: 0.4rem 0.45rem; justify-content: center; }
  .app-tab .app-ico { width: 1.8rem; height: 1.8rem; font-size: 1.05rem; }
  .app-tab .app-txt small { display: none; }
  .app-tab .app-txt b { font-size: 0.8rem; }

  .store-pick { grid-area: store; flex-direction: row; align-items: center; gap: 0.4rem; min-width: 0; }
  .store-pick-label { display: none; }
  #store-switcher { min-width: 0; padding: 0.45rem 0.55rem; }

  .sidebar nav {
    grid-area: nav; flex-direction: row; gap: 0.3rem;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    padding-bottom: 0.15rem; scrollbar-width: none;
  }
  .sidebar nav::-webkit-scrollbar { display: none; }
  .nav-item { white-space: nowrap; padding: 0.5rem 0.75rem; flex: 0 0 auto; width: auto; }
  .nav-item span { width: auto; }

  .sidebar-footer { grid-area: foot; margin-top: 0; flex-direction: row; gap: 0.3rem; align-items: center; }
  .who-row { display: none; }
  #my-email { display: none; } /* alert-email settings live on desktop; keep the bar clean */
  #help-btn .help-lbl { display: none; } /* icon-only ❓ on mobile so it doesn't crush the store selector */
  .sidebar-footer .btn { padding: 0.45rem 0.6rem; }

  .content { overflow: visible; padding: 1rem 0.9rem 2.5rem; }
  .view-head { align-items: flex-start; gap: 0.7rem; }
  .view-head h1 { font-size: 1.3rem; }
  .head-actions { width: 100%; }

  /* One-column content; compact 2-up stat cards */
  .grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 0.7rem; }
  .stat-card { padding: 0.9rem; }
  .stat-num { font-size: 1.6rem; }
  .playlist-layout, .editor-cols, .ov-cols, .sys-grid { grid-template-columns: 1fr; }

  /* Bulk-select bar stays reachable under the app bar */
  .selbar { position: sticky; top: 96px; z-index: 10; }

  .modal { width: 100%; padding: 1.2rem; }
  .designer canvas { width: 100%; }
  .user-row { flex-wrap: wrap; }
  .user-row .u-name { min-width: 0; }
}

/* Staff availability grid (manager, read-only) */
.av-table { border-collapse: collapse; width: 100%; font-size: 0.82rem; }
.av-table th, .av-table td { border: 1px solid var(--border); padding: 0.4rem 0.45rem; text-align: center; white-space: nowrap; }
.av-table thead th { background: #f9fafb; color: var(--muted); font-weight: 700; font-size: 0.75rem; }
.av-table th.av-name { text-align: left; position: sticky; left: 0; background: #fff; z-index: 1; font-weight: 700; }
.av-table thead th.av-name { background: #f9fafb; }
.av-table td.av-on { background: #ecfdf3; color: #027a48; font-weight: 700; font-variant-numeric: tabular-nums; }
.av-table td.av-off { color: var(--border); }

/* Rota builder */
.rota-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: 12px; }
.rota-status { font-size: 0.85rem; font-weight: 600; margin: 0 0 0.5rem; min-height: 1.2em; }
.rota-status.draft { color: var(--muted); }
.rota-status.pub, .rota-status.ok { color: var(--green); }
.rota-status.bad { color: var(--red); }
.rota-table { border-collapse: collapse; width: 100%; font-size: 0.82rem; }
.rota-table th, .rota-table td { border: 1px solid var(--border); padding: 0; text-align: center; }
.rota-table thead th { background: #f9fafb; color: #475467; font-weight: 700; padding: 0.5rem 0.3rem; font-size: 0.75rem; white-space: nowrap; }
.rota-table th.rname { text-align: left; position: sticky; left: 0; background: #fff; z-index: 1; padding: 0.5rem 0.6rem; min-width: 150px; }
.rota-table thead th.rname { background: #f9fafb; }
.rn { font-weight: 700; color: var(--text); }
.rmeta { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.2rem; flex-wrap: wrap; }
.role-tag { font-size: 0.68rem; font-weight: 700; padding: 0.05rem 0.4rem; border-radius: 999px; background: #eef2ff; color: #3730a3; white-space: nowrap; }
.role-tag.none { background: #fef3c7; color: #92400e; }
.prio-tag { font-size: 0.68rem; font-weight: 800; padding: 0.05rem 0.35rem; border-radius: 999px; background: var(--accent); color: #fff; white-space: nowrap; }
.prio-sel { font-size: 0.68rem; font-weight: 700; padding: 0.1rem 0.15rem; border: 1px solid var(--border); border-radius: 6px; background: #fff; color: var(--accent); cursor: pointer; }
.prio-sel:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.rhrs { font-size: 0.72rem; color: var(--muted); font-weight: 600; }
.rcell { position: relative; }
.rota-sel { width: 100%; border: none; background: transparent; font-weight: 700; font-size: 0.8rem; padding: 0.55rem 0.2rem; text-align: center; text-align-last: center; color: inherit; cursor: pointer; appearance: none; -webkit-appearance: none; border-radius: 0; }
.rota-sel:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
/* Shift colours, owner's rule 2026-09-03: after 17:00 is blue, finishing by
   22:00 is yellow, open-to-close is green. Set by `classifyShift`. */
.k-day { background: #fde047; color: #422006; }
.k-evening { background: #38bdf8; color: #082f49; }
.k-long { background: #4ade80; color: #052e16; }
.k-off { background: #fca5a5; color: #7f1d1d; }
.rcell.conflict { box-shadow: inset 0 0 0 3px #dc2626; }
.rwarn { position: absolute; top: 1px; right: 2px; font-size: 0.7rem; z-index: 1; pointer-events: none; }
.rfoot th, .rfoot td { background: #f9fafb; font-size: 0.72rem; padding: 0.35rem; }
.rcov span { display: block; font-weight: 700; }
.rcov .low { color: var(--red); }
.rcov .ok { color: var(--green); }
.rota-cov { margin-top: 0.7rem; padding: 0.6rem 0.8rem; border-radius: 10px; font-size: 0.88rem; line-height: 1.5; }
.rota-cov.ok { background: #ecfdf3; color: #05603a; border: 1px solid #a6f4c5; }
.rota-cov.bad { background: #fef3f2; color: #b42318; border: 1px solid #fecdca; }

/* Staff detail (full page) */
.sd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; align-items: start; }
.sd-fld { display: flex; flex-direction: column; gap: 0.25rem; margin: 0 0 0.7rem; font-size: 0.82rem; font-weight: 600; color: #344054; }
.sd-fld input, .sd-fld select { font-weight: 500; }
.sd-chk { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; font-weight: 500; color: var(--text); margin: 0.4rem 0; }
.sd-chk input { width: auto; }
.sd-doc { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; padding: 0.55rem 0; border-bottom: 1px solid var(--border); }
.sd-doc:last-child { border-bottom: none; }
.sd-doc-t { font-weight: 600; }
.sd-doc-m { font-size: 0.78rem; color: var(--muted); }
@media (max-width: 720px) { .sd-grid { grid-template-columns: 1fr; } }

/* Staff record — polished read-only layout */
.sd-grid { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.sd-grid > .card { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 1.1rem 1.25rem; box-shadow: var(--shadow-xs); }
.sd-grid .list-title { display: flex; align-items: center; gap: 0.45rem; color: var(--accent); font-weight: 800; margin-bottom: 0.5rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border-2); }
.sd-grid .list-title .lt-ico { font-size: 1rem; filter: saturate(1.1); }
.sd-grid .kv { display: grid; grid-template-columns: minmax(90px, 38%) 1fr; gap: 0.35rem 1rem; align-items: baseline; padding: 0.45rem 0; border-bottom: 1px solid var(--border-2); font-size: 0.88rem; }
.sd-grid .kv:last-child { border-bottom: none; }
.sd-grid .kv .k { color: var(--muted); font-weight: 600; text-align: left; }
.sd-grid .kv .v { font-weight: 600; text-align: left; color: var(--text); word-break: break-word; }
.sd-grid .kv .v.v-empty { color: #cfd4dc; font-weight: 500; }
.sd-grid .kv .v.mono { font-family: ui-monospace, "SF Mono", monospace; font-size: 0.84rem; letter-spacing: 0.02em; }
/* Right-to-work action buttons + upload sit in their own tidy block */
.sd-rtw-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 0.6rem 0 0.2rem; }
.sd-rtw-upload { display: flex; gap: 0.4rem; align-items: center; background: var(--bg-3); border: 1px dashed var(--border); border-radius: 10px; padding: 0.5rem 0.6rem; margin: 0.3rem 0 0.2rem; }
.sd-rtw-upload input[type="file"] { flex: 1; min-width: 0; font-size: 0.8rem; }
.sd-detail-note { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.82rem; color: var(--muted); background: var(--bg-3); border: 1px solid var(--border-2); border-radius: 999px; padding: 0.35rem 0.8rem; margin: 0.2rem 0 0; }
.sd-payslip-up { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin-bottom: 0.7rem; padding: 0.6rem; background: var(--bg-3); border: 1px solid var(--border-2); border-radius: 10px; }
.sd-payslip-up input { flex: 1; min-width: 140px; font-size: 0.82rem; }
.sd-payslip-up input[type="file"] { flex: 1.6; }

/* Manager timesheet */
.ts-table { border-collapse: collapse; width: 100%; font-size: 0.82rem; }
.ts-table th, .ts-table td { border: 1px solid var(--border); padding: 0.45rem 0.5rem; text-align: center; white-space: nowrap; }
.ts-table thead th { background: #f9fafb; color: #475467; font-weight: 700; font-size: 0.74rem; }
.ts-table th.ts-name { text-align: left; position: sticky; left: 0; background: #fff; z-index: 1; min-width: 150px; }
.ts-table thead th.ts-name { background: #f9fafb; }
.ts-table td { font-variant-numeric: tabular-nums; }
.ts-rota { font-size: 0.68rem; color: var(--muted); font-weight: 500; margin-top: 1px; }
.ts-over { background: #fef3f2; color: #b42318; font-weight: 700; }
.ts-over .ts-rota { color: #d6817a; }
.ts-zero { color: var(--border); }
.ts-over-total { color: #b42318; font-weight: 800; }
.ts-under { color: var(--muted); }
.ts-flag { display: inline-block; font-size: 0.68rem; font-weight: 700; color: #b42318; background: #fef3f2; border-radius: 999px; padding: 0.05rem 0.4rem; margin-top: 2px; }
.ts-table tr.ts-sum th, .ts-table tr.ts-sum td { background: #f9fafb; font-weight: 800; border-top: 2px solid var(--ink); }
.ts-table tr.ts-cum th, .ts-table tr.ts-cum td { background: #fff; font-weight: 700; color: var(--accent); }
.ts-cum-lbl { text-align: right; color: var(--muted) !important; font-weight: 500 !important; font-size: 0.72rem; }
.ts-edit { cursor: pointer; }
.ts-edit:hover { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 4px; }
/* Content somebody may read but not edit: the figures stay, the invitation to
   click them does not. */
.no-edit { cursor: default; }
.no-edit:hover { outline: none; }

/* Shift editor modal */
.se-row { border: 1px solid var(--border); border-radius: 12px; padding: 0.6rem 0.7rem; margin-bottom: 0.6rem; }
.se-times { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.se-times label { flex: 1; min-width: 200px; font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.se-times input { width: 100%; min-width: 190px; box-sizing: border-box; }
.se-foot { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; }
.se-btns { margin-left: auto; display: flex; gap: 0.35rem; }
.se-dur { font-weight: 700; }
.se-open { color: #92650e; font-weight: 700; font-size: 0.82rem; }
.se-newtag { color: #3538cd; font-weight: 700; font-size: 0.75rem; background: #eef2ff; padding: 1px 7px; border-radius: 999px; }
.se-manual { color: var(--muted); font-size: 0.72rem; font-style: italic; }

/* Pay (payroll) */
.pay-tag { display: inline-block; padding: 2px 7px; border-radius: 999px; font-size: 0.68rem; font-weight: 700; white-space: nowrap; }
.pay-tag.pay-bankcash { background: #eef2ff; color: #3538cd; }
.pay-tag.pay-cash { background: #fef3c7; color: #92650e; }
.pay-tag.pay-bank { background: #e6f4ee; color: #067a52; }
.pay-table td.pay-extra { color: #92650e; }
.pay-table td.pay-bank-cell { color: #067a52; font-weight: 700; }
.pay-table td.pay-cash-cell { color: #92650e; font-weight: 700; }
.pay-table td.pay-total-cell { font-weight: 800; }
.pay-table .pay-sep { border-left: 2px solid var(--ink); }
.pay-table th.pay-day { font-size: 0.72rem; }
.pay-table td.pay-dep { color: #6941c6; font-weight: 700; }
.pay-table td.pay-dep-full { color: #067a52; font-weight: 600; }

/* Activity log (audit trail) */
.audit-filters { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-bottom: 0.8rem; }
.audit-filters input[type="search"] { min-width: 220px; flex: 1 1 220px; }
.audit-filters input, .audit-filters select { padding: 0.4rem 0.55rem; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.au-chk { display: flex; align-items: center; gap: 0.3rem; font-size: 0.85rem; color: var(--muted); white-space: nowrap; }
.audit-table td, .audit-table th { text-align: left; vertical-align: top; }
.audit-table .au-when { white-space: nowrap; color: var(--muted); font-size: 0.78rem; }
.au-actor-t { color: var(--muted); font-size: 0.72rem; }
.au-app { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 0.7rem; font-weight: 700; white-space: nowrap; }
.au-app-attend { background: #eef2ff; color: #3538cd; }
.au-app-signage { background: #e6f4ee; color: #067a52; }
.au-app-platform { background: #f2f4f7; color: #475467; }
.au-action { font-size: 0.75rem; }
.au-fields { font-size: 0.68rem; color: var(--muted); margin-top: 2px; }
.au-id { color: var(--muted); font-size: 0.7rem; margin-left: 0.3rem; }
.au-res.ok { color: #067a52; font-weight: 700; }
.au-res.bad { color: #b42318; font-weight: 800; }
.audit-table tr.au-fail { background: #fef3f2; }
.au-ip { color: var(--muted); font-size: 0.72rem; white-space: nowrap; }
.audit-pager { display: flex; gap: 0.6rem; align-items: center; margin-top: 0.7rem; }

/* FirePantry (stock) */
.pn-table td, .pn-table th { text-align: left; vertical-align: middle; }
.pn-table th.ts-name { min-width: 160px; }
.pn-cat { display: block; font-size: 0.68rem; color: var(--muted); margin-top: 1px; }
.pn-onhand { font-variant-numeric: tabular-nums; font-weight: 700; }
.pn-onhand.pn-low { color: #92650e; }
.pn-onhand.pn-out { color: #b42318; }
.pn-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 0.7rem; font-weight: 700; }
.pn-badge.pn-ok { background: #e6f4ee; color: #067a52; }
.pn-badge.pn-low { background: #fef3c7; color: #92650e; }
.pn-badge.pn-out { background: #fee4e2; color: #b42318; }
.pn-actions { white-space: nowrap; display: flex; gap: 0.25rem; flex-wrap: wrap; }
.pn-suggest { font-weight: 800; color: #3538cd; font-variant-numeric: tabular-nums; }
.pn-total { font-weight: 800; }
.pn-up { color: #067a52; font-weight: 700; }
.pn-down { color: #b42318; font-weight: 700; }
/* Recipes + sales */
.pn-menu-card { padding: 0.8rem 1rem; margin-bottom: 0.6rem; }
.pn-menu-head { display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; }
.pn-menu-ing { font-size: 0.82rem; color: var(--muted); margin-top: 0.2rem; }
.pn-menu-ing b { color: var(--text); }
.pn-menu-cost { font-size: 0.78rem; font-weight: 700; color: #3538cd; background: #eef2ff; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.pn-norecipe { color: #92650e; font-weight: 600; }
.pm-ing-row { display: flex; gap: 0.4rem; align-items: center; margin-bottom: 0.4rem; }
.pm-ing-row .pm-ing-item { flex: 1; min-width: 0; }
.pm-ing-row .pm-ing-qty { width: 90px; flex: 0 0 auto; }
.pn-sale-row { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.pn-sale-row label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.8rem; font-weight: 600; color: #344054; }
#ps-result { margin-top: 0.6rem; display: flex; flex-direction: column; gap: 0.4rem; }
.pn-sale-ok { background: #e6f4ee; color: #067a52; border-radius: 8px; padding: 0.5rem 0.7rem; font-size: 0.85rem; font-weight: 600; }
.pn-sale-warn { background: #fef3c7; color: #92650e; border-radius: 8px; padding: 0.5rem 0.7rem; font-size: 0.85rem; font-weight: 600; }
#si-body textarea { width: 100%; font-family: ui-monospace, "SF Mono", monospace; font-size: 0.78rem; }
.si-map tr.si-unmatched th, .si-map tr.si-unmatched td { background: #fef3c7; }
.si-map .si-map-sel { min-width: 160px; }
.pu-row { display: flex; gap: 0.4rem; align-items: center; margin-bottom: 0.4rem; flex-wrap: wrap; }
.pu-row .pu-item { flex: 1; min-width: 120px; }
.pu-row .pu-qty, .pu-row .pu-price { width: 78px; flex: 0 0 auto; }
.pu-row .pu-unit { flex: 0 0 auto; max-width: 130px; }
.pu-unit-fixed { color: #667085; font-size: 0.82rem; align-self: center; }
.pu-line { margin-bottom: 0.5rem; }
.pu-hint { font-size: 0.76rem; color: #0e7490; margin: -0.1rem 0 0.2rem 2px; min-height: 0.9rem; }
.pn-pack-box { margin-top: 0.6rem; padding: 0.5rem 0.6rem; border: 1px dashed var(--border); border-radius: 8px; background: #fafafa; }
.pn-pack-row { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: 0.4rem; }
/* In a narrow modal the two fields fill the line and the remove button wraps.
   margin-left:auto sends it to the right edge either way, so it reads as
   belonging to the row above rather than as an orphan on the left. */
.pn-pack-row .pn-pdel { margin-left: auto; }
/* An unanswered box is not a blank -- it stops the delivery, so it has to read
   as something to do rather than as a hint that failed to render. */
.pu-ask { color: var(--warn, #b45309); font-weight: 600; }
.books-steps { margin: 0.6rem 0; padding-left: 1.2rem; line-height: 1.7; font-size: 0.9rem; }
.books-steps code { background: #f1f5f9; padding: 0.05rem 0.3rem; border-radius: 4px; font-size: 0.85em; }
.pu-total { text-align: right; margin-top: 0.5rem; font-size: 0.95rem; }
.pn-purchase-row:hover td, .pn-purchase-row:hover th { background: #fff7ed; }

/* Published rota (read-only) */
.pr-table { border-collapse: collapse; width: 100%; font-size: 0.85rem; }
.pr-table th, .pr-table td { border: 1px solid var(--border); padding: 0.55rem 0.5rem; text-align: center; white-space: nowrap; font-weight: 700; font-variant-numeric: tabular-nums; }
.pr-table thead th { background: #f9fafb; color: #475467; font-weight: 700; font-size: 0.75rem; }
.pr-table th.pr-name { text-align: left; position: sticky; left: 0; background: #fff; z-index: 1; min-width: 140px; }
.pr-table thead th.pr-name { background: #f9fafb; }
.pr-off { background: #fca5a5; color: #7f1d1d; }

/* Invoice scanner — reading spinner + review rows */
.scan-spin { display: flex; justify-content: center; padding: 1.4rem 0 0.6rem; }
.spinner { width: 30px; height: 30px; border: 3px solid var(--border); border-top-color: var(--accent, #e11d48); border-radius: 50%; animation: fs-spin 0.8s linear infinite; }
@keyframes fs-spin { to { transform: rotate(360deg); } }
.pn-scan-row { border: 1px solid var(--border); border-radius: 10px; padding: 0.5rem 0.6rem; margin-bottom: 0.5rem; background: var(--bg); }
.pn-scan-row.unmatched { border-color: #f59e0b; background: #fffbeb; }
.pn-scan-row .pu-row { margin-bottom: 0; }
.pn-scan-desc { font-size: 0.8rem; color: #475467; margin-bottom: 0.35rem; display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.pn-conf { font-size: 0.68rem; font-weight: 700; padding: 0.05rem 0.4rem; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.02em; }
.pn-conf.high { background: #dcfce7; color: #166534; }
.pn-conf.medium { background: #fef9c3; color: #854d0e; }
.pn-conf.low { background: #fee2e2; color: #991b1b; }

/* Catalogue import */
.pi-drop { display: block; border: 2px dashed var(--border); border-radius: 12px; padding: 1.1rem; text-align: center; cursor: pointer; color: #475467; background: var(--bg); font-weight: 600; }
.pi-drop:hover { border-color: var(--accent, #e11d48); color: var(--accent, #e11d48); }
.pi-ok { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; border-radius: 10px; padding: 0.6rem 0.7rem; line-height: 1.5; font-size: 0.9rem; }

/* Platform channels */
.ch-intro { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; border-radius: 10px; padding: 0.7rem 0.8rem; font-size: 0.88rem; line-height: 1.5; margin-bottom: 0.9rem; }
.ch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0.7rem; }
.ch-card { border: 1px solid var(--border); border-radius: 12px; padding: 0.8rem 0.9rem; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.ch-card.ch-off { opacity: 0.6; }
.ch-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.2rem; }
.ch-name { font-weight: 700; font-size: 1.02rem; }
.ch-toggle { display: flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; color: #475467; }
.ch-url-row { display: flex; gap: 0.35rem; align-items: center; }

/* Platform API credentials, inside a channel card. Collapsed once saved so the
   card stays scannable, open while it is still empty so it asks to be filled. */
.ch-creds { margin-top: .6rem; border-top: 1px solid var(--border); padding-top: .55rem; }
.ch-creds > summary { cursor: pointer; font-size: .82rem; list-style: none; display: flex; align-items: center; gap: .4rem; }
.ch-creds > summary::-webkit-details-marker { display: none; }
.ch-creds > summary::before { content: '▸'; color: var(--muted); font-size: .8rem; }
.ch-creds[open] > summary::before { content: '▾'; }
.ch-creds label { display: block; margin: .45rem 0 0; font-weight: 600; }
.ch-creds label input { width: 100%; margin-top: .15rem; font-weight: 400; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; }
.ch-creds code { font-size: .72rem; background: var(--bg-3); padding: .05rem .25rem; border-radius: 4px; }

.ch-url { flex: 1; min-width: 0; font-family: ui-monospace, Menlo, monospace; font-size: 0.72rem; padding: 0.4rem 0.5rem; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: #344054; }
.ch-unmapped { background: #fffbeb; }
.ch-unmapped .ch-map { border-color: #f59e0b; }
.uc-steps { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.3rem; }
.uc-step { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; }
.uc-dot { display: inline-flex; align-items: center; justify-content: center; width: 1.3rem; height: 1.3rem; border-radius: 50%; font-size: 0.8rem; font-weight: 700; color: #fff; flex: none; }
.uc-dot.ok { background: #16a34a; }
.uc-dot.wait { background: #f59e0b; }
.uc-dot.no { background: #d1d5db; }
.pv-doc { margin-top: 0.9rem; border-top: 1px solid var(--border); padding-top: 0.6rem; }
.pv-doc-img { max-width: 100%; max-height: 320px; border: 1px solid var(--border); border-radius: 8px; margin: 0.3rem 0; display: block; }
.pv-doc-row { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }

/* Invoice price-deviation vs agreed price list */
.pn-scan-row.pn-over { border-color: #dc2626; background: #fef2f2; }
.pu-price-over { border-color: #dc2626 !important; color: #991b1b; font-weight: 700; }
.pn-dev-line { margin-top: 0.35rem; }
.pn-price-badge { font-size: 0.78rem; padding: 0.1rem 0.45rem; border-radius: 6px; }
.pn-price-badge.ok { color: #15803d; }
.pn-price-badge.over { background: #fee2e2; color: #991b1b; }
.pn-devsum { margin-top: 0.4rem; font-size: 0.85rem; color: #991b1b; }
.pn-devsum:not(:empty) { background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; padding: 0.5rem 0.6rem; }

/* Help & guides modal — topic list → one full page per topic */
.help-menu { display: flex; flex-direction: column; gap: 0.5rem; max-height: 62vh; overflow-y: auto; margin-top: 0.2rem; }
.help-item { width: 100%; display: flex; align-items: center; gap: 0.7rem; padding: 0.85rem 0.9rem; background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; cursor: pointer; font: inherit; font-weight: 700; color: var(--text); text-align: left; transition: border-color 0.12s, background 0.12s; }
.help-item:hover { background: var(--bg-3); border-color: var(--accent); }
.help-ic { font-size: 1.15rem; flex: none; line-height: 1; }
.help-ttl { flex: 1; }
.help-chev { color: var(--muted); font-size: 1.25rem; line-height: 1; }
.help-back { background: none; border: none; color: var(--accent); font-weight: 700; cursor: pointer; padding: 0; margin: 0 0 0.5rem; font-size: 0.9rem; }
.help-dtitle { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 0.8rem; font-size: 1.2rem; }
.help-illus { margin: 0 0 0.9rem; }
.help-illus svg { border-radius: 10px; }
.help-steps { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 0.6rem; color: var(--text-2); line-height: 1.55; font-size: 0.95rem; }
.help-steps li { padding-left: 0.2rem; }
.help-steps b { color: var(--text); }
.help-steps a { color: var(--accent); font-weight: 700; }
.ev-meta { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.4rem; }

/* "Waiting on the other side" note — informational, not an error. Used by the
   Uber connection check when credentials are fine but scopes aren't granted. */
.uc-note { background: var(--amber-soft); border: 1px solid #f3d6a6; color: #b54708; border-radius: var(--radius); padding: 0.65rem 0.8rem; font-size: 0.86rem; line-height: 1.5; }


/* ------------------------------ FireSocial ---------------------------- */
.social-warn { background: var(--amber-soft); border: 1px solid #f3d6a6; color: #b54708; border-radius: var(--radius); padding: 0.8rem 1rem; margin-bottom: 1rem; font-size: 0.88rem; }
.social-warn > b:first-child { display: block; margin-bottom: 0.3rem; }  /* title only - inline <b> mid-sentence must not break the line */
.social-warn p { margin: 0.35rem 0 0; }
.social-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.8rem; margin-bottom: 1.2rem; }
.social-stat { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.8rem 0.9rem; }
.social-stat span { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; }
.social-stat b { display: block; font-size: 1.6rem; line-height: 1.2; margin: 0.15rem 0; }
.social-stat small { color: var(--muted); font-size: 0.75rem; }
.social-review { padding: 0.9rem 1rem; margin-bottom: 0.8rem; }
.social-review.needs-you { border-left: 3px solid var(--amber); }
.social-review-head { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.social-review-text { margin: 0.5rem 0 0.7rem; font-size: 0.9rem; line-height: 1.5; }
.social-stars { color: #f59e0b; letter-spacing: 0.06em; }
.social-reply { background: var(--bg-3); border-radius: var(--radius); padding: 0.7rem 0.8rem; }
.social-reply.published { border-left: 3px solid var(--ok, #16a34a); }
.social-reply p { margin: 0; font-size: 0.88rem; line-height: 1.5; }
.social-reply-text { width: 100%; font: inherit; font-size: 0.88rem; padding: 0.5rem 0.6rem; border: 1px solid var(--border-2); border-radius: var(--radius); background: var(--bg); color: inherit; resize: vertical; }
/* The queue shows each post whole — a veto decision needs the whole thing,
   hashtags included, not a two-line preview. */
.social-queue { display: flex; flex-direction: column; gap: 0.9rem; }
.social-post {
  display: flex; gap: 1rem; padding: 0.9rem 1rem;
  background: var(--bg-1); border: 1px solid var(--line); border-radius: 12px;
}
.social-post.vetoed, .social-post.failed { opacity: 0.6; }
.social-post-media { flex: 0 0 120px; }
.social-post-media img, .social-post-media video {
  width: 120px; height: 120px; object-fit: cover; border-radius: 8px; display: block;
}
.social-post-nomedia {
  width: 120px; height: 120px; border-radius: 8px; background: var(--bg-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; color: var(--muted);
}
.social-post-filename {
  font-size: 0.7rem; margin-top: 0.3rem; max-width: 120px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.social-post-body { flex: 1 1 auto; min-width: 0; }
.social-post-head { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.5rem; }
.social-post-cost { font-size: 0.78rem; margin-left: auto; }
/* pre-wrap so the blank line between caption, CTA and hashtags survives —
   that spacing is how the post will actually look on the platform. */
.social-post-caption {
  white-space: pre-wrap; word-break: break-word;
  font-size: 0.88rem; line-height: 1.5; margin-bottom: 0.6rem;
}
.social-post-foot { display: flex; gap: 0.8rem; align-items: flex-end; flex-wrap: wrap; }
.social-post-when { flex: 0 0 auto; margin: 0; font-size: 0.78rem; }
.social-post-when input { width: 14rem; }
@media (max-width: 620px) {
  .social-post { flex-direction: column; }
  .social-post-media img, .social-post-media video, .social-post-nomedia { width: 100%; height: 160px; }
  .social-post-filename { max-width: none; }
}

.social-caption {
  max-width: 420px; font-size: 0.85rem;
  /* A td ignores max-width, so the caption used to overflow into the Cost and
     Status columns once the queue grew a fourth column. Clamp it as a block. */
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; white-space: normal; word-break: break-word;
}
.social-queue-when, .social-queue-cost { white-space: nowrap; }
.pill.bad { background: var(--amber-soft); color: #b54708; border-color: #f3d6a6; }

.connect-card { padding: 1rem 1.1rem; margin-bottom: 1rem; }
.connect-head { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.pill.good { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.pill.wait { background: var(--bg-3); color: var(--muted); }
.pill.ready { background: var(--accent-soft); color: #b54708; border-color: #f3d6a6; }
.pill.auto { background: #e0f2fe; color: #075985; border-color: #bae6fd; }
.connect-steps { margin: 0.4rem 0 0.8rem; padding-left: 1.1rem; display: flex; flex-direction: column; gap: 0.55rem; }
.connect-steps li { font-size: 0.88rem; }
.connect-steps li p { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.84rem; line-height: 1.45; }
.connect-steps li a { font-size: 0.78rem; word-break: break-all; }
.connect-attach { border: 1px solid var(--border); border-radius: var(--radius); padding: 0.6rem 0.8rem; background: var(--bg-2); }
.connect-attach summary { cursor: pointer; font-weight: 700; font-size: 0.88rem; }
.connect-attach label { margin-top: 0.5rem; }
.connect-checks { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.8rem; }
.connect-check { display: flex; gap: 0.55rem; align-items: flex-start; font-size: 0.86rem; padding: 0.5rem 0.65rem; border-radius: var(--radius); background: var(--bg-3); }
.connect-check p { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.8rem; }
.connect-check.ok { background: #f0fdf4; }
.connect-check.ok > span { color: #16a34a; font-weight: 800; }
.connect-check.bad { background: #fef2f2; }
.connect-check.bad > span { color: #dc2626; font-weight: 800; }
.connect-check.skip > span { color: var(--muted); font-weight: 800; }

.connect-phase { margin: 0.6rem 0; }
.connect-phase > summary { cursor: pointer; font-weight: 800; font-size: 0.9rem; padding: 0.45rem 0; }
.connect-phase h4 { margin: 0.6rem 0 0; font-size: 0.9rem; }
.connect-phase-note { margin: 0.2rem 0 0.5rem; color: var(--muted); font-size: 0.8rem; line-height: 1.45; }
.connect-expect { margin: 0.25rem 0 0 !important; font-size: 0.8rem !important; color: #075985 !important; }
.connect-gotcha { margin: 0.25rem 0 0 !important; font-size: 0.8rem !important; color: #b54708 !important; }
.connect-limits { margin: 0.7rem 0 0; font-size: 0.78rem; color: var(--muted); line-height: 1.45; }

.social-media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0.9rem; }
.social-media-item { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--bg-2); display: flex; flex-direction: column; }
.social-media-item img, .social-media-item video { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--bg-3); display: block; }
.social-media-meta { padding: 0.55rem 0.65rem; display: flex; flex-direction: column; gap: 0.35rem; }
.social-media-meta b { font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.social-media-meta small { color: var(--muted); font-size: 0.74rem; }
.social-media-tags { display: flex; gap: 0.7rem; font-size: 0.78rem; }
.social-media-tags label { flex-direction: row; align-items: center; gap: 0.3rem; font-weight: 600; }
.social-media-tags input { width: auto; }

.social-hours { width: 100%; max-width: 620px; }
.social-hours th { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.social-hours td { padding: 0.25rem 0.35rem; }
.social-hours input[type="time"] { width: auto; padding: 0.3rem 0.4rem; font-size: 0.85rem; }
.social-hours input[type="checkbox"] { width: auto; }

/* Before/after strip for the photo framing preview. */
.se-compare { display: flex; gap: 0.6rem; overflow-x: auto; margin-top: 0.8rem; padding-bottom: 0.4rem; }
.se-compare figure { margin: 0; flex: 0 0 auto; }
.se-compare img { height: 190px; width: auto; border-radius: 8px; display: block; background: var(--bg-3); }
.se-compare figcaption { font-size: 0.72rem; margin-top: 0.25rem; text-align: center; }

/* A comment and our proposed answer to it. */
.social-comment .social-reply-box {
  background: var(--bg-3); border-radius: 8px; padding: 0.6rem 0.75rem; margin-top: 0.5rem;
}
.social-comment .social-reply-box textarea { width: 100%; margin: 0; }

/* Day grouping in the queue, for reviewing a week at a time. */
.social-day { margin-bottom: 1.1rem; }
.social-day-head {
  display: flex; gap: 0.5rem; align-items: baseline;
  padding: 0.35rem 0; margin-bottom: 0.4rem;
  border-bottom: 1px solid var(--line); font-size: 0.9rem;
}

/* Tells you a deploy has landed, instead of silently showing yesterday's app. */
.sw-update-bar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 1.2rem; z-index: 9999;
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.7rem 1rem; border-radius: 999px;
  background: var(--bg-1); border: 1px solid var(--line);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18); font-size: 0.88rem;
}
@media (max-width: 520px) {
  .sw-update-bar { left: 0.8rem; right: 0.8rem; transform: none; border-radius: 12px; justify-content: space-between; }
}

/* How many people each shift needs, day by day. Laid out like the rota below it
   so a number sits over the day it belongs to — a Saturday evening and a Tuesday
   lunchtime are not the same shift, and one number for the week is wrong for
   most of it. */
.rota-cover { margin: .6rem 0 .2rem; }
.rota-cover details { border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.rota-cover summary { cursor: pointer; padding: .5rem .8rem; font-size: .85rem; font-weight: 600; list-style: none; display: flex; align-items: center; gap: .5rem; }
.rota-cover summary::-webkit-details-marker { display: none; }
.rota-cover summary::before { content: '▸'; color: var(--muted); }
.rota-cover details[open] summary::before { content: '▾'; }
.rota-cover .cov-grid { display: grid; grid-template-columns: 5.5rem repeat(7, minmax(3rem, 1fr)); gap: .3rem; padding: 0 .8rem .8rem; align-items: center; }
.rota-cover .cov-day { text-align: center; font-size: .74rem; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.rota-cover .cov-lbl { font-size: .8rem; font-weight: 600; }
.rota-cover input { width: 100%; margin: 0; padding: .3rem .2rem; text-align: center; font-weight: 700; }
.rota-cover .cov-foot { padding: 0 .8rem .7rem; }

/* FireBooks — transaction evidence (receipt or a reason) */
.bk-evbar { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; justify-content: space-between;
  padding: 0.55rem 0.75rem; margin-bottom: 0.7rem; background: var(--bg-3); border: 1px solid var(--border-2); border-radius: 10px; }
.bk-evfrom { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; font-size: 0.85rem; color: var(--text-2); }
.bk-evfilter { display: flex; gap: 0.3rem; flex-shrink: 0; }
.bk-ev { white-space: nowrap; }
.bk-ev .btn.small, .bk-ev .bk-reason { vertical-align: middle; }
/* Amber row, not red: a receipt that has not been attached YET is an outstanding
   job, not an error. Red here would cry wolf on every fresh import. */
.bk-needs > td, .bk-needs > th { background: var(--amber-soft); }
.bk-reason { font-size: 0.8rem; color: var(--text-2); }
/* A suggestion from the mailbox sits ABOVE the manual buttons, on its own line,
   because it is an answer to the question the row is asking. Inline it read as
   a fourth button and got skipped. `nowrap` is dropped for this cell so the
   filename can breathe. */
.bk-sugg { display: flex; gap: 0.3rem; align-items: center; margin-bottom: 0.3rem; white-space: normal; }
.bk-sugg .btn.small { max-width: 22rem; overflow: hidden; text-overflow: ellipsis; }
/* The reasons sit under the suggestion, on the row, because they are what a
   person decides on. In a tooltip they may as well not exist. */
/* Not a button. The server reads on its own now, so this only ever reports. */
.bk-reading { font-size: 0.8rem; }
.bk-why { font-size: 0.75rem; color: var(--text-2); white-space: normal; max-width: 26rem; margin-bottom: 0.35rem; }
.bk-reasons { display: flex; flex-direction: column; gap: 0.3rem; }
.bk-reasons .btn { text-align: left; justify-content: flex-start; }

/* FireBooks — wage check (bank vs FireAttend) */
.wg-stats { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.5rem; }
.wg-stat { flex: 1 1 6rem; padding: 0.55rem 0.7rem; border: 1px solid var(--border-2); border-radius: 10px; background: var(--bg-2); }
.wg-stat-n { font-size: 1.35rem; font-weight: 700; line-height: 1.1; }
.wg-stat-l { font-size: 0.75rem; color: var(--muted); }
.wg-stat.wg-ok  { background: var(--green-soft); border-color: #bfe9d4; }
.wg-stat.wg-bad { background: var(--red-soft);   border-color: #f6cfcb; }
.wg-stat.wg-warn{ background: var(--amber-soft); border-color: #f6ddb0; }
.wg-net { font-size: 0.86rem; margin: 0 0 0.7rem; }
.wg-week { margin-bottom: 1.1rem; }
.wg-week-head { display: flex; gap: 0.5rem; align-items: center; font-size: 0.92rem; margin-bottom: 0.35rem; }
.wg-frozen { font-size: 0.72rem; color: var(--muted); font-weight: 600; }
.wg-pill { font-size: 0.7rem; font-weight: 700; padding: 0.12rem 0.5rem; border-radius: 999px; background: var(--bg-3); color: var(--text-2); }
.wg-pill.wg-ok   { background: var(--green-soft); color: #067a52; }
.wg-pill.wg-bad  { background: var(--red-soft);   color: #b42318; }
.wg-pill.wg-warn { background: var(--amber-soft); color: #92650e; }
.wg-prov-pill { background: var(--blue-soft); color: #175cd3; margin-left: 0.3rem; }
/* An open week is dimmed rather than coloured: its figures can still move, so
   it must not read with the same weight as a settled discrepancy. */
.wg-prov > td, .wg-prov > th { opacity: 0.62; }
.wg-refs { font-size: 0.76rem; color: var(--muted); line-height: 1.45; }
.wg-basis { font-size: 0.68rem; background: var(--bg-3); border-radius: 4px; padding: 0 0.25rem; }

/* FireBooks — confirming what an imported statement could not say itself */
.imp-acct { border: 1px solid var(--border); border-radius: 10px; padding: .6rem .7rem; margin: .6rem 0; background: var(--bg-2); }
.imp-head { font-size: .8rem; color: var(--muted); font-weight: 600; margin-bottom: .45rem; }
.imp-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.imp-row label { flex: 1 1 10rem; font-size: .75rem; color: var(--text-2); font-weight: 600; }
.imp-row select, .imp-row input { width: 100%; }
/* Amber, not red: these are questions to answer, not errors to fix. */
.imp-warn { margin-top: .45rem; padding: .4rem .55rem; border-radius: 8px; font-size: .78rem;
  background: var(--amber-soft); color: #92650e; border: 1px solid #f6ddb0; }
.imp-note { margin-top: .45rem; padding: .4rem .55rem; border-radius: 8px; font-size: .78rem;
  background: var(--bg-3); color: var(--text-2); border: 1px solid var(--border-2); }

/* The restaurant mailbox */
.mail-addr { font-size: .72rem; color: var(--muted); font-weight: 400; }
.mail-snip { font-size: .76rem; color: var(--muted); margin-top: .15rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mail-files { white-space: nowrap; }
/* The attach-from-mailbox picker */
.bp-list { max-height: 22rem; overflow-y: auto; margin-top: .5rem; border: 1px solid var(--border-2); border-radius: 10px; }
.bp-row { display: flex; gap: .6rem; align-items: center; justify-content: space-between;
  padding: .5rem .6rem; border-bottom: 1px solid var(--border-2); flex-wrap: wrap; }
.bp-row:last-child { border-bottom: none; }
.bp-meta { min-width: 0; font-size: .8rem; }
.bp-sub { color: var(--muted); font-size: .78rem; }
.bp-pick { display: flex; gap: .3rem; flex-shrink: 0; flex-wrap: wrap; }
.mail-folders { display: block; font-size: .72rem; color: var(--muted); margin-top: .2rem; }

/* ===== Sales & leakage =====
   Yours and theirs on ONE bar, to one scale across every platform — the whole
   value of the chart is the comparison, and a per-row scale destroys it. */
.bk-lk-range { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.lk-list { display: flex; flex-direction: column; gap: 1.1rem; }
.lk-row { padding: 0.8rem 0.9rem; background: var(--bg-3); border: 1px solid var(--border-2); border-radius: 10px; }
.lk-head { display: flex; gap: 0.5rem; align-items: baseline; justify-content: space-between; margin-bottom: 0.45rem; }
/* The bar is coloured by WHO ENDED UP WITH THE MONEY.
 *
 * Red is reserved for the platform's own cut — commission — so that the one
 * alarming colour on the screen means one thing. Ad spend is amber: they take
 * it, but we chose to spend it. Offers are blue because that money reached the
 * CUSTOMER, not the platform, and colouring a discount we chose the same red as
 * a commission invents a villain. Delivery and service fees are hatched grey:
 * the customer's money, never ours, shown for scale rather than as a loss. */
.lk-bar { display: flex; height: 15px; border-radius: 999px; overflow: hidden; background: var(--bg-2); }
.lk-yours { background: var(--green); }
.lk-theirs { background: var(--red); }
.lk-marketing { background: var(--amber); }
.lk-offers { background: var(--blue); }
.lk-fees {
  background: repeating-linear-gradient(45deg, var(--muted) 0 3px, transparent 3px 6px), var(--bg-2);
  opacity: .55;
}
/* Not read yet — deliberately flat and dull. It must not look like a finding. */
.lk-unread { background: var(--bg-3); box-shadow: inset 0 0 0 1px var(--border); }
/* At 9px the swatch version needs a real border, or "not itemised yet" appears
   with no colour beside it and reads as a rendering fault. */
.lk-key i.lk-unread { background: var(--bg-3); border: 1px solid var(--muted); box-shadow: none; }

.lk-keys { display: flex; flex-wrap: wrap; gap: .35rem .9rem; margin-top: .35rem; font-size: .78rem; color: var(--muted); }
.lk-key { display: inline-flex; align-items: center; gap: .3rem; }
.lk-key b { color: var(--text); font-variant-numeric: tabular-nums; }
.lk-key i { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.lk-warn { color: var(--red); }
.lk-nums { display: flex; gap: 1rem; flex-wrap: wrap; font-size: 0.85rem; margin-top: 0.45rem; }
.lk-pct { color: var(--red); }
.lk-note { font-size: 0.75rem; margin-top: 0.3rem; }
.lk-svg { width: 100%; height: 110px; margin-top: 0.7rem; display: block; }
/* The history bars use the same colours as the summary bar above them, or the
   two disagree about who took the money. */
.lk-r-yours { fill: var(--green); }
.lk-r-theirs { fill: var(--red); }
.lk-r-marketing { fill: var(--amber); }
.lk-r-offers { fill: var(--blue); }
.lk-r-fees { fill: var(--muted); opacity: .45; }
.lk-r-unread { fill: var(--border); }
/* A period that never stated its sales is drawn, and marked — leaving it out
   would read as a week with no trade. */
.lk-r-unknown { fill: var(--border-2); }
.lk-axis { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--text-2); }
.lk-foot { font-size: 0.75rem; margin-top: 0.9rem; }
.lk-till-cards { margin: 0.6rem 0 0.5rem; }
.lk-chips { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.lk-chip { font-size: 0.78rem; padding: 0.2rem 0.55rem; border-radius: 999px;
  background: var(--bg-2); border: 1px solid var(--border-2); }
.bk-lk-range { align-items: center; }
.lk-span { font-size: 0.75rem; margin-right: 0.35rem; white-space: nowrap; }
.lk-dates { display: inline-flex; gap: 0.3rem; align-items: center; }
.lk-dates input[type="date"] {
  font: inherit; font-size: 0.8rem; padding: 0.25rem 0.4rem;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg-2); color: inherit;
}

/* The platforms the leakage screen cannot see. Deliberately quiet — it is a
   caveat on the figures above it, not an error. */
.lk-gap { border-left: 3px solid var(--warn, #d98324); }
.lk-gaplist { margin: 6px 0 8px; padding-left: 20px; }
.lk-gaplist li { margin: 2px 0; }

/* Invitations waiting on the Staff screen. Deliberately quiet — these are
   people who have been asked, not a problem to be solved. */
.invite-panel { border: 1px solid var(--line, #e4e7ec); border-radius: 10px; padding: .4rem .6rem .1rem; margin-bottom: .9rem; background: var(--surface-2, #fafafa); }
.invite-head { font-size: .92rem; padding: .35rem .2rem .45rem; }
.invite-panel .user-row { border-bottom: 1px solid var(--line, #eef0f3); }
.invite-panel .user-row:last-child { border-bottom: 0; }

/* Somebody from another shop on this rota. Quiet — they are a normal part of
   the week, not a warning; the only thing worth saying is whose employee they
   are, because their record and pay live somewhere else. */
.rota-table tr.rvisit .rname { background: var(--surface-2, #fafafa); }
.rvtag {
  display: inline-block; margin-left: .4rem; padding: 0 .4rem; border-radius: 20px;
  background: var(--accent-soft, #ffe4d1); color: #b5460a;
  font-size: .62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  vertical-align: .1em;
}
/* Booked at another shop at that time — the clash, before you make it. */
.relse { font-size: .72rem; margin-right: .15rem; cursor: help; }

/* The platforms that arrive through Foodhub's relay. Deliberately plain — it is
   an explanation of why there is nothing to do, not a thing to do. */
.ch-card.ch-relay { background: var(--surface-2, #fafafa); border-style: dashed; }
.ch-card.ch-relay .ch-name { color: var(--muted, #667085); font-weight: 600; }
