/* ============================================================
   Clara — Painel Admin (GCF)
   Design system: Idle Finance · DeFi terminal dark
   ============================================================ */

:root {
  --color-abyss-navy:    #17202e;
  --color-tide-card:     #202a3e;
  --color-spectral-cyan: #6ae4ff;
  --color-bone-white:    #ffffff;
  --color-carbon-black:  #000000;
  --color-fog-gray:      #cdd0d6;

  --danger:  #ff5050;
  --warning: #ffc83c;
  --success: #6ae4ff;

  --font-primary: 'Open Sans', 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --radius-card:    6px;
  --radius-btn:     6px;
  --radius-badge:  80px;
  --radius-input:   4px;
  --radius-link:    4px;

  --sidebar-w: 232px;
  --header-h:   56px;

  --cyan-06: rgba(106,228,255,.06);
  --cyan-10: rgba(106,228,255,.10);
  --cyan-20: rgba(106,228,255,.20);
  --hair:    rgba(255,255,255,.08);
  --hair-soft: rgba(255,255,255,.04);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }

body {
  font-family: var(--font-primary);
  letter-spacing: -0.036em;
  background: var(--color-abyss-navy);
  color: var(--color-bone-white);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.45;
}

::selection { background: rgba(106,228,255,.28); }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 80px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.16); background-clip: padding-box; }

/* ============================================================
   APP SHELL
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--header-h) 1fr;
  height: 100vh;
  width: 100%;
}

/* ---------- HEADER ---------- */
.header {
  grid-column: 1 / -1;
  background: var(--color-tide-card);
  border-bottom: 1px solid var(--color-carbon-black);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 0 24px;
  gap: 16px;
  position: relative;
  z-index: 30;
}
.brand { display: flex; align-items: center; gap: 9px; font-size: 16px; font-weight: 700; }
.brand .logo-mark {
  width: 22px; height: 22px; border-radius: 7px;
  background: var(--color-spectral-cyan);
  display: grid; place-items: center;
  color: #06202b; font-weight: 700; font-size: 13px;
  flex: 0 0 auto;
}
.brand .slash { color: var(--color-spectral-cyan); font-weight: 400; }

.header-right { display: flex; align-items: center; gap: 14px; }

/* mode switch */
.mode-switch { display: flex; align-items: center; gap: 0; background: var(--color-abyss-navy); border: 1px solid var(--hair); border-radius: var(--radius-btn); padding: 3px; }
.mode-btn {
  border: 0; background: transparent; cursor: pointer;
  font-family: inherit; letter-spacing: 0.04em; text-transform: uppercase;
  font-size: 10.5px; font-weight: 700; color: var(--color-fog-gray);
  padding: 6px 13px; border-radius: var(--radius-btn);
  display: flex; align-items: center; gap: 6px; transition: .14s;
}
.mode-btn .mdot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .55; }
.mode-btn:hover { color: var(--color-bone-white); }
.mode-btn.active { color: #06202b; }
.mode-btn.active .mdot { opacity: 1; background: #06202b; }
.mode-btn[data-mode="simulation"].active { background: var(--color-fog-gray); }
.mode-btn[data-mode="test"].active      { background: var(--warning); }
.mode-btn[data-mode="production"].active { background: var(--color-spectral-cyan); }

.conn { display: flex; align-items: center; gap: 8px; }
.conn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-fog-gray); opacity: .45; transition: .3s; }
.conn.online .dot { background: var(--color-spectral-cyan); opacity: 1; box-shadow: 0 0 0 4px rgba(106,228,255,.14); }
.conn .conn-label { font-size: 13px; color: var(--color-fog-gray); }

.divider-v { width: 1px; height: 24px; background: var(--hair); }

