/* ============================================
   CEMS - Company Expense Management System
   Premium Modern Dashboard Theme
   ============================================ */

:root {
    /* Colors */
    --primary: #2563EB;
    --primary-light: #3B82F6;
    --primary-dark: #1D4ED8;
    --secondary: #4F46E5;
    --success: #16A34A;
    --warning: #F59E0B;
    --danger: #DC2626;
    --info: #0EA5E9;
    --purple: #9333EA;
    --pink: #EC4899;

    /* Neutrals */
    --bg: #F8FAFC;
    --bg-soft: #F1F5F9;
    --surface: #FFFFFF;
    --border: #E2E8F0;
    --border-light: #F1F5F9;
    --text: #0F172A;
    --text-muted: #64748B;
    --text-light: #94A3B8;

    /* Effects */
    --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.07), 0 4px 6px -2px rgba(0,0,0,0.03);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08);

    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;

    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);

    --sidebar-w: 260px;
    --header-h: 64px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ============================================
   LAYOUT
   ============================================ */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    position: relative;
}

.app-sidebar {
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    height: 100vh;
    position: fixed;
    top: 0; left: 0;
    overflow-y: auto;
    z-index: 1040;
    transition: transform var(--transition);
    display: flex; flex-direction: column;
}

.app-main {
    flex: 1;
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-navbar {
    height: var(--header-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 1030;
    backdrop-filter: blur(10px);
    background: rgba(255,255,255,0.9);
}

.app-content {
    padding: 24px;
    flex: 1;
    animation: fadeIn 0.4s ease;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand {
    display: flex; align-items: center; gap: 12px;
    text-decoration: none; color: var(--text);
}
.brand-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 18px;
    box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}
.brand-text h1 {
    font-size: 18px; font-weight: 700; margin: 0; letter-spacing: -0.5px;
}
.brand-text small {
    font-size: 11px; color: var(--text-muted);
    display: block; margin-top: -2px;
}

.sidebar-nav {
    padding: 12px;
    flex: 1;
    overflow-y: auto;
}
.nav-section { margin-bottom: 20px; }
.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-light);
    padding: 8px 12px;
    display: block;
}
.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition);
    margin-bottom: 2px;
    position: relative;
}
.nav-item i { width: 20px; text-align: center; font-size: 15px; }
.nav-item:hover {
    background: var(--bg-soft);
    color: var(--text);
    transform: translateX(2px);
}
.nav-item.active {
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    color: white;
    box-shadow: 0 4px 10px rgba(37,99,235,0.3);
}
.nav-item-logout { color: var(--danger); }
.nav-item-logout:hover { background: rgba(220,38,38,0.08); color: var(--danger); }

/* ============================================
   NAVBAR
   ============================================ */
.navbar-toggle, .sidebar-toggle {
    background: none; border: none; font-size: 18px;
    color: var(--text); padding: 8px; border-radius: 8px;
    cursor: pointer;
}
.navbar-toggle:hover { background: var(--bg-soft); }

.navbar-search {
    flex: 1; max-width: 480px; position: relative;
}
.navbar-search i {
    position: absolute; left: 14px; top: 50%;
    transform: translateY(-50%); color: var(--text-light);
}
.navbar-search input {
    width: 100%;
    height: 40px;
    padding: 0 14px 0 40px;
    background: var(--bg-soft);
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 14px;
    color: var(--text);
    transition: all 0.2s;
    outline: none;
}

.navbar-search input:focus {
    background: white;
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.search-results {
    position: absolute; top: 100%; left: 0; right: 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    margin-top: 4px;
    max-height: 400px; overflow-y: auto;
    z-index: 100; display: none;
}

.navbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.navbar-action, .navbar-user {
    background: none; border: none; padding: 8px;
    border-radius: 8px; cursor: pointer; position: relative;
    color: var(--text-muted); font-size: 16px;
    transition: all var(--transition);
}
.navbar-action:hover, .navbar-user:hover { background: var(--bg-soft); color: var(--text); }
.badge-dot {
    position: absolute; top: 4px; right: 4px;
    background: var(--danger); color: white;
    font-size: 10px; font-weight: 700;
    min-width: 16px; height: 16px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}

.navbar-user {
    display: flex; align-items: center; gap: 10px;
    padding: 4px 12px 4px 4px;
}
.user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white; font-weight: 600;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-name { font-weight: 600; font-size: 13px; line-height: 1.2; }
.user-role { font-size: 11px; color: var(--text-muted); }

.navbar-alert {
    position: relative; padding: 8px;
    color: var(--warning); font-size: 16px;
}
.alert-pulse {
    position: absolute; top: 4px; right: 4px;
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--warning);
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(245,158,11,0.7); }
    70% { box-shadow: 0 0 0 8px rgba(245,158,11,0); }
    100% { box-shadow: 0 0 0 0 rgba(245,158,11,0); }
}

