:root {
  --bg: #ffffff;
  --fg: #0a0a0a;
  --muted: #6b6b6b;
  --border: #e4e4e4;
  --card: #fafafa;
  --accent-bg: #0a0a0a;
  --accent-fg: #ffffff;
  --radius: 10px;
  --error-bg: #fdecea;
  --error-border: #f5c6c0;
  --error-fg: #b3261e;
  --success-bg: #e8f7ec;
  --success-border: #bfe6c9;
  --success-fg: #1e7a34;
  --danger-bg: #d33;
  --danger-fg: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a;
    --fg: #f2f2f2;
    --muted: #9a9a9a;
    --border: #262626;
    --card: #131313;
    --accent-bg: #f2f2f2;
    --accent-fg: #0a0a0a;
    --error-bg: #2c1513;
    --error-border: #5c2b26;
    --error-fg: #f5a29b;
    --success-bg: #10281a;
    --success-border: #235a37;
    --success-fg: #7fd99a;
  }
  .form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='14' height='14' fill='none' stroke='%239a9a9a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "IBM Plex Mono", "IBM Plex Mono Fallback", ui-monospace, Menlo, monospace;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- nav ---- */
.nav {
  border-bottom: 1px solid var(--border);
}
.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  font-weight: 600;
  text-decoration: none;
  letter-spacing: -0.02em;
}
.nav-links {
  display: flex;
  gap: 24px;
  align-items: center;
}
.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
}
.nav-links a:hover {
  color: var(--fg);
}

/* ---- buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid var(--border);
  cursor: pointer;
}
.btn-primary {
  background: var(--accent-bg);
  color: var(--accent-fg);
  border-color: var(--accent-bg);
}
.btn-ghost {
  background: transparent;
  color: var(--fg);
}

/* ---- hero ---- */
.hero {
  padding: 96px 0 64px;
  text-align: center;
}
.hero h1 {
  font-size: 44px;
  font-weight: 600;
  letter-spacing: -0.02em;
  max-width: 720px;
  margin: 0 auto 20px;
}
.hero p {
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto 32px;
  font-size: 16px;
}
.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* ---- feature grid ---- */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  padding: 32px 0 96px;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.card h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
}
.card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* ---- auth ---- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-card {
  width: 100%;
  max-width: 360px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
}
.auth-card h1 {
  font-size: 18px;
  margin: 0 0 4px;
}
.auth-card p {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 24px;
}
.btn-google {
  width: 100%;
  background: var(--bg);
  color: var(--fg);
}

/* ---- alerts ---- */
.alert {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  text-align: left;
}
.alert-error {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error-fg);
}
.alert-success {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success-fg);
}
.btn-danger {
  background: var(--danger-bg);
  color: var(--danger-fg);
  border-color: var(--danger-bg);
}

/* ---- modal ---- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 50;
}
.modal {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
  padding: 24px;
  width: 100%;
  max-width: 360px;
}
.modal h3 {
  margin: 0 0 8px;
  font-size: 16px;
}
.modal p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
}
.modal-input-label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}
.modal-input {
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 20px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--fg);
}
.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.modal-actions .btn {
  width: auto;
  padding: 8px 16px;
}
.modal-actions .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---- dashboard ---- */
/* 1fr tracks default their item's min-width to the item's content (min-width:auto),
   so a wide table/toolbar blows out the track and scrolls the whole page instead of
   just itself - minmax(0, 1fr) lets the track win so inner .table-wrap etc. scroll on their own. */
.app {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 0.15s ease;
}
/* icon-only collapse only makes sense on desktop's push-layout sidebar;
   on mobile "collapsed" is repurposed below to mean "drawer open" instead. */