/* ---------- SIDEBAR ---------- */
.sidebar {
  background: var(--color-tide-card);
  border-right: 1px solid var(--color-carbon-black);
  padding: 16px 12px;
  overflow-y: auto;
  display: flex; flex-direction: column;
  gap: 4px;
}
.nav-group { margin-bottom: 14px; }
.nav-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--color-fog-gray); opacity: .5;
  padding: 6px 12px 8px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: var(--radius-link);
  color: var(--color-fog-gray); font-size: 14px; cursor: pointer;
  border: 1px solid transparent; transition: .12s;
  position: relative; user-select: none;
}
.nav-item svg { width: 17px; height: 17px; flex: 0 0 auto; opacity: .9; }
.nav-item > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item:hover { color: var(--color-bone-white); background: var(--cyan-06); }
.nav-item.active { color: var(--color-spectral-cyan); border-color: var(--color-spectral-cyan); background: var(--cyan-06); font-weight: 600; }
.nav-item .nav-count {
  margin-left: auto; font-size: 11px; font-weight: 700;
  min-width: 19px; height: 19px; padding: 0 5px; border-radius: 80px;
  display: grid; place-items: center;
  background: var(--warning); color: #2a1d00;
}
.nav-item .nav-count.zero { display: none; }
.sidebar-foot { margin-top: auto; padding: 12px; font-size: 11px; color: var(--color-fog-gray); opacity: .4; line-height: 1.5; }
.sidebar-foot code { font-family: var(--font-mono); font-size: 10.5px; }