/* Notification Dropdown */
.notification-dropdown { width: 360px; padding: 0; }
.dropdown-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.dropdown-header h6 { margin: 0; font-weight: 600; }
.notification-list { max-height: 400px; overflow-y: auto; }
.notification-item {
    display: flex; gap: 12px; padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    text-decoration: none; color: var(--text);
    transition: background var(--transition);
}
.notification-item:hover { background: var(--bg-soft); }
.notification-item.unread { background: rgba(37,99,235,0.04); }
.notification-icon {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.notification-content { flex: 1; min-width: 0; }
.notification-title { font-weight: 600; font-size: 13px; }
.notification-text { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.notification-time { font-size: 11px; color: var(--text-light); margin-top: 4px; }

/* ============================================
   PAGE HEADER
   ============================================ */
.page-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 24px; gap: 16px; flex-wrap: wrap;
}
.page-title {
    font-size: 24px; font-weight: 700; margin: 0; letter-spacing: -0.5px;
}
.page-subtitle { color: var(--text-muted); margin: 4px 0 0 0; font-size: 14px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
    background: transparent;
}
.card-title { margin: 0; font-size: 15px; font-weight: 600; }
.card-body { padding: 20px; }
.card-actions { display: flex; gap: 6px; }

.glass-card {
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.5);
    box-shadow: 0 8px 32px rgba(0,0,0,0.04);
}

/* ============================================
   STATS GRID
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    position: relative; overflow: hidden;
    transition: all var(--transition);
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.stat-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: var(--primary);
}
.stat-card-balance::before { background: linear-gradient(90deg, #2563EB, #4F46E5); }
.stat-card-income::before  { background: linear-gradient(90deg, #16A34A, #10B981); }
.stat-card-expense::before { background: linear-gradient(90deg, #DC2626, #EF4444); }
.stat-card-profit::before  { background: linear-gradient(90deg, #F59E0B, #FBBF24); }

.stat-icon {
    width: 44px; height: 44px;
    background: rgba(37,99,235,0.1);
    color: var(--primary);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; margin-bottom: 12px;
}
.bg-success-soft { background: rgba(22,163,74,0.1) !important; }
.bg-warning-soft { background: rgba(245,158,11,0.1) !important; }
.bg-info-soft    { background: rgba(14,165,233,0.1) !important; }
.bg-purple-soft  { background: rgba(147,51,234,0.1) !important; }
.text-purple     { color: var(--purple) !important; }

.stat-label {
    font-size: 12px; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.5px;
    font-weight: 600;
}
.stat-value {
    font-size: 24px; font-weight: 700;
    margin: 6px 0;
    color: var(--text); letter-spacing: -0.5px;
}
.stat-trend {
    font-size: 12px; color: var(--text-muted);
    display: flex; align-items: center; gap: 4px;
}
.trend-up { color: var(--success); }
.trend-down { color: var(--danger); }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    border-radius: 8px; font-weight: 500;
    padding: 8px 16px; font-size: 14px;
    border: 1px solid transparent;
    transition: all var(--transition);
    display: inline-flex; align-items: center; justify-content: center;
    gap: 6px;
}
.btn-primary {
    background: var(--primary); border-color: var(--primary); color: white;
}
.btn-primary:hover {
    background: var(--primary-dark); border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}
.btn-light {
    background: var(--bg-soft); border-color: var(--border); color: var(--text);
}
.btn-light:hover { background: var(--border); }
.btn-success { background: var(--success); border-color: var(--success); color: white; }
.btn-danger  { background: var(--danger);  border-color: var(--danger);  color: white; }
.btn-warning { background: var(--warning); border-color: var(--warning); color: white; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 16px; }
.btn-ripple { position: relative; overflow: hidden; }
.btn-ripple::after {
    content: ''; position: absolute;
    top: 50%; left: 50%;
    width: 0; height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}
.btn-ripple:active::after {
    width: 300px; height: 300px;
}

/* ============================================
   TABLES
   ============================================ */
