/* TTG Petty Cash — Design Tokens */
:root {
  /* Primary CI */
  --navy: #201751;
  --navy-2: #364C9C;
  --navy-deep: #15103A;
  --orange: #F37124;
  --orange-soft: #FDE4D2;

  /* Secondary */
  --white: #FFFFFF;
  --silver: #D8D9DA;
  --silver-30: #ECEDEE;
  --silver-10: #F6F6F7;
  --gold: #BEB081;
  --gold-soft: #EFEADA;
  --charcoal: #1A1A1A;
  --charcoal-70: #4B4B4B;
  --charcoal-30: #9A9A9A;

  /* Semantic */
  --bg: #F4F5F8;
  --surface: #FFFFFF;
  --border: #E4E6EC;
  --border-strong: #C9CCD4;
  --text: #1A1A1A;
  --text-muted: #6B6E78;
  --text-faint: #9CA0AA;

  --ok: #1F8A5B;
  --ok-soft: #E2F3EA;
  --warn: #D08A0A;
  --warn-soft: #FAF1DA;
  --err: #C0392B;
  --err-soft: #FBE6E2;
  --info: var(--navy-2);
  --info-soft: #E1E6F3;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;
  --r-pill: 999px;

  --sh-1: 0 1px 2px rgba(15, 14, 40, 0.06), 0 0 0 1px rgba(15,14,40,0.04);
  --sh-2: 0 2px 8px rgba(15, 14, 40, 0.06), 0 0 0 1px rgba(15,14,40,0.04);
  --sh-3: 0 12px 40px rgba(15, 14, 40, 0.10), 0 0 0 1px rgba(15,14,40,0.05);

  --gap: 16px;
  --pad: 20px;

  --t-fast: 140ms cubic-bezier(.2,.7,.2,1);
  --t-med: 240ms cubic-bezier(.2,.7,.2,1);
}

/* density */
:root[data-density="compact"] {
  --gap: 12px;
  --pad: 14px;
}

* { box-sizing: border-box; }
html, body, #root { height: 100%; }
body {
  margin: 0;
  font-family: "IBM Plex Sans Thai", "Inter", -apple-system, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* === LAYOUT === */
.app {
  display: grid;
  grid-template-columns: 248px 1fr;
  height: 100vh;
  overflow: hidden;
}
.app[data-nav="top"] {
  grid-template-columns: 1fr;
  grid-template-rows: 56px 1fr;
}

/* === SIDEBAR === */
.sidebar {
  background: var(--navy);
  color: #DDE0EE;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255,255,255,0.06);
}
.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 14px;
}
.brand-mark {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--orange) 0%, #ED5A1A 100%);
  display: grid; place-items: center;
  color: white;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 14px rgba(243,113,36,0.4);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { color: #fff; font-size: 14px; letter-spacing: 0.4px; }
.brand-text span { color: #9DA3C5; font-size: 11px; }

.sidebar__section {
  padding: 12px 12px 4px;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7F86A8;
  font-weight: 600;
}
.nav {
  display: flex; flex-direction: column;
  gap: 2px;
  padding: 0 10px;
}
.nav__item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  color: #C8CCE0;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t-fast);
  position: relative;
  user-select: none;
}
.nav__item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav__item.active {
  background: rgba(243,113,36,0.14);
  color: #fff;
}
.nav__item.active::before {
  content: "";
  position: absolute;
  left: -10px; top: 8px; bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--orange);
}
.nav__item svg { flex: 0 0 18px; }
.nav__badge {
  margin-left: auto;
  font-size: 10.5px;
  background: var(--orange);
  color: white;
  padding: 1px 7px;
  border-radius: 999px;
  font-weight: 600;
}

