:root {
  --bg: #06101f;
  --bg-2: #0b1e34;
  --panel: rgba(13, 31, 53, 0.94);
  --line: #193650;
  --text: #f4f8ff;
  --muted: #8aa0b8;
  --blue: #147cff;
  --blue-2: #00b7ff;
  --honey: #f5b942;
  --honey-2: #ffd27a;
  --income: #26d995;
  --expense: #ff6680;
  --notification-panel: #0b1e34;
  --notification-text: #f4f8ff;
  --notification-muted: #9aafc6;
  --notification-border: #193650;
  --notification-hover: rgba(20, 124, 255, 0.12);
  --notification-unread: rgba(220, 53, 69, 0.08);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --font: "Segoe UI", "Trebuchet MS", sans-serif;
  --scale: 1;
}

body.theme-light {
  --bg: #f3f6fb;
  --bg-2: #ffffff;
  --panel: #ffffff;
  --line: #d5e0ee;
  --text: #102033;
  --muted: #5b7088;
  --notification-panel: #ffffff;
  --notification-text: #102033;
  --notification-muted: #5b7088;
  --notification-border: #d5e0ee;
  --notification-hover: rgba(20, 124, 255, 0.08);
  --notification-unread: rgba(220, 53, 69, 0.06);
  --shadow: 0 12px 40px rgba(20, 50, 90, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: calc(16px * var(--scale, 1)); }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; }