@media (min-width: 721px) {
  .app.sidebar-collapsed {
    grid-template-columns: 64px minmax(0, 1fr);
  }
  .app.sidebar-collapsed .sidebar-header {
    padding: 0;
    justify-content: center;
  }
  .app.sidebar-collapsed .sidebar-nav {
    padding-left: 0;
    padding-right: 0;
    align-items: center;
  }
  .app.sidebar-collapsed .sidebar-brand-name {
    display: none;
  }
  .app.sidebar-collapsed .sidebar-user {
    padding: 12px 0;
    display: flex;
    justify-content: center;
  }
  .app.sidebar-collapsed .sidebar-user-trigger {
    width: auto;
  }
  .app.sidebar-collapsed .sidebar-user-name,
  .app.sidebar-collapsed .sidebar-user-trigger .chevron {
    display: none;
  }
  .app.sidebar-collapsed .sidebar-nav a span {
    display: none;
  }
  .app.sidebar-collapsed .sidebar-nav a {
    justify-content: center;
  }
}
.sidebar {
  --bg: #14171a;
  --fg: #f2f2f0;
  --muted: #8b958f;
  --border: #262b2e;
  --card: #20252a;
  --accent-bg: #1f7a5c;
  --accent-fg: #ffffff;
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  white-space: nowrap;
}
#user-avatar {
  background: #c9792e;
}
.sidebar-header {
  height: 69px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar-backdrop {
  display: none;
}
.sidebar-close {
  display: none;
  margin-left: auto;
  background: transparent;
  border: none;
  color: var(--fg);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
}
.sidebar-close:hover {
  background: var(--card);
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--fg);
}
.sidebar-brand-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 8px;
  background: var(--accent-bg);
  color: var(--accent-fg);
  font-size: 13px;
  font-weight: 600;
}
.sidebar-brand-name {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 16px;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
  line-height: 18px;
  padding: 8px 10px;
  border-radius: 8px;
}
.sidebar-nav a svg {
  flex-shrink: 0;
}
.sidebar-nav a.active,
.sidebar-nav a:hover {
  color: var(--fg);
  background: var(--card);
}
.sidebar-user {
  margin-top: auto;
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  padding: 12px 16px;
}
.sidebar-user-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--fg);
  font-family: inherit;
  font-size: 14px;
  padding: 6px;
  border-radius: 8px;
  cursor: pointer;
}
.sidebar-user-trigger:hover {
  background: var(--card);
}
.sidebar-user-name {
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-trigger .chevron {
  flex-shrink: 0;
  color: var(--muted);
}
.sidebar-user-menu {
  position: fixed;
  min-width: 180px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  overflow: hidden;
  z-index: 20;
}
.sidebar-user-menu[hidden] {
  display: none;
}
.sidebar-user-menu a {
  display: block;
  padding: 10px 12px;
  font-size: 14px;
  text-decoration: none;
  color: var(--fg);
}
.sidebar-user-menu a:hover {
  background: var(--card);
}
.topbar {
  min-height: 69px;
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.topbar h2 {
  font-size: 15px;
  margin: 0 auto 0 0;
  font-weight: 600;
}
.sidebar-toggle {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg);
  cursor: pointer;
  font-family: inherit;
  font-size: 16px;
  line-height: 1;
  padding: 8px 10px;
}
.sidebar-toggle:hover {
  background: var(--card);
}

.main {
  padding: 24px;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card .label {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}
.stat-card .value {
  font-size: 22px;
  font-weight: 600;
}
.stat-card .value.amount-income {
  color: var(--success-fg);
}
.stat-card .value.amount-expense {
  color: var(--error-fg);
}
#saving-member-list .name {
  font-size: 16px;
  font-weight: 600;
}

/* ---- balance summary card ---- */
.balance-card {
  margin-bottom: 24px;
}
.balance-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 20px;
}
.balance-card-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.balance-card-value {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 36px;
  font-weight: 700;
}
.balance-card-stats {
  display: flex;
  gap: 32px;
}
.balance-card-stat-value {
  font-size: 18px;
  font-weight: 600;
}
.balance-card-stat-value.amount-income {
  color: var(--success-fg);
}
.balance-card-stat-value.amount-expense {
  color: var(--error-fg);
}
.balance-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
  display: flex;
  margin-bottom: 10px;
}
.balance-bar-fill {
  height: 100%;
}
.balance-bar-fill-income {
  background: var(--success-fg);
}
.balance-bar-fill-expense {
  background: var(--error-fg);
}
.balance-bar-legend {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 12px;
  color: var(--muted);
}
.balance-bar-legend .swatch {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

/* ---- category donut chart ---- */
.chart-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}
.chart-card {
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}
.chart-donut {
  position: relative;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  flex-shrink: 0;
}
.chart-donut-hole {
  position: absolute;
  inset: 24px;
  border-radius: 50%;
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.chart-donut-total-label {
  font-size: 11px;
  color: var(--muted);
}
.chart-donut-total-value {
  font-size: 15px;
  font-weight: 600;
}
.chart-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
}
.chart-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
}
.swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}
.chart-legend .name {
  flex: 1;
}
.chart-legend .amount {
  color: var(--muted);
  white-space: nowrap;
}
.chart-legend-empty {
  color: var(--muted);
}

/* ---- forms (settings, profile, keuangan) ---- */
.form-label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}
.form-input,
.form-select {
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 16px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--fg);
  transition: border-color 0.15s ease;
}
.form-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='14' height='14' fill='none' stroke='%236b6b6b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
}
.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--fg);
}
.modal-backdrop[hidden] {
  display: none;
}

