* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg);
  font-size: 14px; -webkit-font-smoothing: antialiased; }

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

/* ---- sidebar rail: Pick n Pay Blue ---- */
.rail { width: 210px; background: var(--navy); color: #cfe0ec; flex-shrink: 0;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.rail .brand { padding: 22px 20px 16px; }
.rail .brand span { font-family: var(--font-head); font-weight: 800; font-size: 19px;
  color: #fff; display: block; letter-spacing: .2px; }
.rail .brand small { color: #8fb0c6; font-size: 11px; }
.rail nav { display: flex; flex-direction: column; padding: 8px 0; }
.rail nav a { padding: 12px 22px; color: #b8ccdb; cursor: pointer; font-size: 14px;
  border-left: 3px solid transparent; transition: all .12s; }
.rail nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.rail nav a.active { background: rgba(255,221,0,.12); color: #fff; font-weight: 600;
  border-left-color: var(--gold); }
.rail .sync { margin-top: auto; padding: 14px 20px 6px; font-size: 11px; color: #8fb0c6; }
.rail .sync b { color: var(--gold); }
.rail .foot { padding: 10px 20px 20px; font-size: 11px; color: #7ba0b8; line-height: 1.5; }

/* ---- main ---- */
.main { flex: 1; min-width: 0; }
.content { padding: 22px 30px 60px; max-width: 1280px; }
h1 { font-family: var(--font-head); font-weight: 700; font-size: 24px; color: var(--navy);
  margin-bottom: 4px; }
.sub { color: var(--grey); font-size: 13px; margin-bottom: 18px; max-width: 900px; line-height: 1.5; }
.page { display: none; }
.page.active { display: block; }

/* ---- attention strip ---- */
.attn { display: none; padding: 10px 30px; font-size: 13px; }
.attn.show { display: block; }
.attn { background: var(--red-bg); color: var(--red); border-bottom: 1px solid #f0cdd3; }
.attn.ok { background: var(--green-bg); color: var(--green); border-bottom-color: #c9e4cf; }
.attn b { font-weight: 700; }

/* ---- cards ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; margin: 4px 0 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow); }
.card .k { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--grey); }
.card .v { font-family: var(--font-head); font-size: 22px; font-weight: 700; color: var(--navy);
  margin-top: 4px; }
.card .v.good { color: var(--green); }
.card .v.bad { color: var(--red); }
.card .v.warn { color: var(--amber); }
.card .s { font-size: 12px; color: var(--grey); margin-top: 2px; }

/* ---- band + tables ---- */
.band { background: var(--navy); color: #fff; font-family: var(--font-head); font-weight: 600;
  font-size: 13px; padding: 8px 14px; border-radius: 8px 8px 0 0; margin-top: 8px; }
.tablewrap { background: var(--card); border: 1px solid var(--line); border-top: none;
  border-radius: 0 0 var(--radius) var(--radius); overflow: auto; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
thead th { background: var(--pale); color: var(--navy); font-weight: 600; text-align: left;
  padding: 8px 10px; border-bottom: 2px solid var(--line-2); white-space: nowrap;
  position: sticky; top: 0; z-index: 2; }
thead th.r { text-align: right; } thead th.c { text-align: center; }
thead th.y { background: #fff7cc; }
tbody td { padding: 6px 10px; border-bottom: 1px solid #f0ece0; white-space: nowrap; }
tbody td.r { text-align: right; font-variant-numeric: tabular-nums; }
tbody td.c { text-align: center; }
tbody td.b { font-weight: 600; }
tbody td.dim { color: var(--grey); }
tbody tr:hover { background: #fffdf5; }
tbody tr.tot td { background: var(--navy); color: #fff; font-weight: 700; border: none; }
tbody tr.tot td.pill { background: var(--navy); }
tbody tr.flag { background: var(--red-bg); }
tbody tr.flag:hover { background: #f9dde1; }

/* status pills */
td.pill { font-weight: 600; }
td.pill.ok { color: var(--green); }
td.pill.bad { color: var(--red); }
td.pill.warn { color: var(--amber); }

/* ---- editable yellow cells ---- */
td.edit { background: #fffbe0; cursor: pointer; text-align: center; font-weight: 600;
  color: var(--navy); position: relative; }
td.edit:hover { background: var(--gold); }
td.edit:hover::after { content: '✎'; position: absolute; right: 4px; top: 3px; font-size: 9px;
  color: var(--navy); opacity: .5; }
td.edit input { width: 58px; border: 2px solid var(--navy); border-radius: 4px; padding: 2px 4px;
  font: inherit; text-align: center; background: #fff; }

/* ---- controls ---- */
.controls { display: flex; align-items: center; gap: 12px; margin: 6px 0 4px; }
.controls .f { font-size: 12px; color: var(--grey); }
select { padding: 6px 10px; border: 1px solid var(--line-2); border-radius: 8px; font: inherit;
  background: #fff; color: var(--ink); }
button.ghost { padding: 6px 14px; border: 1px solid var(--line-2); background: #fff;
  border-radius: 8px; cursor: pointer; font: inherit; color: var(--navy); }
button.ghost:hover { background: var(--pale); }

.note { font-size: 12px; color: var(--grey); margin-top: 10px; line-height: 1.5; max-width: 960px; }

/* ---- charts ---- */
.chart { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; box-shadow: var(--shadow); flex: 1; min-width: 240px; }
.chart .ct { font-size: 12px; font-weight: 600; color: var(--navy); margin-bottom: 8px; }
.chart .dim { color: var(--grey); font-weight: 400; }

/* ---- toast ---- */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--charcoal); color: #fff; padding: 10px 20px; border-radius: 8px; font-size: 13px;
  opacity: 0; pointer-events: none; transition: all .2s; box-shadow: var(--shadow-lg); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.dim { color: var(--grey); }