a { color: #6db1ff; }
img { max-width: 100%; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--honey); color: #111; padding: 8px 12px; z-index: 20; }
.skip-link:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.app-body { overflow: hidden; }
.app-shell { display: block; min-height: 100vh; height: 100vh; }
.sidebar { position: fixed; top: 0; left: 0; bottom: 0; z-index: 10; width: 260px; height: 100vh; overflow-y: auto; overscroll-behavior: contain; background: #071526; border-right: 1px solid var(--line); padding: 22px 16px 16px; }
.theme-light .sidebar { background: #123154; color: white; }
.sidebar-inner { display: flex; flex-direction: column; min-height: 100%; }
.brand { display: flex; gap: 10px; align-items: center; margin-bottom: 28px; }
.brand span { display: block; color: var(--honey); font-size: 12px; }
.logo-icon {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--blue), var(--blue-2)); font-weight: 700;
  box-shadow: 0 0 18px rgba(20, 124, 255, 0.35);
}
.sidebar-nav { display: flex; flex-direction: column; gap: 19px; flex: 1 0 auto; }
.sidebar-nav-group { display: flex; flex-direction: column; gap: 4px; }
.sidebar-group-label { padding: 0 12px 4px; color: #7890a9; font-size: 10px; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
.theme-light .sidebar-group-label { color: #bdd1e6; }
.sidebar a {
  color: #c5d4e6; text-decoration: none; padding: 10px 12px; border-radius: 10px; display: flex; justify-content: space-between;
}
.sidebar a:hover, .sidebar a.active { background: rgba(20, 124, 255, 0.16); color: white; }
.sidebar a.active { box-shadow: inset 3px 0 0 #3b96ff; }
.sidebar .sidebar-logout { margin-top: auto; border-top: 1px solid rgba(138,160,184,.16); border-radius: 0 0 10px 10px; color: #ff9aab; }
.sidebar .sidebar-logout:hover, .sidebar .sidebar-logout:focus-visible { background: rgba(220,53,69,.15); color: #ffb3bf; }
.theme-light .sidebar .sidebar-logout { color: #ffd0d6; }
.theme-light .sidebar .sidebar-logout:hover, .theme-light .sidebar .sidebar-logout:focus-visible { background: rgba(220,53,69,.23); color: #fff; }
.badge { background: var(--honey); color: #111; border-radius: 999px; padding: 1px 7px; font-size: 12px; }

.main-wrap { display: flex; flex-direction: column; min-width: 0; height: 100vh; margin-left: 260px; overflow-y: auto; overscroll-behavior: contain; }
.topbar [data-toggle-sidebar] { display: none; }
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 16px 24px;
  border-bottom: 1px solid var(--line); background: rgba(6, 16, 31, 0.7); position: sticky; top: 0; z-index: 5;
}
.theme-light .topbar { background: #fff; }
.topbar-title h1 { font-size: 1.35rem; }
.eyebrow { color: var(--honey); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
.topbar-tools { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.who { color: var(--muted); font-size: 14px; }
.topbar-user { display: inline-flex; align-items: center; gap: 9px; min-width: 0; padding: 3px 5px 3px 3px; border: 1px solid transparent; border-radius: 999px; color: var(--text); text-decoration: none; transition: background .16s ease, border-color .16s ease; }
.topbar-user:hover, .topbar-user:focus-visible { border-color: var(--line); background: rgba(20,124,255,.08); outline: none; }
.topbar-avatar { display: inline-grid; width: 36px; height: 36px; flex: 0 0 36px; place-items: center; overflow: hidden; border: 1px solid rgba(109,177,255,.38); border-radius: 50%; background: linear-gradient(145deg, #147cff, #00b7ff); color: #fff; object-fit: cover; }
.topbar-avatar-fallback { font-size: .9rem; font-weight: 750; text-transform: uppercase; box-shadow: 0 3px 12px rgba(20,124,255,.2); }
.theme-light .topbar-avatar { border-color: #b9d5f3; }
.notification-menu { display: flex; align-items: center; }
.notification-bell {
  position: relative; width: 42px; height: 42px; display: grid; place-items: center;
  border: 0; border-radius: 11px; background: transparent; box-shadow: none; color: var(--notification-text);
  font-size: 19px; text-decoration: none; cursor: pointer;
}
.notification-bell:hover, .notification-bell:focus-visible { background: var(--notification-hover); outline: 2px solid rgba(20,124,255,.24); }
.notification-badge {
  position: absolute; top: -6px; right: -7px; min-width: 19px; height: 19px; padding: 0 5px;
  display: grid; place-items: center; border: 2px solid var(--notification-panel); border-radius: 999px;
  background: #dc3545; color: #fff; font-size: 10px; font-weight: 700; line-height: 1;
}
.notification-toast-container { position: fixed; right: 20px; bottom: 20px; z-index: 1000; display: grid; gap: 10px; width: min(390px, calc(100vw - 32px)); pointer-events: none; }
.cc-toast { display: flex; justify-content: space-between; gap: 14px; padding: 14px; border: 1px solid var(--notification-border); border-left: 4px solid var(--blue); border-radius: 12px; background: var(--notification-panel); color: var(--notification-text); box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); transition: opacity .2s ease, transform .2s ease; pointer-events: auto; }
.cc-toast-warning { border-left-color: var(--honey); }
.cc-toast-danger { border-left-color: #dc3545; }
.cc-toast.is-visible { opacity: 1; transform: none; }
.cc-toast-content { min-width: 0; }
.cc-toast-content strong { display: block; margin-bottom: 4px; font-size: 13px; }
.cc-toast-content p { color: var(--notification-muted); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.cc-toast-actions { display: flex; align-items: flex-start; gap: 8px; flex-shrink: 0; }
.cc-toast-mark-read, .cc-toast-close { border: 0; background: transparent; color: #6db1ff; cursor: pointer; font: inherit; font-size: 12px; }
.cc-toast-close { color: var(--notification-muted); font-size: 20px; line-height: 1; }
.content { padding: 24px; flex: 1; }
.app-footer { padding: 16px 24px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }

.icon-btn, .btn, select, input, textarea {
  font: inherit;
}
.icon-btn, .btn {
  border: 1px solid var(--line); background: #0d2140; color: var(--text); border-radius: 10px;
  padding: 9px 14px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.theme-light .icon-btn, .theme-light .btn { background: #eef3fa; }
.btn:hover, .icon-btn:hover { transform: translateY(-1px); }
.btn-primary { background: linear-gradient(135deg, var(--blue), #0066ff); border: 0; color: white; }
.btn-honey { background: linear-gradient(135deg, var(--honey), #e09a12); color: #111; border: 0; }
.btn-danger { background: #5a1d2b; color: #ff90a0; }
.btn-ghost { background: transparent; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
.card h2, .card h3 { margin-bottom: 10px; }
.muted { color: var(--muted); }
.income { color: var(--income); }
.expense { color: var(--expense); }

.stat { padding: 16px; }
.stat small { color: var(--muted); }
.stat strong { display: block; font-size: 1.5rem; margin-top: 6px; }

.alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; }
.alert-success { background: rgba(38, 217, 149, 0.12); border: 1px solid rgba(38, 217, 149, 0.3); color: #7cf0c0; }
.alert-error, .alert-danger { background: rgba(255, 102, 128, 0.12); border: 1px solid rgba(255, 102, 128, 0.3); color: #ff9aab; }
.alert-warning { background: rgba(245, 185, 66, 0.12); border: 1px solid rgba(245, 185, 66, 0.35); color: var(--honey-2); }
.alert-info { background: rgba(20, 124, 255, 0.12); border: 1px solid rgba(20, 124, 255, 0.3); }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 6px; color: #d5e4f5; font-size: 14px; }
.theme-light .form-group label { color: #334; }
.settings-form { display: grid; gap: 16px; max-width: 900px; }
.settings-section > h2 { margin-bottom: 6px; }
.settings-section > .muted { margin-bottom: 18px; }
.settings-option { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.settings-option strong { display: block; margin-bottom: 4px; }
.settings-option .muted { font-size: 13px; }
.settings-switch { flex: 0 0 auto; display: inline-flex; align-items: center; cursor: pointer; }
.settings-switch input { width: 42px; height: 23px; margin: 0; appearance: none; border: 1px solid var(--line); border-radius: 999px; background: #29445f; cursor: pointer; transition: background .18s ease; }
.settings-switch input::before { content: ""; display: block; width: 17px; height: 17px; margin: 2px; border-radius: 50%; background: white; transition: transform .18s ease; }
.settings-switch input:checked { background: var(--blue); border-color: var(--blue); }
.settings-switch input:checked::before { transform: translateX(19px); }
.settings-switch input:focus-visible { outline: 2px solid var(--blue-2); outline-offset: 2px; }
.settings-section .form-group { margin-top: 16px; }
.settings-page { width: min(1160px, 100%); margin: 0 auto; padding: 8px 0 32px; }
.settings-hero { position: relative; display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; padding: clamp(24px, 4vw, 42px); border: 1px solid rgba(70, 151, 255, .24); border-radius: 22px; background: linear-gradient(115deg, rgba(20,124,255,.16), rgba(13,31,53,.65) 58%); }
.theme-light .settings-hero { background: radial-gradient(ellipse at 85% 30%, rgba(0,183,255,.12), transparent 38%), linear-gradient(115deg, rgba(20,124,255,.08), #fff 64%); }
.settings-hero h2 { margin: 5px 0 8px; font-size: clamp(1.8rem, 4vw, 2.55rem); letter-spacing: -.04em; }
.settings-hero p:last-child { max-width: 560px; color: var(--muted); }
.settings-kicker { color: var(--blue-2); font-size: .72rem; font-weight: 800; letter-spacing: .15em; }
.settings-layout { display: grid; grid-template-columns: 265px minmax(0, 1fr); align-items: start; gap: 22px; }
.settings-tabs { position: sticky; top: 96px; display: grid; gap: 6px; padding: 9px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); box-shadow: var(--shadow); }
.settings-tab { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 12px; border: 1px solid transparent; border-radius: 11px; background: transparent; color: var(--muted); text-align: left; cursor: pointer; transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease; }
.settings-tab:hover { color: var(--text); background: rgba(20,124,255,.08); }
.settings-tab.active { border-color: rgba(20,124,255,.25); background: rgba(20,124,255,.13); color: var(--text); }
.settings-tab > span { display: grid; gap: 3px; }
.settings-tab strong { font-size: .88rem; font-weight: 650; }
.settings-tab small { color: var(--muted); font-size: .72rem; }
.settings-icon { display: inline-block; width: 18px; height: 18px; flex: 0 0 auto; vertical-align: middle; }
.settings-tab > .settings-icon { width: 20px; height: 20px; }
.settings-page svg,
.settings-page .bi,
.settings-card svg {
  display: inline-block !important;
  width: 20px !important;
  height: 20px !important;
  max-width: 24px !important;
  max-height: 24px !important;
  flex: 0 0 20px;
}
.settings-content { min-width: 0; }
.settings-panel { display: grid; gap: 16px; animation: settings-in .22s ease both; }
.settings-panel[hidden] { display: none; }
#dashboard-budget-progress, #dashboard-recent-activity { scroll-margin-top: 100px; }
@keyframes settings-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.settings-section-heading { display: flex; align-items: center; gap: 13px; padding: 4px 2px 2px; }
.settings-section-heading h3 { margin-bottom: 4px; font-size: 1.18rem; }
.settings-section-heading p, .settings-card-title p { color: var(--muted); font-size: .86rem; }
.settings-heading-icon { display: grid; width: 44px; height: 44px; flex: 0 0 auto; place-items: center; border: 1px solid rgba(20,124,255,.23); border-radius: 14px; background: rgba(20,124,255,.1); color: #58a5ff; }
.settings-heading-icon .settings-icon { width: 20px; height: 20px; }
.settings-card { display: grid; gap: 18px; padding: clamp(18px, 3vw, 26px); }
.settings-fields-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; }
.settings-card .form-group { min-width: 0; margin: 0; }
.settings-card .form-group label { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; color: var(--text); font-weight: 600; }
.settings-card .form-group label .settings-icon { width: 16px; height: 16px; color: #69aaff; }
.settings-note { display: flex; align-items: center; gap: 9px; padding: 12px 14px; border: 1px solid rgba(20,124,255,.18); border-radius: 11px; background: rgba(20,124,255,.07); color: var(--muted); font-size: .8rem; }
.settings-note .settings-icon { color: #69aaff; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 4px 0 17px; border-bottom: 1px solid var(--line); }
.settings-row:last-of-type { padding-bottom: 6px; border-bottom: 0; }
.settings-label { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.settings-label > .settings-icon { margin-top: 2px; color: #69aaff; }
.settings-label strong { display: block; margin-bottom: 4px; font-size: .9rem; }
.settings-label p, .settings-label small { display: block; color: var(--muted); font-size: .78rem; line-height: 1.5; }
.settings-select-row { padding-top: 4px; }
.settings-select-row > label { color: var(--text) !important; }
.settings-input-prefix { display: flex; align-items: center; overflow: hidden; border: 1px solid #29445f; border-radius: 10px; background: #0a1c30; }
.theme-light .settings-input-prefix { border-color: #c9d6e6; background: #fff; }
.settings-input-prefix > span { padding-left: 13px; color: var(--muted); font-weight: 650; }
.settings-input-prefix input { border: 0; background: transparent; }
.settings-input-prefix input:focus { box-shadow: none; }
.form-hint { display: block; margin-top: 6px; color: var(--muted); font-size: .76rem; line-height: 1.5; }
.form-switch { position: relative; display: inline-flex; flex: 0 0 auto; align-items: center; cursor: pointer; }
.form-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.form-switch::before { width: 44px; height: 25px; border: 1px solid var(--line); border-radius: 999px; background: #29445f; content: ""; transition: background .2s ease, border-color .2s ease; }
.form-switch::after { position: absolute; left: 4px; width: 17px; height: 17px; border-radius: 50%; background: #fff; content: ""; transition: transform .2s ease; }
.form-switch:has(input:checked)::before { border-color: var(--blue); background: var(--blue); }
.form-switch:has(input:checked)::after { transform: translateX(19px); }
.form-switch:has(input:focus-visible)::before { outline: 2px solid var(--blue-2); outline-offset: 3px; }
.settings-savebar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 16px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.settings-savebar .form-hint { margin: 0; }
.settings-savebar .settings-icon, .settings-actions .settings-icon, .settings-password-form .settings-icon { width: 16px; height: 16px; }
.settings-data-block { display: grid; gap: 14px; padding-top: 18px; border-top: 1px solid var(--line); }
.settings-actions { display: flex; flex-wrap: wrap; gap: 10px; padding-left: 30px; }
.btn-secondary { border: 1px solid var(--line); background: transparent; color: var(--text); }
.btn-secondary:hover { border-color: #3d8fff; background: rgba(20,124,255,.09); }
.btn-outline-danger { border: 1px solid rgba(255,102,128,.4); background: transparent; color: #ff8295; }
.btn-outline-danger:hover { border-color: #ff6680; background: rgba(255,102,128,.13); color: #ff9aab; }
.settings-demo-block { grid-template-columns: minmax(0,1fr) auto; align-items: center; padding: 16px; border: 1px solid rgba(255,102,128,.2); border-radius: 12px; background: rgba(255,102,128,.045); }
.settings-card-title { display: flex; align-items: center; gap: 12px; }
.settings-card-title h4 { margin-bottom: 4px; }
.settings-password-form { display: grid; gap: 14px; }
.settings-password-form .btn { justify-self: start; }
.settings-session-card { margin-top: 16px; }
.settings-session-detail { display: flex; align-items: center; gap: 9px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); font-size: .82rem; }
.settings-session-detail .btn { margin-left: auto; }
.session-status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--income); box-shadow: 0 0 0 4px rgba(38,217,149,.11); }
.settings-modal-backdrop { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px; background: rgba(1,8,18,.72); backdrop-filter: blur(7px); }
.settings-modal-backdrop[hidden] { display: none; }
.settings-modal { position: relative; width: min(460px, 100%); padding: 30px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.settings-modal h3 { margin: 16px 0 10px; }
.settings-modal p { margin-bottom: 10px; color: var(--muted); line-height: 1.6; }
.settings-modal .btn { margin-top: 10px; }
.settings-modal-icon { display: grid; width: 48px; height: 48px; place-items: center; border: 1px solid rgba(255,102,128,.25); border-radius: 15px; background: rgba(255,102,128,.1); color: #ff8295; }
.settings-modal-icon .settings-icon { width: 20px; height: 20px; }
.settings-modal-close { position: absolute; top: 12px; right: 14px; border: 0; background: transparent; color: var(--muted); font-size: 27px; cursor: pointer; }
.rating-modal-backdrop { position: fixed; inset: 0; z-index: 1100; display: grid; place-items: center; overflow-y: auto; padding: 22px; background: rgba(2,9,19,.76); backdrop-filter: blur(9px); }
.rating-modal-backdrop[hidden] { display: none; }
.rating-modal-open { overflow: hidden; }
.rating-modal { position: relative; width: min(490px, 100%); max-height: calc(100vh - 36px); overflow-y: auto; padding: clamp(24px, 5vw, 38px); border: 1px solid rgba(91,157,231,.3); border-radius: 23px; background: linear-gradient(155deg, #102741, #09182a 76%); color: #f4f8ff; box-shadow: 0 32px 100px rgba(0,0,0,.58), 0 0 0 1px rgba(20,124,255,.06); text-align: center; animation: rating-pop .28s cubic-bezier(.2,.8,.2,1) both; }
.theme-light .rating-modal { background: linear-gradient(155deg, #fff, #f3f7fd); color: #102033; }
@keyframes rating-pop { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.rating-modal-close { position: absolute; top: 13px; right: 15px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: #9aafc6; font-size: 25px; cursor: pointer; }
.rating-modal-close:hover { background: rgba(255,255,255,.08); color: var(--text); }
.rating-modal-mark { display: grid; width: 48px; height: 48px; margin: 0 auto 17px; place-items: center; border: 1px solid rgba(109,177,255,.32); border-radius: 16px; background: linear-gradient(140deg,#147cff,#00b7ff); color: white; font-size: 1.6rem; font-weight: 800; box-shadow: 0 10px 28px rgba(20,124,255,.25); }
.rating-kicker { color: #70b5ff; font-size: .63rem; font-weight: 800; letter-spacing: .14em; }
.rating-modal h2 { margin: 10px 0 9px; font-size: clamp(1.35rem, 4vw, 1.7rem); letter-spacing: -.035em; line-height: 1.2; }
.rating-modal > p:not(.rating-selection-hint):not(.rating-error) { margin: 0 auto; max-width: 360px; color: #9aafc6; font-size: .9rem; line-height: 1.55; }
.theme-light .rating-modal > p:not(.rating-selection-hint):not(.rating-error) { color: #5b7088; }
.rating-stars { display: flex; justify-content: center; gap: 8px; margin: 22px 0 5px; }
.rating-star { padding: 0; border: 0; background: transparent; color: #52657a; font-size: clamp(2.1rem, 8vw, 2.65rem); line-height: 1; cursor: pointer; transition: color .14s ease, transform .14s ease, filter .14s ease; }
.rating-star:hover, .rating-star:focus-visible, .rating-star.is-active { color: #ffc857; filter: drop-shadow(0 4px 10px rgba(255,200,87,.2)); }
.rating-star:hover, .rating-star:focus-visible { transform: translateY(-3px) scale(1.08); outline: none; }
.rating-selection-hint { min-height: 20px; margin: 8px 0 19px; color: #ffc857; font-size: .78rem; font-weight: 650; }
.rating-feedback-label { display: block; margin: 0 0 8px; color: #d8e6f5; font-size: .82rem; font-weight: 650; text-align: left; }
.theme-light .rating-feedback-label { color: #263b55; }
.rating-feedback-label span { color: #8197ad; font-weight: 400; }
.rating-modal textarea { min-height: 94px; resize: vertical; border-color: rgba(111,148,185,.32); background: rgba(4,16,30,.54); color: #f4f8ff; font-size: .86rem; }
.rating-modal textarea::placeholder { color: #8299b2; }
.theme-light .rating-modal textarea { background: #f8fbff; color: #102033; }
.rating-error { margin: 10px 0 0; color: #ff9aab; font-size: .8rem; text-align: left; }
.rating-modal-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 19px; }
.rating-modal-actions .btn { min-height: 42px; }
.rating-modal-actions .btn-primary:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.admin-ratings-card { overflow: hidden; }
.admin-ratings-heading { align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 19px; }
.admin-ratings-heading .eyebrow { margin-bottom: 5px; }
.admin-ratings-heading h3 { margin-bottom: 4px; }
.admin-ratings-heading .muted { font-size: .82rem; }
.admin-rating-average { display: grid; grid-template-columns: auto auto; align-items: center; column-gap: 10px; text-align: right; }
.admin-rating-average > strong { grid-row: span 2; font-size: 2rem; letter-spacing: -.04em; }
.admin-rating-average > small { color: var(--muted); font-size: .72rem; }
.admin-rating-stars { color: #ffc857; letter-spacing: .06em; white-space: nowrap; }
.rating-breakdown { display: grid; gap: 7px; width: min(370px, 100%); margin: 0 0 20px auto; }
.rating-breakdown-row { display: grid; grid-template-columns: 34px minmax(60px,1fr) 25px; align-items: center; gap: 9px; color: var(--muted); font-size: .77rem; }
.rating-breakdown-track { height: 7px; overflow: hidden; border-radius: 999px; background: rgba(138,160,184,.17); }
.rating-breakdown-track > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#eaa933,#ffd878); }
.rating-breakdown-row > small { text-align: right; }
.admin-ratings-table-wrap { overflow-x: auto; }
.admin-ratings-table { min-width: 680px; }
.admin-ratings-table td:first-child strong, .admin-ratings-table td:first-child small { display: block; }
.admin-ratings-table td:first-child small { margin-top: 3px; color: var(--muted); }
.admin-rating-feedback { max-width: 360px; overflow-wrap: anywhere; }
.admin-ratings-empty { padding: 22px 0; text-align: center; }
.admin-ratings-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; color: var(--muted); font-size: .82rem; }
input, select, textarea {
  width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid #29445f;
  background: #0a1c30; color: var(--text); outline: none;
}
.theme-light input, .theme-light select, .theme-light textarea { background: #fff; color: #102033; border-color: #c9d6e6; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(20,124,255,0.15); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; }
.sortable-heading { padding: 0; transition: background .16s ease, color .16s ease; }
.sortable-heading:hover, .sortable-heading.is-sorted { color: var(--text); background: rgba(20,124,255,.07); }
.sort-link { display: flex; align-items: center; gap: 7px; min-height: 42px; padding: 10px 8px; color: inherit; text-decoration: none; white-space: nowrap; }
.sort-link:hover { color: #75b5ff; }
.sort-link:focus-visible { position: relative; z-index: 1; outline: 2px solid var(--blue-2); outline-offset: -2px; border-radius: 5px; }
.sort-indicator { display: inline-grid; width: 16px; height: 16px; place-items: center; border-radius: 4px; color: var(--muted); font-size: .9rem; line-height: 1; opacity: .55; transition: opacity .16s ease, color .16s ease, background .16s ease; }
.sortable-heading:hover .sort-indicator, .sort-indicator.active { color: #75b5ff; opacity: 1; }
.sort-indicator.active { background: rgba(20,124,255,.14); }

.progress { height: 10px; background: #10233b; border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--honey)); }
.progress.warn > span { background: var(--honey); }
.progress.over > span { background: var(--expense); }

.breadcrumbs ol { display: flex; gap: 8px; list-style: none; color: var(--muted); font-size: 13px; margin-bottom: 16px; flex-wrap: wrap; }
.breadcrumbs li:not(:last-child)::after { content: " /"; margin-left: 8px; color: #4d6480; }

.empty-state { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty-state h3 { color: var(--text); margin-bottom: 8px; }

.chip { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 12px; border: 1px solid var(--line); }
.chip.income { border-color: #1a6b4d; }
.chip.expense { border-color: #6b2a38; }
.chip.warn { border-color: var(--honey); color: var(--honey); }

.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.loading-bar { height: 3px; background: linear-gradient(90deg, var(--blue), var(--honey)); animation: load 1s infinite; }
@keyframes load { from { opacity: .3; } to { opacity: 1; } }

.guest-body {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(circle at top left, #103e72, transparent 35%), var(--bg);
}
.guest-card {
  width: min(460px, 100%); background: var(--panel); border: 1px solid #1c3b58; border-radius: 20px;
  padding: 36px; box-shadow: var(--shadow);
}
.guest-brand { text-align: center; margin-bottom: 22px; display: block; }
.guest-brand .logo-icon { margin: 0 auto 10px; }
.guest-brand span { color: #3f9aff; display: inline; }
.guest-card:has(.login-screen) > .guest-brand { display: none; }
.guest-card:has(.login-screen) { width: min(480px, 100%); padding: 34px; border-color: rgba(70,151,255,.28); background: linear-gradient(155deg, rgba(15,36,61,.98), rgba(7,20,36,.98)); box-shadow: 0 28px 90px rgba(0,0,0,.48), 0 0 0 1px rgba(20,124,255,.05); }
.theme-light .guest-card:has(.login-screen) { background: linear-gradient(155deg, #fff, #f4f8ff); border-color: #d4e4f7; }
.login-screen { width: 100%; }
.login-brand-badge { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 30px; color: var(--text); font-size: .95rem; font-weight: 750; letter-spacing: -.02em; }
.login-brand-mark { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid rgba(109,177,255,.35); border-radius: 13px; background: linear-gradient(140deg, #147cff, #00b7ff); color: #fff !important; box-shadow: 0 8px 24px rgba(20,124,255,.3); font-size: 1.25rem; animation: login-float 3.5s ease-in-out infinite; }
.login-heading { margin-bottom: 26px; text-align: center; }
.login-heading h2 { margin: 7px 0 8px; font-size: 1.8rem; letter-spacing: -.04em; }
.login-heading p { color: var(--muted); font-size: .92rem; }
.login-eyebrow { color: #69aaff; font-size: .66rem; font-weight: 800; letter-spacing: .16em; }
.admin-login-eyebrow { color: var(--honey); }
.login-form .form-group { margin-bottom: 18px; }
.login-form label { display: block; margin-bottom: 8px; color: #dceaff; font-size: .84rem; font-weight: 650; }
.theme-light .login-form label { color: #263b55; }
.login-form input { min-height: 48px; border-color: rgba(111,148,185,.34); background: rgba(4,16,30,.68); color: #f4f8ff; transition: border-color .2s ease, box-shadow .2s ease, background .2s ease; }
.theme-light .login-form input { background: #f8fbff; color: #102033; }
.login-form input::placeholder { color: #8299b2; opacity: 1; }
.theme-light .login-form input::placeholder { color: #7c8ea3; }
.login-form input:focus { border-color: #3d98ff; background: rgba(4,16,30,.9); box-shadow: 0 0 0 3px rgba(20,124,255,.18), 0 0 24px rgba(20,124,255,.16); }
.theme-light .login-form input:focus { background: #fff; }
.login-form-meta { display: flex; justify-content: flex-end; margin: -5px 0 20px; font-size: .84rem; }
.login-form-meta a, .login-signup a { color: #75b5ff; font-weight: 650; text-decoration: none; }
.login-form-meta a:hover, .login-signup a:hover, .login-home-link:hover { text-decoration: underline; }
.login-submit { width: 100%; min-height: 49px; justify-content: center; gap: 10px; border-radius: 11px; box-shadow: 0 9px 24px rgba(20,124,255,.24); font-weight: 700; }
.login-submit span { font-size: 1.1rem; transition: transform .18s ease; }
.login-submit:hover span { transform: translateX(3px); }
.login-signup { margin-top: 24px; color: var(--muted); font-size: .84rem; text-align: center; }
.login-home-link { display: block; width: fit-content; margin: 18px auto 0; color: var(--muted); font-size: .8rem; text-decoration: none; }
.admin-login-screen .login-brand-mark { background: linear-gradient(140deg, #b87918, #f5b942); border-color: rgba(255,210,122,.45); box-shadow: 0 8px 24px rgba(245,185,66,.2); color: #142033 !important; }
.otp-form input[name="otp"] { min-height: 58px; font-size: 1.45rem; font-weight: 750; letter-spacing: .42em; text-align: center; }
.otp-resend-form { margin-top: 14px; text-align: center; }
.otp-resend-button { min-height: 40px; color: #8dbfff; }
.otp-resend-button:disabled { cursor: not-allowed; opacity: .58; transform: none; }
.login-heading strong { color: var(--text); font-weight: 650; }
@keyframes login-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

.sitemap-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.chart { display: flex; align-items: flex-end; gap: 8px; height: 140px; }
.chart .bar { flex: 1; background: linear-gradient(to top, #086cff, #2db7ff); border-radius: 6px 6px 0 0; min-height: 8px; }
.chart.spend .bar { background: linear-gradient(to top, #c46b12, var(--honey)); }

@media (max-width: 1000px) {
  .main-wrap { margin-left: 0; }
  .sidebar { inset: 0 auto 0 0; width: min(260px, 86vw); transform: translateX(-110%); transition: transform .2s ease; z-index: 8; }
  .sidebar.open { transform: none; }
  .topbar [data-toggle-sidebar] { display: inline-flex; }
  .grid-4, .grid-3, .grid-2, .sitemap-grid { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-tabs { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-tab { padding: 10px; }
}
@media (max-width: 600px) {
  .topbar-tools { gap: 6px; }
  .topbar-tools select { max-width: 126px; }
  .notification-toast-container { right: 16px; bottom: 16px; }
  .settings-tabs { grid-template-columns: 1fr; }
  .settings-tab small { display: none; }
  .settings-fields-grid { grid-template-columns: 1fr; }
  .settings-row { align-items: flex-start; }
  .settings-savebar, .settings-session-detail { align-items: flex-start; flex-direction: column; }
  .settings-session-detail .btn { margin: 4px 0 0; }
  .settings-actions { padding-left: 0; }
  .settings-demo-block { grid-template-columns: 1fr; }
}
@media print {
  .sidebar, .topbar, .app-footer, .actions, .skip-link { display: none !important; }
  .app-shell { display: block; }
  .content { padding: 0; }
  body { background: white; color: black; }
}
