/* Ledger Reclaim Admin — Linear-inspired Dark Theme */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --bg-canvas: #08090a;
    --bg-panel: #0f1011;
    --bg-elevated: #191a1b;
    --bg-surface: #1e1f21;
    --bg-hover: #28282c;
    --text-primary: #f7f8f8;
    --text-secondary: #d0d6e0;
    --text-tertiary: #8a8f98;
    --text-quaternary: #62666d;
    --accent: #5e6ad2;
    --accent-hover: #7170ff;
    --accent-light: #828fff;
    --success: #27a644;
    --warning: #e8c468;
    --danger: #e5484d;
    --info: #4cb8d9;
    --border-subtle: rgba(255,255,255,0.05);
    --border-standard: rgba(255,255,255,0.08);
    --border-strong: rgba(255,255,255,0.12);
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --radius-full: 9999px;
    --sidebar-w: 240px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-feature-settings: 'cv01', 'ss03';
    background: var(--bg-canvas);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.app { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-panel);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 24px 20px 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.sidebar-header h1 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-header h1::before {
    content: '';
    width: 18px;
    height: 18px;
    background: var(--accent);
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.sidebar-sub {
    font-size: 11px;
    color: var(--text-quaternary);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    margin-top: 4px;
    margin-left: 26px;
}

.nav { flex: 1; padding: 12px 8px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: var(--text-tertiary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-md);
    margin-bottom: 2px;
    transition: all 0.12s;
    cursor: pointer;
    position: relative;
}

.nav-item:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.04);
}

.nav-item.active {
    color: var(--text-primary);
    background: rgba(94,106,210,0.12);
}

