/* assets/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&family=Syne:wght@600;700;800&display=swap');

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #eff6ff;
    --success: #059669;
    --danger: #dc2626;
    --warning: #d97706;
    --info: #0891b2;
    --sidebar-w: 260px;
    --navbar-h: 60px;
    --bg: #f1f5f9;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text: #1e293b;
    --muted: #64748b;
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -1px rgba(0,0,0,.05);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 14px; color: var(--text); background: var(--bg); }

/* === LOGIN PAGE === */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 50%, #1d4ed8 100%); }
.login-wrapper { width: 100%; max-width: 420px; padding: 20px; }
.login-card { background: white; border-radius: 20px; padding: 40px; box-shadow: 0 25px 50px rgba(0,0,0,.25); }
.login-logo { text-align: center; margin-bottom: 32px; }
.logo-icon { width: 70px; height: 70px; background: linear-gradient(135deg, #2563eb, #1d4ed8); border-radius: 20px;
    display: inline-flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.logo-icon i { font-size: 32px; color: white; }
.login-logo h1 { font-family: 'Syne', sans-serif; font-size: 28px; font-weight: 800; color: var(--text); }
.login-logo p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.btn-login { background: linear-gradient(135deg, #2563eb, #1d4ed8); border: none; padding: 13px; font-size: 15px;
    font-weight: 600; border-radius: 12px; transition: all .2s; }
.btn-login:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(37,99,235,.4); }
.form-floating .form-control { border-radius: 12px; border: 2px solid var(--border); font-size: 14px; }
.form-floating .form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37,99,235,.1); }
.login-hint { text-align: center; }

/* === TOP NAVBAR === */
.top-navbar { position: fixed; top: 0; left: 0; right: 0; height: var(--navbar-h); background: white;
    border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 20px;
    z-index: 1000; box-shadow: var(--shadow); gap: 16px; }
.sidebar-toggle { background: none; border: none; width: 36px; height: 36px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--muted);
    transition: all .15s; }
.sidebar-toggle:hover { background: var(--bg); color: var(--text); }
.navbar-brand { display: flex; align-items: center; gap: 10px; font-family: 'Syne', sans-serif;
    font-size: 20px; font-weight: 800; color: var(--primary); text-decoration: none; }
.navbar-brand i { background: var(--primary); color: white; width: 34px; height: 34px; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center; font-size: 16px; }
.navbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.notification-btn { position: relative; width: 38px; height: 38px; border-radius: 10px; background: var(--bg);
    display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--muted); transition: .15s; }
.notification-btn:hover { background: var(--primary-light); color: var(--primary); }
.notif-badge { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; background: var(--danger); border-radius: 50%; }
.user-menu { display: flex; align-items: center; gap: 8px; }
.user-avatar { width: 36px; height: 36px; background: linear-gradient(135deg, #2563eb, #7c3aed); border-radius: 10px;
    display: flex; align-items: center; justify-content: center; color: white; font-weight: 700; font-size: 14px; }
.user-info { display: none; }
@media(min-width:768px) { .user-info { display: block; } }
.user-name { font-weight: 600; font-size: 13px; line-height: 1.2; }
.user-role { font-size: 11px; color: var(--muted); }
.btn-logout { width: 34px; height: 34px; border-radius: 8px; background: none; border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center; color: var(--muted); text-decoration: none; transition: .15s; }
.btn-logout:hover { background: #fee2e2; border-color: #fecaca; color: var(--danger); }

/* === LAYOUT === */
.main-wrapper { display: flex; margin-top: var(--navbar-h); min-height: calc(100vh - var(--navbar-h)); }
.content-area { flex: 1; padding: 24px; overflow-x: hidden; min-width: 0; }

/* === SIDEBAR === */
.sidebar { width: var(--sidebar-w); background: white; border-right: 1px solid var(--border);
    padding: 16px 12px; overflow-y: auto; position: sticky; top: var(--navbar-h); height: calc(100vh - var(--navbar-h));
    flex-shrink: 0; transition: transform .25s; }
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-section { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
    color: var(--muted); padding: 16px 12px 6px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px;
    color: var(--muted); text-decoration: none; font-weight: 500; font-size: 13.5px; transition: all .15s; }
.nav-item i { width: 18px; text-align: center; font-size: 15px; }
.nav-item:hover { background: var(--bg); color: var(--text); }
.nav-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }

/* === PAGE HEADER === */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }
.page-title { font-family: 'Syne', sans-serif; font-size: 22px; font-weight: 700; }
.page-subtitle { color: var(--muted); font-size: 13px; margin-top: 2px; }
.badge-role { background: var(--primary-light); color: var(--primary); padding: 6px 14px; border-radius: 20px;
    font-size: 12px; font-weight: 600; text-transform: capitalize; }

