@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── 1. Root Variables ── */
:root {
    --primary-color: #004b8d;     /* Accurate Blue */
    --primary-dark: #003366;      /* Sidebar Deep Navy */
    --primary-light: #00599d;     /* Button Hover */
    --secondary-color: #64748b;   /* Slate Grey */
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #0ea5e9;
    --bg-main: #f8fafc;           /* Soft Background */
    --sidebar-bg: #003366;
    --sidebar-active: #004b8d;
    --table-header: #004b8d;
    --table-header-text: #ffffff;
    --table-stripe: #f9fafb;
    --border-color: #e2e8f0;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --font-family: 'Inter', sans-serif;
}

/* ── 2. Global Reset & Layout ── */
body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-family);
    margin: 0;
    height: 100vh;
    overflow: hidden; /* Prevent body scroll */
}

.d-flex.min-vh-100 {
    height: 100vh;
    overflow: hidden;
}

.main-content {
    flex: 1;
    height: 100vh;
    overflow-y: auto; /* Independent scroll */
    padding: 0;
    background-color: var(--bg-main);
}

.content-header {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* ── 3. Sidebar (Accurate Style: Collapsible) ── */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: #ffffff;
    height: 100vh;
    overflow-y: auto; /* Independent scroll */
    overflow-x: hidden;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.05);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    flex-shrink: 0;
}

/* Custom Scrollbar for Sidebar */
.sidebar::-webkit-scrollbar {
    width: 4px;
}
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
.sidebar:hover::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}

/* State: Collapsed by Default */
.sidebar.collapsed {
    width: 75px;
}

.sidebar.collapsed:hover,
.sidebar.expanded {
    width: 260px;
}

/* Adjust toggle button icon based on state */
.sidebar.collapsed #toggleIcon {
    transform: rotate(180deg);
}

.sidebar.expanded #toggleIcon {
    transform: rotate(0deg);
}

#btnToggleSidebar {
    transition: transform 0.3s ease;
    opacity: 0.7;
}

#btnToggleSidebar:hover {
    opacity: 1;
}

.sidebar.collapsed:not(:hover) #btnToggleSidebar {
    display: none !important;
}

.sidebar h1, 
.sidebar .text-white-50,
.sidebar .nav-section-title,
.sidebar a span:not(.bi),
#moduleNav a span:not(.bi) {
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.sidebar.collapsed:not(:hover) h1,
.sidebar.collapsed:not(:hover) .text-white-50,
.sidebar.collapsed:not(:hover) .nav-section-title,
.sidebar.collapsed:not(:hover) a span:not(.bi),
#moduleNav.collapsed:not(:hover) a span:not(.bi) {
    opacity: 0;
    visibility: hidden;
    white-space: nowrap;
}

.sidebar .bi {
    font-size: 1.25rem;
    min-width: 24px;
    text-align: center;
}

.sidebar h1 {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 700;
    margin-bottom: 0.75rem;
    padding-left: 1.25rem;
    letter-spacing: 1px;
}

.sidebar a, #moduleNav a {
    display: flex;
    align-items: center;
    padding: 12px 18px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.875rem;
    border-radius: 8px;
    margin: 4px 10px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.sidebar a:hover, #moduleNav a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.sidebar a.active, #moduleNav a.active {
    background-color: var(--sidebar-active);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.nav-separator {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 1rem 1rem;
}

/* ── 4. Card & UI Elements ── */
.card, .glass-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.btn-primary { background-color: var(--primary-color); border-color: var(--primary-color); }
.btn-primary:hover { background-color: var(--primary-light); border-color: var(--primary-light); }

/* ── 5. Professional DataTables (Accurate Style) ── */
.table-responsive {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: white;
}

.table, table.dataTable {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    border-collapse: collapse !important;
    width: 100% !important;
}

/* Header: Deep Blue / Navy */
.table thead th,
table.dataTable thead th {
    background-color: var(--table-header) !important;
    color: var(--table-header-text) !important;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1.1rem 1rem;
    border: none !important;
    vertical-align: middle;
}

/* Rows: Clean & Sharp */
table.dataTable tbody tr td {
    padding: 0.9rem 1rem;
    vertical-align: middle;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

/* Zebra Stripping: Minimalist Grey */
table.dataTable tbody tr.odd > td {
    background-color: #ffffff !important;
}

table.dataTable tbody tr.even > td {
    background-color: var(--table-stripe) !important;
}

/* Hover: Subtle Accent */
table.dataTable tbody tr:hover > td {
    background-color: #f1f5f9 !important;
    cursor: pointer;
}

/* DataTables Controls Customization */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    padding: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.dataTables_wrapper .dataTables_filter input {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.4rem 0.8rem;
    outline: none;
    transition: border-color 0.2s;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 75, 141, 0.1);
}

/* ── 6. Status Badges (Professional Pills) ── */
.badge {
    padding: 0.5em 0.8em;
    font-weight: 500;
    border-radius: 9999px;
    font-size: 0.75rem;
    letter-spacing: 0.2px;
}

.bg-success { background-color: #dcfce7 !important; color: #166534 !important; border: 1px solid #bbf7d0; }
.bg-danger { background-color: #fee2e2 !important; color: #991b1b !important; border: 1px solid #fecaca; }
.bg-warning { background-color: #fef9c3 !important; color: #854d0e !important; border: 1px solid #fef08a; }
.bg-info { background-color: #e0f2fe !important; color: #075985 !important; border: 1px solid #bae6fd; }

/* ── 7. Login Page Overhaul (Glassmorphism + Neon) ── */
.garage-login-body {
    background: linear-gradient(135deg, #001f3f 0%, #003366 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.glass-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 3rem;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.login-logo {
    width: 80px;
    height: auto;
    margin: 0 auto;
}

.btn-neon {
    background: var(--primary-color);
    color: white;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 0.8rem;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 75, 141, 0.3);
    transition: all 0.3s ease;
}

.btn-neon:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 75, 141, 0.4);
    background: var(--primary-light);
}

/* Password Toggle Styling */
#togglePassword {
    background: transparent;
    border-color: #dee2e6;
    border-left: none;
    color: var(--text-muted);
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
}

#togglePassword:hover {
    color: var(--primary-color);
    background: rgba(0, 0, 0, 0.05);
}

#togglePassword:focus {
    box-shadow: none;
}

.input-group > .form-control:focus + #togglePassword {
    border-color: var(--primary-color);
}

/* ── 8. Utility & Highlighting (Accurate Style) ── */
.text-primary { color: var(--primary-color) !important; }
.fw-bold { font-weight: 700 !important; }
.fw-semibold { font-weight: 600 !important; }
.highlight-name { font-weight: 700; color: var(--text-main); }
.highlight-amount { font-weight: 700; color: var(--primary-color); }
.highlight-code { font-weight: 600; color: var(--primary-dark); }
.highlight-date { font-size: 0.85rem; color: var(--text-muted); }
.rounded-lg { border-radius: 12px !important; }
.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important; }

/* Inactivity Modal Enhancement */
#inactivityModal .modal-content {
    border-radius: 16px;
    overflow: hidden;
}