/* css/style.css - CashTracker v3 Styles */
@import url('https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,300;0,400;0,500;1,400&family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* LIGHT THEME (Default) */
    --bg: #f3f4f6;
    --surface: #ffffff;
    --surface2: #f8fafc;
    --surface-hover: #f1f5f9;
    --border: #e2e8f0;
    --border2: #cbd5e1;
    --text: #1e293b;
    --text2: #475569;
    --text3: #64748b;
    
    --primary: #1e3a8a; /* Deep Navy */
    --primary-light: #eff6ff;
    --accent: #3b82f6; /* Bright Blue */
    --accent-hover: #2563eb;
    
    --green: #059669;
    --green-bg: #d1fae5;
    --red: #e11d48;
    --red-bg: #ffe4e6;
    --orange: #ea580c;
    --orange-bg: #ffedd5;
    --yellow: #ca8a04;
    --yellow-bg: #fef08a;
    --purple: #7c3aed;
    --purple-bg: #ede9fe;
    
    --sidebar-bg: #0f172a; /* Always dark */
    --sidebar-surface: #1e293b;
    --sidebar-text: #f8fafc;
    --sidebar-text2: #94a3b8;
    --sidebar-border: #334155;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme='dark'] {
    /* DARK THEME */
    --bg: #0f172a;
    --surface: #1e293b;
    --surface2: #0f172a;
    --surface-hover: #334155;
    --border: #334155;
    --border2: #475569;
    --text: #f8fafc;
    --text2: #cbd5e1;
    --text3: #94a3b8;
    
    --primary: #3b82f6; 
    --primary-light: rgba(59, 130, 246, 0.1);
    --accent: #60a5fa;
    --accent-hover: #93c5fd;
    
    --green: #34d399;
    --green-bg: rgba(52, 211, 153, 0.15);
    --red: #fb7185;
    --red-bg: rgba(251, 113, 133, 0.15);
    --orange: #fb923c;
    --orange-bg: rgba(251, 146, 60, 0.15);
    --yellow: #facc15;
    --yellow-bg: rgba(250, 204, 21, 0.15);
    --purple: #a78bfa;
    --purple-bg: rgba(167, 139, 250, 0.15);
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.5);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.5);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { 
    background: var(--bg); 
    color: var(--text); 
    font-family: 'Inter', sans-serif; 
    font-size: 14px; 
    min-height: 100vh; 
    line-height: 1.5; 
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* LAYOUT */
.app { display: flex; min-height: 100vh; width: 100%; }
.sidebar { 
    width: 260px; 
    background: var(--sidebar-bg); 
    color: var(--sidebar-text);
    border-right: 1px solid var(--sidebar-border); 
    display: flex; 
    flex-direction: column; 
    position: fixed; 
    height: 100vh; 
    z-index: 100; 
    overflow-y: auto; 
    box-shadow: 4px 0 24px rgba(0,0,0,0.1);
}

.sidebar-logo { padding: 24px; border-bottom: 1px solid var(--sidebar-border); display: flex; align-items: center; justify-content: space-between; }
.sidebar-logo .mark { font-size: 20px; font-weight: 800; color: #fff; display: flex; align-items: center; gap: 10px;}
.sidebar-logo .mark img.sidebar-brand-logo { 
    width: 32px; height: 32px; border-radius: 8px; object-fit: contain; 
    background: rgba(255,255,255,0.1); padding: 2px;
    box-shadow: 0 2px 8px rgba(59,130,246,0.3);
}
.sidebar-logo .mark svg { color: var(--accent); }
.sidebar-logo .company { font-size: 11px; color: var(--sidebar-text2); margin-top: 4px; font-weight: 500; text-transform: uppercase; letter-spacing: 1px; }

.sidebar-nav { flex: 1; padding: 20px 12px; display: flex; flex-direction: column; gap: 4px; }
.nav-label { font-size: 11px; color: var(--sidebar-text2); text-transform: uppercase; letter-spacing: 1px; font-weight: 600; padding: 12px 12px 6px; margin-top: 8px; }
.nav-item { 
    display: flex; align-items: center; gap: 12px; padding: 10px 14px; 
    border-radius: var(--radius-sm); cursor: pointer; color: var(--sidebar-text2); 
    font-size: 14px; font-weight: 500; transition: var(--transition); border: none; background: none; width: 100%; text-align: left; 
}
.nav-item:hover { background: var(--sidebar-surface); color: var(--sidebar-text); transform: translateX(2px); }
.nav-item.active { background: var(--primary); color: #fff; font-weight: 600; box-shadow: 0 4px 12px rgba(30, 58, 138, 0.4); }
.nav-item .icon { width: 20px; display: flex; justify-content: center; opacity: 0.8; }
.nav-item.active .icon { opacity: 1; }
.nav-item .badge-dot { 
    margin-left: auto; background: var(--orange); color: #fff; 
    border-radius: 12px; font-size: 11px; font-weight: 700; padding: 2px 8px; 
    box-shadow: 0 2px 4px rgba(234, 88, 12, 0.3);
}

.sidebar-balance { padding: 20px; border-top: 1px solid var(--sidebar-border); background: rgba(0,0,0,0.1); }
.balance-card { 
    background: var(--sidebar-surface); 
    border: 1px solid var(--sidebar-border); 
    border-radius: var(--radius-sm); 
    padding: 16px; 
    position: relative;
    overflow: hidden;
}
.balance-card::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 3px; background: linear-gradient(90deg, var(--accent), var(--purple)); }
.balance-label { font-size: 11px; color: var(--sidebar-text2); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.balance-amount { font-family: 'DM Mono', monospace; font-size: 20px; color: #fff; margin-top: 4px; font-weight: 600; }
.balance-sub { font-size: 12px; color: var(--accent); margin-top: 2px; font-weight: 500;}

/* MAIN AREA */
.main { flex: 1; margin-left: 260px; display: flex; flex-direction: column; width: calc(100% - 260px); }
.topbar { 
    background: var(--surface); border-bottom: 1px solid var(--border); 
    padding: 16px 32px; display: flex; align-items: center; justify-content: space-between; 
    position: sticky; top: 0; z-index: 50; 
    backdrop-filter: blur(8px);
    background: rgba(var(--surface), 0.95);
}
.page-title { font-size: 20px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }
.topbar-actions { display: flex; gap: 12px; align-items: center; }

/* HAMBURGER MENU (MOBILE) */
.hamburger-btn {
    display: none;
    width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border);
    background: var(--surface2); color: var(--text); cursor: pointer;
    font-size: 20px; align-items: center; justify-content: center;
    transition: var(--transition); margin-right: 12px; flex-shrink: 0;
}
.hamburger-btn:hover { background: var(--surface-hover); border-color: var(--border2); }
.sidebar-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    z-index: 99; backdrop-filter: blur(2px); opacity: 0; transition: opacity 0.3s ease;
}
.sidebar-overlay.active { opacity: 1; }

/* BUTTONS */
.btn { 
    padding: 8px 16px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; 
    cursor: pointer; border: none; transition: var(--transition); 
    font-family: inherit; display: inline-flex; align-items: center; gap: 6px; 
    justify-content: center;
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: #1e40af; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-accent { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn-accent:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-ghost { background: var(--surface2); color: var(--text2); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); background: var(--surface-hover); border-color: var(--border2); }
.btn-green { background: var(--green-bg); color: var(--green); border: 1px solid rgba(5, 150, 105, 0.2); }
.btn-green:hover { background: rgba(5, 150, 105, 0.15); border-color: rgba(5, 150, 105, 0.4); }
.btn-danger { background: var(--red-bg); color: var(--red); border: 1px solid rgba(225, 29, 72, 0.2); }
.btn-danger:hover { background: rgba(225, 29, 72, 0.15); border-color: rgba(225, 29, 72, 0.4); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.icon-btn { 
    width: 28px; height: 28px; border-radius: 6px; display: inline-flex; align-items: center; 
    justify-content: center; cursor: pointer; border: none; font-size: 14px; transition: var(--transition); 
    background: var(--surface2); color: var(--text2); border: 1px solid var(--border);
}
.icon-btn:hover { background: var(--surface-hover); color: var(--text); border-color: var(--border2); transform: translateY(-1px);}

.content { padding: 32px; flex: 1; max-width: 1400px; margin: 0 auto; width: 100%; }
.view { display: none; margin-bottom: 40px; animation: fadeIn 0.3s ease; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ALERTS */
.alert-banner { 
    border-radius: var(--radius-sm); padding: 16px; display: flex; align-items: flex-start; gap: 12px; 
    margin-bottom: 24px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-sm); 
}
.alert-banner.warning { background: var(--yellow-bg); border: 1px solid rgba(202, 138, 4, 0.2); color: #854d0e; }
.alert-banner.info { background: var(--primary-light); border: 1px solid rgba(59, 130, 246, 0.2); color: var(--primary); }
[data-theme='dark'] .alert-banner.warning { color: var(--yellow); }
[data-theme='dark'] .alert-banner.info { color: var(--accent); }
.alert-icon { font-size: 20px; }

/* STAT CARDS */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 32px; }
.stat-card { 
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); 
    padding: 20px; position: relative; overflow: hidden; transition: var(--transition); 
    box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border2); }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.stat-card.blue::before { background: var(--primary); }
.stat-card.green::before { background: var(--green); }
.stat-card.orange::before { background: var(--orange); }
.stat-card.purple::before { background: var(--purple); }

.stat-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.stat-icon-wrap { 
    width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; 
}
.stat-card.blue .stat-icon-wrap { background: var(--primary-light); color: var(--primary); }
.stat-card.green .stat-icon-wrap { background: var(--green-bg); color: var(--green); }
.stat-card.orange .stat-icon-wrap { background: var(--orange-bg); color: var(--orange); }
.stat-card.purple .stat-icon-wrap { background: var(--purple-bg); color: var(--purple); }

.stat-label { font-size: 12px; color: var(--text2); font-weight: 600; }
.stat-value { font-family: 'DM Mono', monospace; font-size: 24px; font-weight: 600; color: var(--text); display: flex; align-items: baseline; gap: 4px; }
.stat-sub { font-size: 12px; color: var(--text3); margin-top: 8px; font-weight: 500; }

/* FILTERS BAR */
.filters-bar { 
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); 
    padding: 12px 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; 
    margin-bottom: 16px; box-shadow: var(--shadow-sm);
}
.filter-input { 
    background: var(--bg); border: 1px solid var(--border); border-radius: 6px; 
    color: var(--text); font-family: inherit; font-size: 13px; padding: 8px 12px; outline: none; transition: var(--transition); 
}
.filter-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); }
.filter-input.search { flex: 1; min-width: 200px; }

