/* ==========================================================================
   ARACPROJECIM PANEL - CORE DESIGN SYSTEM & STYLESHEET
   Design System: Dark Mode & Light Mode, Glassmorphism, HSL Palette
   ========================================================================== */

:root {
    /* DARK THEME (DEFAULT) COLOR TOKENS */
    --bg-main: #0b0f19;
    --bg-secondary: #111827;
    --bg-card: #1f2937;
    --bg-card-hover: #374151;
    --border-color: #374151;
    
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --text-inverse: #111827;

    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: rgba(59, 130, 246, 0.15);

    --success-color: #10b981;
    --success-hover: #059669;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #06b6d4;
    --purple-color: #8b5cf6;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* LIGHT THEME (ENHANCED CONTRAST & VISIBILITY) */
body.light-theme {
    --bg-main: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --border-color: #e2e8f0;
    
    --text-main: #0f172a;
    --text-muted: #475569;
    --text-inverse: #ffffff;

    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: rgba(37, 99, 235, 0.1);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* RESET & BASE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    font-size: 14px;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

/* TOP NAVBAR */
.top-navbar {
    height: 64px;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.icon-btn:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    font-size: 1.6rem;
    color: var(--primary-color);
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.main-title {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.5px;
    color: var(--text-main);
}

.sub-title {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.navbar-center {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sector-badge {
    background-color: var(--primary-light);
    color: var(--primary-color);
    border: 1px solid rgba(59, 130, 246, 0.3);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

body.light-theme .sector-badge {
    background-color: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}

.live-clock {
    font-family: monospace;
    font-weight: 600;
    background: var(--bg-card);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.drive-sync-badge {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

body.light-theme .drive-sync-badge {
    background-color: #ecfdf5;
    color: #047857;
    border-color: #a7f3d0;
}

.role-select {
    background-color: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
}

body.light-theme .role-select {
    background-color: #ffffff;
    color: #0f172a;
    border-color: #cbd5e1;
}

/* APP LAYOUT & SIDEBAR */
.app-layout {
    display: flex;
    min-height: calc(100vh - 64px);
}

.sidebar {
    width: 260px;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary-color), var(--purple-color));
    color: white;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.user-info h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.menu-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.8px;
    padding: 0 10px;
}

.sidebar-menu ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-menu .menu-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 500;
    transition: var(--transition);
}

body.light-theme .sidebar-menu .menu-item a {
    color: #475569;
}

.sidebar-menu .menu-item:hover a,
.sidebar-menu .menu-item.active a {
    background-color: var(--primary-light);
    color: var(--primary-color);
    font-weight: 600;
}

body.light-theme .sidebar-menu .menu-item:hover a,
body.light-theme .sidebar-menu .menu-item.active a {
    background-color: #eff6ff;
    color: #1d4ed8;
}

.sidebar-menu .menu-item .submenu {
    padding-left: 20px;
    margin-top: 4px;
    display: none;
}

.sidebar-menu .menu-item.open .submenu {
    display: flex;
}

/* MAIN CONTENT VIEW */
.main-content {
    flex: 1;
    padding: 24px;
    background-color: var(--bg-main);
    overflow-y: auto;
}

.content-view {
    display: none;
}

.content-view.active {
    display: block;
}

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

.page-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.breadcrumb {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

/* CARDS & CONTAINERS */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    overflow: hidden;
    transition: var(--transition);
}

body.light-theme .card {
    background-color: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body {
    padding: 20px;
}

/* KPI GRID CARDS */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 16px;

}

body.light-theme .kpi-card {
    background-color: #ffffff;
    border-color: #e2e8f0;
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.kpi-card.primary .kpi-icon { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.kpi-card.success .kpi-icon { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.kpi-card.danger .kpi-icon { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.kpi-card.info .kpi-icon { background: rgba(6, 182, 212, 0.15); color: #06b6d4; }

.kpi-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

.kpi-value {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 2px 0;
}

.kpi-sub {
    font-size: 0.75rem;
    font-weight: 600;
}

.kpi-sub.green { color: var(--success-color); }
.kpi-sub.red { color: var(--danger-color); }

/* CUSTOM TABLES */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.custom-table th {
    padding: 12px 16px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

body.light-theme .custom-table th {
    background-color: #f8fafc;
    color: #475569;
    border-bottom-color: #cbd5e1;
}

.custom-table td {
    padding: 14px 16px;
    font-size: 0.85rem;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

body.light-theme .custom-table td {
    color: #1e293b;
    border-bottom-color: #f1f5f9;
}

.custom-table tbody tr:hover {
    background-color: var(--bg-card-hover);
}

/* BADGES */
.badge {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-primary { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.badge-success { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.badge-danger { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.badge-warning { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.badge-info { background: rgba(6, 182, 212, 0.2); color: #22d3ee; }
.badge-admin { background: linear-gradient(135deg, #ef4444, #8b5cf6); color: white; }
.badge-claimed { background: rgba(139, 92, 246, 0.25); color: #c084fc; border: 1px solid rgba(139, 92, 246, 0.4); }

.badge-taxpayer { background: rgba(16, 185, 129, 0.2); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.4); }
.badge-nontaxpayer { background: rgba(107, 114, 128, 0.2); color: #9ca3af; border: 1px solid rgba(107, 114, 128, 0.4); }

body.light-theme .badge-primary { background: #dbeafe; color: #1e40af; }
body.light-theme .badge-success { background: #d1fae5; color: #065f46; }
body.light-theme .badge-danger { background: #fee2e2; color: #991b1b; }
body.light-theme .badge-warning { background: #fef3c7; color: #92400e; }
body.light-theme .badge-info { background: #cff4fc; color: #055160; }
body.light-theme .badge-taxpayer { background: #d1fae5; color: #047857; }
body.light-theme .badge-nontaxpayer { background: #e2e8f0; color: #475569; }

/* BUTTONS */
.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--bg-card-hover);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

body.light-theme .btn-secondary {
    background-color: #f1f5f9;
    color: #1e293b;
    border-color: #cbd5e1;
}

.btn-excel {
    background-color: #059669;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-excel:hover { background-color: #047857; }

.btn-sm {
    padding: 4px 10px;
    font-size: 0.75rem;
}

/* FORMS */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}

body.light-theme .form-group label {
    color: #334155;
}

.form-control {
    background-color: var(--bg-secondary);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition);
}

body.light-theme .form-control {
    background-color: #f8fafc;
    color: #0f172a;
    border-color: #cbd5e1;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-row {
    display: flex;
    gap: 16px;
}

.col-6 { flex: 1; }
.col-4 { flex: 1; }
.col-12 { width: 100%; }

/* TIP ONAY HIERARCHY CARDS & STYLES (SCREENSHOTS 1-5 LIGHT & DARK FIXED) */
.city-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.city-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    cursor: pointer;
    transition: var(--transition);

}

body.light-theme .city-card {
    background: #ffffff;
    border-color: #cbd5e1;

}

.city-card:hover, .city-card.active {
    border-color: var(--primary-color);
    background: var(--primary-light);

}

.city-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.city-card-head h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
}

body.light-theme .city-card-head h4 {
    color: #0f172a !important;
}

.city-card-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
}

body.light-theme .city-card-sub {
    color: #475569 !important;
}

.city-card-badge {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary-color);
    background: rgba(59, 130, 246, 0.15);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    display: inline-block;
    margin-top: 6px;
}

/* VEHICLE MODEL CARDS (SCREENSHOT 2 LIGHT MODE READABILITY FIX) */
.model-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.model-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

body.light-theme .model-card {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.model-card:hover, .model-card.active {
    border-color: var(--primary-color);
    background: var(--primary-light);

}

.model-card h4 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 4px 0 2px 0;
}

body.light-theme .model-card h4 {
    color: #0f172a !important; /* CRISP DARK TEXT IN LIGHT MODE */
}

.model-card span {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
}

body.light-theme .model-card span {
    color: #475569 !important; /* CRISP MUTED TEXT IN LIGHT MODE */
}

.model-card-badge {
    font-size: 0.75rem;
    font-weight: 700;
    color: #2563eb;
    background: rgba(37, 99, 235, 0.12);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    margin-top: 8px;
    display: inline-block;
}

body.light-theme .model-card-badge {
    background: #dbeafe;
    color: #1d4ed8;
}

/* FOLDER CARDS (37 AİTM ONAYLILAR, E ONAYLILAR, TR ONAYLILAR) */
.category-folders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 14px;
}

.folder-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px;
    cursor: pointer;
    transition: var(--transition);
}

body.light-theme .folder-card {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.folder-card:hover {
    border-color: var(--warning-color);

}

.folder-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.folder-card-head h4 {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

body.light-theme .folder-card-head h4 {
    color: #334155 !important;
}

.folder-icon-box {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.folder-icon-green { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.folder-icon-blue { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.folder-icon-purple { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }

.folder-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

body.light-theme .folder-desc {
    color: #475569 !important;
}

.folder-card-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

body.light-theme .folder-card-meta {
    color: #64748b !important;
    border-top-color: #e2e8f0;
}

.folder-card-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-top: 12px;
}

/* NESTED FOLDER HEADER */
.nested-folder-header {
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

body.light-theme .nested-folder-header {
    background: #f8fafc;
    border-bottom-color: #e2e8f0;
}

.nested-folder-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
}

body.light-theme .nested-folder-title {
    color: #0f172a !important;
}

/* MODAL STYLES */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.active { display: flex; }

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 680px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

body.light-theme .modal-card {
    background: #ffffff;
    border-color: #cbd5e1;
}

.modal-card.modal-sm { max-width: 480px; }
.modal-card.modal-lg { max-width: 860px; width: 94vw; }
.modal-card.modal-xl { max-width: 1080px; width: 95vw; }

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-body { padding: 20px; }
.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* CALENDAR STYLES (7-COLUMN MONTHLY GRID) */
.mock-calendar { width: 100%; }

.calendar-header-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.calendar-header-nav h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
}

.calendar-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    text-align: center;
}

.day-head {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    padding: 6px;
}

.day-cell {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    height: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

body.light-theme .day-cell {
    background: #f8fafc;
    color: #1e293b;
    border-color: #e2e8f0;
}

.day-cell:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.day-cell.today {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.2);
    color: var(--primary-color);
    font-weight: 800;
}

.day-cell.has-event .event-dot {
    width: 6px;
    height: 6px;
    border-radius: var(--radius-full);
    background: var(--warning-color);
    margin-top: 2px;
}

/* UTILITY CLASSES */
.margin-top { margin-top: 20px; }
.margin-bottom { margin-bottom: 16px; }
.margin-right { margin-right: 8px; }
.text-muted { color: var(--text-muted); }
.text-green { color: var(--success-color); }
.text-red, .text-danger { color: var(--danger-color); }
.text-blue, .text-primary { color: var(--primary-color); }
.text-purple { color: var(--purple-color); }
.font-monospace { font-family: monospace; }
.font-weight-bold { font-weight: 700; }
.display-block { display: block; }
.width-100 { width: 100%; }

/* HIGHLIGHT BOXES */
.highlight-box {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.danger-box {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

body.light-theme .danger-box {
    background: #fef2f2;
    border-color: #fca5a5;
}

/* NOTIFICATION POPOVER STYLES */
.notification-dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 999px;
    border: 2px solid var(--bg-card);
}

.notification-popover {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 380px;
    max-height: 450px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow: hidden;
}

.notification-popover.active {
    display: block;
}

.notif-header {
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notif-header h4 {
    margin: 0;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-link-sm {
    background: transparent;
    border: none;
    color: var(--primary-color);
    font-size: 0.75rem;
    cursor: pointer;
    text-decoration: underline;
}

.notif-list {
    max-height: 380px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.notif-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    font-size: 0.82rem;
    transition: background 0.2s;
    cursor: pointer;
}

.notif-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.notif-item.unread {
    background: rgba(59, 130, 246, 0.08);
}

.notif-icon {
    font-size: 1.2rem;
    margin-top: 2px;
}

.notif-body {
    flex: 1;
}

.notif-title {
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.notif-time {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.notif-desc {
    color: var(--text-muted);
    line-height: 1.3;
}

/* STEPPED PROGRESS TRACKER */
.step-tracker-container {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin: 15px 0 25px 0;
    padding: 0 10px;
}

.step-tracker-container::before {
    content: '';
    position: absolute;
    top: 18px;
    left: 40px;
    right: 40px;
    height: 3px;
    background: var(--border-color);
    z-index: 1;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    flex: 1;
}

.step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.step-item.active .step-circle {
    border-color: #3b82f6;
    background: #3b82f6;
    color: white;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.5);
}

.step-item.completed .step-circle {
    border-color: #10b981;
    background: #10b981;
    color: white;
}

.step-label {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 8px;
    text-align: center;
    color: var(--text-muted);
}

.step-item.active .step-label,
.step-item.completed .step-label {
    color: var(--text-main);
}

/* --- LOGIN PORTAL OVERLAY & MODAL STYLES --- */
body.login-active {
    overflow: hidden !important;
    height: 100vh !important;
    height: 100dvh !important;
    position: fixed !important;
    width: 100% !important;
}

body.login-active .app-layout {
    display: none !important;
}

#login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    background: #030712;
    backdrop-filter: blur(16px);
    z-index: 999999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

#login-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.login-card {
    width: 100%;
    max-width: 480px;
    background: #0f172a;
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 20px;
    box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.9), 0 0 35px rgba(239, 68, 68, 0.2);
    padding: 26px 22px;
    color: #ffffff;
    text-align: center;
    position: relative;
    margin: auto;
    max-height: 94vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ef4444, #f59e0b, #10b981, #3b82f6);
}

.login-logo-container {
    background: #ffffff;
    border-radius: 12px;
    padding: 10px 14px;
    margin: 4px auto 14px auto;
    max-width: 320px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-logo-img {
    width: 100%;
    max-height: 75px;
    object-fit: contain;
    display: block;
}

.login-title-badge {
    font-size: 0.9rem;
    font-weight: 800;
    color: #ef4444;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.login-subtitle {
    font-size: 0.8rem;
    color: #94a3b8;
    font-weight: 600;
    margin-bottom: 12px;
}

.login-badges-row {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.login-badge {
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
}

.login-badge.tse { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.login-badge.iso { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.login-badge.city { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }

.login-input-group {
    position: relative;
    margin-bottom: 12px;
    text-align: left;
}

.login-input-group label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: #cbd5e1;
    margin-bottom: 4px;
}

.login-input-wrapper {
    position: relative;
}

.login-input-wrapper i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 0.95rem;
}

.login-input {
    width: 100%;
    padding: 10px 12px 10px 40px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 10px;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    outline: none;
    transition: all 0.2s ease;
}

.login-input:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
    background: #0f172a;
}

.login-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    border: none;
    border-radius: 10px;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.4);
    transition: all 0.25s ease;
    margin-top: 4px;
}

.login-btn:hover {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.6);
}

.quick-login-box {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #334155;
    text-align: left;
}

.quick-login-title {
    font-size: 0.76rem;
    font-weight: 700;
    color: #94a3b8;
    margin-bottom: 8px;
}

.quick-login-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.quick-user-btn {
    padding: 7px 9px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #f1f5f9;
    font-size: 0.74rem;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-user-btn:hover {
    background: #334155;
    border-color: #ef4444;
    transform: translateY(-1px);
}

.quick-user-btn small {
    display: block;
    font-size: 0.66rem;
    color: #94a3b8;
    font-weight: 400;
    margin-top: 2px;
}

.header-brand-logo-img {
    height: 38px;
    max-width: 170px;
    object-fit: contain;
    background: #ffffff;
    padding: 4px 8px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.sidebar-logo-img {
    max-width: 160px;
    height: auto;
    margin-bottom: 8px;
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE ENGINE (AIRTIGHT FOR PHONES & TABLETS)
   ========================================================================== */

/* 1. SIDEBAR DRAWER & OVERLAY LAYOUT FOR TABLETS & PHONES (<= 992px) */
@media (max-width: 992px) {
    .app-layout {
        position: relative;
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        top: 64px;
        left: 0;
        bottom: 0;
        width: 280px;
        max-width: 85vw;
        z-index: 9999;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 10px 0 35px rgba(0, 0, 0, 0.6);
        background-color: var(--bg-secondary);
        overflow-y: auto;
    }

    .sidebar.mobile-open,
    .sidebar.active {
        transform: translateX(0) !important;
    }

    .sidebar-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(4px);
        z-index: 9998;
        display: none;
    }

    .sidebar-backdrop.active {
        display: block;
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
        padding: 14px 10px !important;
    }
}

/* 2. TOP NAVBAR MOBILE ADJUSTMENTS (<= 768px) */
@media (max-width: 768px) {
    .top-navbar {
        height: auto;
        min-height: 56px;
        padding: 8px 12px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .navbar-center {
        display: none !important;
    }

    .navbar-right {
        gap: 6px;
    }

    .header-brand-logo-img {
        height: 32px !important;
        max-width: 120px !important;
    }

    #header-user-badge span {
        max-width: 85px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.75rem !important;
    }

    .page-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }

    .header-actions {
        width: 100% !important;
        display: flex;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 8px;
    }

    .header-actions button {
        width: 100%;
    }
}

/* 3. FORM ROWS, TABLES & CARDS (<= 768px) */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column !important;
        gap: 10px !important;
    }

    .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-10, .col-11, .col-12 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }

    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        display: block;
        margin-bottom: 16px;
    }

    .table-responsive table {
        min-width: 640px;
    }

    .kpi-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }

    .modal-card {
        width: 96vw !important;
        padding: 16px 12px !important;
        margin: 10px auto !important;
    }

    .branch-nav-tabs {
        flex-wrap: wrap;
        gap: 6px;
    }

    .branch-nav-tabs .tab-btn {
        flex: 1 1 calc(50% - 6px);
        text-align: center;
        font-size: 0.8rem;
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    .kpi-grid {
        grid-template-columns: 1fr !important;
    }

    #drive-sync-status {
        display: none !important;
    }

    .login-card {
        padding: 20px 16px;
    }

    .login-logo-container {
        max-width: 260px;
        padding: 8px 12px;
    }
}

