@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif&family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ===== DESIGN TOKENS ===== */
:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --ink: #1a1a1a;
  --ink-2: #4a4a48;
  --muted: #8a8a86;
  --line: #ececdf;
  --line-2: #e3e3d3;
  --accent: #2b5a3e;
  --accent-soft: #e8f0eb;
  --warn: #b8771e;
  --warn-soft: #faf1e0;
  --crit: #a83838;
  --crit-soft: #fbeded;
  --paper: #faf9f4;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.45, 0, 0.55, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
}

/* ===== BASE ===== */
body { font-family: 'Geist', system-ui, sans-serif; background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ===== SHELL ===== */
.shell { width: 1440px; margin: 0 auto; display: flex; min-height: 100vh; background: var(--bg); }
.shell.no-sidebar .sidebar { display: none; }
.shell.no-sidebar .main { max-width: 1440px; }

/* ===== SIDEBAR ===== */
.sidebar { width: 248px; flex-shrink: 0; position: sticky; top: 0; height: 100vh; padding: 22px 14px; display: flex; flex-direction: column; background: var(--bg); overflow-y: auto; }
.sb-logo { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; }
.sb-logo-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--ink); color: var(--paper); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; font-family: 'Instrument Serif', serif; font-style: italic; }
.sb-logo-text { font-weight: 600; font-size: 14.5px; letter-spacing: -0.01em; }
.sb-logo-text small { display: block; font-weight: 400; font-size: 11px; color: var(--muted); letter-spacing: 0; }
.sb-section { padding: 18px 10px 6px; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 500; }
.sb-item { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; color: var(--ink-2); font-size: 13.5px; cursor: pointer; margin-bottom: 1px; font-weight: 400; transition: background var(--duration-fast) ease; }
.sb-item:hover { background: rgba(0,0,0,0.03); }
.sb-item.active { background: var(--surface); color: var(--ink); font-weight: 500; box-shadow: 0 1px 2px rgba(20,20,20,0.04), 0 0 0 1px var(--line); }
.sb-item svg { width: 16px; height: 16px; opacity: 0.85; flex-shrink: 0; }
.sb-item .badge { margin-left: auto; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sb-item.active .badge { color: var(--accent); font-weight: 500; }
.sb-readonly { margin-left: auto; opacity: 0.5; display: flex; }
.sb-foot { margin-top: auto; padding: 12px 10px; display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); }
.sb-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #2b5a3e, #4a8862); color: white; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12px; flex-shrink: 0; }
.sb-logout { margin-left: auto; opacity: 0.5; transition: opacity var(--duration-fast) ease; }
.sb-logout:hover { opacity: 1; }

/* ===== MAIN ===== */
.main { flex: 1; min-width: 0; padding: 0 28px 60px; overflow-y: auto; height: 100vh; }