/* ---- section layout ---- */
.section {
  margin-bottom: 32px;
}
.section:has(.section-header) {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  padding: 20px 24px;
}
.section-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 24px;
  align-items: start;
}
.section-row.section-row-reverse {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}
.section-col-left .section:last-child {
  margin-bottom: 0;
}
.section-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 12px;
}
.section-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}
.section-header .spacer {
  flex: 1;
}

/* ---- toolbar (filters) ---- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}
#period-toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.toolbar .form-select,
.toolbar .form-input {
  width: auto;
  margin: 0;
}

/* ---- account cards ---- */
.account-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
.account-card {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.account-card:last-child {
  border-bottom: none;
}
.account-card .name {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
}
.account-card .type {
  font-size: 12px;
  color: var(--muted);
}
.account-card .balance {
  font-size: 14px;
  font-weight: 400;
  white-space: nowrap;
}

/* ---- budget rows ---- */
#budget-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
.budget-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.budget-row:last-child {
  border-bottom: none;
}
.budget-info {
  flex: 1;
  min-width: 160px;
}
.budget-name {
  font-size: 14px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.budget-meta {
  font-size: 12px;
  color: var(--muted);
}
.budget-meta.warn {
  color: #b8860b;
}
.budget-meta.over {
  color: var(--error-fg);
}
.progress-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  overflow: hidden;
  margin-top: 6px;
}
.progress-bar-fill {
  height: 100%;
  background: var(--fg);
  border-radius: 3px;
}
.progress-bar-fill.warn {
  background: #d9a441;
}
.progress-bar-fill.over {
  background: var(--danger-bg);
}
.budget-edit {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}
#budget-list.hide-limit .budget-edit .form-input {
  display: none;
}
.budget-edit .form-input {
  width: 100px;
  margin: 0;
  padding: 8px 10px;
  font-size: 13px;
  text-align: right;
}
.budget-edit .btn {
  padding: 8px 12px;
  font-size: 13px;
}
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}
.date-input-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 0 16px;
}
.date-input-wrap .form-input {
  margin: 0;
}
.toolbar .date-input-wrap {
  margin: 0;
}
.date-input-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--muted);
}
.date-input-picker {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

/* ---- table ---- */
.table-wrap {
  overflow-x: auto;
}
table.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.table th,
table.table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.table tbody tr:nth-child(even) {
  background: var(--bg);
}
table.table tbody tr:hover {
  background: var(--border);
}
table.table th {
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
table.table td.amount-income {
  color: var(--success-fg);
}
.cell-sub {
  font-size: 12px;
  color: var(--muted);
}
#transaction-table .note-cell {
  white-space: normal;
  word-break: break-word;
  min-width: 120px;
  max-width: 240px;
}
.empty-state {
  color: var(--muted);
  font-size: 14px;
  padding: 32px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

@media (max-width: 1440px) {
  .chart-row {
    grid-template-columns: 1fr;
  }
  .section-row,
  .section-row.section-row-reverse {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  /* landing */
  .nav .container {
    height: 56px;
  }
  .nav-links {
    gap: 12px;
  }
  .hero {
    padding: 56px 0 40px;
  }
  .hero h1 {
    font-size: 28px;
  }
  .hero p {
    font-size: 15px;
  }
  .hero-actions {
    flex-direction: column;
  }
  .hero-actions .btn {
    width: 100%;
  }

  /* auth (login/onboarding) */
  .auth-page {
    padding: 24px 16px;
  }
  .auth-card {
    padding: 24px;
  }

  /* dashboard: sidebar becomes an off-canvas drawer opened by .sidebar-toggle */
  .app {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    max-width: 80vw;
    background: var(--bg);
    z-index: 30;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  .app.sidebar-collapsed .sidebar {
    transform: translateX(0);
  }
  .sidebar-close {
    display: flex;
  }
  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 25;
  }
  .app.sidebar-collapsed .sidebar-backdrop {
    display: block;
  }
  .topbar {
    padding: 0 16px;
  }
  .main {
    padding: 16px;
  }
  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }
  /* .budget-info's min-width + .budget-edit's flex-shrink:0 don't fit a narrow
     card at the same time - let the edit controls wrap to their own line instead
     of overflowing the card. */
  .budget-row {
    flex-wrap: wrap;
  }
  .budget-edit {
    margin-left: auto;
  }
}

/* ---- toast notifications ---- */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  opacity: 1;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.toast-success {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success-fg);
}
.toast-error {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error-fg);
}
.toast-hide {
  opacity: 0;
  transform: translateY(8px);
}

/* ---- switch (toggle) ---- */
.switch-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.switch {
  appearance: none;
  -webkit-appearance: none;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: var(--border);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease;
}
.switch::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
  transition: transform 0.15s ease;
}
.switch:checked {
  background: var(--fg);
}
.switch:checked::before {
  transform: translateX(14px);
}
