:root {
    --sidebar-w: 250px;
    --brand: #2c5f8a;
    --brand-dark: #1e4463;
    --brand-light: #eaf2f8;
    --success: #1a9e6b;
    --danger: #d64550;
    --bg: #f4f6f9;
    --card-radius: 14px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Hind Siliguri', 'Segoe UI', sans-serif;
    background: var(--bg);
    color: #29323d;
}

/* ---------- Login ---------- */
.login-body {
    background: linear-gradient(135deg, var(--brand-dark), var(--brand));
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-wrapper { width: 100%; max-width: 420px; padding: 20px; }
.login-card {
    background: #fff;
    border-radius: var(--card-radius);
    padding: 36px 32px;
    box-shadow: 0 20px 45px rgba(0,0,0,0.25);
}
.login-logo { font-size: 44px; }
.login-logo-img { height: 56px; max-width: 200px; object-fit: contain; }

/* ---------- Layout ---------- */
.app-wrapper { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    background: var(--brand-dark);
    color: #fff;
    position: fixed;
    top: 0; bottom: 0; left: 0;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: left .25s ease;
}
.sidebar-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 20px 18px;
    font-weight: 700;
    font-size: 17px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}
.logo-icon { font-size: 24px; display: inline-flex; align-items: center; }
.brand-logo-img { height: 28px; max-width: 120px; object-fit: contain; border-radius: 6px; }

/* ---------- Settings page ---------- */
.settings-logo-preview {
    width: 72px; height: 72px;
    border: 1px dashed #c9d2dc;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: #fbfcfd;
    overflow: hidden;
    flex-shrink: 0;
}
.settings-logo-preview img { width: 100%; height: 100%; object-fit: contain; }
.settings-logo-placeholder { font-size: 30px; }
.preview-sidebar-brand {
    display: flex; align-items: center; gap: 10px;
    background: var(--brand-dark);
    color: #fff;
    padding: 16px 18px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 16px;
}
.preview-sidebar-brand img { height: 28px; max-width: 120px; object-fit: contain; border-radius: 6px; }
.sidebar-nav { padding: 14px 10px; flex-shrink: 0; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 10px;
    color: rgba(255,255,255,0.82);
    padding: 10px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14.5px;
    margin-bottom: 3px;
    transition: .15s;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
    background: rgba(255,255,255,0.12);
    color: #fff;
}
.sidebar-nav a.active { background: var(--brand); font-weight: 600; }
.sidebar-nav a i { width: 18px; text-align: center; }

.sidebar-projects {
    padding: 10px 10px 20px;
    border-top: 1px solid rgba(255,255,255,0.12);
    margin-top: 6px;
    overflow-y: auto;
}
.sidebar-projects-title {
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: rgba(255,255,255,0.5);
    padding: 10px 14px 4px;
}
.mini-link {
    display: flex; align-items: center; gap: 8px;
    color: rgba(255,255,255,0.75);
    padding: 7px 14px;
    font-size: 13.5px;
    text-decoration: none;
    border-radius: 6px;
}
.mini-link:hover { background: rgba(255,255,255,0.1); color: #fff; }

.main-area {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    height: 62px;
    background: #fff;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 22px;
    border-bottom: 1px solid #e6e9ee;
    position: sticky;
    top: 0;
    z-index: 900;
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.page-title { font-weight: 700; color: var(--brand-dark); }
.user-chip { font-size: 14px; color: #5a6472; }
.btn-icon { background: none; border: none; font-size: 22px; color: var(--brand-dark); }

.content { padding: 24px; flex: 1; }

.app-footer {
    text-align: center;
    padding: 14px;
    font-size: 12.5px;
    color: #8b94a0;
    border-top: 1px solid #e6e9ee;
    background: #fff;
}

/* ---------- Cards ---------- */
.stat-card {
    border-radius: var(--card-radius);
    padding: 20px 22px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(20,30,50,0.06);
    height: 100%;
}
.stat-card .stat-label { font-size: 13.5px; color: #6b7480; margin-bottom: 6px; }
.stat-card .stat-value { font-size: 26px; font-weight: 700; }
.stat-card .stat-icon {
    width: 46px; height: 46px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; margin-bottom: 10px;
}
.bg-income { background: #e6f7f0; color: var(--success); }
.bg-expense { background: #fdeceb; color: var(--danger); }
.bg-balance { background: var(--brand-light); color: var(--brand); }
.bg-due { background: #fff4e0; color: #c98a15; }

.card-panel {
    background: #fff;
    border-radius: var(--card-radius);
    box-shadow: 0 2px 10px rgba(20,30,50,0.06);
    padding: 20px;
}
.card-panel-title {
    font-weight: 700;
    color: var(--brand-dark);
    margin-bottom: 16px;
    font-size: 16px;
}

.project-chip {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    background: var(--brand-light);
    color: var(--brand);
    font-size: 12.5px;
    font-weight: 600;
}

.table thead th {
    background: #f6f8fb;
    font-size: 13px;
    color: #5a6472;
    font-weight: 600;
    border-bottom: none;
}
.table td { font-size: 14px; vertical-align: middle; }

.badge-status-running { background:#e6f7f0; color:#1a9e6b; }
.badge-status-completed { background:#eaf2f8; color:#2c5f8a; }
.badge-status-hold { background:#fdf1e6; color:#c9781c; }

@media (max-width: 991.98px) {
    .sidebar { left: -260px; }
    .sidebar.show { left: 0; }
    .main-area { margin-left: 0; }
}