/* TABLE */
.table-wrap { 
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); 
    overflow: hidden; box-shadow: var(--shadow-sm); margin-bottom: 24px;
}
.table-header { padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); background: var(--surface); }
.table-header h3 { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.table-count { font-size: 12px; color: var(--text3); background: var(--bg); padding: 4px 10px; border-radius: 12px; font-weight: 600; }

.table-summary-bar {
    background: var(--surface2); border-bottom: 1px solid var(--border); padding: 10px 20px;
    display: flex; gap: 24px; font-size: 13px; font-weight: 500;
}
.table-summary-bar .item { display: flex; align-items: center; gap: 6px; }

.table-responsive { max-height: calc(100vh - 250px); overflow-y: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
thead th { 
    padding: 12px 20px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; 
    color: var(--text2); font-weight: 600; background: var(--surface2); border-bottom: 1px solid var(--border); 
    position: sticky; top: 0; z-index: 10; white-space: nowrap; 
}
tbody tr { border-bottom: 1px solid var(--border); transition: var(--transition); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface-hover); }
td { padding: 14px 20px; font-size: 13px; color: var(--text); vertical-align: middle; }

td.date { color: var(--text2); font-weight: 500; white-space: nowrap; }
td.desc { font-weight: 500; max-width: 300px; line-height: 1.4; }
td.desc .sub { font-size: 12px; color: var(--text3); font-weight: 400; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
td.amount { font-family: 'DM Mono', monospace; font-size: 14px; font-weight: 500; text-align: right; white-space: nowrap; }
td.amount.credit { color: var(--green); }
td.amount.debit { color: var(--text); }
td.balance { font-family: 'DM Mono', monospace; font-size: 14px; font-weight: 600; text-align: right; white-space: nowrap; }

/* BADGES */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.3px; }
.badge.credit { background: var(--green-bg); color: var(--green); }
.badge.debit { background: var(--surface2); color: var(--text2); border: 1px solid var(--border); }
.cat-badge { display: inline-flex; padding: 4px 8px; border-radius: 6px; font-size: 11px; font-weight: 500; background: var(--bg); color: var(--text2); border: 1px solid var(--border); }

/* STATUS BADGES */
.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.status-badge.cleared { background: var(--green-bg); color: var(--green); }
.status-badge.pending { background: var(--orange-bg); color: var(--orange); }
.status-badge.rejected { background: var(--red-bg); color: var(--red); }
.status-badge.voided { background: var(--surface2); color: var(--text3); border: 1px solid var(--border); }
.status-badge.na { color: var(--text3); font-weight: 500; font-size: 13px;}

/* PENDING ITEM TYPE BADGES */
.p-type { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: 600; }
.p-type.check_deposit { background: var(--purple-bg); color: var(--purple); }
.p-type.client_deposit { background: var(--green-bg); color: var(--green); }
.p-type.remittance { background: var(--primary-light); color: var(--primary); }

/* PDC STYLES */
.pdc-countdown { font-weight: 700; font-size: 12px; padding: 4px 8px; border-radius: 6px; display: inline-block; white-space: nowrap; }
.pdc-countdown.red { background: var(--red-bg); color: var(--red); }
.pdc-countdown.orange { background: var(--orange-bg); color: var(--orange); }
.pdc-countdown.yellow { background: var(--yellow-bg); color: var(--yellow); }
.pdc-countdown.green { background: var(--green-bg); color: var(--green); }

.pdc-series-badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; background: var(--purple-bg); color: var(--purple); }