/* ===== TOPBAR ===== */
.topbar { display: flex; align-items: center; gap: 16px; padding: 22px 0 18px; position: sticky; top: 0; background: var(--bg); z-index: 10; }
.search { flex: 1; max-width: 460px; position: relative; }
.search input { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 9px 14px 9px 36px; font-size: 13px; background: var(--surface); color: var(--ink); }
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: var(--ink-2); }
.search svg { position: absolute; left: 12px; top: 11px; }
.search kbd { position: absolute; right: 10px; top: 8px; font-size: 10.5px; padding: 2px 6px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); background: var(--paper); font-family: 'Geist Mono', monospace; }
.tb-r { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.tb-btn { width: 36px; height: 36px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; cursor: pointer; position: relative; color: var(--ink-2); transition: background var(--duration-fast) ease; }
.tb-btn:hover { background: var(--paper); }
.tb-btn .dot { position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; background: var(--crit); border-radius: 50%; border: 2px solid var(--surface); }
.tb-user { display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; border-radius: 10px; cursor: pointer; background: var(--surface); border: 1px solid var(--line); margin-left: 4px; transition: background var(--duration-fast) ease; }
.tb-user:hover { background: var(--paper); }
.tb-user .av { width: 28px; height: 28px; border-radius: 7px; background: linear-gradient(135deg, #2b5a3e, #4a8862); color: white; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 11px; flex-shrink: 0; }

/* ===== BREADCRUMB ===== */
.crumb { font-size: 12.5px; color: var(--muted); margin-bottom: 14px; display: flex; align-items: center; gap: 7px; }
.crumb .sep { opacity: 0.5; }
.crumb .cur { color: var(--ink); }
.crumb-link { color: var(--muted); }
.crumb-link:hover { color: var(--ink); }

/* ===== PAGE HEADER ===== */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 26px; gap: 24px; }
.page-title { font-family: 'Instrument Serif', serif; font-size: 38px; line-height: 1.1; color: var(--ink); letter-spacing: -0.015em; font-weight: 400; }
.page-title em { font-style: italic; color: var(--accent); }
.page-sub { font-size: 13.5px; color: var(--muted); margin-top: 8px; max-width: 560px; }
.head-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.period-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; font-size: 12px; color: var(--ink-2); }
.period-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.act-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== BUTTONS ===== */
.btn { padding: 9px 16px; border-radius: 10px; font-size: 13px; font-weight: 500; cursor: pointer; border: 1px solid transparent; display: inline-flex; align-items: center; gap: 7px; transition: all var(--duration-fast) ease; white-space: nowrap; }
.btn:active { transform: scale(0.98); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--paper); }
.btn-dark { background: var(--ink); color: var(--paper); }
.btn-dark:hover { background: #000; }
.btn-danger { background: var(--crit); color: white; border-color: var(--crit); }
.btn-danger:hover { background: #8a2c2c; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ===== FILTER RAIL ===== */
.frail { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 24px; }
.fchip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; position: relative; transition: border-color var(--duration-fast) ease; }
.fchip:hover { border-color: var(--line-2); }
.fchip .lbl { color: var(--muted); }
.fchip.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.fchip.active .lbl { color: rgba(255,255,255,0.55); }
.fchip.active svg { stroke: var(--paper); }

/* ===== DROPDOWNS ===== */
.dd-panel { position: absolute; top: calc(100% + 6px); left: 0; min-width: 160px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.08); z-index: 100; display: none; overflow: hidden; }
.dd-panel.open { display: block; }
.dd-option { padding: 8px 14px; font-size: 13px; cursor: pointer; color: var(--ink-2); transition: background var(--duration-fast) ease; }
.dd-option:hover { background: var(--paper); }
.dd-option.selected { color: var(--ink); font-weight: 500; }

/* ===== HERO METRICS ===== */
.hero { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 28px 32px; margin-bottom: 22px; position: relative; overflow: hidden; box-shadow: 0 1px 0 rgba(20,20,20,0.02); }
.hero::before { content: ''; position: absolute; right: -120px; top: -120px; width: 400px; height: 400px; background: radial-gradient(circle, var(--accent-soft) 0%, transparent 70%); pointer-events: none; }
.hero-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 36px; align-items: flex-start; position: relative; z-index: 1; }
.hero-main .lbl { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 500; margin-bottom: 14px; }
.hero-main .val { font-size: 52px; font-weight: 500; letter-spacing: -0.025em; font-family: 'Geist', sans-serif; line-height: 1; color: var(--ink); }
.hero-main .val .cur { font-family: 'Instrument Serif', serif; font-style: italic; color: var(--muted); font-size: 32px; font-weight: 400; margin-right: 4px; vertical-align: top; }
.hero-main .meta { margin-top: 14px; display: flex; gap: 14px; align-items: center; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.delta-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 500; background: var(--accent-soft); color: var(--accent); }
.delta-chip.down { background: var(--crit-soft); color: var(--crit); }
.hero-sub { display: flex; flex-direction: column; gap: 6px; padding-top: 4px; border-left: 1px solid var(--line); padding-left: 24px; }
.hero-sub .lbl { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.hero-sub .val { font-size: 24px; font-weight: 500; letter-spacing: -0.015em; color: var(--ink); font-variant-numeric: tabular-nums; }
.hero-sub .val.warn { color: var(--warn); }
.hero-sub .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ===== GRID ===== */
.grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 20px; margin-bottom: 22px; }

