/* ==========================================================================
   AILO Dashboard D17 — 택스데스크 (세무사 사무소 업무 현황)
   원형: 분할형 — 좌측 개요·고객사 목록 / 우측 고정 상세 패널, 네이비 풀높이 사이드바
   타이포: Pretendard(표 숫자 tabular) + Noto Serif KR(로고 인장만) / 컬러: 네이비 + 스카이, 헤어라인 보더·무그림자
   ========================================================================== */

:root {
  --ailo-bg: #eef2f7;
  --ailo-fg: #0f1d33;
  --ailo-muted: #56667d;
  --ailo-line: #dbe3ee;
  --ailo-accent: #1a6fb3;

  --d17-navy: #0d2240;
  --d17-navy-2: #16325a;
  --d17-sky: #3ea0e8;
  --d17-sky-50: #e8f3fc;
  --d17-surface: #ffffff;
  --d17-radius: 8px;
  --d17-serif: "Noto Serif KR", serif;

  /* 차트: 청구(밝은 스카이)·수금(네이비) 2단 서열 — dataviz --ordinal PASS */
  --d17-s-light: #5aa6e4;
  --d17-s-dark: #1d4f91;
  --d17-spark: #c3d6ec;
  --d17-grid: #e6ebf2;
  --d17-base: #c3cedc;
  --d17-axis: #6d7c92;

  /* 상태 */
  --d17-good: #0b7a3e; --d17-good-bg: #e2f4e9;
  --d17-warn: #8a5300; --d17-warn-bg: #fff1d4;
  --d17-crit: #b42828; --d17-crit-bg: #fde8e8;

  --d17-sb-w: 236px;
  --d17-top-h: 64px;
  --d17-gap: clamp(12px, 1.1vw, 16px);
}

body { background: var(--ailo-bg); font-size: 14px; }
.tbl td, .pager, .log time, .kpi__spark, .sched time, .dd-date { font-variant-numeric: tabular-nums; }

