/* Finance Management System - Main Stylesheet */
:root {
    --primary-color: #0d6efd;
    --sidebar-bg: #1e2a38;
    --accent: #ffc107;
    --text-color: #212529;
    --sidebar-width: 240px;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: #f4f6f9; color: var(--text-color); }

.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: #d0d6df;
    flex-shrink: 0;
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar-header { padding: 18px 16px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.sidebar-header h5 { color: #fff; }
.sidebar-menu { list-style: none; padding: 0; margin: 0; }
.sidebar-menu li.menu-header {
    padding: 14px 16px 6px; font-size: 11px; text-transform: uppercase;
    letter-spacing: .5px; color: #8893a4; font-weight: 600;
}
.sidebar-menu li a {
    display: block; padding: 9px 16px; color: #c9d0db; text-decoration: none;
    font-size: 14px; border-left: 3px solid transparent; transition: all .15s;
}
.sidebar-menu li a:hover {
    background: rgba(255,255,255,0.06); color: #fff;
    border-left-color: var(--primary-color);
}
.sidebar-menu li a i { width: 20px; text-align: center; margin-right: 8px; }

.main-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { padding: .5rem 1rem; min-height: 56px; }
.content-wrapper { padding: 20px; flex: 1; }

.btn-primary, .btn-primary:focus, .btn-primary:active {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}
.btn-primary:hover { filter: brightness(0.92); }

a { color: var(--primary-color); }

.card { border: none; box-shadow: 0 1px 3px rgba(0,0,0,0.06); border-radius: 6px; margin-bottom: 1rem; }
.card-header { background: #fff; border-bottom: 1px solid #eef0f4; font-weight: 600; }

.kpi-card { padding: 18px; border-radius: 8px; color: #fff; }
.kpi-card .kpi-label { font-size: 12px; opacity: 0.85; text-transform: uppercase; letter-spacing: .5px; }
.kpi-card .kpi-value { font-size: 22px; font-weight: 700; margin-top: 6px; }
.kpi-card .kpi-icon { float: right; font-size: 36px; opacity: 0.35; }
.kpi-blue { background: linear-gradient(135deg,#1e6fff,#0d4ec9); }
.kpi-green { background: linear-gradient(135deg,#22a06b,#178050); }
.kpi-orange { background: linear-gradient(135deg,#ff8a3d,#e65f10); }
.kpi-red { background: linear-gradient(135deg,#ff5e6c,#cc1c2c); }
.kpi-purple { background: linear-gradient(135deg,#8b3dff,#5e1ec9); }

table.table th { background: #f4f6f9; font-weight: 600; font-size: 13px; }
table.table td, table.table th { vertical-align: middle; }
.table-hover tbody tr:hover { background: #f8fafd; }

.form-control:focus, .custom-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 .2rem rgba(13,110,253,0.18);
}

.badge { padding: 5px 9px; font-weight: 500; font-size: 11px; }

.page-title { font-size: 20px; font-weight: 600; margin-bottom: 16px; }

.required:after { content: " *"; color: #dc3545; }

/* Login page */
.login-page { background: linear-gradient(135deg, var(--primary-color), var(--sidebar-bg)); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { background: #fff; padding: 36px; border-radius: 10px; box-shadow: 0 12px 30px rgba(0,0,0,0.2); width: 360px; }
.login-card h3 { margin-bottom: 6px; }
.login-card .subtitle { color: #6c757d; margin-bottom: 22px; font-size: 13px; }

/* Print */
@media print {
    .sidebar, .topbar, .no-print, .btn { display: none !important; }
    .main-content { width: 100%; }
    .content-wrapper { padding: 0; }
    body { background: #fff; }
    .card { box-shadow: none; border: 1px solid #ddd; }
}

@media (max-width: 768px) {
    .sidebar { position: fixed; left: -240px; transition: left .2s; z-index: 1040; }
    .sidebar.open { left: 0; }
}

.text-right-num { text-align: right; font-variant-numeric: tabular-nums; }

.notif-row.overdue { background: #fdecea; }
.notif-row.due-soon { background: #fff8e1; }

.approval-card { border-left: 4px solid var(--accent); padding: 12px 16px; margin-bottom: 10px; background: #fff; border-radius: 4px; }

.report-header { text-align: center; padding: 14px 0 18px; border-bottom: 2px solid var(--primary-color); margin-bottom: 16px; }
.report-header h3 { margin: 0; }
.report-header .subtitle { color: #6c757d; font-size: 13px; }

/* Money Input Format */
input.money-input { text-align: right; font-variant-numeric: tabular-nums; }
input.money-input:focus { text-align: left; }
