.theme-toggle{
  position:fixed;
  right:20px;
  bottom:20px;
  z-index:20;
  display:grid;
  place-items:center;
  width:44px;
  min-width:44px;
  height:44px;
  min-height:44px;
  padding:0;
  border:1px solid var(--ledger-line);
  border-radius:50%;
  background:var(--ledger-sheet);
  color:var(--ledger-ink);
  box-shadow:0 2px 8px #18201b1a;
  cursor:pointer;
  transition:background-color .15s ease,border-color .15s ease,transform .15s ease;
}
.theme-toggle:hover{
  border-color:var(--cash);
  background:var(--cash-soft);
  color:var(--cash-deep);
}
.theme-toggle:active{transform:translateY(1px)}
.theme-toggle:focus-visible{
  outline:3px solid #c6921459;
  outline-offset:2px;
}
.theme-icon{font-size:22px;line-height:1}

html[data-theme="dark"]{
  --ledger-ink:#edf2ee;
  --ledger-muted:#a7b2aa;
  --ledger-faint:#849088;
  --ledger-line:#354139;
  --ledger-rule:#2b352f;
  --ledger-paper:#171c19;
  --ledger-sheet:#1d2420;
  --ledger-bg:#131815;
  --ledger-bg-strong:#202821;
  --cash:#54b98a;
  --cash-deep:#7bcda7;
  --cash-soft:#223d31;
  --stamp:#e08172;
  --stamp-soft:#442923;
  --success:#63c787;
  --focus:#d7aa43;
  --shadow:none;
}
html[data-theme="dark"] body{background:var(--ledger-bg);color:var(--ledger-ink)}
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .auth-tabs,
html[data-theme="dark"] th,
html[data-theme="dark"] .pagination{background:#19201c}
html[data-theme="dark"] .brand-mark,
html[data-theme="dark"] .user-chip,
html[data-theme="dark"] .secondary,
html[data-theme="dark"] .profit-card,
html[data-theme="dark"] .filters,
html[data-theme="dark"] .auth-intro{background:#20271f}
html[data-theme="dark"] .nav-link{color:#b9c4bc}
html[data-theme="dark"] .nav-link::before{background:#637068}
html[data-theme="dark"] .nav-link:hover,
html[data-theme="dark"] button:hover,
html[data-theme="dark"] tbody tr:hover{background:#27312b;color:var(--ledger-ink)}
html[data-theme="dark"] .primary:hover{background:#459f76;border-color:#459f76;color:#fff}
html[data-theme="dark"] .danger:hover{background:#bd6659;border-color:#bd6659;color:#fff}
html[data-theme="dark"] .metric-card-main{border-color:#3a5143;background:#202b24}
html[data-theme="dark"] label,
html[data-theme="dark"] label span{color:#c4cec7}
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea{border-color:#465249;background:#171d19;color:var(--ledger-ink)}
html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus{box-shadow:0 0 0 3px #d7aa4329}
html[data-theme="dark"] .auth-facts div{border-color:var(--ledger-line)}
html[data-theme="dark"] dialog{box-shadow:none;color:var(--ledger-ink)}
html[data-theme="dark"] dialog::backdrop{background:#070a08b3}

@media(max-width:767px){.theme-toggle{right:14px;bottom:14px}}
@media(prefers-reduced-motion:reduce){.theme-toggle{transition:none}}