/* ---------- MAIN ---------- */
.main { background: var(--color-abyss-navy); overflow-y: auto; }
.page { display: none; padding: 26px 32px 60px; max-width: 1320px; }
.page.active { display: block; animation: fade .22s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.page-head { margin-bottom: 22px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.page-title { font-size: 22px; font-weight: 700; margin: 0 0 3px; }
.page-sub { font-size: 13px; color: var(--color-fog-gray); margin: 0; }
.page-head-actions { display: flex; align-items: center; gap: 8px; }

/* mode banner */
.mode-banner {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 16px; border-radius: var(--radius-card);
  font-size: 13px; margin-bottom: 20px; border: 1px solid;
}
.mode-banner svg { width: 17px; height: 17px; flex: 0 0 auto; }
.mode-banner b { font-weight: 700; }
.mode-banner.sim  { background: rgba(205,208,214,.06); border-color: rgba(205,208,214,.22); color: var(--color-fog-gray); }
.mode-banner.test { background: rgba(255,200,60,.07);  border-color: rgba(255,200,60,.32);  color: var(--warning); }
.mode-banner.prod { background: var(--cyan-06);        border-color: var(--cyan-20);        color: var(--color-spectral-cyan); }

/* ============================================================
   CARD
   ============================================================ */
.card {
  background: var(--color-tide-card);
  border: 1px solid var(--color-carbon-black);
  border-radius: var(--radius-card);
  padding: 24px;
  margin-bottom: 16px;
}
.card.pad-sm { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-title { font-size: 15px; font-weight: 600; margin: 0; display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.card-title .ti { color: var(--color-spectral-cyan); display: inline-grid; place-items: center; }
.card-title .ti svg { width: 16px; height: 16px; }
.card-sub { font-size: 12px; color: var(--color-fog-gray); opacity: .7; margin: 2px 0 0; font-weight: 400; }

/* grid helpers */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: 1fr; } }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em; padding: 3px 10px; border-radius: var(--radius-badge);
  border: 1px solid; white-space: nowrap; line-height: 1.4;
}
.badge .bdot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-cyan   { color: var(--color-spectral-cyan); border-color: var(--color-spectral-cyan); background: var(--cyan-06); }
.badge-green  { color: var(--color-spectral-cyan); border-color: var(--color-spectral-cyan); background: var(--cyan-06); }
.badge-yellow { color: var(--warning); border-color: var(--warning); background: rgba(255,200,60,.07); }
.badge-red    { color: var(--danger); border-color: var(--danger); background: rgba(255,80,80,.07); }
.badge-gray   { color: var(--color-fog-gray); border-color: rgba(255,255,255,.12); background: rgba(255,255,255,.02); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  font-family: inherit; letter-spacing: -0.02em;
  border-radius: var(--radius-btn); font-weight: 600; font-size: 13px;
  padding: 9px 18px; border: 1px solid transparent; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px; transition: .13s;
  white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; }
.btn-primary   { background: var(--color-bone-white); color: #000; }
.btn-primary:hover { background: #e7eaee; }
.btn-secondary { background: var(--color-spectral-cyan); color: #06202b; }
.btn-secondary:hover { background: #8aebff; }
.btn-ghost     { background: transparent; color: var(--color-spectral-cyan); border-color: var(--color-spectral-cyan); }
.btn-ghost:hover { background: var(--cyan-06); }
.btn-danger    { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: rgba(255,80,80,.08); }
.btn-neutral   { background: transparent; color: var(--color-fog-gray); border-color: var(--hair); }
.btn-neutral:hover { background: rgba(255,255,255,.04); color: var(--color-bone-white); }
.btn-sm { padding: 6px 13px; font-size: 12px; }
.btn-icon { padding: 7px; border-radius: var(--radius-link); }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap { overflow-x: auto; margin: 0 -24px -8px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl thead th {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--color-fog-gray); text-align: left; padding: 8px 12px;
  border-bottom: 1px solid var(--hair); white-space: nowrap; opacity: .85;
}
table.tbl thead th.sortable { cursor: pointer; user-select: none; }
table.tbl thead th.sortable:hover { color: var(--color-bone-white); }
table.tbl thead th .sort-ind { color: var(--color-spectral-cyan); margin-left: 3px; font-size: 10px; }
table.tbl thead th.num, table.tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl tbody td { padding: 11px 12px; border-bottom: 1px solid var(--hair-soft); vertical-align: middle; }
table.tbl tbody tr:hover { background: rgba(106,228,255,.035); }
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl th:first-child, table.tbl td:first-child { padding-left: 24px; }
table.tbl th:last-child,  table.tbl td:last-child  { padding-right: 24px; }
table.tbl .muted { color: var(--color-fog-gray); }
table.tbl .strong { font-weight: 600; }
.cell-actions { display: flex; gap: 6px; justify-content: flex-end; }

.mono { font-family: var(--font-mono); font-size: 12px; }
.rcpt { font-family: var(--font-mono); font-size: 11.5px; color: var(--color-spectral-cyan); }
.shortid { font-family: var(--font-mono); font-size: 11.5px; color: var(--color-fog-gray); }

/* ============================================================
   STAT MINI-CARDS
   ============================================================ */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 4px; }
@media (max-width: 900px) { .stat-grid { grid-template-columns: repeat(2,1fr); } }
.stat {
  background: var(--cyan-06); border: 1px solid var(--cyan-20);
  border-radius: var(--radius-link); padding: 13px 16px;
}
.stat .stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-fog-gray); margin-bottom: 6px; }
.stat .stat-val { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .stat-val.cyan { color: var(--color-spectral-cyan); }
.stat .stat-val.warn { color: var(--warning); }
.stat .stat-val.danger { color: var(--danger); }
.stat .stat-foot { font-size: 11px; color: var(--color-fog-gray); margin-top: 3px; }

/* big KPI (dashboard) */
.kpi { background: var(--color-tide-card); border: 1px solid var(--color-carbon-black); border-radius: var(--radius-card); padding: 20px 22px; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.kpi-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-fog-gray); }
.kpi-ic { color: var(--color-spectral-cyan); opacity: .85; }
.kpi-ic svg { width: 18px; height: 18px; }
.kpi-val { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.kpi-val small { font-size: 16px; font-weight: 600; color: var(--color-fog-gray); }
.kpi-sub { font-size: 12px; color: var(--color-fog-gray); margin-top: 7px; }

/* progress bar */
.prog { height: 7px; border-radius: 80px; background: rgba(255,255,255,.07); overflow: hidden; margin: 12px 0 6px; }
.prog > span { display: block; height: 100%; border-radius: 80px; background: var(--color-spectral-cyan); transition: width .5s ease; }
.prog.warn > span { background: var(--warning); }

/* ============================================================
   STATUS ITEMS
   ============================================================ */
.status-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0; border-bottom: 1px solid var(--hair-soft);
}
.status-row:last-child { border-bottom: 0; }
.status-ic {
  width: 38px; height: 38px; border-radius: 10px; flex: 0 0 auto;
  display: grid; place-items: center; color: var(--color-spectral-cyan);
  background: var(--cyan-06); border: 1px solid var(--cyan-20);
}
.status-ic svg { width: 19px; height: 19px; }
.status-ic.warn { color: var(--warning); background: rgba(255,200,60,.07); border-color: rgba(255,200,60,.3); }
.status-ic.danger { color: var(--danger); background: rgba(255,80,80,.07); border-color: rgba(255,80,80,.3); }
.status-ic.gray { color: var(--color-fog-gray); background: rgba(255,255,255,.03); border-color: var(--hair); }
.status-meta { flex: 1; min-width: 0; }
.status-name { font-size: 14px; font-weight: 600; }
.status-desc { font-size: 12px; color: var(--color-fog-gray); margin-top: 1px; }
.status-desc code { font-family: var(--font-mono); font-size: 11px; color: var(--color-fog-gray); }
.status-right { text-align: right; flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.status-time { font-size: 11px; color: var(--color-fog-gray); opacity: .65; font-variant-numeric: tabular-nums; }

.live-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.live-dot.up { background: var(--color-spectral-cyan); box-shadow: 0 0 0 3px rgba(106,228,255,.15); animation: pulse 2.4s infinite; }
.live-dot.warn { background: var(--warning); }
.live-dot.down { background: var(--danger); }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 3px rgba(106,228,255,.15);} 50% { box-shadow: 0 0 0 5px rgba(106,228,255,.05);} }

/* ============================================================
   TABS
   ============================================================ */
.tab-bar { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.tab-pill {
  background: transparent; color: var(--color-fog-gray);
  font-family: inherit; font-size: 13px; font-weight: 600;
  border: 0; border-radius: var(--radius-btn); padding: 7px 16px; cursor: pointer; transition: .12s;
  display: inline-flex; align-items: center; gap: 7px;
}
.tab-pill:hover { color: var(--color-bone-white); background: var(--cyan-06); }
.tab-pill.active { background: var(--color-bone-white); color: #000; }
.tab-pill .tcount { font-size: 11px; font-weight: 700; opacity: .65; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ============================================================
   TOGGLE
   ============================================================ */
.toggle { width: 36px; height: 20px; border-radius: 80px; background: rgba(255,255,255,.1); border: 1px solid transparent; position: relative; cursor: pointer; transition: .15s; flex: 0 0 auto; }
.toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--color-fog-gray); transition: .15s; }
.toggle.on { background: var(--cyan-20); border-color: var(--color-spectral-cyan); }
.toggle.on::after { background: var(--color-spectral-cyan); transform: translateX(16px); }

/* ============================================================
   COMPETÊNCIAS LAYOUT
   ============================================================ */
.comp-layout { display: grid; grid-template-columns: 230px 1fr; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .comp-layout { grid-template-columns: 1fr; } }
.comp-list { display: flex; flex-direction: column; gap: 3px; }
.comp-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 11px 13px; border-radius: var(--radius-link); cursor: pointer; transition: .12s;
  border: 1px solid transparent;
}
.comp-item:hover { background: var(--cyan-06); }
.comp-item.active { background: var(--cyan-10); border-color: var(--cyan-20); }
.comp-month { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.comp-month small { display: block; font-size: 11px; font-weight: 400; color: var(--color-fog-gray); margin-top: 1px; }

/* ============================================================
   PIPELINE (Comprovantes)
   ============================================================ */
.pipeline { display: flex; align-items: stretch; gap: 0; flex-wrap: wrap; }
.pipe-step { flex: 1; min-width: 130px; position: relative; padding: 4px 8px; }
.pipe-step .pipe-num { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--cyan-20); background: var(--cyan-06); color: var(--color-spectral-cyan); display: grid; place-items: center; font-size: 12px; font-weight: 700; margin-bottom: 9px; }
.pipe-step .pipe-name { font-size: 13px; font-weight: 600; }
.pipe-step .pipe-desc { font-size: 11.5px; color: var(--color-fog-gray); margin-top: 3px; line-height: 1.4; }
.pipe-step:not(:last-child)::after { content: ''; position: absolute; top: 17px; left: calc(50% + 22px); right: calc(-50% + 22px); height: 1px; background: var(--hair); }

/* receipt detail / reconciliation */
.recon-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; }
@media (max-width: 1000px){ .recon-grid { grid-template-columns: 1fr; } }
.field-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--hair-soft); font-size: 13px; }
.field-row:last-child { border-bottom: 0; }
.field-row .fl { color: var(--color-fog-gray); }
.field-row .fv { font-weight: 600; text-align: right; }
.alloc-bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-link); background: var(--color-abyss-navy); border: 1px solid var(--hair); margin-bottom: 8px; }
.alloc-bar .ab-name { flex: 1; font-size: 13px; }
.alloc-bar .ab-val { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ============================================================
   APPROVALS
   ============================================================ */
.approval { border: 1px solid var(--hair); border-radius: var(--radius-card); padding: 18px 20px; margin-bottom: 14px; background: var(--color-abyss-navy); }
.approval-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 13px; }
.approval-kind { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-fog-gray); margin-bottom: 4px; }
.approval-reason { font-size: 14px; font-weight: 600; }
.preview-box { background: var(--color-tide-card); border: 1px solid var(--hair); border-left: 2px solid var(--color-spectral-cyan); border-radius: var(--radius-link); padding: 13px 15px; margin: 12px 0; font-size: 13.5px; line-height: 1.5; }
.preview-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 11.5px; color: var(--color-fog-gray); margin-bottom: 9px; }
.preview-meta b { color: var(--color-bone-white); font-weight: 600; }
.approval-foot { display: flex; gap: 8px; align-items: center; }
.approval.resolved { opacity: .5; }
.approval.resolved .approval-foot .btn { display: none; }

