/* ============================================================
   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; }
.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; }
.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) */
.store-checks { display: flex; flex-direction: column; gap: 0.4rem; max-height: 220px; 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); }
.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; }
  .app-switch { grid-area: switch; flex-direction: row; gap: 0.35rem; }
  .app-tab { flex: 1; 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 */
  .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; }
.k-morning { background: #fde047; color: #422006; }
.k-evening { background: #38bdf8; color: #082f49; }
.k-custom { background: #fdba74; color: #431407; }
.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; }

/* 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: 150px; font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.se-times input { width: 100%; }
.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; }
.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; }
.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; }
