/* ==========================================================================
   AILO Dashboard D19 — 로펌 매니저 (법무법인 업무 현황판)
   원형: 네이비 고정 사이드바 + 장부형 KPI 띠 + 테이블 중심 2단 / 타이포: Noto Serif KR(제목) + Pretendard(본문·수치)
   컬러: 아이보리 지면 + 딥 네이비 + 골드 괘선, 라이트 기본 · 다크 토글(같은 색상의 다크용 단계)
   ========================================================================== */

:root {
  --ailo-bg: #f4efe4;
  --ailo-fg: #1b2333;
  --ailo-muted: #5b6273;
  --ailo-line: #e2dac8;
  --ailo-accent: #1f3b6e;

  --d19-paper: #fffdf8;
  --d19-paper-2: #faf6ec;
  --d19-navy: #14213d;
  --d19-navy-2: #1d2d50;
  --d19-gold: #a97c16;
  --d19-gold-soft: #f3e8cc;
  --d19-gold-ink: #7a5806;
  --d19-rule: #cdb680;
  --d19-s1: #2f5a9e;
  --d19-s2: #a97c16;
  --d19-rose: #b0485e;
  --d19-grid: #ebe5d6;
  --d19-axis: #6f7484;
  --d19-tip: #14213d;
  --d19-tip-ink: #ffffff;
  --d19-good: #0a6b2c;
  --d19-bad: #b42a2a;
  --d19-ag0: #8ba6d6;
  --d19-ag1: #5c80c2;
  --d19-ag2: #3a5fa3;
  --d19-ag3: #1c3a70;
  --d19-hm1: #eef2f9;
  --d19-hm2: #d9e3f2;
  --d19-hm3: #b7c8e6;
  --d19-hm4: #8fa9d6;
  --d19-side-w: 248px;
  --d19-gap: clamp(14px, 1.5vw, 20px);
  --d19-serif: "Noto Serif KR", "Nanum Myeongjo", serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ailo-bg: #0e1420; --ailo-fg: #ebe6da; --ailo-muted: #a4aab8; --ailo-line: #2a3347; --ailo-accent: #d0a64a;
    --d19-paper: #161d2c; --d19-paper-2: #1b2334; --d19-navy: #0a0f1a; --d19-navy-2: #141c2c;
    --d19-gold: #c99a3c; --d19-gold-soft: #2e2918; --d19-gold-ink: #e2bd6c; --d19-rule: #5a4c2a;
    --d19-s1: #5f8bd2; --d19-s2: #b98a2c; --d19-rose: #d0657b; --d19-grid: #253046; --d19-axis: #8e95a5;
    --d19-tip: #ebe6da; --d19-tip-ink: #141b2b; --d19-good: #4cc46a; --d19-bad: #f07a7a;
    --d19-ag0: #36589a; --d19-ag1: #5479bd; --d19-ag2: #7da1dc; --d19-ag3: #b3cbf0;
    --d19-hm1: #1b2436; --d19-hm2: #22314d; --d19-hm3: #2c4370; --d19-hm4: #3b5a94;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ailo-bg: #0e1420; --ailo-fg: #ebe6da; --ailo-muted: #a4aab8; --ailo-line: #2a3347; --ailo-accent: #d0a64a;
  --d19-paper: #161d2c; --d19-paper-2: #1b2334; --d19-navy: #0a0f1a; --d19-navy-2: #141c2c;
  --d19-gold: #c99a3c; --d19-gold-soft: #2e2918; --d19-gold-ink: #e2bd6c; --d19-rule: #5a4c2a;
  --d19-s1: #5f8bd2; --d19-s2: #b98a2c; --d19-rose: #d0657b; --d19-grid: #253046; --d19-axis: #8e95a5;
  --d19-tip: #ebe6da; --d19-tip-ink: #141b2b; --d19-good: #4cc46a; --d19-bad: #f07a7a;
  --d19-ag0: #36589a; --d19-ag1: #5479bd; --d19-ag2: #7da1dc; --d19-ag3: #b3cbf0;
  --d19-hm1: #1b2436; --d19-hm2: #22314d; --d19-hm3: #2c4370; --d19-hm4: #3b5a94;
  color-scheme: dark;
}

