* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --brand: #b3261e;
  --brand-dark: #8c1d17;
  --bg: #faf7f5;
  --card: #ffffff;
  --text: #1f1a17;
  --muted: #7a6f6a;
  --ok: #1b7f3b;
  --warn: #b3261e;
  --line: #e8e0dc;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
.wrap { max-width: 520px; margin: 0 auto; padding: 16px; }
.wrap.wide { max-width: 1100px; }
header.app {
  background: var(--brand);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
header.app h1 { font-size: 18px; font-weight: 700; }
header.app .sub { font-size: 12px; opacity: .85; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  margin-top: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
h2 { font-size: 16px; margin-bottom: 10px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
input, select, textarea {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
}
textarea { resize: vertical; min-height: 60px; }
button {
  width: 100%;
  padding: 14px;
  margin-top: 14px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: var(--brand);
  border: 0;
  border-radius: 12px;
  cursor: pointer;
}
button:disabled { opacity: .5; cursor: not-allowed; }
button.secondary { background: #fff; color: var(--brand); border: 2px solid var(--brand); }
button.small { width: auto; padding: 8px 14px; font-size: 13px; margin: 0; }
button.danger { background: #fff; color: var(--warn); border: 1px solid var(--warn); }
.status { margin-top: 10px; font-size: 14px; padding: 10px 12px; border-radius: 10px; display: none; }
.status.show { display: block; }
.status.ok { background: #e6f4ea; color: var(--ok); }
.status.err { background: #fdeaea; color: var(--warn); }
.status.info { background: #eef2f8; color: #33507a; }
video, canvas.preview { width: 100%; border-radius: 12px; background: #000; aspect-ratio: 4/3; object-fit: cover; }
.big-time { font-size: 34px; font-weight: 800; text-align: center; }
.big-date { text-align: center; color: var(--muted); font-size: 14px; margin-top: 2px; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill.ok { background: #e6f4ea; color: var(--ok); }
.pill.bad { background: #fdeaea; color: var(--warn); }
.pill.mut { background: #f0ece9; color: var(--muted); }
.pill.brk { background: #fdf3e0; color: #9a6a00; }
/* finance role: read-only — hide editing UI.
   Staff tab stays VISIBLE for finance (they need salary + bank details to pay),
   but the add/edit form and action buttons are hidden. */
body.finance .tabs button[data-tab="shifts"],
body.finance .tabs button[data-tab="settings"],
body.finance #stFormBox,
body.finance #stTable button,
body.finance .danger { display: none !important; }
.addr { font-size: 11px; color: var(--muted); max-width: 220px; }
.wsub { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-top: 12px; }
.wsub .head { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: 14px; }
.wsub .note { margin: 8px 0; font-size: 14px; white-space: pre-wrap; }
.wsub .media { display: flex; gap: 8px; flex-wrap: wrap; }
.wsub .media img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; }
.wsub .media video { width: 200px; max-height: 140px; border-radius: 8px; background: #000; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 10px; }
th, td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-weight: 600; white-space: nowrap; }
td img.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; display: block; }
.lang { display: flex; gap: 4px; justify-content: flex-end; margin-bottom: 4px; }
.lang button {
  width: auto; margin: 0; padding: 4px 10px; font-size: 12px; font-weight: 700;
  background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.4); border-radius: 8px;
}
.lang button.active { background: #fff; color: var(--brand); border-color: #fff; }
.seg { margin-top: 4px; }
.seg button { margin-top: 0; padding: 12px 8px; font-size: 15px; }
.seg button.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.tabs { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.tabs button { width: auto; margin: 0; padding: 10px 16px; font-size: 14px; background: #fff; color: var(--text); border: 1px solid var(--line); }
.tabs button.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.muted { color: var(--muted); font-size: 13px; }
.tablewrap { overflow-x: auto; }
a { color: var(--brand); }
/* staff to-do tasks: priority colours (1 = urgent … 4 = low) */
.pill.p1 { background: #fdeaea; color: #b3261e; }
.pill.p2 { background: #fdf3e0; color: #9a6a00; }
.pill.p3 { background: #eef2f8; color: #33507a; }
.pill.p4 { background: #f0ece9; color: #7a6f6a; }
.task { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-top: 10px; }
.task.p1 { border-left: 5px solid #b3261e; }
.task.p2 { border-left: 5px solid #d68a00; }
.task.p3 { border-left: 5px solid #33507a; }
.task.p4 { border-left: 5px solid #a99f9a; }
.task .t-title { font-weight: 700; font-size: 15px; }
.task .t-details { font-size: 13px; color: var(--muted); margin-top: 4px; white-space: pre-wrap; }
.task .t-meta { font-size: 12px; color: var(--muted); margin-top: 6px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.task .t-meta .over { color: #b3261e; font-weight: 700; }
.task button { margin-top: 10px; padding: 10px; font-size: 14px; }
tr.overdue td { background: #fdeaea; }
/* live "working right now" board */
#liveBoard { border-color: var(--ok); }
.board-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.board-sec { margin-top: 12px; }
.board-sec h3 { font-size: 14px; color: var(--brand); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.board-sec h3 .pill { font-size: 11px; }
.worker { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; margin-top: 6px; }
.worker .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); flex: 0 0 auto; }
.worker.brk .dot { background: #d68a00; }
.worker .w-main { flex: 1; min-width: 0; }
.worker .w-name { font-weight: 700; font-size: 15px; }
.worker .w-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.worker .w-since { font-size: 12px; color: var(--muted); text-align: right; white-space: nowrap; flex: 0 0 auto; }
.board-empty { font-size: 13px; color: var(--muted); padding: 4px 0; }
.totals { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.totals .box { flex: 1; min-width: 120px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-align: center; }
.totals .box .n { font-size: 17px; font-weight: 800; line-height: 1.3; white-space: nowrap; }
.totals .box .l { font-size: 12px; color: var(--muted); }

/* ---------- PAID MARKETING (Ad Spend & ROI tab) ---------- */
.sec-h { font-size: 15px; margin: 22px 0 6px; color: var(--brand); }
/* daily spend vs sales — two bars a day, scaled to the biggest number in the range */
.adchart { display: flex; align-items: flex-end; gap: 4px; height: 160px; overflow-x: auto;
           padding: 6px 2px 0; border-bottom: 1px solid var(--line); }
.adchart .d { flex: 0 0 auto; width: 26px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.adchart .bars { display: flex; align-items: flex-end; justify-content: center; gap: 3px; height: 100%; }
.adchart .bar { width: 9px; min-height: 2px; border-radius: 3px 3px 0 0; }
.adchart .bar.sp { background: #c4562f; }
.adchart .bar.sa { background: var(--ok); }
.adchart .dl { font-size: 11px; color: var(--muted); text-align: center; margin-top: 5px; height: 14px; }
.adlegend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 8px; }
.adlegend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
/* month-to-date spend against the monthly cap */
.adpace { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.adpace .p { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; }
.adpace .p .top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 14px; }
.adpace .track { height: 10px; background: #f0ece9; border-radius: 999px; margin-top: 9px; overflow: hidden; }
.adpace .fill { height: 100%; border-radius: 999px; background: var(--ok); }
.adpace .fill.warn { background: #d98324; }
.adpace .fill.over { background: var(--warn); }
tr.adbest td { background: #e6f4ea; }
