:root {
  --font: "IBM Plex Sans", "Noto Sans SC", "Segoe UI", "Microsoft YaHei UI", sans-serif;
  --ink: #16324f; --page: #e8eef8; --paper: #ffffff; --muted: #5b7390; --line: #d5deeb;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--page); color: #1c2430; font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
#login-screen { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(420px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 28px 24px; }
.login-card h1 { margin: 0 0 6px; font-size: 22px; color: #1a4b9c; }
.login-card p { margin: 0 0 14px; color: #5b7390; font-size: 13px; }
.login-card label { display: block; font-size: 13px; color: #3d5874; margin-bottom: 10px; }
.login-card input, .form-grid input, .form-grid select, textarea {
  display: block; width: 100%; margin-top: 6px; border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 10px; font-family: inherit; font-size: 13px;
}
.quick-acc { display: flex; flex-wrap: wrap; gap: 6px; }
#app-screen { display: none; }
body.is-in #login-screen { display: none; }
body.is-in #app-screen { display: block; }
.app { display: flex; min-height: 100vh; align-items: flex-start; }
.side {
  width: 252px; flex: 0 0 252px; position: sticky; top: 0; height: 100vh;
  background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column;
}
.brand { padding: 20px 16px 14px; }
.brand .name { font-size: 22px; font-weight: 800; color: #1a4b9c; }
.brand .sub { font-size: 12px; margin-top: 6px; color: #5b7390; }
.menu { flex: 1; padding: 6px 10px 16px; overflow: auto; }
.lv1, .lv2 { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; font-size: 13.5px; cursor: pointer; }
.lv2 { padding-left: 28px; font-size: 12.5px; color: #3d5874; }
.lv1.on, .lv2.on, label.lv2:has(input:checked) { background: #e8efff; color: #1a4b9c; font-weight: 700; }
.kids { padding: 2px 0 8px; }
.nav-fold { display: flex; align-items: center; justify-content: space-between; width: 100%; border: 0; background: transparent; font: inherit; cursor: pointer; padding: 0; color: inherit; }
.nav-fold .caret { color: #5b7390; font-size: 11px; }
.nav-group.is-collapsed + .kids { display: none !important; }
.nav-group.is-collapsed .caret { transform: rotate(-90deg); }
.side-user { padding: 10px 14px; border-top: 1px solid var(--line); font-size: 12px; color: #3d5874; }
.side-user b { display: block; color: #1a4b9c; font-size: 13px; }
.main { flex: 1; min-width: 0; padding: 18px 22px 48px; }
.page-h h1 { margin: 0; font-size: 28px; color: #1a4b9c; }
.tabs { display: flex; margin: 14px 0 16px; border-bottom: 2px solid var(--line); }
.tabs button { border: 0; background: transparent; padding: 10px 18px; color: var(--muted); cursor: pointer; font: inherit; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tabs button.on { color: #16324f; font-weight: 700; border-bottom-color: #2f6bff; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar span { font-size: 13px; color: var(--muted); }
.year-select, .m-btn, .btn, .chip, .l2-line-sel {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 6px 12px; font-size: 13px; cursor: pointer; font-family: inherit;
}
.m-btn.on, .chip.on { background: #2f6bff; color: #fff; border-color: #2f6bff; font-weight: 700; }
.m-btn.is-off { opacity: .38; pointer-events: none; }
.btn.primary { background: #2f6bff; color: #fff; border-color: #2f6bff; font-weight: 700; }
.btn.ghost { background: #fff; }
.btn.danger { background: #c2410c; color: #fff; border-color: #c2410c; }
.btn-row { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-bottom: 14px; }
.card h2 { margin: 0 0 12px; font-size: 16px; }
.kpis { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.kpis-1 { grid-template-columns: 1fr; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.kpi.hero { text-align: center; box-shadow: 0 10px 28px rgba(36,72,128,.08); }
.k-label { font-size: 12px; color: var(--muted); }
.k-val { font-size: 32px; font-weight: 800; margin: 6px 0 4px; }
.k-val small { font-size: 14px; margin-left: 6px; }
.k-sub { font-size: 12px; color: #2f6bff; }
.treemap { display: flex; flex-direction: column; gap: 6px; min-height: 180px; }
.tm-row { display: flex; gap: 6px; flex: 1; min-height: 64px; }
.tm-cell { border-radius: 10px; color: #fff; padding: 10px 12px; display: flex; flex-direction: column; justify-content: flex-end; min-width: 0; }
.tm-name { font-size: 12px; opacity: .92; }
.tm-val { font-size: 22px; font-weight: 800; }
.tm-pct { font-size: 11px; opacity: .85; }
.lollipop { display: flex; flex-direction: column; gap: 7px; }
.lol-row { display: grid; grid-template-columns: 28px 148px 1fr 48px 48px; gap: 8px; align-items: center; font-size: 12px; }
.lol-rk { color: var(--muted); }
.lol-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lol-track { position: relative; height: 14px; background: #eef3fb; border-radius: 99px; }
.lol-stem { position: absolute; left: 0; top: 6px; height: 2px; background: #3d8bff; }
.lol-dot { position: absolute; top: 2px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: #fff; border: 2px solid #2f6bff; }
.lol-num, .lol-pct { text-align: right; }
.lol-pct { color: var(--muted); }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.split { display: grid; grid-template-columns: 168px minmax(0,1fr); gap: 16px; }
.chip-col { display: flex; flex-direction: column; gap: 6px; }
.semi-block { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.semi-wrap { position: relative; width: min(560px, 92%); }
.semi { width: 100%; aspect-ratio: 2 / 1; border-radius: 560px 560px 0 0; -webkit-mask: radial-gradient(circle at 50% 100%, transparent 58%, #000 59%); mask: radial-gradient(circle at 50% 100%, transparent 58%, #000 59%); }
.semi-lab { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); text-align: center; width: 80%; }
.semi-lab b { display: block; font-size: 36px; }
.semi-lab span { font-size: 12px; color: var(--muted); }
.legend { list-style: none; margin: 0; padding: 0; font-size: 13px; width: 100%; max-width: 640px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 32px; }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend b { margin-left: auto; }
.legend em { width: 46px; text-align: right; font-style: normal; color: var(--muted); }
.sw { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 10px; }
.bubbles { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; }
.bub { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 76px; }
.bub .dot { border-radius: 50%; display: grid; place-items: center; color: #1c2430; font-weight: 800; }
.bub .nm { font-size: 10px; text-align: center; color: var(--muted); min-height: 26px; }
.heat-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
table.heat { border-collapse: collapse; width: 100%; font-size: 11px; table-layout: fixed; }
.heat th, .heat td { border: 1px solid #d5deeb; padding: 5px 4px; text-align: center; }
.heat thead th, .heat tbody th { background: #f4f7fc; }
.heat tbody th { text-align: left; font-weight: 400; width: 132px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.heat .h0 { background: #f7faff; color: #b7c3d4; }
.heat .h1 { background: #dce9ff; }
.heat .h2 { background: #b7d2ff; }
.heat .h3 { background: #6ea4ff; color: #fff; }
.heat .h4 { background: #2f6bff; color: #fff; }
.heat .h5 { background: #1a4b9c; color: #fff; }
.l2-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.l2-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #f7faff; }
.l2-card-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 14px; font-weight: 600; }
.trend-svg { width: 100%; height: auto; display: block; }
.svg-num { font-size: 13px; fill: #16324f; font-weight: 600; }
.svg-lab { font-size: 12px; fill: #5b7390; }
.filter-bar { display: grid; grid-template-columns: 56px minmax(0,1fr); gap: 10px; padding: 10px 12px; border-radius: 12px; margin-bottom: 12px; }
.filter-bar.line { background: #f4f7fc; border: 1px solid #d5deeb; }
.filter-bar.dept { background: #f3faf8; border: 1px solid #cfe3dc; }
.filter-k { font-size: 12px; font-weight: 700; padding-top: 6px; }
.band { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px 6px; margin-bottom: 16px; }
.band-month { border-left: 4px solid #2f6bff; background: #f7faff; }
.band-trend { border-left: 4px solid #2a9d8f; background: #f4faf8; }
.sec-head { margin: 0 0 12px; font-size: 15px; color: #1a4b9c; }
.band-trend .sec-head { color: #1f6b58; }
.empty-year { background: #fff; border: 1px dashed #c5d2e6; border-radius: 16px; padding: 28px; color: var(--muted); text-align: center; }
#month-content.fade-swap { animation: fadeSwap .18s ease; }
@keyframes fadeSwap { from { opacity: .35; } to { opacity: 1; } }
.denied { display: none; background: #fff; border: 1px dashed #c5d2e6; border-radius: 16px; padding: 28px; color: var(--muted); text-align: center; }
.toast { position: fixed; right: 16px; bottom: 16px; z-index: 40; background: #16324f; color: #fff; border-radius: 12px; padding: 10px 14px; font-size: 13px; display: none; max-width: 360px; }
.modal-mask { display: none; position: fixed; inset: 0; background: rgba(22,50,79,.35); z-index: 30; align-items: center; justify-content: center; padding: 16px; }
.modal { background: #fff; border-radius: 16px; padding: 20px; width: min(520px, 100%); }
.modal h3 { margin: 0 0 10px; color: #1a4b9c; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td { border-bottom: 1px solid #e4ebf5; padding: 8px 6px; text-align: left; }
.pill { display: inline-block; border-radius: 999px; padding: 1px 8px; font-size: 12px; }
.pill.ok { background: #e8f6ef; color: #1f6b58; }
.pill.bad { background: #fde8e4; color: #9a3412; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-note { font-size: 12px; color: var(--muted); }
.chk-wrap { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-top: 8px; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.gate-list { max-height: 240px; overflow: auto; font-size: 12px; background: #f7faff; border-radius: 10px; padding: 8px 10px; }
.topbar-mobile { display: none; align-items: center; justify-content: space-between; padding: 10px 14px; background: #fff; border-bottom: 1px solid var(--line); }
.burger { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 6px 10px; }
@media (max-width: 860px) {
  .topbar-mobile { display: flex; }
  .app { flex-direction: column; }
  .side { display: none; width: 100%; flex-basis: auto; height: auto; position: static; }
  body.nav-open .side { display: flex; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .l2-grid, .split, .form-grid { grid-template-columns: 1fr; }
  .lol-row { grid-template-columns: 24px 1fr 48px; }
  .lol-pct { display: none; }
  .legend { grid-template-columns: 1fr; }
}