.table { margin: 0; }
.table thead th {
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
}
.table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}
.table-hover tbody tr:hover { background: var(--bg-soft); }

/* ============================================
   FORMS
   ============================================ */
.form-control, .form-select {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    transition: all var(--transition);
    background: white;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
    outline: none;
}
.form-label { font-weight: 500; font-size: 13px; margin-bottom: 6px; }
.form-floating > .form-control:focus ~ label { color: var(--primary); }

/* ============================================
   BADGES
   ============================================ */
.badge {
    font-size: 11px; font-weight: 600;
    padding: 4px 10px; border-radius: 6px;
}

/* ============================================
   BUDGET
   ============================================ */
.budget-stats {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 12px; margin-bottom: 12px;
}
.budget-stats > div {
    padding: 12px;
    background: var(--bg-soft);
    border-radius: 8px;
}
.budget-stats .text-muted { font-size: 11px; text-transform: uppercase; }
.budget-stats strong { display: block; margin-top: 4px; }

.progress-bar-custom {
    height: 8px;
    background: var(--bg-soft);
    border-radius: 4px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.6s ease;
}

.budget-summary {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 12px; text-align: center;
}
.budget-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; }

/* ============================================
   TRANSACTIONS LIST
   ============================================ */
.transaction-list { padding: 0; }
.transaction-item {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition);
}
.transaction-item:hover { background: var(--bg-soft); }
.transaction-icon {
    width: 40px; height: 40px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.tx-income { background: rgba(22,163,74,0.1); color: var(--success); }
.tx-expense { background: rgba(220,38,38,0.1); color: var(--danger); }
.transaction-info { flex: 1; min-width: 0; }
.transaction-title { font-weight: 500; font-size: 14px; }
.transaction-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.transaction-amount { font-weight: 600; font-size: 14px; }
.tx-amount-income { color: var(--success); }
.tx-amount-expense { color: var(--danger); }

/* ============================================
   CATEGORY CARDS
   ============================================ */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}
.category-card {
    padding: 16px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-align: center;
    position: relative;
    transition: all var(--transition);
    cursor: pointer;
}
.category-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--cat-color, var(--primary));
}
.category-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 10px;
    font-size: 18px;
}
.category-name { font-weight: 500; font-size: 13px; }
.category-actions {
    position: absolute; top: 6px; right: 6px;
    opacity: 0; transition: opacity var(--transition);
}
.category-card:hover .category-actions { opacity: 1; }

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state i { font-size: 48px; opacity: 0.5; margin-bottom: 16px; }
.empty-state h4, .empty-state h5 { color: var(--text); margin-bottom: 8px; }
.empty-state p { margin-bottom: 20px; }
.empty-state-mini { padding: 24px; text-align: center; color: var(--text-muted); }
.empty-state-mini i { font-size: 24px; opacity: 0.4; }

/* ============================================
   AUTH PAGES - White + Animated Graph Grid
   ============================================ */
.auth-body {
    background-color: #ffffff;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* === Animated Graph Grid Background === */

/* Base grid lines */
.auth-body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(37, 99, 235, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(37, 99, 235, 0.07) 1px, transparent 1px);
    background-size: 48px 48px;
    z-index: 0;
}

/* Moving scan line — like a live chart ticker */
.auth-body::after {
    content: '';
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 47px,
        rgba(37, 99, 235, 0.18) 48px
    );
    animation: graphScan 6s linear infinite;
    z-index: 0;
}

@keyframes graphScan {
    0%   { background-position-x: 0; }
    100% { background-position-x: 48px; }
}

/* Corner accent blobs — very subtle, white-tinted blue */
.auth-decoration {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.auth-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.12;
    animation: blobFloat 10s ease-in-out infinite;
}

@keyframes blobFloat {
    0%, 100% { transform: scale(1) translate(0, 0); }
    40%       { transform: scale(1.06) translate(16px, -20px); }
    70%       { transform: scale(0.94) translate(-12px, 16px); }
}

.blob-1 {
    width: 480px; height: 480px;
    background: #2563EB;
    top: -160px; left: -160px;
    animation-duration: 12s;
}