.app { display: flex; min-height: 100vh; }
.shell { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ---------- Sidebar ---------- */
.sb {
  position: sticky; top: 0; height: 100vh; width: var(--d17-sb-w); flex-shrink: 0;
  background: var(--d17-navy); color: #c9d6e8; display: flex; flex-direction: column;
  transition: width .28s var(--ailo-ease); overflow: hidden; z-index: 60;
}
.sb__brand { height: var(--d17-top-h); display: flex; align-items: center; gap: 8px; padding: 0 16px; border-bottom: 1px solid rgba(255, 255, 255, .08); flex-shrink: 0; }
.sb__logo { display: flex; align-items: center; gap: 12px; color: #fff; min-width: 0; flex: 1; white-space: nowrap; }
.sb__seal { width: 34px; height: 34px; border: 1.5px solid var(--d17-sky); color: var(--d17-sky); font-family: var(--d17-serif); font-weight: 700; font-size: 18px; display: grid; place-items: center; border-radius: 4px; flex-shrink: 0; }
.sb__name { display: flex; flex-direction: column; line-height: 1.2; font-weight: 800; font-size: 16px; letter-spacing: -.02em; }
.sb__name small { font-weight: 500; font-size: 11px; color: #8ea6c6; letter-spacing: 0; }
.sb__close { display: none; width: 34px; height: 34px; border: 0; background: rgba(255, 255, 255, .08); color: #fff; border-radius: 6px; }
.sb__nav { flex: 1; padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; overflow-x: hidden; }
.sb__nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 6px; font-weight: 500; white-space: nowrap; position: relative; color: #c9d6e8; transition: background .2s, color .2s; }
.sb__nav a i { width: 18px; text-align: center; color: #7f98bb; transition: color .2s; }
.sb__nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sb__nav a:hover i { color: #fff; }
.sb__nav a.is-active { background: var(--d17-navy-2); color: #fff; font-weight: 700; }
.sb__nav a.is-active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--d17-sky); }
.sb__nav a.is-active i { color: var(--d17-sky); }
.sb__nav em { margin-left: auto; font-style: normal; font-size: 11px; font-weight: 600; color: #9fb4d1; background: rgba(255, 255, 255, .07); padding: 1px 7px; border-radius: 4px; }
.sb__nav em.is-alert { background: #d64545; color: #fff; }
.sb__foot { padding: 12px 10px 14px; border-top: 1px solid rgba(255, 255, 255, .08); display: flex; flex-direction: column; gap: 10px; }
.sb__season { padding: 12px; border-radius: 6px; background: rgba(62, 160, 232, .12); border: 1px solid rgba(62, 160, 232, .25); white-space: nowrap; }
.sb__season p { font-size: 11px; color: #9fc6ea; }
.sb__season b { display: block; color: #fff; font-size: 13px; margin-top: 2px; }
.sb__collapse { display: flex; align-items: center; gap: 12px; border: 0; background: transparent; color: #9fb4d1; padding: 8px 12px; border-radius: 6px; font-size: 13px; white-space: nowrap; }
.sb__collapse:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sb__collapse i { width: 18px; transition: rotate .25s; }

html.sb-mini .sb { width: 68px; }
html.sb-mini .sb__name, html.sb-mini .sb__nav a span, html.sb-mini .sb__nav em, html.sb-mini .sb__season, html.sb-mini .sb__collapse span { display: none; }
html.sb-mini .sb__brand { padding: 0; justify-content: center; }
html.sb-mini .sb__logo { flex: none; }
html.sb-mini .sb__nav a { justify-content: center; padding: 12px 0; }
html.sb-mini .sb__collapse { justify-content: center; padding: 10px 0; }
html.sb-mini .sb__collapse i { rotate: 180deg; }
.sb-overlay { display: none; }

/* ---------- Topbar ---------- */
.top { height: var(--d17-top-h); background: var(--d17-surface); border-bottom: 1px solid var(--ailo-line); display: flex; align-items: center; gap: 16px; padding: 0 clamp(16px, 1.8vw, 24px); position: sticky; top: 0; z-index: 50; }
.top__burger { display: none; width: 40px; height: 40px; border: 1px solid var(--ailo-line); background: var(--d17-surface); border-radius: 6px; flex-shrink: 0; }
.top__title { margin-right: auto; min-width: 0; }
.crumb { display: flex; gap: 6px; font-size: 11px; color: var(--ailo-muted); line-height: 1.3; }
.crumb li + li::before { content: "›"; margin-right: 6px; }
.crumb a:hover { color: var(--ailo-accent); }
.top h1 { font-size: 18px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.35; }
.top__date { font-size: 13px; font-weight: 500; color: var(--ailo-muted); margin-left: 8px; }
.top__search { position: relative; width: clamp(200px, 22vw, 320px); }
.top__search i { position: absolute; left: 12px; top: 50%; translate: 0 -50%; font-size: 13px; color: var(--ailo-muted); }
.top__search input { width: 100%; height: 38px; border: 1px solid var(--ailo-line); border-radius: 6px; background: #f6f8fb; padding: 0 12px 0 34px; font: inherit; font-size: 13px; color: inherit; }
.top__search input:focus { outline: none; border-color: var(--ailo-accent); background: #fff; box-shadow: 0 0 0 3px var(--d17-sky-50); }
.top__actions { display: flex; align-items: center; gap: 8px; }
.icon-btn { position: relative; width: 38px; height: 38px; border: 1px solid var(--ailo-line); border-radius: 6px; background: var(--d17-surface); display: grid; place-items: center; }
.icon-btn:hover { border-color: var(--ailo-accent); color: var(--ailo-accent); }
.badge-n { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 4px; background: #d64545; color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.profile { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; padding: 4px 6px; border-radius: 6px; text-align: left; }
.profile:hover { background: #f3f6fa; }
.profile__ava { width: 34px; height: 34px; border-radius: 50%; background: var(--d17-navy); color: #fff; font-family: var(--d17-serif); font-weight: 700; display: grid; place-items: center; }
.profile__txt { display: flex; flex-direction: column; line-height: 1.25; }
.profile__txt b { font-size: 13px; }
.profile__txt small { font-size: 11px; color: var(--ailo-muted); }
.profile > i { font-size: 10px; color: var(--ailo-muted); }

.notif { position: relative; }
.notif__panel { position: absolute; right: 0; top: calc(100% + 8px); width: min(360px, calc(100vw - 32px)); background: var(--d17-surface); border: 1px solid var(--ailo-line); border-radius: var(--d17-radius); box-shadow: 0 18px 40px -18px rgba(13, 34, 64, .35); z-index: 90; }
.notif__head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--ailo-line); }
.notif__head small { background: var(--d17-sky-50); color: var(--ailo-accent); font-size: 11px; padding: 0 6px; border-radius: 4px; margin-left: 4px; }
.link-btn { border: 0; background: none; font-size: 12px; color: var(--ailo-accent); font-weight: 600; }
.link-btn:hover { text-decoration: underline; }
.notif__panel li { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-bottom: 1px solid var(--ailo-line); }
.notif__panel li:last-child { border-bottom: 0; }
.notif__panel li.is-new { background: #f7fbff; }
.notif__panel p { font-size: 13px; line-height: 1.45; }
.notif__panel small { display: block; font-size: 11px; color: var(--ailo-muted); }
.n-tag { flex-shrink: 0; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 4px; background: #e9eef5; color: #3d4f69; margin-top: 2px; }
.n-tag--crit { background: var(--d17-crit-bg); color: var(--d17-crit); }
.n-tag--warn { background: var(--d17-warn-bg); color: var(--d17-warn); }

/* ---------- Split layout ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--d17-gap); padding: var(--d17-gap) clamp(16px, 1.8vw, 24px); align-items: start; flex: 1; }
.split__list { display: flex; flex-direction: column; gap: var(--d17-gap); min-width: 0; transition: opacity .2s; }
.split__list.is-loading .kpis, .split__list.is-loading .row2 { opacity: .55; }
.split__detail { position: sticky; top: calc(var(--d17-top-h) + var(--d17-gap)); display: flex; flex-direction: column; gap: var(--d17-gap); max-height: calc(100vh - var(--d17-top-h) - var(--d17-gap) * 2); overflow-y: auto; scrollbar-width: thin; min-width: 0; }

/* filters */
.filters { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--ailo-line); border-radius: 6px; background: var(--d17-surface); overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 7px 16px; font-size: 13px; font-weight: 600; color: var(--ailo-muted); border-right: 1px solid var(--ailo-line); }
.seg button:last-child { border-right: 0; }
.seg button:hover { color: var(--ailo-fg); background: #f6f8fb; }
.seg button[aria-pressed="true"] { background: var(--d17-navy); color: #fff; }
.filters__note { font-size: 12px; color: var(--ailo-muted); }
.filters__note b { color: var(--ailo-fg); }

/* KPI strip */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--d17-surface); border: 1px solid var(--ailo-line); border-radius: var(--d17-radius); transition: opacity .2s; }
.kpi { padding: 14px 16px 12px; border-right: 1px solid var(--ailo-line); min-width: 0; display: flex; flex-direction: column; }
.kpi:last-child { border-right: 0; }
.kpi h2 { font-size: 12px; font-weight: 600; color: var(--ailo-muted); }
.kpi__v { font-size: clamp(20px, 1.7vw, 26px); font-weight: 800; letter-spacing: -.03em; margin-top: 4px; white-space: nowrap; }
.kpi__v small { font-size: 13px; font-weight: 600; color: var(--ailo-muted); margin-left: 2px; }
.kpi--alert { background: linear-gradient(180deg, #fff 0%, #fff7f7 100%); border-radius: 0 var(--d17-radius) var(--d17-radius) 0; }
.kpi--alert .kpi__v { color: var(--d17-crit); }
.delta { font-size: 11px; color: var(--ailo-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up { color: var(--d17-good); font-weight: 700; }
.down { color: var(--d17-crit); font-weight: 700; }
.neutral { color: var(--ailo-fg); font-weight: 700; }
.kpi__spark { height: 28px; margin-top: 10px; }
.kpi__spark svg { display: block; width: 100%; height: 100%; }

/* panels */
.panel { background: var(--d17-surface); border: 1px solid var(--ailo-line); border-radius: var(--d17-radius); padding: 16px; min-width: 0; }
.panel__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.panel__head h2 { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.panel__head h2 i { color: var(--ailo-accent); margin-right: 4px; }
.panel__sub { font-size: 12px; color: var(--ailo-muted); margin-top: 1px; }
.link-more { font-size: 12px; color: var(--ailo-accent); font-weight: 600; white-space: nowrap; }
.link-more:hover { text-decoration: underline; }
.row2 { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--d17-gap); transition: opacity .2s; }
.row2--even { grid-template-columns: 1fr 1fr; }

.legend { display: flex; gap: 12px; font-size: 12px; color: #33445d; }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; background: var(--c); }

/* D-day list */
.dday { display: flex; flex-direction: column; }
.dday__item { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--ailo-line); }
.dday__item:first-child { border-top: 0; padding-top: 0; }
.dday__badge { display: flex; flex-direction: column; align-items: center; border: 1px solid var(--ailo-line); border-radius: 6px; padding: 4px 0; line-height: 1.2; background: #f7f9fc; }
.dday__badge b { font-size: 15px; font-weight: 800; letter-spacing: -.02em; }
.dday__badge small { font-size: 10px; color: var(--ailo-muted); }
.is-crit .dday__badge { background: var(--d17-crit-bg); border-color: #f3c4c4; }
.is-crit .dday__badge b { color: var(--d17-crit); }
.is-warn .dday__badge { background: var(--d17-warn-bg); border-color: #f1d9a6; }
.is-warn .dday__badge b { color: var(--d17-warn); }
.dday__t { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dday__m { font-size: 12px; color: var(--ailo-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-meter { width: 64px; height: 6px; border-radius: 3px; background: var(--d17-sky-50); }
.mini-meter span { display: block; height: 100%; border-radius: 3px; background: var(--d17-s-dark); }

/* tags (icon + label) */
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 4px; white-space: nowrap; border: 1px solid transparent; }
.tag i { font-size: 10px; }
.tag--navy { background: #e4ebf5; color: var(--d17-navy-2); border-color: #cdd9ea; }
.tag--sky { background: var(--d17-sky-50); color: #145f99; border-color: #c9e2f6; }
.tag--warn { background: var(--d17-warn-bg); color: var(--d17-warn); border-color: #f1d9a6; }
.tag--good { background: var(--d17-good-bg); color: var(--d17-good); border-color: #bfe5cd; }
.tag--crit { background: var(--d17-crit-bg); color: var(--d17-crit); border-color: #f3c4c4; }

/* fee chart */
.panel--fee { display: flex; flex-direction: column; }
.chart { position: relative; width: 100%; }
.chart--fee { flex: 1; min-height: 210px; }
.chart--type { height: 236px; }
.fee-sum { display: grid; grid-template-columns: repeat(3, 1fr); margin: 12px 0 0; border-top: 1px solid var(--ailo-line); padding-top: 12px; }
.fee-sum div { padding: 0 12px; border-left: 1px solid var(--ailo-line); }
.fee-sum div:first-child { border-left: 0; padding-left: 0; }
.fee-sum dt { font-size: 11px; color: var(--ailo-muted); font-weight: 500; }
.fee-sum dd { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -.02em; }

/* table */
.panel--table { padding: 0; overflow: hidden; }
.panel__head--table { padding: 16px 16px 12px; margin: 0; align-items: center; flex-wrap: wrap; }
.tbl-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.chips { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.chips button { border: 1px solid var(--ailo-line); background: var(--d17-surface); border-radius: 99px; padding: 5px 12px; font-size: 12px; font-weight: 600; color: var(--ailo-muted); }
.chips button:hover { border-color: var(--ailo-accent); color: var(--ailo-accent); }
.chips button[aria-pressed="true"] { background: var(--d17-sky-50); border-color: var(--d17-sky); color: #145f99; }
.tbl-search { position: relative; }
.tbl-search i { position: absolute; left: 10px; top: 50%; translate: 0 -50%; font-size: 11px; color: var(--ailo-muted); }
.tbl-search input { height: 32px; width: 170px; border: 1px solid var(--ailo-line); border-radius: 6px; padding: 0 10px 0 28px; font: inherit; font-size: 12px; }
.tbl-search input:focus { outline: none; border-color: var(--ailo-accent); }
.tbl-wrap { overflow-x: auto; border-top: 1px solid var(--ailo-line); }
.tbl { width: 100%; min-width: 790px; border-collapse: collapse; font-size: 13px; }
.tbl th { background: #f6f8fb; font-size: 12px; font-weight: 600; color: var(--ailo-muted); text-align: left; padding: 0; border-bottom: 1px solid var(--ailo-line); white-space: nowrap; }
.tbl th button { border: 0; background: none; padding: 9px 10px; color: inherit; font-weight: inherit; display: inline-flex; align-items: center; gap: 6px; }
.tbl th button:hover { color: var(--ailo-fg); }
.tbl th button i { font-size: 10px; opacity: .5; }
.tbl th[aria-sort="ascending"], .tbl th[aria-sort="descending"] { color: var(--ailo-accent); }
.tbl th[aria-sort="ascending"] i, .tbl th[aria-sort="descending"] i { opacity: 1; }
.tbl th.num, .tbl td.num { text-align: right; }
.tbl th.num button { flex-direction: row-reverse; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--ailo-line); white-space: nowrap; }
.tbl tbody tr { cursor: pointer; transition: background .15s; }
.tbl tbody tr:hover { background: #f7faff; }
.tbl tbody tr:focus-visible { outline: 2px solid var(--ailo-accent); outline-offset: -2px; }
.tbl tbody tr.is-selected { background: var(--d17-sky-50); box-shadow: inset 3px 0 0 var(--d17-sky); }
.cl { display: flex; flex-direction: column; line-height: 1.3; }
.cl small { font-size: 11px; color: var(--ailo-muted); }
.book { display: inline-flex; align-items: center; gap: 8px; }
.book__bar { width: 46px; height: 6px; background: #e6edf6; border-radius: 3px; overflow: hidden; }
.book__bar i { display: block; height: 100%; background: var(--d17-s-dark); border-radius: 3px; }
.book b { min-width: 36px; font-weight: 600; }
.dd { display: inline-block; font-weight: 800; min-width: 40px; }
.dd.is-crit { color: var(--d17-crit); }
.dd.is-warn { color: var(--d17-warn); }
.dd-date { color: var(--ailo-muted); font-size: 11px; }
.empty { text-align: center !important; color: var(--ailo-muted); padding: 28px !important; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; font-size: 12px; color: var(--ailo-muted); gap: 10px; }
.pager__list { display: flex; gap: 4px; }
.pager__list button { min-width: 30px; height: 30px; border: 1px solid var(--ailo-line); background: var(--d17-surface); border-radius: 4px; font-size: 12px; font-weight: 600; }
.pager__list button:hover:not(:disabled) { border-color: var(--ailo-accent); color: var(--ailo-accent); }
.pager__list button.is-current { background: var(--d17-navy); border-color: var(--d17-navy); color: #fff; }
.pager__list button:disabled { opacity: .4; cursor: default; }

/* staff meters */
.meters { display: flex; flex-direction: column; gap: 14px; padding-top: 4px; }
.meters li { display: grid; grid-template-columns: 130px minmax(0, 1fr) 52px; align-items: center; gap: 12px; font-size: 13px; }
.meters__who { display: flex; align-items: center; gap: 8px; font-weight: 600; white-space: nowrap; }
.meters__who i { font-style: normal; width: 26px; height: 26px; border-radius: 50%; background: #e4ebf5; color: var(--d17-navy-2); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.meters__who small { font-weight: 400; color: var(--ailo-muted); font-size: 11px; }
.meters__bar { height: 8px; background: #e2ecf8; border-radius: 4px; }
.meters__bar span { display: block; height: 100%; border-radius: 4px; background: var(--d17-s-dark); }
.meters__bar.is-low { background: #fbeedb; }
.meters__bar.is-low span { background: #c27a00; }
.meters b { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }

/* ---------- Detail panel ---------- */
.detail { background: var(--d17-surface); border: 1px solid var(--ailo-line); border-radius: var(--d17-radius); overflow: hidden; }
.detail__head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 18px 16px 14px; background: linear-gradient(135deg, var(--d17-navy) 0%, var(--d17-navy-2) 100%); color: #fff; }
.detail__ava { width: 46px; height: 46px; border-radius: 6px; background: var(--d17-sky); color: var(--d17-navy); font-family: var(--d17-serif); font-weight: 700; font-size: 20px; display: grid; place-items: center; }
.detail__type { font-size: 11px; color: #9fc6ea; }
.detail__id h2 { font-size: 18px; font-weight: 800; letter-spacing: -.02em; line-height: 1.3; }
.detail__biz { font-size: 11px; color: #a9bcd6; font-variant-numeric: tabular-nums; }
.detail__head .tag { background: rgba(255, 255, 255, .95); }
.tabs { display: flex; border-bottom: 1px solid var(--ailo-line); padding: 0 8px; }
.tabs button { border: 0; background: none; padding: 11px 12px; font-size: 13px; font-weight: 600; color: var(--ailo-muted); position: relative; }
.tabs button:hover { color: var(--ailo-fg); }
.tabs button[aria-selected="true"] { color: var(--ailo-accent); }
.tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--ailo-accent); }
.tabpanel { padding: 14px 16px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin: 0; }
.facts dt { font-size: 11px; color: var(--ailo-muted); font-weight: 500; }
.facts dd { margin: 0; font-size: 13px; font-weight: 600; }
.detail__h { font-size: 12px; font-weight: 700; color: var(--ailo-muted); margin: 18px 0 10px; letter-spacing: .02em; }
.steps { display: grid; grid-template-columns: repeat(5, 1fr); counter-reset: s; }
.steps li { counter-increment: s; font-size: 11px; color: var(--ailo-muted); text-align: center; position: relative; padding-top: 30px; line-height: 1.3; }
.steps li::before { content: counter(s); position: absolute; top: 0; left: 50%; translate: -50% 0; width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 1.5px solid var(--d17-base); display: grid; place-items: center; font-size: 11px; font-weight: 700; z-index: 1; }
.steps li::after { content: ""; position: absolute; top: 11px; left: -50%; width: 100%; height: 2px; background: var(--ailo-line); }
.steps li:first-child::after { display: none; }
.steps li.is-done { color: var(--ailo-fg); }
.steps li.is-done::before { content: "✓"; background: var(--d17-s-dark); border-color: var(--d17-s-dark); color: #fff; }
.steps li.is-done::after, .steps li.is-now::after { background: var(--d17-s-dark); }
.steps li.is-now { color: var(--ailo-accent); font-weight: 700; }
.steps li.is-now::before { border-color: var(--d17-sky); color: var(--ailo-accent); box-shadow: 0 0 0 4px var(--d17-sky-50); }
.paid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; }
.paid__m { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.paid__m i { width: 100%; height: 18px; border-radius: 3px; background: var(--d17-s-dark); }
.paid__m small { font-size: 10px; color: var(--ailo-muted); }
.paid__m--late i { background: repeating-linear-gradient(135deg, #c27a00 0 3px, #f4c66a 3px 6px); }
.paid__m--no i { background: #fff; border: 1.5px solid var(--d17-crit); }
.paid__m--none i { background: #eef2f7; }
.paid__legend { display: flex; gap: 12px; margin-top: 8px; font-size: 11px; color: var(--ailo-muted); }
.paid__legend span { display: inline-flex; align-items: center; gap: 5px; }
.paid__legend i { width: 12px; height: 10px; border-radius: 2px; display: inline-block; }
.paid__legend .ok { background: var(--d17-s-dark); }
.paid__legend .late { background: repeating-linear-gradient(135deg, #c27a00 0 3px, #f4c66a 3px 6px); }
.paid__legend .no { border: 1.5px solid var(--d17-crit); }
.sched li { display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--ailo-line); font-size: 13px; }
.sched li:last-child { border-bottom: 0; }
.sched b { font-weight: 800; }
.sched b.is-crit { color: var(--d17-crit); }
.sched b.is-warn { color: var(--d17-warn); }
.sched time { color: var(--ailo-muted); font-size: 12px; }
.memo { font-size: 13px; line-height: 1.7; background: #fbfaf3; border: 1px solid #ece6c9; border-radius: 6px; padding: 12px; }
.detail__actions { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; padding: 0 16px 16px; }
.btn-pri, .btn-line { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; border-radius: 6px; font-size: 13px; font-weight: 600; padding: 0 12px; white-space: nowrap; transition: background .2s, border-color .2s, color .2s; }
.btn-pri { border: 0; background: var(--ailo-accent); color: #fff; }
.btn-pri:hover { background: #135a93; }
.btn-line { border: 1px solid var(--ailo-line); background: var(--d17-surface); }
.btn-line:hover { border-color: var(--ailo-accent); color: var(--ailo-accent); }
.btn-icon { width: 38px; padding: 0; }

/* log */
.log { background: var(--d17-surface); border: 1px solid var(--ailo-line); border-radius: var(--d17-radius); padding: 14px 16px; }
.log h2 { font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.log li { display: grid; grid-template-columns: 40px 1fr; gap: 10px; padding: 7px 0; font-size: 12.5px; border-top: 1px solid var(--ailo-line); }
.log li:first-child { border-top: 0; }
.log time { color: var(--ailo-muted); font-size: 12px; }
.log p { line-height: 1.45; color: #33445d; }
.log b { color: var(--ailo-fg); }

/* footer */
.foot { padding: 4px clamp(16px, 1.8vw, 24px) 20px; font-size: 12px; color: var(--ailo-muted); }
.foot a:hover { color: var(--ailo-accent); text-decoration: underline; }

/* ---------- Responsive ---------- */
@media (max-width: 1499.98px) {
  .split { grid-template-columns: minmax(0, 1fr) 340px; }
}
@media (max-width: 1399.98px) {
  .row2:not(.row2--even) { grid-template-columns: 1fr; }
  .chart--fee { min-height: 230px; flex: none; height: 230px; }
}
@media (max-width: 1199.98px) {
  .split { grid-template-columns: 1fr; }
  .split__detail { position: static; max-height: none; overflow: visible; display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; }
  .row2 { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
}
@media (max-width: 991.98px) {
  .sb { position: fixed; left: 0; top: 0; bottom: 0; height: 100%; width: min(290px, 86vw); translate: -105% 0; visibility: hidden; transition: translate .3s var(--ailo-ease), visibility .3s; z-index: 200; box-shadow: 20px 0 50px -20px rgba(0, 0, 0, .5); }
  html.sb-open .sb { translate: 0 0; visibility: visible; transition: translate .3s var(--ailo-ease), visibility 0s; } /* 열 때 visibility 즉시 → 곧바로 포커스 가능 */
  html.sb-mini .sb { width: min(290px, 86vw); }
  html.sb-mini .sb__name, html.sb-mini .sb__nav a span, html.sb-mini .sb__nav em, html.sb-mini .sb__season { display: revert; }
  html.sb-mini .sb__brand { padding: 0 16px; justify-content: flex-start; }
  html.sb-mini .sb__logo { flex: 1; }
  html.sb-mini .sb__nav a { justify-content: flex-start; padding: 10px 12px; }
  .sb__name { display: flex !important; }
  .sb__collapse { display: none; }
  .sb__close { display: grid; place-items: center; }
  .sb-overlay { display: block; position: fixed; inset: 0; background: rgba(6, 16, 32, .5); z-index: 190; opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s; }
  html.sb-open .sb-overlay { opacity: 1; visibility: visible; }
  html.sb-open body { overflow: hidden; }
  .top__burger { display: grid; place-items: center; }
  .top__date { display: none; }
  .profile__txt, .profile > i { display: none; }
  .row2, .row2--even { grid-template-columns: 1fr; }
  .chart--fee { flex: none; height: 230px; }
}
@media (max-width: 767.98px) {
  .top__search { display: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { border-bottom: 1px solid var(--ailo-line); }
  .kpi:nth-child(2n) { border-right: 0; }
  .kpi--alert { grid-column: 1 / -1; border-bottom: 0; border-radius: 0 0 var(--d17-radius) var(--d17-radius); }
  .split__detail { grid-template-columns: 1fr; }
}
@media (max-width: 575.98px) {
  .top { gap: 10px; }
  .top h1 { font-size: 17px; }
  .seg { width: 100%; }
  .seg button { flex: 1; padding: 8px 4px; }
  .tbl-tools, .tbl-search, .tbl-search input { width: 100%; }
  .meters li { grid-template-columns: 1fr 52px; }
  .meters__bar { grid-column: 1 / -1; grid-row: 2; }
  .dday__item { grid-template-columns: 58px minmax(0, 1fr); }
  .dday__item > .tag, .dday__item > .mini-meter { grid-column: 2; justify-self: start; }
  .notif { position: static; }
  .notif__panel { position: fixed; left: 12px; right: 12px; top: 70px; width: auto; }
  .detail__actions { grid-template-columns: 1fr 1fr; }
  .detail__actions .btn-icon { display: none; }
  .fee-sum dd { font-size: 15px; }
}
