:root {
  --accent: #0b6bcb; --accent-dark: #084f96; --accent-soft: #e8f1fb;
  --ink: #1f2933; --muted: #616e7c; --line: #d9e0e7; --bg: #f3f5f8; --card: #fff;
  --ok: #1f7a3d; --ok-soft: #dcf2e3; --warn: #b42318; --warn-soft: #fde7e4; --amber: #8a5a00; --amber-soft: #fdf0cc; --grey-soft: #eceff3;
  --radius: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); }
[hidden] { display: none !important; }
button, input, select { font: inherit; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }

/* top bar */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; padding: 0 20px; height: 56px; background: var(--accent); color: #fff; }
.brand { font-weight: 700; font-size: 18px; color: #fff; letter-spacing: .2px; } .brand:hover { text-decoration: none; }
.search { position: relative; flex: 1; max-width: 460px; }
.search input { width: 100%; height: 36px; border: 0; border-radius: 18px; padding: 0 16px; background: rgba(255,255,255,.18); color: #fff; outline: none; }
.search input::placeholder { color: rgba(255,255,255,.8); } .search input:focus { background: #fff; color: var(--ink); }
.suggest { position: absolute; top: 42px; left: 0; right: 0; background: var(--card); color: var(--ink); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.18); overflow: hidden; }
.suggest a { display: block; padding: 10px 14px; color: var(--ink); border-bottom: 1px solid var(--line); } .suggest a:hover { background: var(--accent-soft); text-decoration: none; }
.suggest small { color: var(--muted); } .suggest .none { padding: 10px 14px; color: var(--muted); }
.spacer { flex: 1; }
.top .ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.55); border-radius: 16px; padding: 4px 12px; cursor: pointer; }
.top .ghost:hover { background: rgba(255,255,255,.15); }
.who { font-size: 13px; opacity: .9; }