.sidebar__footer {
  margin-top: auto;
  padding: 14px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #9C8B58);
  color: var(--navy-deep);
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 12px;
}
.avatar.lg { width: 44px; height: 44px; font-size: 14px; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.user-mini { font-size: 12px; line-height: 1.25; flex: 1; min-width: 0; }
.user-mini b { color: #fff; display: block; font-weight: 600; }
.user-mini span { color: #8C92B0; font-size: 11px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* === MAIN === */
.main {
  display: flex; flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.topbar {
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}
.topbar__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.topbar__crumb {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-left: 2px;
}
.topbar__crumb b { color: var(--text); font-weight: 600; }
.topbar__spacer { flex: 1; }

.search {
  position: relative;
  width: 320px;
}
.search input {
  width: 100%;
  height: 36px;
  border: 1px solid var(--border);
  background: var(--silver-10);
  border-radius: var(--r-md);
  padding: 0 12px 0 36px;
  font: inherit;
  color: var(--text);
  transition: all var(--t-fast);
}
.search input:focus {
  outline: none;
  background: white;
  border-color: var(--navy-2);
  box-shadow: 0 0 0 3px rgba(54, 76, 156, 0.12);
}
.search svg {
  position: absolute;
  left: 11px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  pointer-events: none;
}

.icon-btn {
  width: 36px; height: 36px;
  border-radius: var(--r-md);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  display: grid; place-items: center;
  cursor: pointer;
  position: relative;
  transition: all var(--t-fast);
}
.icon-btn:hover { background: var(--silver-10); color: var(--text); }
.icon-btn .dot {
  position: absolute;
  top: 8px; right: 8px;
  width: 7px; height: 7px;
  background: var(--orange);
  border-radius: 50%;
  border: 2px solid var(--surface);
}

.role-pill {
  height: 36px;
  padding: 0 12px 0 8px;
  border-radius: var(--r-pill);
  background: var(--silver-10);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  transition: all var(--t-fast);
  position: relative;
}
.role-pill:hover { background: white; box-shadow: var(--sh-1); }
.role-pill__role { color: var(--text-muted); font-size: 11px; }

/* === CONTENT === */
.content {
  flex: 1;
  overflow: auto;
  padding: 24px 32px 60px;
}
.content__head {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 22px;
}
.content__head h1 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
  color: var(--text);
}
.content__head p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13.5px;
}
.content__head__actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

/* === BUTTONS === */
.btn {
  height: 36px;
  padding: 0 16px;
  border-radius: var(--r-md);
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all var(--t-fast);
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--primary {
  background: var(--orange);
  color: white;
  box-shadow: 0 1px 2px rgba(243,113,36,0.25), inset 0 -1px 0 rgba(0,0,0,0.1);
}
.btn--primary:hover:not(:disabled) {
  background: #E66218;
  box-shadow: 0 4px 14px rgba(243,113,36,0.35);
  transform: translateY(-0.5px);
}
.btn--navy {
  background: var(--navy);
  color: white;
}
.btn--navy:hover:not(:disabled) { background: var(--navy-deep); }
.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn--ghost:hover:not(:disabled) { background: var(--silver-10); border-color: var(--border-strong); }
.btn--subtle {
  background: var(--silver-10);
  color: var(--text);
}
.btn--subtle:hover:not(:disabled) { background: var(--silver-30); }
.btn--danger {
  background: var(--err-soft);
  color: var(--err);
}
.btn--danger:hover:not(:disabled) { background: #F5D2CB; }
.btn--success {
  background: var(--ok);
  color: white;
}
.btn--success:hover:not(:disabled) { background: #1A7048; }
.btn--sm { height: 30px; padding: 0 12px; font-size: 12px; border-radius: 8px; }
.btn--lg { height: 42px; padding: 0 22px; font-size: 14px; }
.btn--icon { padding: 0; width: 36px; justify-content: center; }

/* === CARDS === */
.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  box-shadow: var(--sh-1);
}
.card--lg { border-radius: var(--r-xl); }
.card__head {
  padding: 16px var(--pad);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.card__head h3 {
  font-size: 14.5px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.005em;
}
.card__head__actions { margin-left: auto; display: flex; gap: 8px; }
.card__body { padding: var(--pad); }
.card__foot {
  padding: 14px var(--pad);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  background: var(--silver-10);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}

/* === STAT CARDS === */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
  margin-bottom: 24px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}
.stat__label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 10px;
}
.stat__icon {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: grid; place-items: center;
}
.stat__value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  margin-bottom: 6px;
  line-height: 1.1;
}
.stat__value small { font-size: 13px; color: var(--text-muted); font-weight: 500; margin-left: 4px; }
.stat__delta {
  font-size: 11.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.stat__delta.up { color: var(--ok); }
.stat__delta.down { color: var(--err); }
.stat__delta.flat { color: var(--text-muted); }
.stat__bar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
}

/* === BADGES === */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: 0.01em;
  line-height: 1.4;
  white-space: nowrap;
}
.badge .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge--draft { background: #EEF0F4; color: #5B6172; }
.badge--pending { background: var(--warn-soft); color: var(--warn); }
.badge--approved { background: var(--ok-soft); color: var(--ok); }
.badge--rejected { background: var(--err-soft); color: var(--err); }
.badge--clearing { background: var(--info-soft); color: var(--navy-2); }
.badge--paid { background: var(--gold-soft); color: #806A2B; }
.badge--closed { background: #E7E3F5; color: #4A3E84; }

/* === TABLE === */
.table-wrap { overflow-x: auto; }
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.table th {
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 11.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 10px 16px;
  background: var(--silver-10);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1;
  white-space: nowrap;
}
.table th:first-child { padding-left: 20px; }
.table th:last-child { padding-right: 20px; }
.table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}
.table td:first-child { padding-left: 20px; }
.table td:last-child { padding-right: 20px; }
.table tbody tr { transition: background var(--t-fast); cursor: pointer; }
.table tbody tr:hover { background: var(--silver-10); }
.table tbody tr:last-child td { border-bottom: 0; }
.table__id { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12px; color: var(--navy-2); font-weight: 600; }
.table__money { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.table__money--neg { color: var(--err); }
.table__money--pos { color: var(--ok); }

/* === FORM === */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 24px;
}
.form-grid--3 { grid-template-columns: repeat(3, 1fr); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field--full { grid-column: 1 / -1; }
.field__label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 4px;
}
.field__label .req { color: var(--orange); }
.field__hint { font-size: 11.5px; color: var(--text-muted); }
.field__error { font-size: 11.5px; color: var(--err); display: flex; align-items: center; gap: 4px; }

.input, .textarea, .select {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
  transition: all var(--t-fast);
  width: 100%;
}
.textarea { height: auto; padding: 10px 12px; min-height: 80px; resize: vertical; }
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--navy-2);
  box-shadow: 0 0 0 3px rgba(54, 76, 156, 0.12);
}
.input.error, .textarea.error, .select.error {
  border-color: var(--err);
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.10);
}
.input[readonly], .input:disabled {
  background: var(--silver-10);
  color: var(--text-muted);
}
.input--money { text-align: right; font-variant-numeric: tabular-nums; }
.input--withprefix { padding-left: 36px; }
.input-wrap { position: relative; }
.input-wrap__prefix {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--text-muted);
  pointer-events: none;
  font-weight: 500;
}
.input-wrap__suffix {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

/* line items */
.line-items {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.li-row {
  display: grid;
  grid-template-columns: 40px 1fr 160px 40px;
  gap: 0;
  align-items: stretch;
  border-bottom: 1px solid var(--border);
  background: white;
}
.li-row--clearing {
  grid-template-columns: 40px 1fr 140px 140px 40px;
}
.li-row.head {
  background: var(--silver-10);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.li-row:last-child { border-bottom: 0; }
.li-cell {
  padding: 10px 12px;
  display: flex; align-items: center;
  border-right: 1px solid var(--border);
}
.li-cell:last-child { border-right: 0; }
.li-cell input {
  width: 100%; height: 32px;
  border: 0; background: transparent;
  font: inherit; color: var(--text);
  outline: none;
}
.li-cell input.money { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.li-cell__num { justify-content: center; color: var(--text-muted); font-size: 12px; }
.li-cell__del {
  justify-content: center;
  padding: 0;
}
.li-cell__del button {
  background: transparent; border: 0;
  color: var(--text-faint);
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: all var(--t-fast);
}
.li-cell__del button:hover { background: var(--err-soft); color: var(--err); }
.li-add {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px;
  border: 0;
  background: var(--silver-10);
  width: 100%;
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--navy-2);
  cursor: pointer;
  transition: background var(--t-fast);
}
.li-add:hover { background: var(--silver-30); }

.totals {
  background: var(--silver-10);
  border-radius: var(--r-md);
  padding: 14px 20px;
  display: flex; flex-direction: column;
  gap: 8px;
}
.totals__row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.totals__row.major {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 4px;
  font-size: 15px;
  font-weight: 700;
}
.totals__row .v { font-variant-numeric: tabular-nums; font-weight: 600; }
.totals__row.major .v { font-size: 18px; color: var(--navy); }
.totals__row.balance--return .v { color: var(--ok); }
.totals__row.balance--addon .v { color: var(--orange); }

/* === RECEIPTS DROPZONE === */
.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-md);
  padding: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  background: var(--silver-10);
  cursor: pointer;
  transition: all var(--t-fast);
}
.dropzone:hover {
  border-color: var(--navy-2);
  background: #EEF1FA;
  color: var(--navy);
}
.dropzone b { color: var(--text); font-weight: 600; font-size: 13.5px; }
.dropzone span { font-size: 11.5px; }
.receipts {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}
.receipt {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 12px;
  display: flex; align-items: center; gap: 10px;
  background: white;
}
.receipt__thumb {
  width: 36px; height: 36px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--silver-30), var(--silver));
  display: grid; place-items: center;
  color: var(--charcoal-70);
  flex-shrink: 0;
}
.receipt__meta { flex: 1; min-width: 0; font-size: 12px; }
.receipt__meta b { display: block; font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.receipt__meta span { color: var(--text-muted); font-size: 11px; }
.receipt__del {
  background: transparent; border: 0;
  color: var(--text-faint); cursor: pointer; padding: 4px;
}
.receipt__del:hover { color: var(--err); }

/* === TIMELINE === */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.tl-row {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  align-items: flex-start;
  position: relative;
}
.tl-row + .tl-row { padding-top: 16px; }
.tl-row::before {
  content: "";
  position: absolute;
  left: 13px; top: 0; bottom: 0;
  width: 2px;
  background: var(--border);
}
.tl-row:first-child::before { top: 14px; }
.tl-row:last-child::before { bottom: calc(100% - 14px); }
.tl-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--silver-30);
  color: var(--text-muted);
  display: grid; place-items: center;
  position: relative; z-index: 1;
  flex-shrink: 0;
}
.tl-dot.done { background: var(--ok); color: white; }
.tl-dot.active { background: var(--orange); color: white; box-shadow: 0 0 0 4px var(--orange-soft); }
.tl-dot.reject { background: var(--err); color: white; }
.tl-dot.wait { background: white; border: 2px dashed var(--border-strong); color: var(--text-faint); }
.tl-body { padding-bottom: 4px; }
.tl-body__title { font-weight: 600; font-size: 13.5px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.tl-body__role { font-size: 11.5px; color: var(--text-muted); }
.tl-body__meta { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.tl-body__note {
  margin-top: 6px;
  padding: 8px 10px;
  background: var(--silver-10);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text);
  border-left: 3px solid var(--silver);
}
.tl-body__note.reject { border-left-color: var(--err); background: var(--err-soft); color: var(--err); }

/* === DETAIL ROWS === */
.kv {
  display: grid;
  grid-template-columns: 160px 1fr;
  padding: 9px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 13px;
}
.kv:last-child { border-bottom: 0; }
.kv__k { color: var(--text-muted); }
.kv__v { color: var(--text); font-weight: 500; }

/* === TABS === */
.tabs {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}
.tab {
  padding: 10px 16px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: all var(--t-fast);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--navy); border-bottom-color: var(--orange); font-weight: 600; }
