/* Dark theme and privacy mode. Loaded after tools.css. */
/* ══ DARK THEME ══ */
body.theme-dark{
  --navy:#0f1f3d;--navy-light:#162a50;--navy-hover:#1e3566;
  --blue:#3d9ef5;--blue-light:#5aaef7;--blue-pale:#0d1f3c;
  --accent:#e0aa20;--white:#1a2236;--bg:#10172a;--border:#2a3d5c;
  --text:#dde5f0;--muted:#7a93b0;
  --success:#34d370;--success-bg:#052918;--danger:#f26060;--danger-bg:#2d0a0a;
  --warning:#f0a320;--warning-bg:#1a1200;--purple:#a78bfa;--purple-bg:#1e1040;
  --teal:#2dd4bf;--teal-bg:#042a28;
  color-scheme:dark;
}
body.theme-dark .topbar{background:#1a2236;border-color:var(--border);}
body.theme-dark .topbar-title{color:#dde5f0;}
body.theme-dark .modal{background:#1a2236;color:var(--text);}
body.theme-dark .modal-head{background:#1a2236;border-color:var(--border);}
body.theme-dark .modal-foot{border-color:var(--border);}
body.theme-dark .fg input,body.theme-dark .fg select,body.theme-dark .fg textarea,
body.theme-dark .adv-fg input,body.theme-dark .adv-fg select,
body.theme-dark .settings-control select,body.theme-dark .settings-control input{background:#10172a!important;color:var(--text)!important;border-color:var(--border)!important;}
body.theme-dark .table-card{background:#1a2236;border-color:var(--border);}
body.theme-dark .table-card thead th{background:#10172a;}
body.theme-dark .table-card tbody td{border-color:#1e2d45;}
body.theme-dark .table-card tbody tr:hover td{background:#1e2d45;}
body.theme-dark .stat-card{background:#1a2236;border-color:var(--border);}
body.theme-dark .toolbar{background:#1a2236;border-color:var(--border);}
body.theme-dark .dash-toolbar{background:#0d1f3c;border-color:var(--border);}
body.theme-dark .adv-filter{background:#1a2236;border-color:var(--border);}
body.theme-dark .chip{background:#1a2236;border-color:var(--border);color:var(--muted);}
body.theme-dark .chip.active{background:var(--blue);color:#fff;border-color:var(--blue);}
body.theme-dark .file-chip{background:#10172a;color:var(--muted);}
body.theme-dark .widget-card{background:#1a2236;border-color:var(--border);}
body.theme-dark .alert-item.alert-warn{background:#1a1400;border-color:#4a3800;}
body.theme-dark .alert-item.alert-info{background:#0d1f3c;border-color:var(--border);}
body.theme-dark .bottom-nav{background:#0a1220;border-color:#1a2a45;}
body.theme-dark .ei-card{border-color:var(--border);}
body.theme-dark .ei-card:hover{background:#0d1f3c;}
body.theme-dark .bk-card{background:#1a2236;border-color:var(--border);}
body.theme-dark .bk-warn-banner{background:#1a1200;border-color:#4a3800;color:#d4a017;}
body.theme-dark .inv-record{background:#1a2236;border-color:var(--border);}
body.theme-dark .inv-record:hover{background:#0d1f3c;}
body.theme-dark .inv-sum-card{background:#1a2236;border-color:var(--border);}
body.theme-dark .fm-card{background:#1a2236;}
body.theme-dark .reminder-card{background:#1a2236;border-color:var(--border);}
body.theme-dark .pb-bond-row{background:#1a2236;border-color:var(--border);}
body.theme-dark .pb-draw-card{border-color:var(--border);background:#1a2236;}
body.theme-dark .pb-stat{background:#1a2236;border-color:var(--border);}
body.theme-dark .ie-row{background:#1a2236;border-color:var(--border);}
body.theme-dark .ie-stat{background:#1a2236;}
body.theme-dark .chart-box{background:#1a2236;border-color:var(--border);}
body.theme-dark .ss-result{background:#1a2236;border-color:var(--border);}
body.theme-dark .ss-result:hover{background:#0d1f3c;}
body.theme-dark .tl-event{background:#1a2236;border-color:var(--border);}
body.theme-dark .lc-card{background:#1a2236;border-color:var(--border);}
body.theme-dark .ad-month-section{background:#1a2236;border-color:var(--border);}
body.theme-dark .ad-month-header{background:linear-gradient(90deg,#1a2236,#10172a);border-color:var(--border);}
body.theme-dark .ad-event:hover{background:#0d1f3c;}
body.theme-dark .ad-event-day{background:#0d1f3c;}
body.theme-dark .fa-section{background:#1a2236;border-color:var(--border);}
body.theme-dark .fa-checkbox{border-color:var(--border);}
body.theme-dark .fa-counter input{background:#10172a!important;color:var(--text)!important;border-color:var(--border)!important;}
body.theme-dark .fa-result-row{background:#1a2236;border-color:var(--border);}
body.theme-dark .fa-note{background:#10213a;border-color:#1e4a7a;color:#9ecbff;}
body.theme-dark .zk-section{background:#1a2236;border-color:var(--border);}
body.theme-dark .zk-row input{background:#10172a!important;color:var(--text)!important;border-color:var(--border)!important;}
body.theme-dark .nisab-card{background:#1a1200;border-color:#4a3800;color:#d4a017;}
body.theme-dark .drop-zone{background:#10172a;}
body.theme-dark body.theme-dark body.theme-dark .pay-card{border-color:var(--border);}
body.theme-dark .pay-number{background:#10172a;color:var(--text);}
body.theme-dark .fm-doc-item{background:#10172a;border-color:var(--border);}
body.theme-dark .customize-tool-row{background:#1a2236;border-color:var(--border);}
body.theme-dark .customize-tool-row.is-hidden{background:#10172a;}
body.theme-dark .settings-row{border-color:var(--border);}
body.theme-dark .theme-btn{background:#10172a;border-color:var(--border);color:var(--muted);}
body.theme-dark .radio-opt{background:#10172a;border-color:var(--border);color:var(--muted);}
body.theme-dark .currency-preview{background:#0d1f3c;border-color:var(--border);color:var(--text);}
body.theme-dark .license-input-section{background:#1a1200;border-color:#4a3800;}
body.theme-dark .zk-summary-row{color:var(--text);}
body.theme-dark .recent-row:hover{background:#0d1f3c;}
body.theme-dark .tl-chip{background:#1a2236;border-color:var(--border);}
body.theme-dark .tl-chip.active{background:var(--navy);color:#fff;}
body.theme-dark .ad-sum-card{background:#1a2236;border-color:var(--border);}
body.theme-dark .inv-type-card{background:#10172a;border-color:var(--border);}
body.theme-dark .pb-input-opt{background:#1a2236;border-color:var(--border);}
body.theme-dark .chpw-box{background:#1a2236;}

/* ══ PRIVACY MODE ══ */
body.privacy-mode .stat-num{filter:blur(6px);user-select:none;transition:filter .25s;}
body.privacy-mode .ie-amount{filter:blur(6px);user-select:none;}
body.privacy-mode .inv-rec-amount{filter:blur(6px);user-select:none;}
body.privacy-mode .inv-sum-num{filter:blur(6px);user-select:none;}
body.privacy-mode #ie-total-in,body.privacy-mode #ie-total-ex,
body.privacy-mode #ie-balance,body.privacy-mode #ie-savings{filter:blur(6px);user-select:none;}
body.privacy-mode #zk-amount{filter:blur(6px);user-select:none;}
body.privacy-mode #emi-monthly,body.privacy-mode #emi-interest,body.privacy-mode #emi-total{filter:blur(6px);user-select:none;}
body.privacy-mode #fa-total-display,.privacy-mode .fa-result-amt{filter:blur(6px);user-select:none;}
body.privacy-mode #pb-total-won{filter:blur(6px);user-select:none;}
body.privacy-mode #db-right{filter:blur(5px);user-select:none;}
body.privacy-mode .pm-val{filter:blur(6px);user-select:none;}
.privacy-eye-btn{background:none;border:none;cursor:pointer;font-size:17px;padding:5px 7px;border-radius:6px;color:var(--muted);transition:all .15s;line-height:1;}
.privacy-eye-btn:hover{background:var(--bg);color:var(--text);}
.privacy-eye-btn.active{color:var(--blue);}
/* ── Diary / Journal ── */
.diary-entry-card{background:var(--white);border:1.5px solid var(--border);border-radius:12px;padding:14px 16px;margin-bottom:10px;cursor:pointer;transition:box-shadow .15s,border-color .15s;position:relative;}
.diary-entry-card:hover{box-shadow:0 2px 12px rgba(0,0,0,.09);border-color:var(--blue);}
.diary-entry-top{display:flex;align-items:center;gap:8px;margin-bottom:6px;}
.diary-entry-mood{font-size:22px;line-height:1;}
.diary-entry-title{font-size:14px;font-weight:700;color:var(--navy);flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.diary-entry-date{font-size:11px;color:var(--muted);white-space:nowrap;}
.diary-entry-preview{font-size:12.5px;color:var(--muted);line-height:1.6;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;}
.diary-entry-del{position:absolute;top:10px;right:10px;background:none;border:none;cursor:pointer;font-size:14px;color:var(--muted);padding:4px 6px;border-radius:6px;opacity:0;transition:opacity .15s;}
.diary-entry-card:hover .diary-entry-del{opacity:1;}
.diary-entry-del:hover{background:#fee2e2;color:#dc2626;}
.diary-mood-row{display:flex;gap:8px;flex-wrap:wrap;margin:8px 0;}
.diary-mood-btn{font-size:22px;background:var(--bg);border:2px solid var(--border);border-radius:8px;cursor:pointer;padding:5px 10px;transition:all .15s;line-height:1;}
.diary-mood-btn:hover,.diary-mood-btn.selected{border-color:#9c27b0;background:rgba(156,39,176,.1);}
.diary-pin-screen{text-align:center;padding:30px 20px;}
.diary-pin-title{font-size:18px;font-weight:700;color:var(--navy);margin-bottom:6px;}
.diary-pin-sub{font-size:13px;color:var(--muted);margin-bottom:20px;}
.diary-pin-dots{display:flex;justify-content:center;gap:12px;margin-bottom:20px;}
.diary-pin-dot{width:16px;height:16px;border-radius:50%;border:2px solid var(--border);background:var(--bg);transition:all .2s;}
.diary-pin-dot.filled{background:#9c27b0;border-color:#9c27b0;}
.diary-pin-pad{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;max-width:240px;margin:0 auto;}
.diary-pin-key{background:var(--white);border:1.5px solid var(--border);border-radius:10px;font-size:20px;font-weight:600;padding:14px;cursor:pointer;color:var(--navy);transition:all .15s;}
.diary-pin-key:hover{background:rgba(156,39,176,.1);border-color:#9c27b0;}
.diary-pin-key.del-key{font-size:16px;color:var(--muted);}
.diary-compose-area{display:none;}
.diary-compose-area.open{display:block;}
.diary-list-area.hidden{display:none;}
body.theme-dark .diary-entry-card{background:#1a2236;border-color:var(--border);}
body.theme-dark .diary-pin-key{background:#1a2236;border-color:var(--border);color:var(--text);}
body.theme-dark .diary-mood-btn{background:rgba(255,255,255,.05);}
/* ===== ACCOUNTS ===== */
.acc-tab-bar{display:flex;gap:4px;overflow-x:auto;padding:0 0 8px 0;border-bottom:2px solid var(--border);margin-bottom:14px;scrollbar-width:none;}
.acc-tab-bar::-webkit-scrollbar{display:none;}
.acc-tab{padding:7px 16px;border-radius:20px;font-size:13px;font-weight:600;cursor:pointer;border:1.5px solid var(--border);background:var(--bg);color:var(--muted);white-space:nowrap;transition:all .15s;}
.acc-tab.active{background:#0078d4;color:#fff;border-color:#0078d4;}
.acc-card{background:var(--white);border:1.5px solid var(--border);border-radius:14px;padding:15px 16px;margin-bottom:10px;cursor:pointer;transition:box-shadow .15s,border-color .15s;position:relative;}
.acc-card:hover{box-shadow:0 2px 14px rgba(0,0,0,.1);border-color:#0078d4;}
.acc-card-top{display:flex;align-items:center;gap:10px;margin-bottom:6px;}
.acc-card-icon{width:38px;height:38px;border-radius:10px;display:flex;align-items:center;justify-content:center;font-size:18px;flex-shrink:0;}
.acc-card-name{font-size:14px;font-weight:700;color:var(--navy);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.acc-card-balance{font-size:15px;font-weight:700;color:#0078d4;white-space:nowrap;}
.acc-card-sub{font-size:11.5px;color:var(--muted);display:flex;gap:10px;flex-wrap:wrap;}
.acc-badge{display:inline-block;font-size:10.5px;font-weight:700;padding:2px 8px;border-radius:20px;background:#e3f2fd;color:#0078d4;text-transform:uppercase;letter-spacing:.4px;}
.acc-badge.maturity-soon{background:#fff3cd;color:#b45309;}
.acc-badge.loan{background:#fee2e2;color:#dc2626;}
.acc-badge.positive{background:#d1fae5;color:#065f46;}
.acc-badge.negative{background:#fee2e2;color:#dc2626;}
.acc-stat-row{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:14px;}
.acc-stat-box{background:var(--white);border:1.5px solid var(--border);border-radius:12px;padding:12px 10px;text-align:center;}
.acc-stat-box .sv{font-size:16px;font-weight:700;color:var(--navy);}
.acc-stat-box .sl{font-size:11px;color:var(--muted);margin-top:2px;}
.acc-tx-row{display:flex;align-items:center;gap:10px;padding:9px 0;border-bottom:1px solid var(--border);}
.acc-tx-row:last-child{border-bottom:none;}
.acc-tx-icon{width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:14px;flex-shrink:0;}
.acc-tx-icon.in{background:#d1fae5;}
.acc-tx-icon.out{background:#fee2e2;}
.acc-tx-icon.transfer{background:#e0e7ff;}
.acc-tx-meta{flex:1;min-width:0;}
.acc-tx-cat{font-size:13px;font-weight:600;color:var(--navy);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.acc-tx-desc{font-size:11.5px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.acc-tx-right{text-align:right;flex-shrink:0;}
.acc-tx-amt{font-size:14px;font-weight:700;}
.acc-tx-amt.in{color:#059669;}
.acc-tx-amt.out{color:#dc2626;}
.acc-tx-date{font-size:11px;color:var(--muted);}
.acc-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;}
.acc-form-grid .full{grid-column:1/-1;}
.acc-form-row{margin-bottom:10px;}
.acc-form-row label{font-size:12.5px;font-weight:600;color:var(--navy);display:block;margin-bottom:4px;}
.acc-form-row input,.acc-form-row select,.acc-form-row textarea{width:100%;padding:9px 11px;border:1.5px solid var(--border);border-radius:8px;font-size:13px;font-family:inherit;background:var(--white);color:var(--text);}
.acc-form-row input:focus,.acc-form-row select:focus,.acc-form-row textarea:focus{outline:none;border-color:#0078d4;}
.acc-color-row{display:flex;gap:8px;flex-wrap:wrap;margin:4px 0;}
.acc-color-btn{width:28px;height:28px;border-radius:50%;border:3px solid transparent;cursor:pointer;transition:all .15s;}
.acc-color-btn.selected{border-color:#0078d4;transform:scale(1.2);}
.acc-group-badge{display:inline-block;font-size:11px;padding:2px 9px;border-radius:12px;background:#e0e7ff;color:#3730a3;font-weight:600;margin:2px;}
.acc-detail-hero{border-radius:14px;padding:20px 18px;color:#fff;margin-bottom:14px;position:relative;overflow:hidden;}
.acc-detail-hero::after{content:'';position:absolute;right:-20px;top:-20px;width:100px;height:100px;border-radius:50%;background:rgba(255,255,255,.08);}
.acc-maturity-bar{height:6px;border-radius:3px;background:var(--border);margin:6px 0;}
.acc-maturity-fill{height:100%;border-radius:3px;background:linear-gradient(90deg,#0078d4,#00b4d8);}
.acc-holding-row{display:flex;align-items:center;gap:10px;padding:8px 0;border-bottom:1px solid var(--border);}
.acc-holding-row:last-child{border-bottom:none;}
.acc-holding-sym{font-size:13px;font-weight:700;color:var(--navy);min-width:60px;}
.acc-holding-meta{flex:1;font-size:12px;color:var(--muted);}
.acc-holding-right{text-align:right;}
.acc-holding-val{font-size:13px;font-weight:700;color:var(--navy);}
.acc-holding-gain{font-size:11.5px;}
.acc-holding-gain.pos{color:#059669;}
.acc-holding-gain.neg{color:#dc2626;}
.acc-section-head{font-size:13px;font-weight:700;color:var(--navy);margin:14px 0 8px;display:flex;align-items:center;justify-content:space-between;}
.acc-filter-row{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:10px;}
.acc-filter-row select,.acc-filter-row input{padding:6px 10px;border:1.5px solid var(--border);border-radius:8px;font-size:12.5px;font-family:inherit;background:var(--white);color:var(--text);}
body.theme-dark .acc-card{background:#1a2236;}
body.theme-dark .acc-stat-box{background:#1a2236;}
body.theme-dark .acc-form-row input,body.theme-dark .acc-form-row select,body.theme-dark .acc-form-row textarea{background:#1a2236;border-color:var(--border);color:var(--text);}
body.theme-dark .acc-filter-row select,body.theme-dark .acc-filter-row input{background:#1a2236;color:var(--text);}
body.theme-dark .lm-res,body.theme-dark .lm-shape.active{background:#2a2410;border-color:#6d5a1a;}
body.theme-dark .lm-res-v{color:#ffe082;}
body.theme-dark .lm-shape{background:#1a2236;}
body.theme-dark .lm-k-banner{background:#102a14;border-color:#2e5c33;color:#a5d6a7;}
body.theme-dark .lm-table th{background:#1a2236;}
body.theme-dark .lm-svg polygon{fill:#2a2410;}
body.theme-dark .lm-svg text{fill:#ffe082;}