body { background: var(--ailo-bg); font-size: 14px; transition: background .25s; }

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

/* ===== Sidebar ===== */
.side {
  flex: none; position: sticky; top: 0; align-self: flex-start; height: 100vh;
  width: var(--d19-side-w); background: var(--d19-navy); color: #d9deea;
  display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; z-index: 60;
  border-right: 1px solid rgba(201, 154, 60, .35); transition: width .28s var(--ailo-ease);
}
.side__head { display: flex; align-items: center; justify-content: space-between; padding: 22px 18px 20px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; color: #fff; }
.brand:hover { color: #fff; }
.brand__seal {
  flex: none; width: 40px; height: 40px; display: grid; place-items: center; font-family: var(--d19-serif); font-weight: 700; font-size: 20px;
  color: #e6c472; border: 1.5px solid #c99a3c; outline: 1px solid rgba(201, 154, 60, .4); outline-offset: 3px;
}
.brand__txt { font-family: var(--d19-serif); font-weight: 700; font-size: 18px; line-height: 1.15; white-space: nowrap; letter-spacing: -.01em; }
.brand__txt small { display: block; font-family: var(--ailo-font); font-weight: 500; font-size: 11.5px; color: #9aa4ba; margin-top: 4px; letter-spacing: 0; }
.side__x { display: none; width: 38px; height: 38px; border: 1px solid rgba(255, 255, 255, .2); background: transparent; color: #fff; }

.snav { display: flex; flex-direction: column; padding: 14px 10px; gap: 2px; }
.snav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; color: #c3cad9; font-weight: 500; white-space: nowrap; border-left: 2px solid transparent; }
.snav a i { width: 18px; text-align: center; color: #7f8aa3; flex: none; }
.snav a span { flex: 1; }
.snav a em { font-style: normal; font-size: 11px; font-weight: 700; padding: 1px 7px; background: rgba(255, 255, 255, .08); color: #dfe4ee; font-variant-numeric: tabular-nums; }
.snav a em.is-gold { background: #c99a3c; color: #14213d; }
.snav a:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.snav a.is-active { background: linear-gradient(90deg, rgba(201, 154, 60, .2), transparent); color: #fff; border-left-color: #e6c472; }
.snav a.is-active i { color: #e6c472; }
.side__note { margin: 6px 16px 14px; padding: 14px; border: 1px solid rgba(201, 154, 60, .4); }
.side__note-t { font-size: 11.5px; color: #9aa4ba; }
.side__note-v { font-family: var(--d19-serif); font-size: 18px; font-weight: 700; color: #fff; margin-top: 2px; }
.side__note-v span { font-family: var(--ailo-font); font-size: 11px; font-weight: 700; color: #14213d; background: #e6c472; padding: 1px 6px; vertical-align: 3px; margin-left: 4px; }
.side__note-s { font-size: 12px; color: #c3cad9; margin-top: 4px; }
.side__fold { margin-top: auto; display: flex; align-items: center; gap: 12px; padding: 14px 22px; border: 0; border-top: 1px solid rgba(255, 255, 255, .08); background: transparent; color: #9aa4ba; white-space: nowrap; }
.side__fold i { width: 18px; transition: rotate .28s; }
.side__fold:hover { color: #fff; }
@media (min-width: 992px) {
  html.side-folded { --d19-side-w: 72px; }
  html.side-folded .brand__txt, html.side-folded .snav a span, html.side-folded .snav a em,
  html.side-folded .side__note, html.side-folded .side__fold span { display: none; }
  html.side-folded .side__head { justify-content: center; padding-inline: 0; }
  html.side-folded .snav a { justify-content: center; padding-inline: 0; }
  html.side-folded .side__fold { justify-content: center; padding-inline: 0; }
  html.side-folded .side__fold i { rotate: 180deg; }
}
.side-dim { display: none; }

/* ===== Topbar ===== */
.top {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px var(--d19-gap); background: var(--d19-paper); border-bottom: 1px solid var(--ailo-line);
}
.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 3px; border-bottom: 1px solid var(--ailo-line); pointer-events: none; }
.top__burger { flex: none; color: var(--ailo-fg); }
.top__title { margin-right: auto; min-width: 0; }
.crumb { display: flex; gap: 6px; font-size: 12px; color: var(--ailo-muted); }
.crumb li + li::before { content: "›"; margin-right: 6px; }
.crumb a:hover { color: var(--ailo-fg); text-decoration: underline; }
.top h1 { font-family: var(--d19-serif); font-weight: 700; font-size: clamp(20px, 1.8vw, 24px); line-height: 1.25; letter-spacing: -.01em; }
.top__search { position: relative; width: min(360px, 30vw); }
.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: 40px; padding: 0 40px 0 36px; border: 1px solid var(--ailo-line); background: var(--d19-paper-2); color: var(--ailo-fg); font-size: 13.5px; border-radius: 2px; }
.top__search input::placeholder { color: var(--ailo-muted); }
.top__search input:focus { outline: 2px solid var(--ailo-accent); outline-offset: 1px; }
.top__search kbd { position: absolute; right: 8px; top: 50%; translate: 0 -50%; font: 600 11px var(--ailo-font); color: var(--ailo-muted); border: 1px solid var(--ailo-line); padding: 1px 6px; background: var(--d19-paper); }
.top__tools { display: flex; align-items: center; gap: 6px; }
.tbtn { position: relative; width: 40px; height: 40px; border: 1px solid var(--ailo-line); background: var(--d19-paper); color: var(--ailo-fg); display: grid; place-items: center; font-size: 16px; border-radius: 2px; }
.tbtn:hover { border-color: var(--d19-gold); color: var(--d19-gold-ink); }
.badge-n { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px; background: var(--d19-gold); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; }
.me { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 2px 4px 2px 8px; color: var(--ailo-fg); }
.me__av { width: 38px; height: 38px; display: grid; place-items: center; background: var(--d19-navy); color: #e6c472; font-family: var(--d19-serif); font-weight: 700; border: 1px solid var(--d19-gold); }
.me__txt { text-align: left; line-height: 1.2; }
.me__txt b { display: block; font-size: 13.5px; }
.me__txt small { font-size: 11.5px; color: var(--ailo-muted); }

.pop { position: relative; }
.pop__panel { position: absolute; right: 0; top: calc(100% + 8px); width: 340px; z-index: 80; background: var(--d19-paper); border: 1px solid var(--ailo-line); border-top: 3px solid var(--d19-gold); box-shadow: 0 18px 40px -16px rgba(10, 15, 26, .45); }
.pop__head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--ailo-line); }
.pop__head strong { font-family: var(--d19-serif); }
.lnk { border: 0; background: none; padding: 2px 0; font-size: 12.5px; font-weight: 600; color: var(--d19-gold-ink); white-space: nowrap; }
.lnk:hover { color: var(--ailo-fg); text-decoration: underline; }
.notif li { display: flex; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--ailo-line); position: relative; }
.notif li:last-child { border-bottom: 0; }
.notif li > i { color: var(--d19-gold); margin-top: 3px; width: 16px; text-align: center; }
.notif p { font-size: 13px; line-height: 1.5; color: var(--ailo-muted); }
.notif b { display: block; color: var(--ailo-fg); }
.notif small { display: block; font-size: 11.5px; }
.notif li.is-new { background: var(--d19-paper-2); }
.notif li.is-new::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--d19-gold); }

/* ===== Main ===== */
.main { padding: var(--d19-gap); display: flex; flex-direction: column; gap: var(--d19-gap); }
.filter { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.filter__date { font-size: 13px; color: var(--ailo-muted); }
.filter__date span { font-family: var(--d19-serif); font-weight: 700; color: var(--ailo-fg); font-size: 15px; margin-right: 8px; }
.seg { display: inline-flex; border: 1px solid var(--ailo-line); background: var(--d19-paper); }
.seg button { border: 0; background: none; height: 36px; padding: 0 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: var(--d19-paper-2); }
.seg button[aria-pressed="true"] { background: var(--d19-navy); color: #fff; box-shadow: inset 0 -2px 0 #e6c472; }

/* KPI ledger */
.ledger { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); background: var(--d19-paper); border: 1px solid var(--ailo-line); border-top: 3px double var(--d19-rule); }
.kp { padding: 16px 18px 12px; border-right: 1px solid var(--ailo-line); min-width: 0; }
.kp:last-child { border-right: 0; }
.kp__l { font-size: 12px; font-weight: 600; color: var(--ailo-muted); letter-spacing: .02em; }
.kp__v { font-size: clamp(22px, 1.9vw, 28px); font-weight: 700; letter-spacing: -.02em; margin-top: 6px; line-height: 1.15; white-space: nowrap; }
.kp__v small { font-size: .5em; font-weight: 600; margin-left: 3px; color: var(--ailo-muted); letter-spacing: 0; }
.kp__d { font-size: 12px; font-weight: 600; margin-top: 4px; white-space: nowrap; }
.kp__d.is-good { color: var(--d19-good); }
.kp__d.is-bad { color: var(--d19-bad); }
.kp__d.is-flat { color: var(--ailo-muted); }
.kp__vs { color: var(--ailo-muted); font-weight: 400; margin-left: 6px; }
.spark { width: 100%; height: 30px; margin-top: 8px; overflow: visible; }
.spark__l { fill: none; stroke: var(--d19-s1); stroke-width: 1.6; opacity: .7; stroke-linejoin: round; }
.spark__d { fill: var(--d19-gold); stroke: var(--d19-paper); stroke-width: 2; }

/* Panels */
.row-a { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--d19-gap); }
.row-b { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: var(--d19-gap); }
.row-c { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--d19-gap); }
.panel { background: var(--d19-paper); border: 1px solid var(--ailo-line); padding: 18px 20px 16px; min-width: 0; display: flex; flex-direction: column; }
.panel__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--d19-rule); position: relative; }
.panel__head::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; border-bottom: 1px solid var(--ailo-line); }
.panel__t { font-family: var(--d19-serif); font-weight: 700; font-size: 18px; line-height: 1.3; display: flex; align-items: baseline; gap: 10px; }
.panel__t .num { font-size: 14px; color: var(--d19-gold); font-weight: 600; min-width: 14px; }
.panel__s { font-size: 12px; color: var(--ailo-muted); margin-top: 2px; padding-left: 24px; }

.btn-gold, .btn-line { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; font-size: 13px; font-weight: 600; border-radius: 2px; white-space: nowrap; }
.btn-gold { border: 1px solid var(--d19-gold); background: var(--d19-gold); color: #fff; }
.btn-gold:hover { background: var(--d19-gold-ink); border-color: var(--d19-gold-ink); }
.btn-line { border: 1px solid var(--ailo-line); background: transparent; color: var(--ailo-fg); }
.btn-line:hover { border-color: var(--d19-gold); color: var(--d19-gold-ink); }

/* Table */
.tbar { display: flex; gap: 6px; flex-wrap: wrap; }
.tbar__q { position: relative; }
.tbar__q i { position: absolute; left: 10px; top: 50%; translate: 0 -50%; font-size: 12px; color: var(--ailo-muted); }
.tbar__q input { height: 36px; width: 190px; padding: 0 10px 0 30px; border: 1px solid var(--ailo-line); background: var(--d19-paper-2); color: var(--ailo-fg); font-size: 13px; border-radius: 2px; }
.sel {
  height: 36px; padding: 0 30px 0 10px; border: 1px solid var(--ailo-line); border-radius: 2px; font: inherit; font-size: 13px; color: var(--ailo-fg); appearance: none;
  background: var(--d19-paper-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23a97c16' stroke-width='1.6' fill='none'/%3E%3C/svg%3E") no-repeat right 10px center;
}
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; min-width: 700px; border-collapse: collapse; font-size: 13.5px; }
.tbl thead th { position: sticky; top: 0; background: var(--d19-paper-2); text-align: left; font-size: 12px; font-weight: 600; color: var(--ailo-muted); padding: 0 10px; border-top: 1px solid var(--ailo-line); border-bottom: 1px solid var(--d19-rule); white-space: nowrap; }
.tbl th button { border: 0; background: none; padding: 9px 0; color: inherit; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.tbl th button i { font-size: 10px; opacity: .5; }
.tbl th button:hover { color: var(--ailo-fg); }
.tbl th[aria-sort="ascending"] button, .tbl th[aria-sort="descending"] button { color: var(--d19-gold-ink); }
.tbl th[aria-sort="ascending"] i, .tbl th[aria-sort="descending"] i { opacity: 1; }
.tbl th.r { text-align: right; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--ailo-line); vertical-align: middle; }
.tbl tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--d19-paper-2) 60%, transparent); }
.tbl tbody tr:hover td { background: var(--d19-gold-soft); }
.tbl .ttl { font-family: var(--d19-serif); font-weight: 600; display: block; font-size: 14px; }
.tbl small { display: block; color: var(--ailo-muted); font-size: 12px; margin-top: 1px; }
.tbl .r { text-align: right; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: -.01em; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.muted { color: var(--ailo-muted); }
.empty { text-align: center; color: var(--ailo-muted); padding: 30px 10px !important; }
.dd { display: inline-block; font-size: 11px; font-weight: 700; padding: 0 6px; line-height: 18px; border: 1px solid var(--d19-rule); color: var(--d19-gold-ink); font-variant-numeric: tabular-nums; margin-left: 2px; }
.dd--0 { background: var(--d19-rose); border-color: var(--d19-rose); color: #fff; }
.dd--doc { background: var(--d19-gold-soft); }
.stg { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border: 1px solid; white-space: nowrap; }
.stg::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: 2px; }
.stg--navy { color: var(--d19-s1); border-color: color-mix(in srgb, var(--d19-s1) 40%, transparent); }
.stg--rose { color: var(--d19-rose); border-color: color-mix(in srgb, var(--d19-rose) 40%, transparent); }
.stg--gold { color: var(--d19-gold-ink); border-color: var(--d19-rule); }
.stg--gray { color: var(--ailo-muted); border-color: var(--ailo-line); }
.stg--ok { color: var(--d19-good); border-color: color-mix(in srgb, var(--d19-good) 40%, transparent); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 12px; font-size: 12.5px; color: var(--ailo-muted); }
.pager nav { display: flex; }
.pager nav button { min-width: 32px; height: 32px; border: 1px solid var(--ailo-line); margin-left: -1px; background: var(--d19-paper); color: var(--ailo-fg); font-size: 13px; font-weight: 600; }
.pager nav button:hover:not(:disabled) { color: var(--d19-gold-ink); }
.pager nav button[aria-current="page"] { background: var(--d19-navy); color: #fff; border-color: var(--d19-navy); }
.pager nav button:disabled { opacity: .4; cursor: default; }

/* Hearings */
.hear li { display: grid; grid-template-columns: 46px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px dotted var(--ailo-line); }
.hear li:last-child { border-bottom: 0; }
.hear__d { text-align: center; border: 1px solid var(--ailo-line); padding: 4px 0; align-self: start; }
.hear__d b { display: block; font-family: var(--d19-serif); font-size: 19px; line-height: 1.1; }
.hear__d small { font-size: 11px; color: var(--ailo-muted); }
.hear li.is-today .hear__d { background: var(--d19-navy); color: #fff; border-color: var(--d19-navy); }
.hear li.is-today .hear__d small { color: #e6c472; }
.hear__k { font-size: 12px; color: var(--ailo-muted); }
.hear__k .dd { margin: 0 4px 0 0; }
.hear__t { font-family: var(--d19-serif); font-weight: 600; font-size: 14px; margin-top: 2px; }
.hear__m { font-size: 12px; color: var(--ailo-muted); }

/* Charts */
.chart { position: relative; height: 280px; }
.chart--util { height: 260px; }

/* Timesheet */
.ts { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.ts__tbl { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 13px; }
.ts__tbl thead th { font-size: 12px; font-weight: 600; color: var(--ailo-muted); padding: 8px 6px; border-bottom: 1px solid var(--d19-rule); text-align: center; white-space: nowrap; }
.ts__tbl thead th:first-child { text-align: left; }
.ts__tbl thead th.is-today { color: var(--d19-gold-ink); }
.ts__tbl tbody th { text-align: left; padding: 8px 6px; font-weight: 600; white-space: nowrap; border-bottom: 1px solid var(--ailo-line); }
.ts__tbl tbody th small { display: block; font-size: 11.5px; color: var(--ailo-muted); font-weight: 400; }
.ts__tbl td { border-bottom: 1px solid var(--ailo-line); padding: 4px; }
.ts__c { text-align: center; line-height: 1.2; font-variant-numeric: tabular-nums; }
.ts__c b { display: block; font-size: 14px; }
.ts__c small { font-size: 11px; color: var(--ailo-muted); }
.ts__c--1 { background: var(--d19-hm1); }
.ts__c--2 { background: var(--d19-hm2); }
.ts__c--3 { background: var(--d19-hm3); }
.ts__c--4 { background: var(--d19-hm4); }
.ts__c.is-today { box-shadow: inset 0 0 0 1.5px var(--d19-gold); }
.ts__c--fut { color: var(--ailo-muted); }
.ts__c--miss { color: var(--d19-bad); font-size: 11.5px; font-weight: 600; background: repeating-linear-gradient(135deg, transparent 0 5px, color-mix(in srgb, var(--d19-bad) 10%, transparent) 5px 7px); }
.ts__tbl .r { text-align: right; }
.ts__sum { white-space: nowrap; color: var(--ailo-muted); padding-right: 10px !important; }
.ts__sum b { color: var(--ailo-fg); }
.ts__meter { width: 100%; min-width: 70px; height: 6px; background: var(--d19-hm2); }
.ts__meter span { display: block; height: 100%; background: var(--d19-s1); }
.ts__pct { font-size: 11px; color: var(--ailo-muted); font-variant-numeric: tabular-nums; }
.ts__h { font-family: var(--d19-serif); font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.ts__h small { font-family: var(--ailo-font); font-size: 12px; color: var(--ailo-muted); font-weight: 400; margin-left: 6px; }

/* Aging */
.aging { display: flex; gap: 2px; height: 28px; margin: 6px 0 12px; }
.aging__s { display: flex; align-items: center; padding-left: 8px; font-size: 12px; font-weight: 700; border-radius: 4px; min-width: 0; overflow: hidden; white-space: nowrap; }
.aging__s--0 { background: var(--d19-ag0); color: #0b0b0b; }
.aging__s--1 { background: var(--d19-ag1); color: #0b0b0b; }
.aging__s--2 { background: var(--d19-ag2); color: #fff; }
.aging__s--3 { background: var(--d19-ag3); color: #fff; }
:root[data-theme="dark"] .aging__s--0, :root[data-theme="dark"] .aging__s--1 { color: #fff; }
:root[data-theme="dark"] .aging__s--2, :root[data-theme="dark"] .aging__s--3 { color: #0b0b0b; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .aging__s--0, :root:not([data-theme="light"]) .aging__s--1 { color: #fff; }
  :root:not([data-theme="light"]) .aging__s--2, :root:not([data-theme="light"]) .aging__s--3 { color: #0b0b0b; }
}
.aging__lg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; margin-bottom: 14px; }
.aging__lg li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.aging__lg b { margin-left: auto; font-variant-numeric: tabular-nums; }
.sw { width: 10px; height: 10px; flex: none; padding: 0; border-radius: 2px; }
.mini { width: 100%; border-collapse: collapse; font-size: 13px; }
.mini th { font-size: 12px; color: var(--ailo-muted); font-weight: 600; text-align: left; padding: 6px 0; border-bottom: 1px solid var(--d19-rule); }
.mini td { padding: 8px 0; border-bottom: 1px solid var(--ailo-line); font-variant-numeric: tabular-nums; }
.mini .r { text-align: right; }

/* Log */
.log li { display: grid; grid-template-columns: 52px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px dotted var(--ailo-line); font-size: 13px; }
.log li:last-child { border-bottom: 0; }
.log time { font-variant-numeric: tabular-nums; color: var(--d19-gold-ink); font-weight: 600; }
.log .ok { font-size: 11.5px; font-weight: 700; color: var(--d19-good); border: 1px solid currentColor; padding: 0 5px; margin-left: 4px; }

/* Footer */
.foot { padding: 4px var(--d19-gap) 24px; }
.foot p { font-size: 12px; color: var(--ailo-muted); border-top: 1px solid var(--ailo-line); padding-top: 14px; }
.foot a:hover { color: var(--ailo-fg); text-decoration: underline; }
.foot b { color: var(--ailo-fg); }

/* ===== Responsive ===== */
@media (max-width: 1399.98px) {
  .ledger { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kp:nth-child(3) { border-right: 0; }
  .kp:nth-child(-n+3) { border-bottom: 1px solid var(--ailo-line); }
  .ts { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1199.98px) {
  .row-a, .row-b { grid-template-columns: minmax(0, 1fr); }
  .top__search { width: min(280px, 28vw); }
}
@media (max-width: 991.98px) {
  .side {
    position: fixed; top: 0; left: 0; bottom: 0; height: auto; align-self: stretch; width: min(290px, 84vw); z-index: 130;
    translate: -105% 0; visibility: hidden; transition: translate .32s var(--ailo-ease), visibility .32s;
  }
  html.nav-open .side { translate: 0 0; visibility: visible; transition: translate .32s var(--ailo-ease), visibility 0s; } /* 열 때 visibility 즉시 → 곧바로 포커스 가능 */
  .side__x { display: grid; place-items: center; }
  .side__fold { display: none; }
  .side-dim { display: block; position: fixed; inset: 0; z-index: 125; background: rgba(10, 15, 26, .5); opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s; }
  html.nav-open .side-dim { opacity: 1; visibility: visible; }
  .top { gap: 10px; }
  .top__search { order: 5; width: 100%; }
  .top__search kbd { display: none; }
  .row-c { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767.98px) {
  .me__txt { display: none; }
  .pop__panel { position: fixed; left: 12px; right: 12px; top: 64px; width: auto; }
  .ledger { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kp { border-bottom: 1px solid var(--ailo-line); }
  .kp:nth-child(3) { border-right: 1px solid var(--ailo-line); }
  .kp:nth-child(2n) { border-right: 0; }
  .kp:nth-last-child(-n+2) { border-bottom: 0; }
}
@media (max-width: 575.98px) {
  .crumb { display: none; }
  .filter { flex-direction: column; align-items: stretch; }
  .seg { display: flex; }
  .seg button { flex: 1; padding: 0 6px; }
  .kp { padding: 12px 12px 10px; }
  .kp__vs { display: none; }
  .panel { padding: 16px 14px 14px; }
  .panel__s { padding-left: 0; }
  .tbar, .tbar__q, .tbar__q input { width: 100%; }
  .tbar .sel { flex: 1; }
  .chart { height: 250px; }
  .aging__lg { grid-template-columns: minmax(0, 1fr); }
}