.tab__count {
  background: var(--silver-30);
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
}
.tab.active .tab__count { background: var(--orange-soft); color: var(--orange); }

/* === FILTERS === */
.filterbar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.filter-chip {
  height: 32px;
  padding: 0 10px 0 12px;
  border-radius: var(--r-pill);
  background: white;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  cursor: pointer;
  color: var(--text);
}
.filter-chip:hover { border-color: var(--border-strong); }
.filter-chip.active { background: var(--navy); color: white; border-color: var(--navy); }
.filter-chip select {
  appearance: none;
  background: transparent;
  border: 0;
  font: inherit;
  font-size: 12.5px;
  color: inherit;
  cursor: pointer;
  padding-right: 2px;
}

/* === MODAL (Dropdown menu) === */
.menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 240px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--sh-3);
  z-index: 100;
  padding: 6px;
  animation: pop 140ms ease;
}
@keyframes pop { from { opacity: 0; transform: translateY(-4px);} to { opacity: 1; transform: translateY(0);} }
.menu__head {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  padding: 8px 10px 4px;
}
.menu__item {
  padding: 8px 10px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
}
.menu__item:hover { background: var(--silver-10); }
.menu__item.active { background: var(--silver-10); color: var(--navy); }
.menu__sep { height: 1px; background: var(--border); margin: 6px 4px; }