/* === STATS GRID === */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 8px; }
.stat-card { background: white; border-radius: 16px; padding: 20px; display: flex; align-items: center;
    gap: 14px; box-shadow: var(--shadow); border: 1px solid var(--border); transition: .2s; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
    font-size: 20px; flex-shrink: 0; }
.stat-value { font-family: 'Syne', sans-serif; font-size: 20px; font-weight: 700; line-height: 1.2; }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 2px; }

.stat-blue   .stat-icon { background: #dbeafe; color: #2563eb; }
.stat-green  .stat-icon { background: #d1fae5; color: #059669; }
.stat-purple .stat-icon { background: #ede9fe; color: #7c3aed; }
.stat-orange .stat-icon { background: #ffedd5; color: #ea580c; }
.stat-red    .stat-icon { background: #fee2e2; color: #dc2626; }
.stat-teal   .stat-icon { background: #cffafe; color: #0891b2; }
.stat-yellow .stat-icon { background: #fef9c3; color: #ca8a04; }
.stat-indigo .stat-icon { background: #e0e7ff; color: #4f46e5; }

/* === CARD PANEL === */
.card-panel { background: white; border-radius: 16px; border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden; }
.panel-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px;
    border-bottom: 1px solid var(--border); }
.panel-header h3 { font-size: 15px; font-weight: 600; }
.card-panel .table { margin: 0; }
.card-panel .table td, .card-panel .table th { padding: 12px 16px; vertical-align: middle; }
.card-panel .table thead th { background: var(--bg); font-size: 12px; font-weight: 600; text-transform: uppercase;
    letter-spacing: .04em; color: var(--muted); border-bottom: 1px solid var(--border); }

/* === ADVANCE ITEMS === */
.advance-item { display: flex; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--border); gap: 12px; }
.advance-item:last-child { border-bottom: none; }
.advance-info { flex: 1; min-width: 0; }
.advance-name { font-weight: 600; font-size: 13px; }
.advance-obj { font-size: 12px; color: var(--muted); }
.advance-amount { font-weight: 700; color: var(--primary); white-space: nowrap; }
.advance-actions { display: flex; gap: 4px; }

/* === FILTER BAR === */
.filter-bar { background: white; border-radius: 12px; border: 1px solid var(--border); padding: 12px 16px;
    margin-bottom: 16px; box-shadow: var(--shadow); }

/* === BUTTONS === */
.btn { border-radius: 10px; font-weight: 500; font-size: 13.5px; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-xs { padding: 3px 8px; font-size: 12px; border-radius: 6px; }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); }

/* === BADGES === */
.badge { font-weight: 500; padding: 4px 10px; border-radius: 20px; font-size: 11.5px; }

/* === MODAL === */
.modal-content { border-radius: 16px; border: none; box-shadow: 0 20px 60px rgba(0,0,0,.15); }
.modal-header { border-bottom: 1px solid var(--border); padding: 20px 24px; }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); }
.form-control, .form-select { border-radius: 10px; border: 1.5px solid var(--border); font-size: 14px; padding: 9px 12px; }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.form-label { font-weight: 500; font-size: 13px; margin-bottom: 6px; }

/* === INLINE STAT === */
.stat-inline { font-size: 13px; }

/* === ALERTS === */
.alert { border-radius: 12px; border: none; padding: 12px 16px; }

/* === TABLE === */
.table-hover tbody tr:hover { background: var(--bg); }

/* === MOBILE === */
@media(max-width:768px) {
    .sidebar { position: fixed; top: var(--navbar-h); left: 0; bottom: 0; z-index: 999;
        transform: translateX(-100%); box-shadow: var(--shadow-md); }
    .sidebar.open { transform: translateX(0); }
    .content-area { padding: 16px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .stat-card { padding: 14px; }
    .stat-value { font-size: 16px; }
}
