/* Petty Cash v2 — Clean Modern UI */

:root {
    --sidebar-width: 250px;
    --sidebar-bg: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-active: #38bdf8;
    --topbar-height: 60px;
    --brand-primary: #3b82f6;
    --brand-success: #10b981;
    --brand-danger: #ef4444;
    --brand-warning: #f59e0b;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #f1f5f9;
    color: #334155;
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    z-index: 1000;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand i { font-size: 1.5rem; color: var(--sidebar-active); }
.sidebar-brand small { font-size: 0.65rem; opacity: 0.5; vertical-align: super; }

.sidebar-nav {
    list-style: none;
    padding: 10px 0;
    margin: 0;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-nav li a:hover {
    background: rgba(255,255,255,0.05);
    color: #e2e8f0;
}

.sidebar-nav li a.active {
    color: var(--sidebar-active);
    background: rgba(56,189,248,0.08);
    border-left-color: var(--sidebar-active);
}

.sidebar-nav li a i { font-size: 1.1rem; width: 22px; text-align: center; }

.sidebar-divider {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 10px 0;
}

.sidebar-heading {
    padding: 8px 20px 4px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.3);
}

/* Main content */
#main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.topbar {
    display: flex;
    align-items: center;
    height: var(--topbar-height);
    padding: 0 24px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.content-wrapper {
    padding: 24px;
}

/* FY Selector */
.fy-selector select {
    min-width: 140px;
    font-weight: 600;
}

/* Cards */
.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px 24px;
    border: 1px solid #e2e8f0;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 8px 0 2px;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Utilisation bar */
.utilisation-bar {
    height: 10px;
    border-radius: 5px;
    background: #e2e8f0;
    overflow: hidden;
}

.utilisation-bar .fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.6s ease;
}

.utilisation-bar .fill.low { background: var(--brand-success); }
.utilisation-bar .fill.medium { background: var(--brand-warning); }
.utilisation-bar .fill.high { background: var(--brand-danger); }

/* Table styling */
.table-ledger {
    font-size: 0.88rem;
}

.table-ledger th {
    background: #f8fafc;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: #64748b;
    border-bottom: 2px solid #e2e8f0;
}

.table-ledger td {
    vertical-align: middle;
}

.table-ledger .text-credit { color: var(--brand-success); font-weight: 600; }
.table-ledger .text-expense { color: var(--brand-danger); font-weight: 600; }
.table-ledger .text-balance { color: var(--brand-primary); font-weight: 700; }

.badge-credit { background: #d1fae5; color: #065f46; }
.badge-expense { background: #fee2e2; color: #991b1b; }

/* Forms */
.form-card {
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    border: 1px solid #e2e8f0;
    max-width: 700px;
}

.form-card .form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #475569;
}

/* Login */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.login-card h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.login-card .subtitle {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 32px;
}

/* Page header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

/* Report cards */
.report-section {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 24px;
    margin-bottom: 24px;
}

.report-section h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: #1e293b;
}

/* Responsive */
@media (max-width: 767.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    #main-content {
        margin-left: 0;
    }
    .content-wrapper {
        padding: 16px;
    }
    .stat-card .stat-value {
        font-size: 1.2rem;
    }
}

/* Print styles */
@media print {
    .sidebar, .topbar, .sidebar-toggle, .no-print { display: none !important; }
    #main-content { margin-left: 0; }
    .content-wrapper { padding: 0; }
}
