:root {
  --teal: #006d77; --teal-d: #00525a; --teal-l: #e6f2f3; --gold: #f6c85f; --gold-l: #fdf4dc;
  --ink: #1d2a2e; --muted: #5f6f74; --line: #dde5e7; --bg: #f5f7f8; --card: #fff;
  --red: #b42318; --red-l: #fdecea; --green: #127a3c; --blue: #1d4ed8;
  --radius: 10px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, Arial, sans-serif; color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); font-size: 14px; }
#app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
#sidebar { background: #fff; border-right: 1px solid var(--line); padding: 18px 14px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; }
.brand img { width: 180px; display: block; }
.brand-sub { color: var(--muted); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; margin: 6px 0 18px 2px; }
#nav a { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; color: var(--ink);
  text-decoration: none; margin-bottom: 2px; }
#nav a:hover { background: var(--bg); }
#nav a.active { background: var(--teal-l); color: var(--teal-d); font-weight: 600; }
#nav .nav-title { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin: 14px 10px 6px; }
#nav .proj-name { font-weight: 600; margin: 0 10px 8px; line-height: 1.3; }
.side-foot { margin-top: auto; padding: 10px; }
.side-foot a { color: var(--muted); text-decoration: none; font-size: 13px; }
main { min-width: 0; }
#topbar { position: sticky; top: 0; z-index: 5; background: rgba(245,247,248,.95); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line); padding: 10px 24px; display: flex; gap: 18px; align-items: center; flex-wrap: wrap; min-height: 54px; }
#topbar .kpi { display: flex; flex-direction: column; }
#topbar .kpi b { font-size: 15px; }
#topbar .kpi span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
#topbar .spacer { flex: 1; }
.save-state { font-size: 12px; color: var(--muted); }
#view { padding: 22px 24px 60px; max-width: 1500px; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 0 0 8px; }
.sub { color: var(--muted); margin: 0 0 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 18px; margin-bottom: 16px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1100px) { .g4, .g6 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: 1fr; } }
.kcard { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kcard .lab { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.kcard .val { font-size: 22px; font-weight: 700; margin-top: 4px; }
.kcard.accent { background: var(--teal); color: #fff; border-color: var(--teal); }
.kcard.accent .lab { color: #cfe7e9; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
input, select, textarea { font: inherit; color: var(--ink); border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px;
  background: #fff; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(0,109,119,.25); border-color: var(--teal); }
input.num { text-align: right; }
input.in, select.in, textarea.in { color: var(--blue); }
textarea { width: 100%; resize: vertical; line-height: 1.45; }
.btn { font: inherit; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 7px 12px; border-radius: 8px;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn:hover { background: var(--bg); }
.btn.primary { background: var(--teal); color: #fff; border-color: var(--teal); }
.btn.primary:hover { background: var(--teal-d); }
.btn.gold { background: var(--gold); border-color: #e5b545; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.danger { color: var(--red); }
.btn.sm { padding: 4px 8px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
table.t { border-collapse: collapse; width: 100%; font-size: 13px; }
table.t th { background: #f0f4f5; color: var(--muted); font-weight: 600; text-align: left; font-size: 12px; padding: 7px 8px;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; white-space: nowrap; }
table.t td { padding: 4px 8px; border-bottom: 1px solid #eef2f3; vertical-align: middle; }
table.t td.r, table.t th.r { text-align: right; }
table.t tr.tot td { background: var(--teal-l); font-weight: 600; }
table.t tr.grand td { background: var(--gold-l); font-weight: 700; }
table.t input { padding: 4px 6px; width: 100%; }
table.t input.num { width: 84px; }
table.t input.hrs { width: 64px; }
table.t td.name input { min-width: 260px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tag { display: inline-block; font-size: 11px; padding: 2px 7px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); }
.tag.ovr { background: #fce4d6; border-color: #f2c4a8; color: #8a3b12; }
.tag.inc { background: var(--teal-l); border-color: #b9dadd; color: var(--teal-d); }
.code { display: inline-flex; width: 28px; height: 28px; border-radius: 7px; background: var(--teal); color: #fff; font-weight: 700;
  align-items: center; justify-content: center; flex: none; }
.sec-head { display: flex; gap: 10px; align-items: center; }
.sec-head input.sec-name { font-weight: 600; font-size: 15px; border-color: transparent; background: transparent; flex: 1; min-width: 200px; }
.sec-head input.sec-name:hover { border-color: var(--line); }
details.card > summary { list-style: none; cursor: pointer; }
details.card > summary::-webkit-details-marker { display: none; }
.warn { background: var(--red-l); border: 1px solid #f5c2bd; color: var(--red); border-radius: 8px; padding: 9px 12px; margin-bottom: 8px; font-size: 13px; }
.note { background: var(--gold-l); border: 1px solid #f0dca8; border-radius: 8px; padding: 9px 12px; font-size: 13px; }
.bar { height: 8px; border-radius: 4px; background: var(--teal); }
.bar-bg { background: #eef2f3; border-radius: 4px; height: 8px; }
.scen { border: 2px solid var(--line); border-radius: var(--radius); padding: 14px; background: #fff; }
.scen.active { border-color: var(--teal); background: var(--teal-l); }
.scen .big { font-size: 20px; font-weight: 700; }
.proj-card { cursor: pointer; }
.proj-card:hover { border-color: var(--teal); }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px;
  border-radius: 8px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 50; max-width: 80vw; }
#toast.show { opacity: .95; }
.modal-bg { position: fixed; inset: 0; background: rgba(15,23,26,.45); display: flex; align-items: center; justify-content: center; z-index: 40; }
.modal { background: #fff; border-radius: 12px; padding: 20px; width: min(720px, 94vw); max-height: 88vh; overflow: auto; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.pos { color: var(--green); } .neg { color: var(--red); }
.slot-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.vars { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.spinner { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.btn:not(.primary) .spinner { border-color: rgba(0,0,0,.15); border-top-color: var(--teal); }
@keyframes spin { to { transform: rotate(360deg); } }
table.t select { max-width: 210px; }
table.t td.name input { min-width: 320px; }
/* landing page (sign-in) */
#auth { min-height: 100vh; display: flex; flex-direction: column; background:
  radial-gradient(1200px 500px at 85% -10%, rgba(246,200,95,.25), transparent 60%),
  radial-gradient(900px 600px at -10% 110%, rgba(0,109,119,.12), transparent 60%), var(--bg); }
.land-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px clamp(16px, 5vw, 56px); }
.land-head img { height: 34px; display: block; }
.land-head .prod { font-weight: 700; color: var(--teal-d); letter-spacing: .02em; }
.land-main { flex: 1; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, 400px); gap: clamp(24px, 5vw, 64px);
  align-items: center; padding: 24px clamp(16px, 5vw, 56px) 40px; max-width: 1240px; width: 100%; margin: 0 auto; }
.land-hero .eyebrow { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--teal-d); background: var(--teal-l); border: 1px solid #b9dadd; border-radius: 999px; padding: 4px 10px; }
.land-hero h1 { font-size: clamp(34px, 5vw, 54px); line-height: 1.05; margin: 16px 0 14px; letter-spacing: -.02em; }
.land-hero h1 span { color: var(--teal); }
.land-hero .lead { font-size: 17px; line-height: 1.55; color: var(--muted); max-width: 560px; margin: 0 0 26px; }
.land-feats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 620px; }
.land-feat { background: rgba(255,255,255,.75); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.land-feat b { display: block; margin-bottom: 3px; }
.land-feat span { font-size: 13px; color: var(--muted); line-height: 1.45; }
.auth-card { width: 100%; padding: 24px; }
.auth-card h2 { font-size: 20px; margin: 0 0 4px; }
.auth-card form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.auth-card input { padding: 10px 12px; }
.auth-card .btn.primary { justify-content: center; padding: 10px 12px; font-weight: 600; }
.auth-card .err { color: var(--red); font-size: 13px; min-height: 1em; }
.land-foot { text-align: center; padding: 18px 16px 22px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }
.powered { color: var(--muted); text-decoration: none; font-size: 12px; }
.powered:hover { color: var(--teal-d); }
.powered b { letter-spacing: .06em; }
#sidebar .powered { display: block; padding: 10px 10px 0; }
@media (max-width: 860px) { .land-main { grid-template-columns: 1fr; } .land-feats { grid-template-columns: 1fr; } }
/* user box, locks, admin centre */
.side-foot { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line); }
.side-foot .who { font-size: 13px; font-weight: 600; }
.side-foot .who .tag { margin-left: 4px; }
.side-foot a, .side-foot button.linkish { color: var(--muted); text-decoration: none; font-size: 13px; background: none; border: 0;
  padding: 0; text-align: left; cursor: pointer; font: inherit; font-size: 13px; }
.side-foot a:hover, .side-foot button.linkish:hover { color: var(--teal-d); }
.side-foot a.active { color: var(--teal-d); font-weight: 600; }
.tag.lock { background: #eef0ff; border-color: #c9cff5; color: #2f3a8f; }
.lock-banner { background: #eef0ff; border: 1px solid #c9cff5; color: #2f3a8f; border-radius: 8px; padding: 10px 12px;
  margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--teal-d); border-bottom-color: var(--teal); font-weight: 600; }
.tabs a:hover { color: var(--ink); }
.empty { color: var(--muted); padding: 14px 4px; }
/* task-level comparison */
.cmp-tog { font-variant-numeric: tabular-nums; }
tr.cmp-detail > td { background: #f8fbfb; padding: 8px 10px 12px 52px; }
table.cmp-lines { font-size: 12px; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
table.cmp-lines th { position: static; font-size: 11px; }
table.cmp-lines td { vertical-align: top; padding: 5px 8px; }
.nowrap { white-space: nowrap; }
/* Microsoft / Google sign-in */
.sso { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.sso-btn { justify-content: center; padding: 10px 12px; font-weight: 600; text-decoration: none; }
.sso-mark { width: 16px; height: 16px; display: inline-block; flex: none; }
.sso-mark.microsoft { background: linear-gradient(90deg, #f25022 0 47%, transparent 47% 53%, #7fba00 53%) top / 100% 47% no-repeat,
  linear-gradient(90deg, #00a4ef 0 47%, transparent 47% 53%, #ffb900 53%) bottom / 100% 47% no-repeat; }
.sso-mark.google { border-radius: 50%; background: conic-gradient(#ea4335 0 25%, #fbbc05 0 50%, #34a853 0 75%, #4285f4 0); }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin-top: 14px; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