/* policy */
.policy-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 16px; }
@media (max-width:900px){ .policy-grid { grid-template-columns: 1fr; } }
.phrase-item { padding: 11px 14px; border-radius: var(--radius-link); background: var(--color-abyss-navy); border: 1px solid var(--hair); margin-bottom: 8px; font-size: 13px; }
.phrase-item .pi-tag { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--color-spectral-cyan); margin-bottom: 4px; }
.window-bar { position: relative; height: 30px; border-radius: var(--radius-link); background: var(--color-abyss-navy); border: 1px solid var(--hair); overflow: hidden; margin: 10px 0; }
.window-bar .wb-active { position: absolute; top: 0; bottom: 0; background: var(--cyan-10); border-left: 1px solid var(--cyan-20); border-right: 1px solid var(--cyan-20); }
.window-bar .wb-tick { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--hair-soft); }
.window-scale { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--color-fog-gray); opacity: .6; }

/* timeline (dashboard) */
.timeline { position: relative; padding-left: 4px; }
.tl-item { display: flex; gap: 13px; padding-bottom: 16px; position: relative; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--color-spectral-cyan); margin-top: 5px; flex: 0 0 auto; position: relative; z-index: 1; }
.tl-dot.gray { background: var(--color-fog-gray); }
.tl-dot.warn { background: var(--warning); }
.tl-item:not(:last-child)::before { content:''; position: absolute; left: 4px; top: 14px; bottom: -2px; width: 1px; background: var(--hair); }
.tl-body { flex: 1; }
.tl-text { font-size: 13px; line-height: 1.45; }
.tl-time { font-size: 11px; color: var(--color-fog-gray); opacity: .65; margin-top: 2px; }

