:root {
  --navy: #0f1b33; --navy-2: #182847; --bg: #f4f6fa; --card: #fff; --line: #e2e7ef; --text: #16213a; --muted: #64748b;
  --accent: #1d4ed8; --ok: #15803d; --warn: #b45309; --bad: #b91c1c; --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif; color: var(--text); background: var(--bg); }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; } h2 { font-size: 15px; margin: 0 0 10px; } h3 { font-size: 13px; margin: 14px 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; background: #fff; width: 100%; }
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn { border: 1px solid var(--line); background: #fff; border-radius: 7px; padding: 6px 12px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: #f1f4f9; } .btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; } .btn.primary:hover { filter: brightness(1.08); }
.btn.small { padding: 3px 8px; font-size: 12px; } .btn.ghost { border-color: transparent; background: none; } .btn.danger { color: var(--bad); }
.muted { color: var(--muted); } .small { font-size: 12px; } .right { margin-left: auto; } .nowrap { white-space: nowrap; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .grow { flex: 1; min-width: 0; }

/* shell */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.shell.collapsed { grid-template-columns: 58px 1fr; } .shell.collapsed .side .label, .shell.collapsed .brand small { display: none; }
.side { background: var(--navy); color: #c9d4ea; padding: 14px 10px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.brand { color: #fff; font-weight: 700; font-size: 20px; letter-spacing: .06em; padding: 4px 10px 14px; cursor: pointer; }
.brand small { display: block; font-size: 10.5px; font-weight: 400; letter-spacing: .02em; color: #8fa1c4; }
.side a { display: flex; gap: 10px; align-items: center; color: inherit; padding: 8px 10px; border-radius: 7px; margin-bottom: 2px; }
.side a:hover { background: var(--navy-2); text-decoration: none; } .side a.on { background: var(--navy-2); color: #fff; box-shadow: inset 3px 0 0 #7aa2ff; }
.side .ico { width: 18px; text-align: center; } .side .foot { margin-top: auto; font-size: 12px; padding: 10px; color: #8fa1c4; }
.top { display: flex; gap: 12px; align-items: center; padding: 10px 24px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.search { position: relative; flex: 1; max-width: 520px; }
.results { position: absolute; top: 38px; left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(15,27,51,.14); max-height: 420px; overflow: auto; }
.results a { display: block; padding: 8px 12px; color: inherit; border-bottom: 1px solid var(--line); } .results a:hover { background: #f4f6fa; text-decoration: none; }
main { padding: 22px 24px 60px; max-width: 1400px; }
.head { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.demo { background: #fff7e6; border: 1px solid #f3d79b; color: #7a4b00; border-radius: 6px; padding: 1px 7px; font-size: 11px; font-weight: 600; }
.banner { background: #fff7e6; border: 1px solid #f3d79b; color: #7a4b00; border-radius: var(--radius); padding: 8px 12px; margin-bottom: 14px; }
.banner.info { background: #eef4ff; border-color: #c9dafc; color: #1e3a8a; }

/* cards, tables */
.grid { display: grid; gap: 14px; } .g2 { grid-template-columns: 1fr 1fr; } .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); }
.g21 { grid-template-columns: 2fr 1fr; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; min-width: 0; }
.stat .n { font-size: 28px; font-weight: 700; line-height: 1.1; } .stat .l { color: var(--muted); font-size: 12px; }
.stat .n.bad { color: var(--bad); }
table { width: 100%; border-collapse: collapse; } th { text-align: left; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
th, td { padding: 8px 8px; border-bottom: 1px solid var(--line); vertical-align: top; } tr:last-child td { border-bottom: 0; }
td select { padding: 3px 6px; width: auto; }
.list > div, .list > a { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); align-items: flex-start; color: inherit; }
.list > :last-child { border-bottom: 0; } .list > a:hover { text-decoration: none; background: #f8fafc; }
.empty { color: var(--muted); padding: 14px 0; text-align: center; }
.badge { display: inline-block; border-radius: 20px; padding: 1px 8px; font-size: 11.5px; font-weight: 600; background: #eef1f6; color: #475569; white-space: nowrap; }
.badge.ok { background: #e3f5e9; color: var(--ok); } .badge.warn { background: #fdf0d9; color: var(--warn); } .badge.bad { background: #fde4e4; color: var(--bad); }
.badge.acc { background: color-mix(in srgb, var(--accent) 14%, #fff); color: var(--accent); }
.ext { display: inline-grid; place-items: center; width: 34px; height: 24px; border-radius: 5px; font-size: 10px; font-weight: 700; color: #fff; background: #64748b; flex: none; }
.ext.pdf { background: #c2410c; } .ext.pptx { background: #be123c; } .ext.docx { background: #1d4ed8; } .ext.xlsx { background: #15803d; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; } .tabs a.on { color: var(--accent); border-color: var(--accent); font-weight: 600; } .tabs a:hover { text-decoration: none; color: var(--text); }
.logo { width: 38px; height: 38px; border-radius: 9px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.meter { height: 7px; background: #e8ecf3; border-radius: 6px; overflow: hidden; } .meter > i { display: block; height: 100%; background: var(--accent); }
.ring { --p: 0; width: 64px; height: 64px; border-radius: 50%; background: conic-gradient(var(--accent) calc(var(--p) * 1%), #e8ecf3 0); display: grid; place-items: center; flex: none; }
.ring b { background: #fff; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; }
.check { display: flex; gap: 8px; padding: 3px 0; } .check .y { color: var(--ok); } .check .n { color: var(--bad); }
.drop { display: block; border: 2px dashed #c5cede; border-radius: var(--radius); padding: 18px; text-align: center; color: var(--muted); cursor: pointer; }
.drop.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, #fff); }
.ai { border-left: 3px solid var(--accent); } .ai-tag { font-size: 11px; font-weight: 700; color: var(--accent); letter-spacing: .05em; }
.claim { padding: 5px 0; } .chip { display: inline-block; font-size: 11px; background: #eef1f6; border-radius: 4px; padding: 0 6px; margin: 0 4px 0 0; color: #475569; }
.chip.none { background: #fdf0d9; color: var(--warn); } .chip.bad { background: #fde4e4; color: var(--bad); }

/* calendar */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cal > div { background: #fff; min-height: 92px; padding: 4px 6px; font-size: 12px; } .cal .dow { min-height: 0; background: #f8fafc; color: var(--muted); font-weight: 600; }
.cal .out { background: #fafbfd; color: #b6c0d0; } .cal .today .d { background: var(--accent); color: #fff; border-radius: 10px; padding: 0 6px; }
.cal a { display: block; border-left: 3px solid var(--accent); background: #f4f6fa; border-radius: 3px; padding: 1px 5px; margin-top: 3px; color: inherit; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* document viewer */
.viewer iframe { width: 100%; height: 78vh; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.slide { aspect-ratio: 16 / 9; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 4% 5%; overflow: auto; border-top: 6px solid var(--accent); margin-bottom: 14px; box-shadow: 0 2px 10px rgba(15,27,51,.06); }
.slide h4 { font-size: clamp(18px, 2.2vw, 30px); margin: 0 0 3%; color: var(--navy); } .slide ul { margin: 0; padding-left: 1.2em; font-size: clamp(13px, 1.4vw, 19px); } .slide li { margin: .35em 0; }
.slide table, .page table { font-size: clamp(11px, 1.1vw, 15px); margin-top: 3%; } .slide th, .page th { background: #f4f6fa; }
.page { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 28px; margin-bottom: 14px; overflow: auto; } .page h4 { font-size: 17px; margin: 0 0 8px; }
.page pre { white-space: pre-wrap; font: 13px/1.55 ui-monospace, Menlo, monospace; margin: 0; }
.loc { font-size: 11px; color: var(--muted); float: right; }

/* modal, toast, login */
#modal { position: fixed; inset: 0; background: rgba(15,27,51,.45); display: grid; place-items: start center; padding: 6vh 16px; z-index: 50; overflow: auto; }
#modal[hidden] { display: none; }
.dialog { background: #fff; border-radius: 12px; padding: 20px; width: min(620px, 100%); box-shadow: 0 20px 60px rgba(15,27,51,.3); } .dialog.wide { width: min(900px, 100%); }
.field { margin-bottom: 10px; } .field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; } .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#toasts { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 60; }
.toast { background: var(--navy); color: #fff; padding: 9px 14px; border-radius: 8px; max-width: 420px; box-shadow: 0 8px 24px rgba(15,27,51,.25); } .toast.bad { background: var(--bad); }
.login { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(160deg, var(--navy), #1c3566); }
.login form { background: #fff; padding: 30px; border-radius: 14px; width: min(380px, 92vw); }
.login .brand { color: var(--navy); padding: 0 0 16px; font-size: 30px; } .login .brand small { color: var(--muted); font-size: 12px; }

/* presentation mode: the slide gets the screen; agenda folds to a rail, notes live in a drawer */
.present { position: fixed; inset: 0; background: #0b1426; color: #e6ecf7; display: grid; grid-template-rows: auto 1fr auto; z-index: 20; overflow: hidden; }
.present .bar { display: flex; gap: 10px; align-items: center; padding: 8px 16px; border-bottom: 1px solid #1f2d4a; }
.present .body { position: relative; display: grid; grid-template-columns: 250px 1fr; min-height: 0; transition: grid-template-columns .2s; }
.present.rail .body { grid-template-columns: 56px 1fr; }
.present .col { overflow: auto; padding: 12px; min-height: 0; } .present.rail .col.agenda { padding: 10px 8px; }
.present .col.mid { background: #111d36; display: flex; flex-direction: column; overflow: hidden; padding: 10px 16px; }
.present .itemhead { margin-bottom: 8px; flex: none; flex-wrap: nowrap; }
.present .stage { flex: 1; min-height: 0; overflow: auto; } .present .stage.img { display: flex; align-items: center; justify-content: center; overflow: hidden; }
.present .stage.img .pageimg { max-width: 100%; max-height: 100%; width: auto; height: auto; margin: 0; border: 0; border-radius: 8px; object-fit: contain; }
.present .stage .viewer iframe { height: 100%; min-height: 60vh; }
.present .card { background: #14213d; border-color: #24365c; color: inherit; margin-bottom: 12px; }
.present input, .present select, .present textarea { background: #0e1930; border-color: #2a3c63; color: #e6ecf7; }
.present .btn { background: #1a2a4c; border-color: #2a3c63; color: #e6ecf7; } .present .btn:hover { background: #22355e; } .present .btn.primary { background: var(--accent); border-color: var(--accent); }
.present .btn.ghost { background: none; border-color: transparent; }
.present .muted, .present h3 { color: #8fa1c4; }
.present .pill { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.tl { border-left: 2px solid #2a3c63; margin-left: 8px; padding-left: 14px; }
.tl > div { position: relative; padding: 7px 8px; border-radius: 7px; cursor: pointer; margin-bottom: 4px; } .tl > div:hover { background: #172544; }
.tl > div::before { content: ""; position: absolute; left: -21px; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: #2a3c63; border: 2px solid #0b1426; }
.tl > div.cur { background: #1a2a4c; } .tl > div.cur::before { background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.tl > div.done::before { background: #22c55e; } .tl > div.deferred::before { background: #f59e0b; }
.railitem { width: 36px; height: 36px; margin: 0 auto 8px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; cursor: pointer; background: #1a2a4c; border: 2px solid #2a3c63; }
.railitem:hover { border-color: #8fa1c4; } .railitem.cur { background: var(--accent); border-color: var(--accent); color: #fff; }
.railitem.done { border-color: #22c55e; } .railitem.deferred { border-color: #f59e0b; }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(400px, 92vw); background: #0f1a31; border-left: 1px solid #24365c; box-shadow: -18px 0 40px rgba(0,0,0,.35);
  padding: 14px; overflow: auto; transform: translateX(105%); transition: transform .22s ease; z-index: 3; }
.present.panel .drawer { transform: none; }
.handle { position: absolute; right: 0; top: 50%; transform: translateY(-50%); z-index: 2; background: #1a2a4c; color: #e6ecf7; border: 1px solid #2a3c63; border-right: 0;
  border-radius: 10px 0 0 10px; padding: 12px 8px; cursor: pointer; font-size: 11px; line-height: 1.4; opacity: .55; } .handle:hover { opacity: 1; }
.timer { font: 600 20px ui-monospace, Menlo, monospace; } .timer.over { color: #f87171; }
.present .slide, .present .page { color: var(--text); }
.present .foot { display: flex; gap: 8px; align-items: center; padding: 8px 16px; border-top: 1px solid #1f2d4a; }
@media (max-width: 1300px) { .present .keys { display: none; } }

@media (max-width: 1000px) {
  .shell { grid-template-columns: 58px 1fr; } .side .label, .brand small { display: none; }
  .g2, .g3, .g4, .g21, .two { grid-template-columns: 1fr; } main { padding: 16px 14px 60px; }
  .present .body, .present.rail .body { grid-template-columns: 1fr; } .present .col.agenda { display: none; }
  table { display: block; overflow-x: auto; }
}
@media print { .side, .top, .btn, #toasts { display: none !important; } .shell { display: block; } }
.pageimg { display: block; width: 100%; height: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; box-shadow: 0 2px 10px rgba(15,27,51,.08); }
details summary { cursor: pointer; color: var(--accent); }
.brandlogo { height: 40px; max-width: 160px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 4px 7px; flex: none; }
.brandlogo.sm { height: 24px; max-width: 80px; padding: 2px 4px; border-radius: 5px; vertical-align: middle; }
.present .brandlogo { height: 38px; border: 0; }
.orglogo { padding: 4px 6px 10px; } .orglogo img { max-width: 100%; max-height: 44px; background: #fff; border-radius: 8px; padding: 5px 8px; display: block; }
.shell.collapsed .orglogo { display: none; }