/* === DRAWER (right side detail) === */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(15,14,40,0.4);
  z-index: 200;
  animation: fade 180ms ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 740px;
  max-width: 92vw;
  background: var(--bg);
  z-index: 201;
  display: flex;
  flex-direction: column;
  animation: slide 220ms cubic-bezier(.2,.7,.2,1);
  box-shadow: -20px 0 60px rgba(15,14,40,0.18);
}
@keyframes slide { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.drawer__head {
  height: 60px;
  background: white;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  flex-shrink: 0;
}
.drawer__head h2 { font-size: 16px; font-weight: 600; margin: 0; flex: 1; }
.drawer__body { flex: 1; overflow: auto; padding: 20px; }
.drawer__foot {
  border-top: 1px solid var(--border);
  background: white;
  padding: 12px 20px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* === EMPTY STATE === */
.empty {
  padding: 60px 24px;
  text-align: center;
  color: var(--text-muted);
}
.empty__icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--silver-10);
  display: grid; place-items: center;
  margin: 0 auto 14px;
  color: var(--text-faint);
}
.empty h3 { font-size: 15px; color: var(--text); margin: 0 0 4px; font-weight: 600; }
.empty p { margin: 0 0 14px; font-size: 13px; }

/* === MISC === */
.row { display: flex; gap: 12px; align-items: center; }
.col { display: flex; flex-direction: column; gap: 12px; }
.split { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: flex-start; }
.split--wide { grid-template-columns: 1fr 360px; }