/* ===== CARDS ===== */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 1px 0 rgba(20,20,20,0.02); transition: box-shadow var(--duration-fast) ease; }
.card-head { padding: 22px 26px 12px; display: flex; justify-content: space-between; align-items: flex-start; }
.card-title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.card-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.card-body-inner { padding: 0 26px 22px; }
.card-tabs { display: flex; gap: 4px; background: var(--paper); border-radius: 8px; padding: 3px; }
.card-tab { padding: 5px 12px; font-size: 12px; border-radius: 6px; cursor: pointer; color: var(--ink-2); transition: all var(--duration-fast) ease; }
.card-tab.active { background: var(--surface); color: var(--ink); font-weight: 500; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }

/* ===== AGING ===== */
.aging-wrap { padding: 0 26px 22px; }
.aging-bar { display: flex; height: 14px; border-radius: 10px; overflow: hidden; margin-top: 8px; background: var(--paper); }
.aging-bar > div { transition: all 0.2s; }
.aging-key { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-top: 22px; }
.akey { padding: 14px 0; border-top: 1px solid var(--line); }
.akey .dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 6px; vertical-align: middle; }
.akey .lbl { font-size: 11.5px; color: var(--muted); }
.akey .val { font-size: 22px; font-weight: 500; letter-spacing: -0.015em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.akey .sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.akey.warn .val { color: var(--warn); }
.akey.crit .val { color: var(--crit); }

/* ===== TREND ===== */
.trend { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.trend-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.trend-head .t { font-size: 13px; font-weight: 500; }
.trend-head .s { font-size: 11.5px; color: var(--muted); }
.trend-svg { width: 100%; height: 130px; display: block; }

/* ===== RECONCILIATION ===== */
.recon-body { padding: 8px 26px 24px; }
.recon-flow { display: flex; align-items: center; gap: 16px; padding: 22px 0 18px; border-bottom: 1px dashed var(--line); }
.recon-node { flex: 1; }
.recon-node .src { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500; margin-bottom: 4px; }
.recon-node .amt { font-size: 19px; font-weight: 500; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.recon-arrow { width: 30px; height: 30px; border-radius: 50%; background: var(--paper); display: flex; align-items: center; justify-content: center; color: var(--muted); flex-shrink: 0; }
.recon-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 18px 0 0; }
.rstat { background: var(--paper); border-radius: 12px; padding: 14px; }
.rstat .lbl { font-size: 11.5px; color: var(--muted); }
.rstat .val { font-size: 20px; font-weight: 500; letter-spacing: -0.01em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.rstat .sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.variance-card { margin-top: 18px; padding: 18px; border-radius: 14px; background: linear-gradient(135deg, var(--warn-soft), #f9efdb); border: 1px solid #efdcb3; position: relative; overflow: hidden; }
.variance-card .row1 { display: flex; justify-content: space-between; align-items: center; }
.variance-card .lbl { font-size: 11.5px; color: #8a6618; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500; }
.variance-card .val { font-size: 30px; font-weight: 500; color: var(--warn); letter-spacing: -0.015em; font-variant-numeric: tabular-nums; margin-top: 6px; }
.variance-card .val .pre { font-family: 'Instrument Serif', serif; font-style: italic; color: var(--warn); opacity: 0.7; font-weight: 400; font-size: 22px; margin-right: 4px; }
.variance-card .desc { font-size: 12.5px; color: #6e5a2a; margin-top: 10px; max-width: 290px; line-height: 1.5; }
.variance-card .cta { margin-top: 14px; display: inline-flex; align-items: center; gap: 5px; padding: 7px 14px; background: var(--ink); color: var(--paper); border-radius: 999px; font-size: 12px; font-weight: 500; cursor: pointer; transition: background var(--duration-fast) ease; }
.variance-card .cta:hover { background: #000; }

/* ===== TABLE ===== */
.tbl-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; margin-bottom: 22px; overflow: hidden; box-shadow: 0 1px 0 rgba(20,20,20,0.02); }
.tbl-head { padding: 22px 26px 16px; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.tbl-tabs { display: flex; gap: 4px; }
.tbl-tab { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; transition: all var(--duration-fast) ease; }
.tbl-tab.active { background: var(--paper); color: var(--ink); }
.tbl-tab .cnt { background: var(--surface); border: 1px solid var(--line); padding: 1px 6px; border-radius: 999px; font-size: 10.5px; font-variant-numeric: tabular-nums; }
.tbl-tab.active .cnt { background: var(--ink); color: var(--paper); border-color: var(--ink); }
table.dtable { width: 100%; border-collapse: collapse; }
table.dtable th { text-align: left; padding: 10px 26px; font-size: 11px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; border-bottom: 1px solid var(--line); background: var(--paper); white-space: nowrap; }
table.dtable th.sortable { cursor: pointer; }
table.dtable th.sortable:hover { color: var(--ink); }
table.dtable th .sort-icon { opacity: 0.4; margin-left: 4px; }
table.dtable td { padding: 16px 26px; font-size: 13.5px; color: var(--ink); border-bottom: 1px solid var(--line); vertical-align: middle; }
table.dtable tr:last-child td { border-bottom: none; }
table.dtable tr:hover td { background: var(--paper); }
table.dtable tr[style*="cursor"] { cursor: pointer; }
.cust-cell { display: flex; align-items: center; gap: 11px; }
.cust-av { width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12px; color: var(--paper); flex-shrink: 0; }
.cust-name { font-weight: 500; }
.cust-meta { font-size: 11.5px; color: var(--muted); font-family: 'Geist Mono', monospace; margin-top: 1px; }
.num { font-variant-numeric: tabular-nums; text-align: right; font-family: 'Geist Mono', monospace; font-size: 13px; }
.num.warn { color: var(--warn); }
.num.crit { color: var(--crit); font-weight: 500; }
.num.mute { color: var(--muted); }
.row-action { color: var(--ink-2); cursor: pointer; transition: color var(--duration-fast) ease; }
.row-action:hover { color: var(--ink); }
.tbl-foot { padding: 14px 26px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); background: var(--paper); font-size: 12.5px; color: var(--muted); }
.pg { display: flex; gap: 4px; }
.pg-btn { min-width: 28px; height: 28px; padding: 0 8px; border-radius: 7px; background: transparent; border: 1px solid transparent; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 12px; color: var(--ink-2); transition: all var(--duration-fast) ease; }
.pg-btn:hover { background: var(--surface); }
.pg-btn.active { background: var(--ink); color: var(--paper); }

/* ===== PILLS ===== */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 500; border: 1px solid; white-space: nowrap; }
.pill .d { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: #efdcb3; }
.pill.crit { background: var(--crit-soft); color: var(--crit); border-color: #f1cccc; }
.pill.info { background: #eef1f7; color: #3a5599; border-color: #d6dceb; }
.pill.mute { background: var(--paper); color: var(--muted); border-color: var(--line); }

/* ===== BOTTOM ROW ===== */
.bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.act-list { padding: 8px 0; }
.act-row-i { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.act-row-i:last-child { border-bottom: none; }
.act-icon { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.act-icon.ok { background: var(--accent-soft); color: var(--accent); }
.act-icon.warn { background: var(--warn-soft); color: var(--warn); }
.act-icon.info { background: #eef1f7; color: #3a5599; }
.act-icon.mute { background: var(--paper); color: var(--muted); }
.act-text { font-size: 13.5px; line-height: 1.45; }
.act-text b { font-weight: 600; }
.act-meta { font-size: 11.5px; color: var(--muted); margin-top: 3px; display: flex; gap: 8px; align-items: center; }
.cust-list { padding: 8px 26px 22px; }
.cust-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.cust-row:last-child { border-bottom: none; }
.cust-row .name { font-size: 13.5px; font-weight: 500; }
.cust-row .meta { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.cust-row .amt { font-family: 'Geist Mono', monospace; font-size: 13.5px; font-weight: 500; }
.cust-row .bar { height: 4px; background: var(--paper); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.cust-row .bar > div { height: 100%; background: var(--accent); border-radius: 4px; }

/* ===== MODAL ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; z-index: 1000; backdrop-filter: blur(2px); opacity: 1; transition: opacity var(--duration-normal) ease; }
.modal-overlay.modal-enter { opacity: 0; }
.modal-overlay.modal-exit { opacity: 0; }
.modal-panel { background: var(--surface); border-radius: 20px; box-shadow: 0 24px 48px rgba(0,0,0,0.12); min-width: 420px; max-width: 560px; max-height: 80vh; overflow-y: auto; transform: scale(1); transition: transform var(--duration-normal) var(--ease-out); }
.modal-enter .modal-panel { transform: scale(0.95); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 22px 26px 14px; }
.modal-title { font-size: 18px; font-weight: 600; }
.modal-close-btn { background: none; border: none; color: var(--muted); cursor: pointer; padding: 4px; }
.modal-body { padding: 0 26px 18px; font-size: 14px; line-height: 1.6; }
.modal-footer { padding: 14px 26px 22px; display: flex; gap: 8px; justify-content: flex-end; }
.modal-field { margin-bottom: 16px; }
.modal-field label { display: block; font-size: 12px; color: var(--muted); font-weight: 500; margin-bottom: 6px; }
.modal-input, .modal-select, .modal-textarea { width: 100%; padding: 9px 14px; border: 1px solid var(--line); border-radius: 8px; font-size: 13.5px; background: var(--surface); color: var(--ink); font-family: inherit; }
.modal-textarea { resize: vertical; min-height: 70px; }
.modal-select { appearance: auto; }
.modal-input:focus, .modal-select:focus, .modal-textarea:focus { outline: none; border-color: var(--ink-2); }

/* ===== TOAST ===== */
#toast-root { position: fixed; bottom: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast-item { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; font-size: 13.5px; min-width: 280px; max-width: 420px; box-shadow: 0 4px 12px rgba(0,0,0,0.08); transition: all var(--duration-normal) var(--ease-out); opacity: 1; transform: translateY(0); }
.toast-item.toast-enter { opacity: 0; transform: translateY(16px); }
.toast-item.toast-exit { opacity: 0; transform: translateX(100px); }
.toast-icon { flex-shrink: 0; display: flex; }
.toast-msg { flex: 1; }
.toast-close { background: none; border: none; cursor: pointer; color: inherit; opacity: 0.5; padding: 2px; flex-shrink: 0; }
.toast-close:hover { opacity: 1; }

/* ===== LOGIN ===== */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 40px; }
.login-container { max-width: 680px; width: 100%; }
.login-header { display: flex; align-items: center; gap: 16px; margin-bottom: 36px; }
.login-group { margin-bottom: 28px; }
.login-group-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 500; margin-bottom: 12px; }
.login-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.login-card { background: var(--surface); border: 2px solid var(--line); border-radius: 14px; padding: 16px; display: flex; align-items: center; gap: 12px; cursor: pointer; transition: all var(--duration-fast) ease; }
.login-card:hover { border-color: var(--line-2); box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.login-card.selected { border-color: var(--accent); background: var(--accent-soft); }
.login-card-name { font-weight: 600; font-size: 13.5px; }
.login-card-role { font-size: 12px; color: var(--accent); font-weight: 500; }
.login-card-dept { font-size: 11px; color: var(--muted); }
.login-form { margin-top: 8px; }
.login-input-row { display: flex; gap: 12px; }
.login-input { flex: 1; padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; background: var(--surface); color: var(--ink); }
.login-submit { padding: 12px 24px; }

/* ===== WORKSPACE ===== */
.ws-layout { display: grid; grid-template-columns: 380px 1fr; gap: 20px; }
.ws-list-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.ws-list-header { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.ws-filter-select { padding: 5px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; background: var(--surface); }
.ws-list { max-height: 600px; overflow-y: auto; }
.ws-item { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background var(--duration-fast) ease; }
.ws-item:hover { background: var(--paper); }
.ws-item.active { background: var(--accent-soft); border-left: 3px solid var(--accent); }
.ws-item.resolved { opacity: 0.5; }
.ws-detail-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 24px; }
.ws-detail-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
.ws-comparison { display: flex; align-items: center; gap: 20px; padding: 20px; background: var(--paper); border-radius: 12px; margin-bottom: 20px; }
.ws-comp-col { flex: 1; }
.ws-comp-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
.ws-comp-val { font-size: 20px; font-weight: 500; font-variant-numeric: tabular-nums; }
.ws-comp-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.ws-comp-arrow { color: var(--muted); }
.ws-variance-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 500; margin-bottom: 16px; }
.ws-section-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 12px; }
.ws-audit-list { margin-bottom: 20px; }
.ws-audit-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 13px; }
.ws-audit-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.ws-audit-dot.ok { background: var(--accent); }
.ws-audit-dot.info { background: #3a5599; }
.ws-audit-dot.warn { background: var(--warn); }
.ws-audit-time { margin-left: auto; font-size: 11px; color: var(--muted); }
.ws-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ws-resolved-banner { padding: 12px 16px; background: var(--accent-soft); border: 1px solid #b3d4be; border-radius: 10px; font-size: 13px; color: var(--accent); display: flex; align-items: center; gap: 8px; }

/* ===== DETAIL PAGES ===== */
.detail-grid { display: flex; flex-direction: column; gap: 0; }
.detail-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--muted); font-size: 12.5px; }
.detail-textarea { width: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; font-size: 13.5px; background: var(--surface); resize: vertical; min-height: 70px; font-family: inherit; }
.detail-textarea:focus { outline: none; border-color: var(--ink-2); }
.doc-list { display: flex; flex-direction: column; gap: 0; }
.doc-item { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.doc-item:last-child { border-bottom: none; }
.doc-meta { margin-left: auto; font-size: 11px; color: var(--muted); }

/* ===== PERIOD CLOSE ===== */
.pc-tabs { display: flex; gap: 4px; margin-bottom: 20px; }
.pc-tab { padding: 8px 16px; border-radius: 8px; font-size: 13px; cursor: pointer; color: var(--muted); transition: all var(--duration-fast) ease; }
.pc-tab.active { background: var(--surface); color: var(--ink); font-weight: 500; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.pc-grid { display: grid; gap: 16px; }
.pc-period-card.selected { border-color: var(--accent); }
.pc-period-head { padding: 22px 26px 16px; display: flex; justify-content: space-between; align-items: flex-start; }
.pc-period-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 0 26px 16px; }
.pc-checklist { padding: 0 26px 16px; }
.pc-check-item { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 13px; }
.pc-check { width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pc-check.done { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.pc-check-count { margin-left: auto; font-size: 12px; color: var(--warn); }
.pc-period-actions { padding: 0 26px 22px; }

/* ===== REPORTING ===== */
.rpt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 28px; }

/* ===== PRICING PLANS ===== */
.pc-plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ===== INTEGRATION ===== */
.int-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.id-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.id-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.id-metrics .lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.id-metrics .val { margin-top: 4px; }

/* ===== RESOLUTION ===== */
.res-decision-card { background: var(--surface); border: 2px solid var(--line); border-radius: 16px; padding: 28px; cursor: pointer; text-align: center; transition: all var(--duration-fast) ease; }
.res-decision-card:hover { border-color: var(--line-2); box-shadow: 0 4px 12px rgba(0,0,0,0.04); }
.res-decision-card.selected { border-color: var(--accent); background: var(--accent-soft); }
.res-decision-icon { margin-bottom: 12px; }
.res-decision-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.res-decision-sub { font-size: 13px; color: var(--muted); }

/* ===== TIMELINE ===== */
.timeline-v { position: relative; padding-left: 28px; }
.timeline-item { position: relative; padding-bottom: 24px; }
.timeline-item::before { content: ''; position: absolute; left: -20px; top: 10px; bottom: -14px; width: 1px; background: var(--line); }
.timeline-item:last-child::before { display: none; }
.timeline-dot { position: absolute; left: -24px; top: 4px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); }
.timeline-dot.done { background: var(--accent); border-color: var(--accent); }
.timeline-dot.current { background: var(--warn); border-color: var(--warn); box-shadow: 0 0 0 4px var(--warn-soft); }

/* ===== TEST CONSOLE ===== */
.tc-step { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.tc-step:last-child { border-bottom: none; }

/* ===== CUSTOMER PORTAL ===== */
.ao-action-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); transform: translateY(-1px); }
.ds-upload-area { border: 2px dashed var(--line); border-radius: 12px; padding: 24px; text-align: center; cursor: pointer; color: var(--muted); margin-top: 8px; transition: border-color var(--duration-fast) ease; }
.ds-upload-area:hover { border-color: var(--accent); color: var(--accent); }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
#main-slot > * { animation: slideUp 200ms var(--ease-out); }