.blob-2 {
    width: 380px; height: 380px;
    background: #4F46E5;
    bottom: -120px; right: -120px;
    animation-duration: 14s;
    animation-delay: -5s;
}

.blob-3 {
    width: 260px; height: 260px;
    background: #6366F1;
    top: 45%; left: 58%;
    animation-duration: 10s;
    animation-delay: -3s;
}

/* === Chart tick marks on left + bottom edges === */
.auth-body .auth-graph-ticks {
    display: none; /* handled by SVG canvas injected via JS */
}

/* === Container + Card === */
.auth-container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 460px;
    animation: authFadeIn 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes authFadeIn {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-card {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(37, 99, 235, 0.12);
    border-radius: 24px;
    padding: 48px 44px;
    box-shadow:
        0 4px 6px rgba(37, 99, 235, 0.04),
        0 20px 60px rgba(37, 99, 235, 0.10),
        0 0 0 1px rgba(255,255,255,0.9) inset;
    position: relative;
    overflow: hidden;
}

/* Top shimmer line on card */
.auth-card::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 55%;
    height: 2px;
    border-radius: 0 0 4px 4px;
    background: linear-gradient(90deg, transparent, rgba(37,99,235,0.5), rgba(99,102,241,0.5), transparent);
}

/* === Brand / Logo === */
.auth-brand {
    text-align: center;
    margin-bottom: 36px;
}

.auth-logo {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #2563EB, #4F46E5);
    color: white;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    margin-bottom: 18px;
    box-shadow:
        0 10px 28px rgba(37, 99, 235, 0.35),
        0 0 0 4px rgba(37, 99, 235, 0.08);
    position: relative;
}

.auth-brand h1 {
    font-size: 30px;
    font-weight: 800;
    margin: 0 0 6px;
    background: linear-gradient(135deg, #1D4ED8 0%, #4F46E5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.auth-brand p {
    color: #64748B;
    margin: 0;
    font-size: 14px;
}

/* === Alerts === */
.auth-card .alert-warning {
    background: #FFFBEB;
    border: 1px solid #FCD34D;
    color: #92400E;
    border-radius: 12px;
    margin-bottom: 20px;
}

.auth-card .alert-danger {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #991B1B;
    border-radius: 12px;
    margin-bottom: 20px;
}

/* === Form Inputs === */
.auth-card .form-floating > .form-control {
    background: #F8FAFF;
    border: 1.5px solid #E0E7FF;
    border-radius: 14px;
    color: #0F172A;
    font-size: 15px;
    transition: all 0.3s ease;
}

.auth-card .form-floating > .form-control:focus {
    background: #ffffff;
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    outline: none;
    color: #0F172A;
}

.auth-card .form-floating > label {
    color: #64748B;
    font-size: 14px;
}

.auth-card .form-floating > .form-control:focus ~ label,
.auth-card .form-floating > .form-control:not(:placeholder-shown) ~ label {
    color: #2563EB;
}

/* === Checkbox + Remember === */
.auth-card .form-check-input {
    border-color: #CBD5E1;
    width: 16px;
    height: 16px;
}

.auth-card .form-check-input:checked {
    background-color: #2563EB;
    border-color: #2563EB;
}

.auth-card .form-check-label {
    color: #475569;
    font-size: 14px;
}

/* === Password Toggle === */
.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94A3B8;
    cursor: pointer;
    z-index: 5;
    padding: 4px;
    transition: color 0.2s;
}

.password-toggle:hover {
    color: #2563EB;
}

/* === Auth Link === */
.auth-link {
    font-size: 13px;
    color: #2563EB;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.auth-link:hover {
    color: #1D4ED8;
    text-decoration: underline;
}