/* mini receipt list */
.mini-list { display: flex; flex-direction: column; }
.mini-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--hair-soft); }
.mini-row:last-child { border-bottom: 0; }
.mini-av { width: 32px; height: 32px; border-radius: 9px; background: var(--cyan-06); border: 1px solid var(--cyan-20); display: grid; place-items: center; color: var(--color-spectral-cyan); font-size: 12px; font-weight: 700; flex: 0 0 auto; }
.mini-main { flex: 1; min-width: 0; }
.mini-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-sub { font-size: 11.5px; color: var(--color-fog-gray); margin-top: 1px; }
.mini-val { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 13px; }

/* ============================================================
   INLINE EDIT
   ============================================================ */
.editable { cursor: text; border-radius: 4px; padding: 2px 5px; margin: -2px -5px; transition: .1s; position: relative; }
.editable:hover { background: var(--cyan-06); box-shadow: inset 0 0 0 1px var(--cyan-20); }
.editable:hover::after { content: '✎'; color: var(--color-spectral-cyan); font-size: 11px; margin-left: 6px; }
.inline-edit { font-family: inherit; font-size: 13.5px; background: var(--color-abyss-navy); border: 1px solid var(--color-spectral-cyan); border-radius: 4px; color: var(--color-bone-white); padding: 4px 7px; width: 100%; outline: none; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(2px); display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal-backdrop.open { display: flex; animation: fade .15s; }
.modal { background: var(--color-tide-card); border: 1px solid var(--color-carbon-black); border-radius: var(--radius-card); padding: 26px 28px; max-width: 480px; width: 100%; max-height: 90vh; overflow-y: auto; }
.modal.wide { max-width: 640px; }
.modal-title { font-size: 18px; font-weight: 700; margin: 0 0 4px; }
.modal-desc { font-size: 13px; color: var(--color-fog-gray); margin: 0 0 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--hair); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.form-field { margin-bottom: 14px; }
.form-field.col-span { grid-column: 1 / -1; }
.form-label { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-fog-gray); margin-bottom: 7px; }
.input, .select, .textarea {
  width: 100%; font-family: inherit; font-size: 14px; letter-spacing: -0.02em;
  background: var(--color-abyss-navy); border: 1px solid var(--hair);
  border-radius: var(--radius-input); color: var(--color-bone-white); padding: 9px 12px; outline: none; transition: .12s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--color-spectral-cyan); }
