/* ================================================================
   Settlement & Reconciliation — Complete Design System
   ================================================================ */

/* --- Tokens --- */
:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --ink: #171612;
  --ink-2: #3a3833;
  --muted: #76726a;
  --line: #ebe7df;
  --line-2: #f1ede5;
  --accent: #2c5e4f;
  --accent-soft: #e8efe9;
  --warn: #a8581a;
  --warn-soft: #fbeedf;
  --crit: #8a1f1f;
  --crit-soft: #f8e2e1;
  --gold: #8a6a1a;
  --gold-soft: #f7eed3;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Layout --- */
.app { width: 1440px; margin: 0 auto; display: flex; position: relative; min-height: 100vh; }
.app::before { content: ""; position: fixed; top: -200px; right: calc(50% - 720px); width: 800px; height: 800px; border-radius: 50%; background: radial-gradient(circle, rgba(44,94,79,.08), transparent 60%); pointer-events: none; z-index: 0; }

/* --- Sidebar --- */
.sidebar { width: 248px; position: fixed; top: 0; bottom: 0; left: calc(50% - 720px); padding: 22px 14px; display: flex; flex-direction: column; background: rgba(255,255,255,.55); backdrop-filter: blur(20px); border-right: 1px solid var(--line); z-index: 2; }
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 10px 22px; }
.brand-mark { width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(140deg, #1d3d33, #2c5e4f); display: flex; align-items: center; justify-content: center; color: #fff; font-family: 'Instrument Serif', serif; font-size: 18px; box-shadow: 0 4px 12px rgba(44,94,79,.25); }
.brand-text { font-weight: 600; font-size: 14px; letter-spacing: -.01em; line-height: 1.3; }
.brand-text small { display: block; font-weight: 400; font-size: 11px; color: var(--muted); letter-spacing: .02em; }

.nav-section { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 18px 12px 6px; font-weight: 600; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px; color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 13.5px; margin-bottom: 1px; transition: all var(--duration-fast); }
.nav a:hover { background: rgba(0,0,0,.03); }
.nav a.active { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 0 0 1px var(--line); }
.nav a .ico { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }
.nav a .ico svg { display: block; }
.nav a.active .ico { color: var(--accent); }
.nav a .badge { margin-left: auto; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 1px 8px; font-size: 10.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.nav a:not(.active) .badge { background: transparent; color: var(--muted); }

.sidebar-foot { margin-top: auto; padding: 14px; border-radius: 12px; background: #fff; border: 1px solid var(--line); display: flex; align-items: center; gap: 11px; }
.av-c { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #2c5e4f, #1d3d33); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12px; flex-shrink: 0; }
.uinfo { font-size: 13px; font-weight: 600; flex: 1; min-width: 0; }
.uinfo small { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; }
.foot-ic { color: var(--muted); cursor: pointer; text-decoration: none; }
.foot-ic:hover { color: var(--ink); }

/* --- Main --- */
.main { margin-left: 248px; flex: 1; min-width: 0; position: relative; z-index: 1; }

/* --- Header --- */
.header { height: 64px; display: flex; align-items: center; gap: 14px; padding: 0 32px; border-bottom: 1px solid var(--line); background: rgba(246,245,241,.85); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 5; }
.crumbs { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--muted); }
.crumbs strong { color: var(--ink); font-weight: 600; }
.crumbs .sep { color: #c8c3b9; }
.crumbs .pill { font-size: 11px; font-weight: 600; background: var(--accent-soft); color: var(--accent); padding: 3px 8px; border-radius: 999px; margin-left: 6px; }
.search { margin-left: auto; display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; width: 340px; box-shadow: 0 1px 2px rgba(0,0,0,.02); }
.search input { border: 0; background: transparent; outline: 0; flex: 1; font-family: inherit; font-size: 13px; color: var(--ink); }
.search input:focus { outline: none; }
.search .kbd { font-size: 10.5px; color: var(--muted); background: #f1ede5; border-radius: 5px; padding: 2px 6px; font-weight: 600; }
.hbtn { width: 38px; height: 38px; border-radius: 10px; background: #fff; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--ink-2); cursor: pointer; position: relative; transition: background var(--duration-fast); }
.hbtn:hover { background: #fafaf6; }
.ndot { position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--crit); box-shadow: 0 0 0 2px #fff; }
.havatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, #2c5e4f, #1d3d33); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12.5px; box-shadow: 0 2px 6px rgba(0,0,0,.08); flex-shrink: 0; }

/* --- Page --- */
.page { padding: 32px 32px 60px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 28px; gap: 24px; }
.title-block .eyebrow { font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.title-block h1 { font-family: 'Instrument Serif', serif; font-size: 38px; font-weight: 400; letter-spacing: -.02em; color: var(--ink); line-height: 1.1; }
.title-block h1 em { font-family: 'Instrument Serif', serif; font-style: italic; color: var(--accent); }
.title-block p { font-size: 14px; color: var(--muted); margin-top: 10px; max-width: 560px; }
.title-meta { display: flex; gap: 18px; margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.title-meta span strong { color: var(--ink-2); font-weight: 600; }
.head-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* --- Buttons --- */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 10px 16px; border-radius: 10px; font-family: inherit; font-size: 13px; font-weight: 500; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; transition: all var(--duration-fast); white-space: nowrap; }
.btn:hover { background: #fafaf6; }
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.btn.primary:hover { background: #000; }
.btn.primary:disabled, .btn:disabled { opacity: .5; pointer-events: none; }

/* --- Metrics --- */
.metrics { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 0; background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,.02), 0 8px 32px rgba(0,0,0,.04); margin-bottom: 28px; }
.metric { padding: 24px 26px; border-right: 1px solid var(--line-2); position: relative; }
.metric:last-child { border-right: 0; }
.metric.hero { background: linear-gradient(135deg, #fafaf6 0%, #fff 100%); }
.metric .lbl { font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.metric .num { font-family: 'Instrument Serif', serif; font-size: 44px; font-weight: 400; letter-spacing: -.02em; color: var(--ink); line-height: 1; }
.metric .num small { font-family: 'Inter', sans-serif; font-size: 13.5px; color: var(--muted); font-weight: 500; margin-left: 6px; }
.metric .sub { font-size: 12.5px; color: var(--muted); margin-top: 10px; display: flex; align-items: center; gap: 8px; }
.trend { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; display: inline-flex; align-items: center; gap: 3px; }
.trend.up { background: var(--crit-soft); color: var(--crit); }
.trend.down { background: var(--accent-soft); color: var(--accent); }
.spark { margin-top: 14px; height: 30px; display: flex; align-items: flex-end; gap: 3px; }
.spark span { flex: 1; background: linear-gradient(to top, #2c5e4f, #5a8a7c); border-radius: 2px 2px 0 0; opacity: .85; }
.breakdown { display: flex; gap: 18px; margin-top: 18px; }
.bd { flex: 1; }
.bd-lbl { font-size: 11px; color: var(--muted); font-weight: 500; letter-spacing: .04em; margin-bottom: 6px; }
.bd-val { font-size: 18px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.bd-val.crit { color: var(--crit); }
.bd-val.warn { color: var(--warn); }
.bd-val.gold { color: var(--gold); }
.bar { height: 5px; border-radius: 3px; background: var(--line); margin-top: 8px; overflow: hidden; display: flex; }
.bar i { display: block; height: 100%; }

/* --- Toolbar & Segmented Tabs --- */
.toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.segmented { display: inline-flex; background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 4px; gap: 2px; box-shadow: 0 1px 2px rgba(0,0,0,.02); flex-wrap: wrap; }
.seg { padding: 7px 14px; font-size: 13px; font-weight: 500; color: var(--muted); border-radius: 8px; cursor: pointer; display: flex; align-items: center; gap: 8px; transition: all var(--duration-fast); white-space: nowrap; }
.seg:hover { background: rgba(0,0,0,.02); }
.seg.active { background: var(--ink); color: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.1); }
.seg .ct { background: rgba(255,255,255,.15); color: inherit; border-radius: 999px; padding: 1px 7px; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.seg:not(.active) .ct { background: #f1ede5; color: var(--muted); }

/* --- Filters --- */
.filters { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin-bottom: 18px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; box-shadow: 0 1px 2px rgba(0,0,0,.02); }
.filters .ftitle { font-size: 11.5px; color: var(--muted); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; background: #faf8f2; border: 1px solid var(--line); font-size: 12.5px; font-weight: 500; color: var(--ink-2); cursor: pointer; transition: all var(--duration-fast); }
.chip:hover { background: #f5f1e7; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.chip.on { background: var(--accent-soft); color: var(--accent); border-color: #c8dccf; }
.chip .x { color: inherit; opacity: .5; font-size: 11px; }
.chip .car { color: var(--muted); font-size: 10px; }
.dv { width: 1px; height: 20px; background: var(--line); }
.clearall { font-size: 12.5px; color: var(--muted); cursor: pointer; margin-left: auto; }
.clearall:hover { color: var(--ink); }

/* --- Table Card --- */
.tcard { background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,.02), 0 12px 40px rgba(0,0,0,.04); }
.tcard-head { padding: 16px 22px; display: flex; align-items: center; gap: 14px; border-bottom: 1px solid var(--line-2); }
.tcard-head .ttl { font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; }
.tcard-head .meta { font-size: 12.5px; color: var(--muted); }
.sel-bar { margin-left: auto; display: flex; align-items: center; gap: 10px; background: var(--accent-soft); color: var(--accent); padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.sel-actions { display: flex; gap: 6px; margin-left: 8px; }
.sm-btn { padding: 6px 11px; font-size: 12px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 500; color: var(--ink-2); font-family: inherit; transition: all var(--duration-fast); }
.sm-btn:hover { background: #fafaf6; }
.sm-btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }

table { width: 100%; border-collapse: collapse; }
th { background: transparent; text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 600; padding: 14px 18px; border-bottom: 1px solid var(--line-2); cursor: default; white-space: nowrap; }
th[data-sort] { cursor: pointer; }
th[data-sort]:hover { color: var(--ink-2); }
td { padding: 18px; border-bottom: 1px solid var(--line-2); font-size: 13.5px; vertical-align: middle; color: var(--ink); }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background var(--duration-fast); }
tbody tr:hover { background: #fafaf6; }
tr.sel { background: #fbf6ec; }
tr.sel:hover { background: #f9f1de; }

/* --- Checkbox --- */
.chk { width: 16px; height: 16px; border: 1.5px solid #c8c3b9; border-radius: 5px; display: inline-block; vertical-align: middle; background: #fff; flex-shrink: 0; position: relative; cursor: pointer; transition: all var(--duration-fast); }
.chk.on { background: var(--ink); border-color: var(--ink); }
.chk.on::after { content: ""; position: absolute; top: 2px; left: 5px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* --- Data Display --- */
.idc { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--ink-2); font-weight: 500; letter-spacing: -.02em; }
.idc small { display: block; font-family: 'Inter', sans-serif; font-size: 11.5px; color: var(--muted); font-weight: 400; margin-top: 2px; letter-spacing: 0; }

.sev { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; }
.sev .bar-i { width: 3px; height: 14px; border-radius: 2px; }
.sev.crit { color: var(--crit); } .sev.crit .bar-i { background: var(--crit); }
.sev.high { color: var(--warn); } .sev.high .bar-i { background: var(--warn); }
.sev.med { color: var(--gold); } .sev.med .bar-i { background: var(--gold); }
.sev.low { color: var(--muted); } .sev.low .bar-i { background: var(--muted); }

.src { font-size: 12.5px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.src .arr { color: var(--muted); }

.amt { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; font-size: 14px; letter-spacing: -.01em; }
.amt.neg { color: var(--crit); }
.amt.pos { color: var(--accent); }
.amt small { display: block; font-weight: 400; font-size: 11px; color: var(--muted); margin-top: 2px; }

.rc { font-size: 12.5px; color: var(--ink-2); }
.rc small { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }

.age { display: flex; align-items: center; gap: 10px; font-variant-numeric: tabular-nums; }
.age-pill { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: #f1ede5; color: var(--ink-2); }
.age-pill.old { background: var(--crit-soft); color: var(--crit); }
.age-pill.mid { background: var(--warn-soft); color: var(--warn); }

.own { display: flex; align-items: center; gap: 9px; font-size: 12.5px; }
.own .av { width: 26px; height: 26px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 600; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); flex-shrink: 0; }
.own .unassigned { color: var(--muted); font-style: italic; display: flex; align-items: center; gap: 7px; }
.own .unassigned .dotted { width: 24px; height: 24px; border-radius: 50%; border: 1.5px dashed #c8c3b9; flex-shrink: 0; }

/* --- Status --- */
.stat { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 500; padding: 5px 11px; border-radius: 999px; background: #faf8f2; border: 1px solid var(--line); white-space: nowrap; }
.stat .pip { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.stat.open .pip { background: #76726a; }
.stat.prog { background: #e8f0f5; border-color: #cde0eb; color: #1d4a6b; } .stat.prog .pip { background: #1d4a6b; }
.stat.rev { background: #f0e8f4; border-color: #dcc8e6; color: #5a2680; } .stat.rev .pip { background: #5a2680; }
.stat.esc { background: var(--crit-soft); border-color: #e9c9c8; color: var(--crit); } .stat.esc .pip { background: var(--crit); animation: pulse 1.5s infinite; }
.stat.resolved { background: var(--accent-soft); border-color: #c8dccf; color: var(--accent); } .stat.resolved .pip { background: var(--accent); }
.stat.rej { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); } .stat.rej .pip { background: var(--warn); }

/* --- Actions --- */
.act { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.openbtn { padding: 7px 14px; font-size: 12.5px; border-radius: 9px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 600; color: var(--ink); display: inline-flex; align-items: center; gap: 5px; font-family: inherit; transition: all var(--duration-fast); white-space: nowrap; }
.openbtn:hover { background: #fafaf6; }
.openbtn:active { transform: scale(0.97); }
.openbtn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.openbtn.primary:hover { background: #000; }
.dotsb { width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); cursor: pointer; position: relative; }
.dotsb:hover { background: #f1ede5; color: var(--ink); }

/* --- Dots Menu --- */
.dots-menu { position: absolute; top: 100%; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 4px; box-shadow: 0 8px 24px rgba(0,0,0,.1); z-index: 50; min-width: 160px; }
.dots-menu div { padding: 8px 12px; font-size: 13px; font-weight: 500; color: var(--ink-2); cursor: pointer; border-radius: 7px; white-space: nowrap; }
.dots-menu div:hover { background: #f1ede5; }

/* --- Pagination --- */
.tcard-foot { padding: 14px 22px; display: flex; align-items: center; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line-2); }
.pager { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.pg { min-width: 32px; height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12.5px; color: var(--ink-2); cursor: pointer; font-weight: 500; transition: all var(--duration-fast); }
.pg:hover { background: #f1ede5; }
.pg.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* --- Forms --- */
.form-select { display: block; width: 100%; padding: 10px 14px; font-family: inherit; font-size: 13.5px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2376726a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; cursor: pointer; transition: border-color var(--duration-fast); }
.form-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(44,94,79,.1); }
.form-textarea { display: block; width: 100%; padding: 10px 14px; font-family: inherit; font-size: 13.5px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); resize: vertical; min-height: 60px; transition: border-color var(--duration-fast); }
.form-textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(44,94,79,.1); }
.form-input { display: block; width: 100%; padding: 10px 14px; font-family: inherit; font-size: 13.5px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); transition: border-color var(--duration-fast); }
.form-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(44,94,79,.1); }

/* --- Modal --- */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .2s; }
.modal-overlay.modal-visible { opacity: 1; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.4); }
.modal-panel { position: relative; background: #fff; border-radius: 18px; padding: 0; max-width: 480px; width: 90%; box-shadow: 0 24px 80px rgba(0,0,0,.15); transform: scale(0.95); transition: transform .2s var(--ease-out); }
.modal-visible .modal-panel { transform: scale(1); }
.modal-header { padding: 20px 24px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line-2); }
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close { background: none; border: none; cursor: pointer; color: var(--muted); padding: 4px; border-radius: 6px; }
.modal-close:hover { background: #f1ede5; color: var(--ink); }
.modal-body { padding: 20px 24px; font-size: 14px; color: var(--ink-2); line-height: 1.6; }
.modal-textarea { display: block; width: 100%; margin-top: 12px; padding: 10px 14px; font-family: inherit; font-size: 13.5px; border: 1px solid var(--line); border-radius: 10px; resize: vertical; min-height: 80px; }
.modal-textarea:focus { outline: none; border-color: var(--accent); }
.modal-footer { padding: 16px 24px; display: flex; gap: 8px; justify-content: flex-end; border-top: 1px solid var(--line-2); }
.btn-modal-confirm { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-modal-confirm:disabled { opacity: .5; cursor: not-allowed; }
.btn-modal-danger { background: var(--crit); color: #fff; border-color: var(--crit); }
.btn-modal-danger:disabled { opacity: .5; cursor: not-allowed; }

/* --- Toast --- */
@keyframes toastIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-10px); } }

/* --- Dropdown --- */
.dropdown-panel { position: fixed; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px; box-shadow: 0 12px 40px rgba(0,0,0,.12); z-index: 100; min-width: 200px; display: none; }
.dropdown-panel.dropdown-open { display: block; }
.dropdown-panel [data-value] { padding: 8px 12px; border-radius: 8px; font-size: 13px; cursor: pointer; }
.dropdown-panel [data-value]:hover { background: #f1ede5; }

/* --- Login --- */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; width: 1440px; padding: 40px; }
.login-container { max-width: 800px; width: 100%; }
.login-header { text-align: center; margin-bottom: 36px; }
.login-brand { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 16px; }
.login-title { font-family: 'Instrument Serif', serif; font-size: 28px; font-weight: 400; }
.login-subtitle { font-size: 13px; color: var(--muted); margin-top: 2px; }
.login-desc { font-size: 14px; color: var(--muted); max-width: 480px; margin: 0 auto; }
.login-groups { display: flex; flex-direction: column; gap: 20px; margin-bottom: 24px; }
.login-group-title { font-size: 14px; font-weight: 600; margin-bottom: 10px; display: flex; align-items: baseline; gap: 8px; }
.login-group-title small { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.login-group-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.login-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: #fff; border: 2px solid var(--line); border-radius: 14px; cursor: pointer; transition: all var(--duration-fast); }
.login-card:hover { border-color: #c8c3b9; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.login-card.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px rgba(44,94,79,.15); }
.login-avatar { width: 40px; height: 40px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; flex-shrink: 0; }
.login-card-info { min-width: 0; }
.login-card-name { font-weight: 600; font-size: 13.5px; }
.login-card-email { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.login-card-role { font-size: 11px; color: var(--muted); margin-top: 2px; display: flex; align-items: center; gap: 4px; }
.login-role-badge { background: var(--accent-soft); color: var(--accent); font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 4px; }
.login-footer { text-align: center; padding-top: 16px; border-top: 1px solid var(--line); }
.login-selected { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.login-error { color: var(--crit); font-size: 13px; margin-bottom: 8px; font-weight: 500; }
.login-btn { padding: 12px 32px; font-size: 14px; }

/* --- Upload --- */
.upload-dropzone.dragover { border-color: var(--accent); background: var(--accent-soft); }

/* --- Motion & Animations --- */
.fade-in { animation: fadeIn var(--duration-normal) var(--ease-out) forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }

.stagger-1 { animation-delay: 0ms; }
.stagger-2 { animation-delay: 80ms; }
.stagger-3 { animation-delay: 160ms; }
.stagger-4 { animation-delay: 240ms; }

/* --- Spinner --- */
.spinner-small { width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .6s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- SVG default --- */
svg { display: block; }