/* === Sign In Button === */
.auth-card .btn-primary {
    background: linear-gradient(135deg, #2563EB, #4F46E5);
    border: none;
    border-radius: 14px;
    padding: 14px;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.3px;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.auth-card .btn-primary::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.55s ease;
}

.auth-card .btn-primary:hover::after {
    left: 100%;
}

.auth-card .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(37, 99, 235, 0.45);
    background: linear-gradient(135deg, #1D4ED8, #4338CA);
}

.auth-card .btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* === Footer === */
.auth-footer {
    text-align: center;
    margin-top: 28px;
    color: #94A3B8;
    font-size: 12px;
    padding-top: 20px;
    border-top: 1px solid #E2E8F0;
}

/* ============================================
   PROFILE
   ============================================ */
.profile-avatar {
    width: 100px; height: 100px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white; font-size: 36px; font-weight: 600;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: 200px 0; }
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 0%, #f8f8f8 50%, #f0f0f0 100%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: 4px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 992px) {
    .app-sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-xl);
    }
    .app-sidebar.open { transform: translateX(0); }
    .app-main { margin-left: 0; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 576px) {
    .app-content { padding: 16px; }
    .stats-grid { grid-template-columns: 1fr; }
    .auth-card { padding: 24px; }
    .navbar-search { display: none; }
    .budget-stats, .budget-summary { grid-template-columns: 1fr; }
}

/* Print */
@media print {
    .app-sidebar, .app-navbar, .no-print { display: none !important; }
    .app-main { margin-left: 0; }
}

/* ============================================
   NAVBAR FIXES - Add to end of style.css
   ============================================ */