.pdc-preview-row { display: grid; grid-template-columns: 30px 80px 100px 1fr; gap: 12px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
.pdc-preview-row:last-child { border-bottom: none; }
.pdc-preview-row.manual { grid-template-columns: 30px 80px 100px 120px; }


.action-btns { display: flex; gap: 6px; justify-content: flex-end; }
.empty-state { padding: 60px 20px; text-align: center; color: var(--text3); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty-state .icon { font-size: 48px; color: var(--border2); }
.empty-state p { font-size: 14px; font-weight: 500; }

/* PAGINATION */
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; background: var(--surface); border-top: 1px solid var(--border); }
.pagination-info { font-size: 13px; color: var(--text2); }
.pagination-controls { display: flex; gap: 4px; }
.page-btn { padding: 6px 12px; border: 1px solid var(--border); background: var(--surface); border-radius: 6px; cursor: pointer; transition: var(--transition); font-size: 13px; font-weight: 500; color: var(--text2); }
.page-btn:hover:not(:disabled) { background: var(--surface-hover); color: var(--text); border-color: var(--border2); }
.page-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.page-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

/* GRID CARDS (PERIODS) */
.history-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; margin-bottom: 30px; }
.period-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; transition: var(--transition); box-shadow: var(--shadow-sm); cursor: pointer; position: relative;}
.period-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--accent); }
.period-card.active { border: 2px solid var(--primary); }
.period-card.active::after { content: 'CURRENT'; position: absolute; top: 16px; right: 16px; font-size: 10px; font-weight: 700; background: var(--primary); color: #fff; padding: 2px 8px; border-radius: 12px; letter-spacing: 1px;}
.period-header { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.period-dates { font-size: 12px; color: var(--text3); margin-bottom: 20px; display: flex; align-items: center; gap: 6px;}

.period-stats { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; background: var(--bg); padding: 16px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.pstat-row { display: flex; justify-content: space-between; align-items: center; }
.pstat-label { font-size: 12px; font-weight: 600; color: var(--text2); }
.pstat-val { font-family: 'DM Mono', monospace; font-size: 14px; font-weight: 600; }
.pstat-val.in { color: var(--green); }
.pstat-val.out { color: var(--text); }
.pstat-val.bal { font-size: 16px; color: var(--primary); }

/* SETTINGS */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.settings-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.settings-section h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.settings-desc { font-size: 13px; color: var(--text2); margin-bottom: 24px; line-height: 1.5; }
.setting-row { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--border); }
.setting-row:last-child { border-bottom: none; padding-bottom: 0; }
.setting-info h4 { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.setting-info p { font-size: 12px; color: var(--text3); }

/* MODALS */
.modal-overlay { 
    position: fixed; inset: 0; background: rgba(15, 23, 42, 0.7); backdrop-filter: blur(4px); 
    z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; 
    opacity: 0; pointer-events: none; transition: opacity 0.2s ease; 
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal { 
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); 
    width: 100%; max-width: 500px; box-shadow: var(--shadow-lg); 
    transform: translateY(20px) scale(0.95); transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    max-height: 90vh; display: flex; flex-direction: column; overflow: hidden;
}
.modal-overlay.active .modal { transform: translateY(0) scale(1); }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; background: var(--surface2); }
.modal-title { font-size: 16px; font-weight: 600; color: var(--text); }
.modal-close { width: 32px; height: 32px; border-radius: 8px; border: none; background: transparent; color: var(--text2); cursor: pointer; font-size: 20px; display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-body { padding: 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 20px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 12px; background: var(--bg); }

/* FORMS */
.form-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 2px;}
.form-label { font-size: 12px; font-weight: 600; color: var(--text); }
.form-input { 
    background: var(--bg); border: 1px solid var(--border2); border-radius: 8px; 
    color: var(--text); font-family: inherit; font-size: 14px; padding: 10px 14px; 
    outline: none; transition: var(--transition); width: 100%; 
}
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); background: var(--surface); }
.form-input::placeholder { color: var(--text3); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-hint { font-size: 12px; color: var(--text3); }

/* TYPE TOGGLES */
.type-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.type-btn { 
    padding: 12px; border-radius: 8px; border: 2px solid var(--border); background: var(--bg); 
    color: var(--text2); font-weight: 600; font-size: 14px; cursor: pointer; transition: var(--transition); 
    text-align: center; font-family: inherit; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.type-btn.active-credit { border-color: var(--green); background: var(--green-bg); color: var(--green); }
.type-btn.active-debit { border-color: var(--text2); background: var(--surface2); color: var(--text); }

/* TABS */
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--bg); border-radius: 8px; border: 1px solid var(--border); width: fit-content; margin-bottom: 24px; }
.tab { padding: 8px 16px; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; border: none; background: transparent; color: var(--text2); transition: var(--transition); }
.tab:hover { color: var(--text); }
.tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* TOASTS */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 12px; }
.toast { 
    padding: 16px 20px; border-radius: 12px; font-size: 14px; font-weight: 500; 
    display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow-lg); 
    animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; 
    max-width: 380px; 
}
.toast.success { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--green); color: var(--text); }
.toast.error { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--red); color: var(--text); }
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; transform: translateY(-10px); } }

.loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 40px; color: var(--text3); font-weight: 500; }
.spinner { width: 20px; height: 20px; border: 2px solid var(--border2); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* UTILS */
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-orange { color: var(--orange); }
.mono { font-family: 'DM Mono', monospace; }

/* ============================================================ */
/* SKELETON LOADING */
/* ============================================================ */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.skeleton {
    background: linear-gradient(90deg, var(--border) 25%, var(--surface-hover) 50%, var(--border) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 6px;
}
.skeleton-text { height: 14px; margin-bottom: 8px; border-radius: 4px; }
.skeleton-text.sm { width: 60%; }
.skeleton-text.md { width: 80%; }
.skeleton-text.lg { width: 100%; }
.skeleton-value { height: 28px; width: 140px; border-radius: 6px; }
.skeleton-row { display: flex; gap: 20px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.skeleton-cell { flex: 1; }
.skeleton-cell .skeleton { height: 16px; }

/* ============================================================ */
/* LOGIN SCREEN ENHANCEMENTS */
/* ============================================================ */
#loginOverlay {
    background: linear-gradient(135deg, rgba(15,23,42,0.92) 0%, rgba(30,58,138,0.88) 50%, rgba(15,23,42,0.92) 100%);
    backdrop-filter: blur(12px);
}
.login-card {
    background: var(--surface);
    padding: 48px 40px 40px;
    border-radius: 16px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.05);
    text-align: center;
    max-width: 420px;
    width: 100%;
    border: 1px solid var(--border);
    animation: loginSlideIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
@keyframes loginSlideIn {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.login-logo {
    width: 64px; height: 64px; border-radius: 16px; object-fit: contain;
    margin: 0 auto 20px; display: block;
    box-shadow: 0 4px 16px rgba(59,130,246,0.3);
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    padding: 8px;
}
.login-title { font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.login-subtitle { color: var(--text3); font-size: 14px; margin-bottom: 28px; }
.login-footer { margin-top: 24px; font-size: 11px; color: var(--text3); letter-spacing: 0.5px; text-transform: uppercase; }

/* ============================================================ */
/* KEYBOARD SHORTCUTS MODAL */
/* ============================================================ */
.shortcut-list { list-style: none; padding: 0; }
.shortcut-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 0; border-bottom: 1px solid var(--border);
}
.shortcut-item:last-child { border-bottom: none; }
.shortcut-desc { font-size: 14px; color: var(--text2); font-weight: 500; }
.shortcut-key {
    display: inline-flex; align-items: center; gap: 4px;
}
.shortcut-key kbd {
    background: var(--bg); border: 1px solid var(--border2); border-radius: 6px;
    padding: 4px 10px; font-family: 'DM Mono', monospace; font-size: 12px;
    font-weight: 600; color: var(--text); box-shadow: 0 2px 0 var(--border);
    min-width: 28px; text-align: center;
}

/* ============================================================ */
/* RESPONSIVE */
/* ============================================================ */
@media (max-width: 1200px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1024px) { 
    .settings-grid { grid-template-columns: 1fr; } 
}
@media (max-width: 768px) { 
    .hamburger-btn { display: inline-flex; }
    .sidebar { transform: translateX(-100%); transition: transform 0.3s ease; } 
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.active { display: block; }
    .main { margin-left: 0; width: 100%; } 
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .topbar { padding: 12px 16px; }
    .content { padding: 20px 16px; }
    .filters-bar { flex-direction: column; }
    .filter-input.search { min-width: auto; width: 100%; }
    .topbar-actions .btn span.btn-label { display: none; }
    .login-card { padding: 32px 24px 28px; margin: 16px; }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .type-toggle { grid-template-columns: 1fr; }
}

/* ============================================================ */
/* PRINT STYLES */
/* ============================================================ */
@media print {
    body { background: #fff !important; color: #000 !important; font-size: 12px; }
    .sidebar, .topbar, .toast-container, #loginOverlay, .hamburger-btn,
    .modal-overlay, .btn, .icon-btn, .action-btns, .filters-bar,
    .sidebar-overlay, .pagination { display: none !important; }
    .main { margin-left: 0 !important; width: 100% !important; }
    .content { padding: 0 !important; max-width: 100% !important; }
    .app { display: block !important; }
    .view { display: block !important; animation: none !important; }
    .view:not(.active) { display: none !important; }
    .stats-grid { grid-template-columns: repeat(4, 1fr) !important; gap: 8px !important; break-inside: avoid; }
    .stat-card { box-shadow: none !important; border: 1px solid #ccc !important; transform: none !important; padding: 12px !important; }
    .stat-card::before { display: none !important; }
    .table-wrap { box-shadow: none !important; border: 1px solid #ccc !important; }
    table { font-size: 11px; }
    thead th { background: #f0f0f0 !important; color: #333 !important; }
    td { padding: 8px 12px !important; }
    .table-responsive { max-height: none !important; overflow: visible !important; }
    a { color: #000 !important; text-decoration: none !important; }
    
    /* Print header */
    .print-header { 
        display: flex !important; align-items: center; gap: 12px;
        padding: 16px 0; border-bottom: 2px solid #333; margin-bottom: 16px;
    }
    .print-header img { width: 40px; height: 40px; }
    .print-header h1 { font-size: 18px; }
    .print-header .print-date { font-size: 11px; color: #666; margin-left: auto; }
}

/* Print header hidden on screen */
.print-header { display: none; }
