@import url('https://fonts.googleapis.com/css2?family=Aleo:ital,wght@0,600;0,700;1,400&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --orange: #DA6A26; --teal: #438696; --deep-teal: #2F6B79; --deep-orange: #B4561A;
  --charcoal: #231F20; --slate: #5E6470; --cream: #FAEEE7; --tint: #E3EFF1; --rule: #E4DED9;
  --bg: #FFFFFF; --surface: #FFFFFF; --page: #FBF8F6; --text: var(--charcoal); --muted: var(--slate);
  --ok: #2E7D5B; --ok-bg: #E4F2EA; --warn: #9A5B00; --warn-bg: #FDF1DC; --bad: #B3261E; --bad-bg: #FBE7E5;
  --radius: 10px; --shadow: 0 1px 2px rgba(35,31,32,.06), 0 2px 8px rgba(35,31,32,.05);
  --head: 'Aleo', Georgia, serif; --body: 'Inter', Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--body); color: var(--text); background: var(--page); font-size: 14.5px; line-height: 1.45; }
a { color: var(--deep-teal); }
h1, h2, h3 { margin: 0; }
h1 { font-family: var(--head); font-weight: 700; color: var(--orange); font-size: 28px; line-height: 1.15; }
h2 { font-family: var(--head); font-weight: 700; color: var(--deep-teal); font-size: 19px; }
h3 { font-size: 14.5px; font-weight: 700; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--deep-teal); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.tagline { font-family: var(--head); font-style: italic; color: var(--deep-teal); }