/* Ensure navbar has proper height and layout */
.app-navbar {
    height: var(--header-h, 64px) !important;
    min-height: 64px;
    background: var(--surface, #FFFFFF) !important;
    border-bottom: 1px solid var(--border, #E2E8F0);
    display: flex !important;
    align-items: center !important;
    padding: 0 20px !important;
    gap: 12px !important;
    position: sticky;
    top: 0;
    z-index: 1030;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95) !important;
}

/* Search bar - PROPER SIZING */
.navbar-search {
    flex: 1;
    max-width: 480px;
    position: relative;
    margin: 0 16px;
}

.navbar-search i.fa-search {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light, #94A3B8);
    font-size: 14px;
    pointer-events: none;
    z-index: 1;
}

.navbar-search input {
    width: 100%;
    height: 40px;
    padding: 0 14px 0 40px !important;
    background: var(--bg-soft, #F1F5F9);
    border: 1px solid transparent;
    border-radius: 10px !important;
    font-size: 14px;
    color: var(--text, #0F172A);
    transition: all 0.2s ease;
    outline: none;
}

.navbar-search input::placeholder {
    color: var(--text-light, #94A3B8);
}

.navbar-search input:focus {
    background: white;
    border-color: var(--primary, #2563EB);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border, #E2E8F0);
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    margin-top: 4px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-light, #F1F5F9);
    text-decoration: none;
    color: var(--text, #0F172A);
    transition: background 0.15s;
}

.search-result-item:hover {
    background: var(--bg-soft, #F1F5F9);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item i {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--bg-soft, #F1F5F9);
    font-size: 14px;
}

.search-result-item strong {
    display: block;
    font-size: 13px;
    font-weight: 500;
}

.search-result-item small {
    display: block;
    font-size: 11px;
    color: var(--text-muted, #64748B);
    margin-top: 2px;
}

/* Navbar right actions */
.navbar-actions {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    margin-left: auto !important;
}

/* Icon buttons (notifications, alerts) */
.navbar-icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    border-radius: 10px;
    color: var(--text-muted, #64748B);
    font-size: 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
}

.navbar-icon-btn:hover {
    background: var(--bg-soft, #F1F5F9);
    color: var(--text, #0F172A);
}

.navbar-icon-btn .badge-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    background: var(--danger, #DC2626);
    color: white;
    font-size: 9px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

/* Alert pulse animation */
.navbar-alert {
    color: var(--warning, #F59E0B) !important;
}

.alert-pulse {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--warning, #F59E0B);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
    100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* User profile button */
.navbar-user {
    display: flex !important;
    align-items: center !important;
    gap: 10px;
    padding: 4px 12px 4px 4px !important;
    background: none;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text, #0F172A);
    height: 44px;
}

.navbar-user:hover {
    background: var(--bg-soft, #F1F5F9);
}

/* User avatar circle */
.user-avatar {
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, var(--primary, #2563EB), var(--secondary, #4F46E5)) !important;
    color: white !important;
    font-weight: 600;
    font-size: 14px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden;
    flex-shrink: 0;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-avatar span {
    line-height: 1;
}

/* User info text */
.user-info {
    display: flex;
    flex-direction: column;
    text-align: left;
    line-height: 1.3;
    gap: 2px;
}
.user-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
    line-height: 1.2;
    display: block;
}
.user-role {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.2;
    display: block;
}
.user-chevron {
    font-size: 10px;
    color: var(--text-muted);
    margin-left: 4px;
}


.user-chevron {
    font-size: 10px;
    color: var(--text-muted, #64748B);
    margin-left: 4px;
}

/* Dropdown menus */
.dropdown-menu {
    border: 1px solid var(--border, #E2E8F0);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 0;
    overflow: hidden;
    margin-top: 8px;
}

.dropdown-item {
    padding: 10px 16px;
    font-size: 13px;
    color: var(--text, #0F172A);
    display: flex;
    align-items: center;
    transition: background 0.15s;
}

.dropdown-item:hover {
    background: var(--bg-soft, #F1F5F9);
}

.dropdown-item i {
    width: 16px;
    text-align: center;
    color: var(--text-muted, #64748B);
}

.dropdown-item.text-danger {
    color: var(--danger, #DC2626) !important;
}

.dropdown-item.text-danger i {
    color: var(--danger, #DC2626) !important;
}

.dropdown-header {
    padding: 12px 16px;
    background: var(--bg-soft, #F1F5F9);
    border-bottom: 1px solid var(--border, #E2E8F0);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dropdown-header h6 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text, #0F172A);
}

.dropdown-header a {
    font-size: 12px;
    color: var(--primary, #2563EB);
    text-decoration: none;
    cursor: pointer;
}

.dropdown-divider {
    border-color: var(--border-light, #F1F5F9);
    margin: 0;
}

/* User dropdown header (when opened) */
.user-dropdown .dropdown-header {
    background: white;
    padding: 16px;
}

.dropdown-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dropdown-avatar {
    width: 44px !important;
    height: 44px !important;
    font-size: 16px !important;
}

.dropdown-user-info strong {
    display: block;
    font-size: 14px;
    color: var(--text, #0F172A);
}

.dropdown-user-info small {
    display: block;
    font-size: 12px;
    color: var(--text-muted, #64748B);
    margin-top: 2px;
}

/* Notification dropdown */
.notification-dropdown {
    width: 360px;
    max-width: 90vw;
}

.notification-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    display: flex !important;
    gap: 12px;
    padding: 12px 16px !important;
    border-bottom: 1px solid var(--border-light, #F1F5F9);
    text-decoration: none !important;
    color: var(--text, #0F172A) !important;
    transition: background 0.15s;
}

.notification-item:hover {
    background: var(--bg-soft, #F1F5F9);
}

.notification-item.unread {
    background: rgba(37, 99, 235, 0.04);
    position: relative;
}

.notification-item.unread::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--primary, #2563EB);
}

.notification-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--text, #0F172A);
    line-height: 1.3;
}

.notification-text {
    font-size: 12px;
    color: var(--text-muted, #64748B);
    margin-top: 2px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-time {
    font-size: 11px;
    color: var(--text-light, #94A3B8);
    margin-top: 4px;
}

.empty-state-mini {
    padding: 32px 24px;
    text-align: center;
    color: var(--text-muted, #64748B);
}

.empty-state-mini i {
    font-size: 32px;
    opacity: 0.4;
    display: block;
    margin-bottom: 8px;
}

.empty-state-mini p {
    margin: 0;
    font-size: 13px;
}

/* Sidebar toggle button */
.navbar-toggle {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text, #0F172A);
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.navbar-toggle:hover {
    background: var(--bg-soft, #F1F5F9);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .navbar-search {
        display: none;
    }

    .navbar-user {
        padding: 4px !important;
    }

    .user-info,
    .user-chevron {
        display: none !important;
    }

    .navbar-actions {
        gap: 4px !important;
    }

    .notification-dropdown {
        width: 300px;
    }
}

@media (max-width: 576px) {
    .app-navbar {
        padding: 0 12px !important;
    }
}

.navbar-icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    border-radius: 10px;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
    flex-shrink: 0;
}
.navbar-icon-btn:hover {
    background: var(--bg-soft);
    color: var(--text);
}

/* ============================================
   NAVBAR FIXES (Add at end of style.css)
   ============================================ */

/* Fix search input height */
.navbar-search input {
    width: 100% !important;
    height: 40px !important;
    padding: 0 14px 0 40px !important;
    line-height: 40px !important;
    background: var(--bg-soft) !important;
    border: 1px solid transparent !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    color: var(--text) !important;
    transition: all 0.2s !important;
    outline: none !important;
}
.navbar-search input::placeholder {
    color: var(--text-light) !important;
}
.navbar-search input:focus {
    background: white !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
}

/* Fix navbar-icon-btn (used in navbar.php) */
.navbar-icon-btn {
    position: relative !important;
    width: 40px !important;
    height: 40px !important;
    background: none !important;
    border: none !important;
    border-radius: 10px !important;
    color: var(--text-muted) !important;
    font-size: 16px !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
}
.navbar-icon-btn:hover {
    background: var(--bg-soft) !important;
    color: var(--text) !important;
}
.navbar-icon-btn .badge-dot {
    position: absolute !important;
    top: 6px !important;
    right: 6px !important;
    background: var(--danger) !important;
    color: white !important;
    font-size: 9px !important;
    font-weight: 700 !important;
    min-width: 16px !important;
    height: 16px !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 4px !important;
    line-height: 1 !important;
}

/* Fix navbar-user profile button */
.navbar-user {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 4px 12px 4px 4px !important;
    background: none !important;
    border: none !important;
    border-radius: 30px !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    color: var(--text) !important;
    height: 44px !important;
    flex-shrink: 0 !important;
}
.navbar-user:hover {
    background: var(--bg-soft) !important;
}

/* Fix user info layout */
.user-info {
    display: flex !important;
    flex-direction: column !important;
    text-align: left !important;
    line-height: 1.3 !important;
    gap: 2px !important;
}
.user-name {
    font-weight: 600 !important;
    font-size: 13px !important;
    color: var(--text) !important;
    line-height: 1.2 !important;
    display: block !important;
}
.user-role {
    font-size: 11px !important;
    color: var(--text-muted) !important;
    line-height: 1.2 !important;
    display: block !important;
}
.user-chevron {
    font-size: 10px !important;
    color: var(--text-muted) !important;
    margin-left: 4px !important;
}

/* Navbar alert pulse */
.navbar-alert {
    color: var(--warning) !important;
}
.alert-pulse {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    width: 8px !important;
    height: 8px !important;
    border-radius: 50% !important;
    background: var(--warning) !important;
    animation: pulse 1.5s infinite !important;
}

/* Notification dropdown fixes */
.notification-dropdown {
    width: 360px !important;
    max-width: 90vw !important;
    padding: 0 !important;
}
.notification-list {
    max-height: 400px !important;
    overflow-y: auto !important;
}
.notification-item {
    display: flex !important;
    gap: 12px !important;
    padding: 12px 16px !important;
    border-bottom: 1px solid var(--border-light) !important;
    text-decoration: none !important;
    color: var(--text) !important;
    transition: background 0.15s !important;
}
.notification-item:hover {
    background: var(--bg-soft) !important;
}
.notification-item.unread {
    background: rgba(37, 99, 235, 0.04) !important;
}
.notification-icon {
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
}
.notification-content {
    flex: 1 !important;
    min-width: 0 !important;
}
.notification-title {
    font-weight: 600 !important;
    font-size: 13px !important;
    line-height: 1.3 !important;
}
.notification-text {
    font-size: 12px !important;
    color: var(--text-muted) !important;
    margin-top: 2px !important;
}
.notification-time {
    font-size: 11px !important;
    color: var(--text-light) !important;
    margin-top: 4px !important;
}

/* User dropdown header */
.user-dropdown .dropdown-header {
    background: white !important;
    padding: 16px !important;
}
.dropdown-user-info {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
}
.dropdown-avatar {
    width: 44px !important;
    height: 44px !important;
    font-size: 16px !important;
}
.dropdown-user-info strong {
    display: block !important;
    font-size: 14px !important;
}
.dropdown-user-info small {
    display: block !important;
    font-size: 12px !important;
    color: var(--text-muted) !important;
    margin-top: 2px !important;
}

/* Empty state mini */
.empty-state-mini {
    padding: 32px 24px !important;
    text-align: center !important;
    color: var(--text-muted) !important;
}
.empty-state-mini i {
    font-size: 32px !important;
    opacity: 0.4 !important;
    display: block !important;
    margin-bottom: 8px !important;
}
.empty-state-mini p {
    margin: 0 !important;
    font-size: 13px !important;
}