.input.mono-input { font-family: var(--font-mono); font-size: 13px; }
.textarea { resize: vertical; min-height: 70px; line-height: 1.5; }
.field-hint { font-size: 11.5px; color: var(--color-fog-gray); opacity: .7; margin-top: 5px; }
.form-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; }

/* empty / loading */
.empty-state { text-align: center; color: var(--color-fog-gray); opacity: .5; padding: 48px 0; font-size: 14px; }
.empty-state svg { width: 34px; height: 34px; margin-bottom: 12px; opacity: .6; }
.loading { color: var(--color-fog-gray); font-size: 14px; opacity: .6; padding: 20px 0; }

/* utility */
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.muted { color: var(--color-fog-gray); }
.tnum { font-variant-numeric: tabular-nums; }
.mt0 { margin-top: 0; } .mb0 { margin-bottom: 0; }
.gap-sm { gap: 6px; } .gap-lg { gap: 24px; }
.right { text-align: right; }
.chip { display:inline-flex; align-items:center; gap:6px; font-size: 12px; padding: 4px 10px; border-radius: 80px; background: var(--color-abyss-navy); border: 1px solid var(--hair); color: var(--color-fog-gray); }
.chip svg { width: 13px; height: 13px; }
.tag-cat { font-size: 11px; color: var(--color-fog-gray); }