.nav-item.active::before {
    content: '';
    width: 3px;
    height: 14px;
    background: var(--accent-hover);
    border-radius: var(--radius-full);
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

.sidebar-footer { padding: 16px 20px; border-top: 1px solid var(--border-subtle); font-size: 12px; }
.sidebar-footer p { margin: 2px 0; color: var(--text-secondary); }
.muted { color: var(--text-tertiary); font-size: 11px; }
.main { flex: 1; margin-left: var(--sidebar-w); padding: 32px; min-width: 0; }
.view { display: none; }
.view.active { display: block; animation: fadeIn 0.15s ease; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.page-header h2 { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; color: var(--text-primary); }
.date { font-size: 13px; color: var(--text-tertiary); font-weight: 400; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 28px; }
.stat-card { background: var(--bg-elevated); border: 1px solid var(--border-standard); border-radius: var(--radius-lg); padding: 18px 20px; transition: border-color 0.15s; }
.stat-card:hover { border-color: var(--border-strong); }
.stat-label { display: block; font-size: 11px; color: var(--text-tertiary); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 500; }
.stat-value { display: block; font-size: 24px; font-weight: 600; color: var(--text-primary); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.card { background: var(--bg-elevated); border: 1px solid var(--border-standard); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 16px; }
.card h3 { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 16px; letter-spacing: -0.01em; }
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.table-wrap { background: var(--bg-elevated); border: 1px solid var(--border-standard); border-radius: var(--radius-lg); overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table thead { background: rgba(255,255,255,0.02); }
.data-table th { text-align: left; padding: 10px 14px; font-weight: 500; color: var(--text-tertiary); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--border-standard); white-space: nowrap; }
.data-table td { padding: 10px 14px; border-bottom: 1px solid var(--border-subtle); color: var(--text-secondary); vertical-align: middle; }
.data-table tbody tr { transition: background 0.1s; }
.data-table tbody tr:hover { background: rgba(255,255,255,0.025); }
.data-table tbody tr:last-child td { border-bottom: none; }
.badge-status { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: var(--radius-full); font-size: 11px; font-weight: 500; white-space: nowrap; border: 1px solid transparent; }
.badge-filed { background: rgba(76,184,217,0.12); color: #4cb8d9; border-color: rgba(76,184,217,0.2); }
.badge-review { background: rgba(232,196,104,0.12); color: #e8c468; border-color: rgba(232,196,104,0.2); }
.badge-docs { background: rgba(229,72,77,0.1); color: #e5484d; border-color: rgba(229,72,77,0.2); }
.badge-approved { background: rgba(39,166,68,0.12); color: #27a644; border-color: rgba(39,166,68,0.2); }
.badge-disbursed { background: rgba(16,185,129,0.12); color: #10b981; border-color: rgba(16,185,129,0.2); }
.badge-denied { background: rgba(229,72,77,0.08); color: #e5484d; border-color: rgba(229,72,77,0.15); }
.filters { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.search-input { flex: 1; min-width: 200px; padding: 9px 14px; background: var(--bg-elevated); border: 1px solid var(--border-standard); border-radius: var(--radius-md); color: var(--text-primary); font-size: 13px; font-family: inherit; transition: border-color 0.15s; }
.search-input::placeholder { color: var(--text-quaternary); }
.search-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(94,106,210,0.12); }
.filter-select { padding: 9px 14px; background: var(--bg-elevated); border: 1px solid var(--border-standard); border-radius: var(--radius-md); color: var(--text-secondary); font-size: 13px; font-family: inherit; cursor: pointer; transition: border-color 0.15s; }
.filter-select:hover { border-color: var(--border-strong); }
.filter-select:focus { outline: none; border-color: var(--accent); }
.btn { padding: 8px 16px; border: 1px solid var(--border-standard); border-radius: var(--radius-md); cursor: pointer; font-size: 13px; font-weight: 500; font-family: inherit; background: rgba(255,255,255,0.03); color: var(--text-secondary); transition: all 0.12s; }
.btn:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-danger { background: rgba(229,72,77,0.1); border-color: rgba(229,72,77,0.3); color: var(--danger); }
.btn-danger:hover { background: rgba(229,72,77,0.2); color: var(--danger); }
.pagination { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 16px; }
.clients-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.client-card { background: var(--bg-elevated); border: 1px solid var(--border-standard); border-radius: var(--radius-lg); padding: 18px; cursor: pointer; transition: all 0.15s; }
.client-card:hover { border-color: var(--border-strong); background: var(--bg-surface); transform: translateY(-1px); }
.client-card h3 { color: var(--text-primary); margin-bottom: 6px; font-size: 14px; font-weight: 600; }
.client-info { font-size: 12px; color: var(--text-tertiary); margin: 3px 0; }
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 100; overflow-y: auto; backdrop-filter: blur(4px); }
.modal.active { display: flex; }
.modal-content { background: var(--bg-elevated); border: 1px solid var(--border-standard); border-radius: var(--radius-xl); max-width: 680px; margin: auto; width: 90%; max-height: 88vh; overflow-y: auto; box-shadow: 0 24px 80px rgba(0,0,0,0.5); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--border-subtle); }
.modal-header h3 { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-tertiary); padding: 4px 8px; border-radius: var(--radius-sm); transition: all 0.12s; }
.modal-close:hover { color: var(--text-primary); background: rgba(255,255,255,0.06); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border-subtle); display: flex; justify-content: flex-end; gap: 10px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { margin-bottom: 14px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 12px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.03em; }
.form-group input, .form-group textarea, .form-group select { width: 100%; padding: 9px 12px; background: var(--bg-canvas); border: 1px solid var(--border-standard); border-radius: var(--radius-md); color: var(--text-primary); font-size: 13px; font-family: inherit; transition: border-color 0.15s; }
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--text-quaternary); }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(94,106,210,0.12); }
.form-group select option { background: var(--bg-elevated); color: var(--text-primary); }
.calc-card { max-width: 480px; margin: 0 auto 16px; }
.calc-result { margin-top: 20px; padding: 20px; background: var(--bg-canvas); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); }
.calc-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border-subtle); }
.calc-row:last-child { border: none; }
.calc-label { color: var(--text-tertiary); font-size: 13px; }
.calc-value { font-weight: 600; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.compliance-status p { margin: 6px 0; font-size: 13px; color: var(--text-secondary); }
.compliance-status strong { color: var(--text-primary); font-weight: 600; }
.compliance-rules { padding-left: 18px; list-style: none; }
.compliance-rules li { margin: 8px 0; font-size: 13px; color: var(--text-tertiary); padding-left: 8px; position: relative; }
.compliance-rules li::before { content: '\2192'; color: var(--accent-hover); position: absolute; left: -18px; }
.compliance-check { padding: 8px 0; border-bottom: 1px solid var(--border-subtle); }
.compliance-check:last-child { border: none; }
.compliance-check label { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-secondary); cursor: pointer; }
.compliance-check input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
.status-bar { display: flex; align-items: center; gap: 12px; margin: 10px 0; font-size: 12px; }
.status-bar-label { min-width: 100px; color: var(--text-tertiary); font-weight: 500; }
.status-bar-track { flex: 1; height: 6px; background: var(--bg-canvas); border-radius: var(--radius-full); overflow: hidden; }
.status-bar-fill { height: 100%; border-radius: var(--radius-full); transition: width 0.3s ease; }
.status-bar-count { min-width: 30px; text-align: right; font-weight: 600; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.recent-item { padding: 10px 0; border-bottom: 1px solid var(--border-subtle); font-size: 13px; display: flex; justify-content: space-between; align-items: center; color: var(--text-secondary); }
.recent-item:last-child { border: none; }
.recent-item strong { color: var(--text-primary); font-weight: 600; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }
@media (max-width: 768px) {
    .sidebar { width: 100%; height: auto; position: relative; border-right: none; border-bottom: 1px solid var(--border-subtle); }
    .app { flex-direction: column; }
    .main { margin-left: 0; padding: 20px; }
    .form-grid { grid-template-columns: 1fr; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}


/* ─── Login Screen ─────────────────────────── */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-canvas);
}

.login-screen.hidden { display: none; }

.login-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-standard);
    border-radius: var(--radius-xl);
    padding: 40px;
    width: 360px;
    max-width: 90vw;
    box-shadow: 0 24px 80px rgba(0,0,0,0.4);
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo {
    width: 40px;
    height: 40px;
    background: var(--accent);
    border-radius: var(--radius-lg);
    margin: 0 auto 16px;
}

.login-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.login-sub {
    font-size: 12px;
    color: var(--text-quaternary);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.login-input {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-canvas);
    border: 1px solid var(--border-standard);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s;
    margin-bottom: 12px;
}

.login-input::placeholder { color: var(--text-quaternary); }
.login-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(94,106,210,0.12);
}

.btn-login {
    width: 100%;
    padding: 11px;
    font-size: 14px;
    margin-top: 4px;
}

.login-error {
    color: var(--danger);
    font-size: 12px;
    margin-top: 12px;
    text-align: center;
    min-height: 16px;
}

.login-hint {
    color: var(--text-tertiary);
    font-size: 12px;
    margin-bottom: 16px;
    text-align: center;
}

.app.hidden { display: none; }

/* Logout button in sidebar */
.logout-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: var(--text-tertiary);
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.12s;
    margin: 8px;
    border: 1px solid var(--border-subtle);
}

.logout-btn:hover {
    color: var(--danger);
    border-color: rgba(229,72,77,0.2);
    background: rgba(229,72,77,0.06);
}