/* layout */
.shell { display: flex; min-height: calc(100vh - 56px); }
.nav { width: 220px; flex: none; background: var(--card); border-right: 1px solid var(--line); padding: 16px 10px; }
.nav a { display: block; padding: 10px 14px; margin-bottom: 2px; border-radius: 8px; color: var(--ink); font-weight: 500; }
.nav a:hover { background: var(--grey-soft); text-decoration: none; } .nav a.on { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
main { flex: 1; min-width: 0; padding: 24px 28px 60px; max-width: 1180px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 8px; } .crumbs a { color: var(--muted); } .crumbs span { margin: 0 6px; }
h1 { margin: 0 0 4px; font-size: 26px; } h2 { margin: 28px 0 10px; font-size: 18px; } h3 { margin: 0 0 8px; font-size: 15px; }
.sub { color: var(--muted); margin: 0 0 20px; }
.notice { background: var(--amber-soft); color: var(--amber); border-radius: var(--radius); padding: 10px 14px; font-size: 13px; margin: 0 0 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.grid { display: grid; gap: 16px; } .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.tile { display: flex; flex-direction: column; gap: 4px; color: var(--ink); } .tile:hover { text-decoration: none; border-color: var(--accent); box-shadow: 0 2px 10px rgba(11,107,203,.15); }
.tile .big { font-size: 38px; font-weight: 700; color: var(--accent-dark); line-height: 1.1; } .tile .lbl { font-weight: 600; } .tile .hint { color: var(--muted); font-size: 13px; } .tile .go { margin-top: 8px; font-size: 13px; }

/* tables and chips */
.bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.bar label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 2px; }
select { height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; background: #fff; }
.chk { flex-direction: row !important; align-items: center; gap: 6px !important; font-size: 14px !important; color: var(--ink) !important; }
table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f8fafc; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
tr:last-child td { border-bottom: 0; } tbody tr.link { cursor: pointer; } tbody tr.link:hover td { background: var(--accent-soft); }
.tablewrap { overflow-x: auto; }
.pager { display: flex; gap: 10px; align-items: center; margin-top: 10px; color: var(--muted); font-size: 13px; }
.pager button { height: 32px; padding: 0 14px; border: 1px solid var(--line); background: #fff; border-radius: 8px; cursor: pointer; } .pager button:disabled { opacity: .45; cursor: default; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--grey-soft); color: var(--ink); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.warn { background: var(--warn-soft); color: var(--warn); } .pill.amber { background: var(--amber-soft); color: var(--amber); } .pill.accent { background: var(--accent-soft); color: var(--accent-dark); }
.sup { color: var(--muted); font-style: italic; }
.small { font-size: 12px; color: var(--muted); } .neg { color: var(--warn); } .pos { color: var(--ok); }

/* profile */
.head { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700; flex: none; }
.head .meta { color: var(--muted); } .head .chips { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 10px 16px; cursor: pointer; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.tabs button.on { color: var(--accent-dark); border-bottom-color: var(--accent); }
.list { list-style: none; margin: 0; padding: 0; } .list li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); } .list li:last-child { border: 0; }
.meter { position: relative; height: 8px; border-radius: 4px; background: var(--grey-soft); min-width: 90px; margin-top: 7px; } .meter i { position: absolute; inset: 0 auto 0 0; border-radius: 4px; background: var(--accent); }
.meter.risk i { background: var(--amber); }
.prov { margin-top: 18px; font-size: 12px; color: var(--muted); }

/* login */
.login { max-width: 380px; margin: 12vh auto; } .login form { display: flex; flex-direction: column; gap: 12px; }
.login input { height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; }
.btn { height: 40px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 600; cursor: pointer; padding: 0 18px; } .btn:hover { background: var(--accent-dark); }
.err { color: var(--warn); min-height: 20px; margin: 8px 0 0; }

/* board report + print */
.report-page .row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.commentary { min-height: 120px; border: 1px dashed var(--line); border-radius: var(--radius); padding: 10px; margin-top: 8px; }
@media print {
  .top, .nav, .noprint, .crumbs { display: none !important; } body { background: #fff; } main { padding: 0; max-width: none; }
  .card, table { border-color: #bbb; } h2 { break-after: avoid; } table { break-inside: auto; } tr { break-inside: avoid; }
}

/* phone */
@media (max-width: 800px) {
  .top { padding: 0 12px; gap: 8px; } .who { display: none; }
  .shell { flex-direction: column; } .nav { width: auto; display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; }
  .nav a { white-space: nowrap; margin: 0 2px; } main { padding: 16px 16px 48px; }
  .g2, .g4 { grid-template-columns: 1fr; } .head { align-items: flex-start; }
  th, td { padding: 8px 10px; }
}

/* dialogs and small buttons */
.dlg { border: 0; border-radius: var(--radius); padding: 22px; width: min(480px, 92vw); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.dlg::backdrop { background: rgba(31,41,51,.45); }
.dlg form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
.field input, .field select, .field textarea { font: inherit; font-weight: 400; color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.actions { display: flex; justify-content: flex-end; gap: 8px; }
.ghostbtn { background: #fff; color: var(--ink); border: 1px solid var(--line); } .ghostbtn:hover { background: var(--grey-soft); }
.linkbtn { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; font-weight: 600; } .linkbtn:hover { text-decoration: underline; }
.card .btn { margin-top: 10px; } .bar .btn { margin-top: auto; height: 34px; }

.informs { margin: 0 0 14px; padding: 8px 12px; background: var(--accent-soft); color: var(--accent-dark); border-radius: 8px; font-size: 13px; }

.refcard .refhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 6px; } .refcard .refhead h3 { margin: 0; font-size: 16px; }
.refcard table { margin: 8px 0 10px; } .plainlist { margin: 0; padding-left: 18px; } .plainlist li { padding: 3px 0; }

.explain { background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin: 4px 0 10px; font-size: 13px; } .explain p { margin: 4px 0; }
.draftbar { border: 1px solid var(--amber); background: var(--amber-soft); border-radius: 8px; padding: 8px 12px; margin: 8px 0; font-size: 13px; } .draftbar.ok { border-color: var(--ok); background: var(--ok-soft); } .draftbar p { margin: 2px 0; }
.actions.left { justify-content: flex-start; margin: 8px 0; } .rowbtns { display: flex; gap: 12px; } .linkbtn.danger { color: var(--warn); }

.graph { margin: 0 0 16px; } .grow { display: grid; grid-template-columns: 170px 1fr 36px; gap: 10px; align-items: center; margin: 5px 0; font-size: 13px; }
.gaxis { position: relative; height: 18px; background: var(--grey-soft); border-radius: 3px; } .ghead .gaxis, .gfoot .gaxis { background: none; height: 16px; }
.gbar { position: absolute; inset: 2px auto 2px 0; background: #f2c200; border-radius: 3px; } .gbar.risk { background: var(--amber); }
.gedge { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; z-index: 1; } .gtick, .gband { position: absolute; transform: translateX(-50%); font-size: 11px; color: var(--muted); }
.glabel { text-align: right; color: var(--muted); } .gval { font-weight: 700; }
@media (max-width: 640px) { .grow { grid-template-columns: 110px 1fr 30px; } }

.gbar.dark { background: #46566b; } .rrow { grid-template-columns: 200px 1fr 44px; } .facets { margin: 0 0 8px 20px; } .facets .glabel { font-size: 12px; }
.facets .gaxis { height: 12px; } .pair { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: center; margin: 4px 0; } .pair .grow { grid-template-columns: 70px 1fr 38px; margin: 2px 0; }
.graph h4 { margin: 12px 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
@media (max-width: 640px) { .rrow { grid-template-columns: 120px 1fr 38px; } }

.story { background: var(--accent-soft); border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; font-size: 14px; } .story h3 { margin: 0 0 4px; font-size: 13px; color: var(--accent-dark); }
.story p { margin: 4px 0; line-height: 1.5; } .stories { display: grid; gap: 4px; } .stories .story { margin: 0 0 8px; }
.story-line { font-size: 13px; color: var(--muted); margin: 10px 0 0; line-height: 1.5; border-top: 1px dashed var(--line); padding-top: 8px; }

.hr-line { color: var(--accent-dark); font-size: 13px; margin: 2px 0 6px; padding-left: 10px; border-left: 3px solid var(--accent); }

.fnsel { height: 34px; border-radius: 17px; border: 1px solid rgba(255,255,255,.5); background: rgba(255,255,255,.15); color: #fff; padding: 0 12px; margin-left: 12px; } .fnsel option { color: #111; }

.login select { width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; font: inherit; background: #fff; margin-bottom: 12px; } .demofoot { margin: 14px 0 0; text-align: center; }

.navhelp { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); } .navhelp span { display: block; padding: 4px 14px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); } .navhelp a { font-size: 14px; }
