/* Prototype palette (White / Aubergine / Crimson / Gold), light only, one 4px radius. Swap = edit :root. */
:root{
  --white: #FFFFFF; --ground: #F3F1F6; --ink: #25182E; --ink2: #5B4A66; --line: #E2DCE8;
  --act: #CA1F3D; --act-ink: #FFFFFF; --gold: #FFBE00;
  --ok: #1E7A46; --ok-bg: #E4F4EA; --warn: #9A6200; --warn-bg: #FBF0D9; --bad: #B3261E; --bad-bg: #FBE6E4;
  --radius: 4px; --font: "Inter", system-ui, -apple-system, "Segoe UI", "Noto Sans Bengali", sans-serif;
}
*{ box-sizing: border-box; }
html{ background: var(--ground); }
body{ margin: 0; background: var(--ground); color: var(--ink); font: 15px/1.5 var(--font); }
a{ color: inherit; }
button, input, select, textarea{ font: inherit; color: inherit; }

/* header band */
.top{ display: flex; align-items: center; gap: 24px; padding: 12px 24px; background: var(--ink); color: #fff; flex-wrap: wrap; }
.brand{ text-decoration: none; font-size: 19px; letter-spacing: .01em; }
.brand b{ color: var(--gold); font-weight: 600; }
.brand small{ display: block; font-size: 11px; color: #CFC3D8; letter-spacing: .04em; }
.nav{ display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav a{ padding: 8px 12px; border-radius: var(--radius); text-decoration: none; color: #E9E2EE; white-space: nowrap; }
.who > *{ white-space: nowrap; }
.nav a.on{ background: var(--act); color: var(--act-ink); }
.nav a .n{ margin-left: 6px; padding: 0 6px; border-radius: var(--radius); background: var(--gold); color: var(--ink); font-size: 12px; font-weight: 600; }
.who{ display: flex; align-items: center; gap: 18px; font-size: 13px; }
.lang button{ border: 0; background: none; padding: 4px 2px; color: rgba(255,255,255,.5); cursor: pointer; }
.lang button[aria-pressed=true]{ color: #fff; }
.lang i{ margin: 0 6px; color: rgba(255,255,255,.3); font-style: normal; }
.me b{ color: var(--gold); font-weight: 600; }
.mypin{ color: #E9E2EE; text-decoration: none; }
.out{ border: 1px solid rgba(255,255,255,.3); border-radius: var(--radius); background: none; color: #fff; padding: 5px 10px; cursor: pointer; }

/* sign-in screens */
.auth{ max-width: 420px; margin: 48px auto; padding: 28px; }
.auth form > label, #setpin > label{ margin-top: 14px; }
.auth .btn, #setpin .btn{ margin-top: 16px; }
.auth .foot{ margin: 16px 0 0; font-size: 14px; color: var(--ink2); }
.pinbox{ position: relative; display: block; }
.pinbox input{ padding-right: 44px; letter-spacing: .3em; font-size: 18px; }
.eye{ position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; background: none; color: var(--ink2); cursor: pointer; display: grid; place-items: center; }
.match{ min-height: 1.4em; margin: 8px 0 0; font-size: 14px; } .match.ok{ color: var(--ok); } .match.bad{ color: var(--bad); }
.err{ margin: 12px 0 0; color: var(--bad); font-size: 14px; }
[hidden]{ display: none !important; }
tr.muted td{ opacity: .55; }
/* the PO the AI read, with yellow boxes on each field */
.poview{ margin-top: 14px; }
.popage{ position: relative; margin: 8px 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; max-width: 100%; }
.popage canvas{ display: block; max-width: 100%; }
.pomark{ position: absolute; background: rgba(255,190,0,.28); outline: 2px solid var(--gold); border-radius: var(--radius); pointer-events: none; }
.pomark::after{ content: attr(data-label); position: absolute; left: 0; top: -16px; font-size: 10px; font-weight: 600; background: var(--gold); color: var(--ink); padding: 0 4px; border-radius: var(--radius); white-space: nowrap; }
/* change dots */
.dots{ display: inline-block; position: relative; vertical-align: middle; }
.dots summary{ list-style: none; cursor: pointer; color: var(--act); font-size: 11px; letter-spacing: 1px; }
.dots summary::-webkit-details-marker{ display: none; }
.dots-box{ position: absolute; z-index: 5; left: 0; top: 18px; min-width: 260px; max-height: 260px; overflow: auto; padding: 10px 12px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 6px 20px rgba(37,24,46,.12); font-size: 13px; color: var(--ink); text-transform: none; letter-spacing: 0; font-weight: 400; }
.dots-box div + div{ margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
@media print{ .top, .nav, .no-print, .tabs, .btn{ display: none !important; } main{ padding: 0; max-width: none; } .card{ border: 0; padding: 0; } body, html{ background: #fff; } }

/* page */
main{ max-width: 1240px; margin: 0 auto; padding: 24px; }
h1{ margin: 0 0 4px; font-size: 26px; font-weight: 600; }
h2{ margin: 0 0 12px; font-size: 18px; font-weight: 600; }
.sub{ margin: 0 0 20px; color: var(--ink2); }
.row{ display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread{ justify-content: space-between; margin-bottom: 12px; }
.card{ background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.grid2{ display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }

/* buttons */
.btn{ display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border: 1px solid var(--act); border-radius: var(--radius); background: var(--act); color: var(--act-ink); cursor: pointer; text-decoration: none; font-weight: 500; }
.btn.ghost{ background: var(--white); color: var(--act); }
.btn.quiet{ border-color: var(--line); background: var(--white); color: var(--ink); }
.btn:disabled{ opacity: .45; cursor: not-allowed; }
.btn.sm{ padding: 5px 10px; font-size: 13px; }

/* forms */
label{ display: block; font-size: 13px; color: var(--ink2); }
input, select, textarea{ display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
input:focus, select:focus, textarea:focus{ outline: 2px solid var(--act); outline-offset: -1px; }
.hint{ margin: 4px 0 0; font-size: 12px; color: var(--ink2); }

/* tables */
.tw{ overflow-x: auto; }
table{ width: 100%; border-collapse: collapse; background: var(--white); }
th, td{ padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th{ font-size: 12px; font-weight: 600; color: var(--ink2); text-transform: uppercase; letter-spacing: .03em; }
th small{ display: block; text-transform: none; letter-spacing: 0; font-weight: 400; }
td.num, th.num{ text-align: right; font-variant-numeric: tabular-nums; }
tr.click{ cursor: pointer; } tr.click:hover td{ background: #FAF8FC; }
tfoot td{ font-weight: 600; }
.qty input{ width: 84px; margin: 0 0 0 auto; text-align: right; }

/* status chips */
.chip{ display: inline-block; padding: 2px 8px; border-radius: var(--radius); font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip.ontime, .chip.done{ background: var(--ok-bg); color: var(--ok); }
.chip.risk, .chip.soon{ background: var(--warn-bg); color: var(--warn); }
.chip.late{ background: var(--bad-bg); color: var(--bad); }
.chip.open, .chip.draft{ background: var(--ground); color: var(--ink2); }
.count{ display: inline-block; min-width: 22px; padding: 0 6px; border-radius: var(--radius); background: var(--gold); color: var(--ink); font-weight: 700; text-align: center; }
.bad{ color: var(--bad); }

/* tabs */
.tabs{ display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 20px 0 16px; flex-wrap: wrap; }
.tabs a{ padding: 9px 14px; text-decoration: none; color: var(--ink2); border-bottom: 2px solid transparent; }
.tabs a.on{ color: var(--act); border-bottom-color: var(--act); font-weight: 600; }

/* gate box + notes */
.gate{ padding: 14px 16px; border-radius: var(--radius); background: var(--warn-bg); color: var(--warn); margin: 16px 0; }
.gate.ok{ background: var(--ok-bg); color: var(--ok); }
.gate.bad{ background: var(--bad-bg); color: var(--bad); }
.gate + .gate{ margin-top: -8px; }
.gate ul{ margin: 6px 0 0; padding-left: 20px; }
.note{ padding: 10px 14px; border-left: 3px solid var(--gold); background: var(--white); color: var(--ink2); font-size: 13px; margin: 12px 0; }
.formula{ font-size: 12px; color: var(--ink2); }
.kpis{ display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi{ background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi b{ display: block; font-size: 26px; font-weight: 600; }
.kpi span{ font-size: 13px; color: var(--ink2); }
.kpi.key b{ font-size: 20px; margin: 4px 0 2px; display: flex; gap: 8px; align-items: center; }
tr.phase th{ background: var(--ground); color: var(--ink); font-size: 12px; letter-spacing: .05em; padding-top: 12px; }
.sms{ font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; color: var(--ink2); }
.empty{ padding: 24px; text-align: center; color: var(--ink2); }

@media (max-width: 700px){ main{ padding: 16px; } .top{ padding: 12px 16px; gap: 10px; } h1{ font-size: 22px; } }
