/* Lucid Trading public account-page visual language, adapted to the ledger. */
:root {
  color-scheme: dark;
  --bg-base: #090909;
  --bg-deep: #090909;
  --panel: #111114;
  --panel-soft: #18181c;
  --line: #33333b;
  --line-soft: #27272e;
  --ink: #f5f5f7;
  --ink-soft: #d5d5df;
  --muted: #9999a8;
  --accent: #5a82b4;
  --accent-strong: #86a9d5;
  --friendly: #73b99a;
  --friendly-dark: #73b99a;
  --shadow: none;
  --inner-glow: none;
}
html, body { background: var(--bg-base); }
body, button, input, select, textarea { font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif; }
body { -webkit-font-smoothing: antialiased; }
body::before, .broker-light::before, .entry-section-title::before { display: none; }
button { cursor: pointer; transition: background-color .16s, border-color .16s, color .16s; }
button:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 3px; }
button:disabled { cursor: wait; opacity: .55; }
#appShell { padding-top: 24px; }
.app-header { padding: 0 0 18px; margin-bottom: 20px; border-bottom: 1px solid var(--line-soft); }
.app-header::before, .ledger-freeze-cards::before { background: var(--bg-base); }
.glass, .soft-card, #cards > div, #entryForm { background: var(--panel) !important; border: 1px solid var(--line-soft) !important; box-shadow: none; backdrop-filter: none; }
.glass, .soft-card, #entryForm { border-radius: 16px; }
#cards { gap: 14px; padding-bottom: 0; }
.metric-card { min-height: 82px; padding: 18px 20px !important; border-radius: 12px !important; }
.metric-card-title { font-weight: 500; line-height: 1.5; }
.metric-card-value { font-size: 26px; font-weight: 600; letter-spacing: -.6px; }
.friendly { color: var(--friendly) !important; }
.unfriendly { color: #df8090 !important; }
button[class*="bg-white"], button[class*="bg-slate-100"], .kindTab, #fetchRatesButton {
  background: #19191e !important; color: var(--ink-soft) !important;
  border: 1px solid #34343e !important; box-shadow: none !important; border-radius: 8px !important;
}
button[class*="bg-white"]:hover, button[class*="bg-slate-100"]:hover, .kindTab:hover, #fetchRatesButton:hover {
  background: #212631 !important; border-color: #5a82b4 !important; color: #fff !important; transform: none;
}
button.tab-active, .entry-tabs .kindTab.tab-active, .purchase-primary-btn, .entry-save, .currency-input-row button, .col-filter-footer .primary {
  background: #1c293b !important; border: 1px solid #5a82b4 !important;
  color: #b9d1f0 !important; box-shadow: none !important; font-weight: 600;
}
.purchase-primary-btn:hover, .entry-save:hover, .currency-input-row button:hover { background: #283b55 !important; color: #fff !important; }
.pageSwitchBtn { min-height: 40px; padding: 9px 22px; }
.ledger-toolbar { background: var(--panel) !important; padding: 20px; box-shadow: none; flex-wrap: wrap; }
.ledger-toolbar > div:last-child { flex: 1 1 560px; }
.ledger-toolbar h2 { font-size: 18px; font-weight: 600; }
.ledger-toolbar > div:last-child > .text-xs { flex-basis: 100%; text-align: right; line-height: 1.6; }
input, select, textarea, #entryForm input, #entryForm select, #entryForm textarea {
  background: #111114 !important; color: var(--ink) !important;
  border: 1px solid #54545e !important; border-radius: 8px !important;
  box-shadow: none !important; font-weight: 400;
}
input::placeholder, textarea::placeholder, #entryForm input::placeholder, #entryForm textarea::placeholder { color: #878795; opacity: 1; }
input:focus, select:focus, textarea:focus, #entryForm input:focus, #entryForm select:focus, #entryForm textarea:focus {
  border-color: #86a9d5 !important; outline: 2px solid #5a82b433; outline-offset: 1px; box-shadow: none !important; background: #141419 !important;
}
.ledger-search-select, .ledger-search-input { height: 36px; font-size: 13px; }
.ledger-table-scroll, .ledger-table, table tbody, .ledger-table tbody tr, .ledger-table tbody tr:nth-child(even) { background: #111114 !important; }
.ledger-table-scroll { scrollbar-color: #505e72 #18181c; }
.ledger-table-scroll::-webkit-scrollbar-thumb { background: #505e72; }
.ledger-table-scroll::before, .ledger-table thead, .ledger-table thead tr, .ledger-table thead th { background: #1b1b21 !important; }
.ledger-table thead th { box-shadow: 0 -8px 0 #1b1b21; font-weight: 500; color: #bdbdca !important; border-bottom-color: #34343e; }
.ledger-table th, .ledger-table td { padding: 9px 10px !important; }
.ledger-table th:nth-child(-n+4) { background: #1b1b21 !important; }
.ledger-table td:nth-child(-n+4) { background: #111114 !important; }
.ledger-table tbody tr:hover, .ledger-table tbody tr:hover td:nth-child(-n+4) { background: #1c2430 !important; }
.ledger-table tbody tr.payout-row, .ledger-table tbody tr.payout-row:nth-child(even), .ledger-table tbody tr.payout-row td:nth-child(-n+4) { background: #0e0e11 !important; }
.ledger-table tbody tr.payout-row:hover, .ledger-table tbody tr.payout-row:hover td:nth-child(-n+4) { background: #1c2430 !important; }
.ledger-table td.text-emerald-700 { color: #73b99a !important; text-shadow: none; font-weight: 600; }
.ledger-table td.text-rose-700 { color: #df8090 !important; text-shadow: none; font-weight: 600; }
.tag { background: #242833; border-color: #373e4d; color: #d5ddeb; }
.sort-mark, .th-filter-btn.th-filter-active, .rate-preview b { color: #a8c6ed; }
.th-filter-btn.th-filter-active { background: #253247; }
.col-filter-panel { background: #18181c; border-radius: 12px; border-color: #34343e; }
.col-filter-sort button, .col-filter-actions button, .col-filter-footer button { background: #202026; border-color: #41414d; }
.col-filter-value input { accent-color: #5a82b4; }
#pageAnalysis > section { padding: 24px; }
.analysis-table, .analysis-table thead th { background: #16161b !important; }
.analysis-table th, .analysis-table td { border-color: #303038; padding: 12px; }
#entryForm { box-shadow: 0 24px 80px #0009; }
#entryForm label { color: #c8c8d3; font-weight: 500; }
.entry-section { background: transparent; border: 0; border-radius: 0; box-shadow: none; padding: 14px 0; }
.entry-section + .entry-section { border-top: 1px solid var(--line-soft); }
.entry-section-title { font-weight: 600; color: #e2e2eb; font-size: 14px; }
.entry-tabs { padding: 10px; border-radius: 10px; background: #0d0d10; }
.rate-preview > div { background: #161d28; border: 1px solid #303e53; font-weight: 500; }
.entry-actions { background: #111114; border-radius: 0 0 16px 16px; }
@media (max-width: 767px) {
  body.ledger-mode, body.ledger-mode #appShell { height: auto; min-height: 100dvh; overflow: visible; width: 100%; }
  .app-header::before, .ledger-freeze-cards::before { display: none; }
  body.ledger-mode { overflow-x: hidden; }
  body.ledger-mode #reportArea, body.ledger-mode #pageLedger, body.ledger-mode .ledger-section { overflow: visible; }
  body.ledger-mode .ledger-section { display: block; }
  body.ledger-mode .ledger-table-scroll { max-height: 65dvh; overflow: auto; }
  #appShell { padding: 16px 12px; }
  #cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .metric-card { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px !important; }
  .metric-card-value { font-size: 22px; }
  .ledger-toolbar { padding: 14px; }
  .ledger-toolbar > div:last-child { flex-basis: auto; }
  .ledger-toolbar > div:last-child > .text-xs { text-align: left; }
  .ledger-table th:nth-child(-n+4), .ledger-table td:nth-child(-n+4) { position: static; }
  .ledger-table thead th:nth-child(-n+4) { position: sticky; left: auto; }
  #pageAnalysis > section { padding: 16px; }
  .entry-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