/* ---------- shell */
.topbar { background: #fff; border-bottom: 3px solid var(--teal); position: sticky; top: 0; z-index: 20; }
.topbar-inner { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; gap: 18px; padding: 8px 20px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { height: 40px; width: auto; }
.brand span { font-family: var(--head); font-weight: 600; color: var(--deep-teal); font-size: 15px; border-left: 1px solid var(--rule); padding-left: 10px; }
nav.main { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
nav.main a { text-decoration: none; color: var(--charcoal); padding: 8px 12px; border-radius: 8px; font-weight: 500; white-space: nowrap; font-size: 14px; }
nav.main a:hover { background: var(--tint); }
nav.main a.active { background: var(--deep-teal); color: #fff; }
nav.main a .count { background: var(--orange); color: #fff; border-radius: 10px; padding: 0 6px; font-size: 11px; margin-left: 4px; font-weight: 700; }
.user { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.user a { color: var(--muted); }
main { max-width: 1280px; margin: 0 auto; padding: 24px 20px 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 2px solid var(--teal); }
.page-head .eyebrow { margin-bottom: 4px; }
footer.foot { max-width: 1280px; margin: 0 auto; padding: 14px 20px 30px; display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }

/* ---------- controls */
.btn { font: inherit; font-weight: 600; font-size: 13.5px; border-radius: 8px; padding: 8px 14px; border: 1px solid var(--deep-teal); background: var(--deep-teal); color: #fff; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; line-height: 1.2; }
.btn:hover { filter: brightness(1.08); }
.btn.secondary { background: #fff; color: var(--deep-teal); }
.btn.orange { background: var(--orange); border-color: var(--orange); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--deep-teal); padding: 6px 8px; }
.btn.ghost:hover { background: var(--tint); }
.btn.danger { background: #fff; color: var(--bad); border-color: var(--bad); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn[disabled] { opacity: .5; cursor: default; }
input, select, textarea { font: inherit; border: 1px solid #CFC8C2; border-radius: 8px; padding: 8px 10px; background: #fff; color: var(--text); width: 100%; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--slate); margin-bottom: 4px; }
.field { margin-bottom: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filters .field { margin: 0; min-width: 150px; }
.check { display: flex; gap: 6px; align-items: center; font-weight: 500; color: var(--text); font-size: 13.5px; }
.check input { width: auto; }

/* ---------- cards & tables */
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.cols { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; align-items: start; }
.cols-even { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { background: var(--deep-teal); color: #fff; font-weight: 600; text-align: left; padding: 8px 10px; font-size: 12.5px; white-space: nowrap; }
th:first-child { border-top-left-radius: 6px; } th:last-child { border-top-right-radius: 6px; }
td { padding: 9px 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--tint); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }

.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: #fff; border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px 16px; border-top: 4px solid var(--teal); }
.kpi .v { font-family: var(--head); font-weight: 700; font-size: 30px; color: var(--charcoal); line-height: 1.1; }
.kpi .v small { font-family: var(--body); font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi .l { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.kpi.alert { border-top-color: var(--orange); }

.chip { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 9px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.chip.todo { background: #F1EEEC; color: var(--slate); }
.chip.submitted { background: var(--warn-bg); color: var(--warn); }
.chip.done { background: var(--ok-bg); color: var(--ok); }
.chip.na { background: #F1EEEC; color: #8B8F98; text-decoration: line-through; }
.chip.late { background: var(--bad-bg); color: var(--bad); }
.chip.gate { background: var(--cream); color: var(--deep-orange); }
.chip.role { background: var(--tint); color: var(--deep-teal); }
.chip.phase { background: var(--deep-teal); color: #fff; }

.bar { height: 8px; border-radius: 4px; background: #EEE8E4; overflow: hidden; min-width: 80px; }
.bar > i { display: block; height: 100%; background: var(--teal); border-radius: 4px; }
.bar.orange > i { background: var(--orange); }
.flag { color: var(--bad); font-size: 12.5px; font-weight: 600; }
.flag::before { content: '⚑ '; }
.callout { background: var(--cream); border-left: 4px solid var(--orange); border-radius: 6px; padding: 12px 14px; margin: 12px 0; }
.callout strong { color: var(--deep-orange); }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }

/* ---------- phases & items */
.phase { margin-bottom: 18px; }
.phase-head { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 2px solid var(--teal); margin-bottom: 4px; flex-wrap: wrap; }
.phase-head h2 { flex: 1; min-width: 200px; }
.items { list-style: none; margin: 0; padding: 0; }
.item { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: start; padding: 10px 6px; border-bottom: 1px solid var(--rule); }
.item:hover { background: #FDFBFA; }
.item .tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #CFC8C2; display: grid; place-items: center; margin-top: 1px; font-size: 13px; color: #fff; background: #fff; cursor: pointer; padding: 0; }
.item .tick.done { background: var(--ok); border-color: var(--ok); }
.item .tick.submitted { background: var(--warn); border-color: var(--warn); }
.item .tick.na { background: #CFC8C2; border-color: #CFC8C2; }
.item .tick[disabled] { cursor: default; }
.item .t { font-weight: 600; cursor: pointer; }
.item .t:hover { color: var(--deep-teal); text-decoration: underline; }
.item .meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; margin-top: 2px; align-items: center; }
.item .right { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- binder */
.binder-hero { background: var(--deep-teal); color: #fff; border-radius: 14px; padding: 24px 26px; display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; position: relative; overflow: hidden; margin-bottom: 18px; }
.binder-hero::after { content: ''; position: absolute; right: -120px; top: -160px; width: 420px; height: 420px; border-radius: 50%; border: 6px solid var(--orange); border-left-color: transparent; border-bottom-color: transparent; transform: rotate(-20deg); opacity: .9; }
.binder-hero h1 { color: #fff; font-size: 30px; }
.binder-hero .eyebrow { color: #CFE5EA; }
.binder-hero p { margin: 8px 0 0; max-width: 620px; color: #E9F3F5; }
.ring { width: 112px; height: 112px; position: relative; z-index: 1; }
.ring svg { transform: rotate(-90deg); }
.ring .lbl { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; font-family: var(--head); font-weight: 700; font-size: 26px; line-height: 1; }
.ring .lbl small { display: block; font-family: var(--body); font-weight: 500; font-size: 11px; margin-top: 2px; opacity: .85; }
.team-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.person { border: 1px solid var(--rule); border-radius: 8px; padding: 10px 12px; background: #fff; }
.person .r { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--deep-teal); font-weight: 600; }
.person .n { font-weight: 600; margin-top: 2px; word-break: break-all; }
.mod-card { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 10px; background: #fff; margin-bottom: 8px; cursor: pointer; }
.mod-card:hover { border-color: var(--teal); box-shadow: var(--shadow); }
.mod-card .ic { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: var(--tint); color: var(--deep-teal); font-weight: 700; font-size: 15px; }
.mod-card.done .ic { background: var(--ok-bg); color: var(--ok); }
.mod-card.submitted .ic { background: var(--warn-bg); color: var(--warn); }
.mod-card .ttl { font-weight: 600; }
.mod-card .sub { font-size: 12.5px; color: var(--muted); }
.reader { max-width: 760px; }
.reader .content { font-size: 15px; line-height: 1.6; }
.reader .content h2 { margin: 22px 0 8px; font-size: 18px; }
.reader .content blockquote { margin: 12px 0; background: var(--cream); border-left: 4px solid var(--orange); padding: 10px 16px; border-radius: 6px; font-family: var(--head); font-style: italic; color: var(--deep-teal); }
.reader .content table { margin: 12px 0; }
.reader .content li { margin: 4px 0; }

/* ---------- drawer / modal */
.overlay { position: fixed; inset: 0; background: rgba(35,31,32,.38); z-index: 50; display: flex; justify-content: flex-end; }
.drawer { width: min(620px, 100%); background: #fff; height: 100%; overflow-y: auto; padding: 22px 24px 40px; box-shadow: -6px 0 24px rgba(0,0,0,.12); animation: slide .18s ease-out; }
.overlay.center { justify-content: center; align-items: flex-start; padding: 40px 16px; overflow-y: auto; }
.modal { width: min(760px, 100%); background: #fff; border-radius: 14px; padding: 24px; box-shadow: 0 10px 40px rgba(0,0,0,.2); }
@keyframes slide { from { transform: translateX(30px); opacity: .5; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.close { background: none; border: none; font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; font-size: 13.5px; margin: 12px 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.timeline { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.timeline li { padding: 7px 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 120px 1fr; gap: 10px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--charcoal); color: #fff; padding: 10px 18px; border-radius: 8px; z-index: 99; font-weight: 500; box-shadow: var(--shadow); }
.scale { display: flex; gap: 6px; }
.scale label { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 34px; border: 1px solid #CFC8C2; border-radius: 8px; cursor: pointer; margin: 0; color: var(--text); font-weight: 600; }
.scale input { display: none; }
.scale input:checked + span { color: #fff; }
.scale label:has(input:checked) { background: var(--deep-teal); border-color: var(--deep-teal); color: #fff; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--rule); margin-bottom: 14px; flex-wrap: wrap; }
.tabs button { font: inherit; background: none; border: none; padding: 8px 12px; border-bottom: 3px solid transparent; cursor: pointer; color: var(--muted); font-weight: 600; }
.tabs button.on { color: var(--deep-teal); border-bottom-color: var(--orange); }

/* ---------- charts */
.chart svg { width: 100%; height: auto; display: block; }
.chart text { font-family: var(--body); font-size: 11px; fill: var(--slate); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.ms-row { display: grid; grid-template-columns: 210px 1fr 90px; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--rule); font-size: 13px; }
.ms-track { position: relative; height: 18px; background: #F4F0ED; border-radius: 4px; }
.ms-track .target { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--charcoal); }
.ms-track .val { position: absolute; top: 3px; height: 12px; border-radius: 3px; background: var(--teal); }
.ms-track .val.over { background: var(--orange); }

/* ---------- login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--page); }
.login .box { background: #fff; border-radius: 16px; padding: 36px; width: min(440px, 100%); box-shadow: 0 8px 30px rgba(0,0,0,.08); border-top: 6px solid var(--teal); }
.login img { width: 170px; }

@media (max-width: 900px) {
  .cols, .cols-even, .grid2, .grid3 { grid-template-columns: 1fr; }
  .binder-hero { grid-template-columns: 1fr; }
  .ms-row { grid-template-columns: 1fr; }
  .brand span { display: none; }
  .topbar-inner { flex-wrap: wrap; }
  nav.main { order: 3; flex-basis: 100%; }
  main { padding: 16px 16px 48px; }
  .item { grid-template-columns: 28px 1fr; }
  .item .right { grid-column: 2; justify-content: flex-start; }
}
@media print {
  .topbar, .no-print, footer.foot { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  main { padding: 0; max-width: none; }
  .card { box-shadow: none; border: none; padding: 0; }
  .print-break { page-break-before: always; }
  .mod-print { page-break-inside: avoid; margin-bottom: 18px; }
}