.section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 18px 0 10px;
}
.section-title:first-child { margin-top: 0; }

.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

.help-text {
  background: var(--info-soft);
  color: var(--navy);
  border-radius: var(--r-md);
  padding: 10px 14px;
  font-size: 12.5px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-left: 3px solid var(--navy-2);
}
.help-text.warn { background: var(--warn-soft); color: var(--warn); border-left-color: var(--warn); }
.help-text.success { background: var(--ok-soft); color: var(--ok); border-left-color: var(--ok); }

.skeleton-bar { background: linear-gradient(90deg, var(--silver-30) 0%, var(--silver-10) 50%, var(--silver-30) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 4px; height: 10px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; }}

.toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  background: var(--charcoal);
  color: white;
  padding: 12px 20px;
  border-radius: var(--r-md);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--sh-3);
  z-index: 500;
  animation: toast 200ms ease;
}
@keyframes toast { from { opacity: 0; transform: translate(-50%, 10px);} to { opacity: 1; transform: translate(-50%, 0);} }
.toast .ok { color: #6BE6A6; }

/* Scrollbar */
.content::-webkit-scrollbar, .drawer__body::-webkit-scrollbar { width: 10px; }
.content::-webkit-scrollbar-thumb, .drawer__body::-webkit-scrollbar-thumb { background: var(--silver); border-radius: 999px; }
.content::-webkit-scrollbar-thumb:hover, .drawer__body::-webkit-scrollbar-thumb:hover { background: var(--charcoal-30); }
.content::-webkit-scrollbar-track, .drawer__body::-webkit-scrollbar-track { background: transparent; }

/* mini summary in approval queue */
.approval-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  transition: all var(--t-fast);
  cursor: pointer;
}
.approval-card:hover { box-shadow: var(--sh-2); border-color: var(--border-strong); }
.approval-card__h {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px;
}
.approval-card__id { font-family: ui-monospace, monospace; font-size: 12px; color: var(--navy-2); font-weight: 600; }
.approval-card__title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.approval-card__meta { display: flex; gap: 16px; color: var(--text-muted); font-size: 12px; align-items: center;}
.approval-card__money { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--navy); letter-spacing: -0.01em; text-align: right; }
.approval-card__money small { font-size: 11.5px; font-weight: 500; color: var(--text-muted); display: block; margin-bottom: 2px; }
.approval-card__actions { grid-column: 1 / -1; display: flex; gap: 8px; border-top: 1px solid var(--border); padding-top: 12px; margin-top: 4px; }

.diff-money {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* Approval cards mini */
@media (max-width: 1280px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
