/* ===== FONTS - self-hosted Inter (OFL) =====
   Bundled under wwwroot/fonts/ so prod doesn't depend on Google Fonts. Aptos wins if installed. */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/Inter-400.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/fonts/Inter-500.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/fonts/Inter-600.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/fonts/Inter-700.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url('/fonts/Inter-800.woff2') format('woff2');
}

/* ===== ROOT VARIABLES =====
   Al Haditha brand (blue + green). Aptos primary, Inter fallback (self-hosted). */
:root {
    --primary: #2E94CB;             /* Al Haditha Blue */
    --primary-dark: #1E6E9C;
    --primary-light: #E3F2FB;
    --brand-grey: #3FA34A;          /* Al Haditha Green - secondary accent */
    --brand-grey-dark: #2E7D34;
    --success: #059669;
    --success-light: #ECFDF5;
    --warning: #D97706;
    --warning-light: #FFFBEB;
    --danger: #DC2626;
    --danger-light: #FEF2F2;
    --info: #0891B2;
    --info-light: #ECFEFF;
    --dark: #0F172A;
    --gray-1: #475569;
    --gray-2: #64748B;
    --gray-3: #94A3B8;
    --gray-4: #CBD5E1;
    --gray-5: #E2E8F0;
    --gray-6: #F1F5F9;
    --gray-7: #F8FAFC;
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    --header-height: 64px;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.06);
    --transition: all 0.2s ease;
}

/* Base reset & typography. Cascade: Aptos -> Segoe UI Variable -> Segoe UI -> Inter -> system sans. */
html { overflow-x: hidden; }
body {
    font-family: 'Aptos', 'Segoe UI Variable', 'Segoe UI', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gray-7);
    color: var(--dark);
    margin: 0;
    overflow-x: hidden;
}
h1,h2,h3,h4,h5,h6 {
    font-family: 'Aptos', 'Segoe UI Variable', 'Segoe UI', 'Inter', system-ui, sans-serif;
    font-weight: 700;
}

/* ===== Bootstrap 5 variable overrides =====
   Override Bootstrap theme vars or .btn-primary/etc render default colours. */
:root {
    --bs-primary: #2E94CB;
    --bs-primary-rgb: 46, 148, 203;
    --bs-secondary: #3FA34A;
    --bs-secondary-rgb: 63, 163, 74;
    --bs-link-color: #2E94CB;
    --bs-link-hover-color: #1E6E9C;
    --bs-link-color-rgb: 46, 148, 203;
}
.btn-primary {
    --bs-btn-bg: #2E94CB; --bs-btn-border-color: #2E94CB;
    --bs-btn-hover-bg: #1E6E9C; --bs-btn-hover-border-color: #1E6E9C;
    --bs-btn-active-bg: #155678; --bs-btn-active-border-color: #155678;
    --bs-btn-disabled-bg: #2E94CB; --bs-btn-disabled-border-color: #2E94CB;
}
.btn-outline-primary {
    --bs-btn-color: #2E94CB; --bs-btn-border-color: #2E94CB;
    --bs-btn-hover-bg: #2E94CB; --bs-btn-hover-border-color: #2E94CB;
    --bs-btn-active-bg: #2E94CB; --bs-btn-active-border-color: #2E94CB;
}
.btn-secondary {
    --bs-btn-bg: #3FA34A; --bs-btn-border-color: #3FA34A;
    --bs-btn-hover-bg: #2E7D34; --bs-btn-hover-border-color: #2E7D34;
    --bs-btn-active-bg: #1F5921; --bs-btn-active-border-color: #1F5921;
}
.btn-outline-secondary {
    --bs-btn-color: #3FA34A; --bs-btn-border-color: #3FA34A;
    --bs-btn-hover-bg: #3FA34A; --bs-btn-hover-border-color: #3FA34A;
}
/* Semantic states - aligned with Tailwind-ish palette used elsewhere. */
.btn-success {
    --bs-btn-bg: #059669; --bs-btn-border-color: #059669;
    --bs-btn-hover-bg: #047857; --bs-btn-hover-border-color: #047857;
    --bs-btn-active-bg: #065F46; --bs-btn-active-border-color: #065F46;
}
.btn-warning {
    --bs-btn-bg: #D97706; --bs-btn-border-color: #D97706; --bs-btn-color: #fff;
    --bs-btn-hover-bg: #B45309; --bs-btn-hover-border-color: #B45309; --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #92400E; --bs-btn-active-border-color: #92400E; --bs-btn-active-color: #fff;
}
.btn-danger {
    --bs-btn-bg: #DC2626; --bs-btn-border-color: #DC2626;
    --bs-btn-hover-bg: #B91C1C; --bs-btn-hover-border-color: #B91C1C;
    --bs-btn-active-bg: #991B1B; --bs-btn-active-border-color: #991B1B;
}
.btn-info {
    --bs-btn-bg: #0891B2; --bs-btn-border-color: #0891B2; --bs-btn-color: #fff;
    --bs-btn-hover-bg: #0E7490; --bs-btn-hover-border-color: #0E7490; --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #155E75; --bs-btn-active-border-color: #155E75; --bs-btn-active-color: #fff;
}
/* Bootstrap badges too. */
.bg-primary { background-color: #2E94CB !important; }
.bg-secondary { background-color: #3FA34A !important; }
.text-primary { color: #2E94CB !important; }
.text-secondary { color: #3FA34A !important; }
/* Form-control focus ring on inputs (Bootstrap default is blue glow). */
.form-control:focus, .form-select:focus, .form-check-input:focus {
    border-color: #2E94CB;
    box-shadow: 0 0 0 0.2rem rgba(46, 148, 203, 0.15);
}
.form-check-input:checked {
    background-color: #2E94CB;
    border-color: #2E94CB;
}
/* Nav-tabs / nav-pills active state */
.nav-link.active, .nav-pills .nav-link.active {
    background-color: #2E94CB;
}
.nav-tabs .nav-link.active {
    color: #2E94CB;
    border-bottom-color: #2E94CB;
}

/* App wrapper */
.app-wrapper { display: flex; min-height: 100vh; overflow-x: hidden; }

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-width);
    background: white;
    border-right: 1px solid var(--gray-5);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1040;
    overflow-y: auto;
    overflow-x: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--gray-5);
    min-height: 72px;
}

/* Al Haditha logo (colored variant for the white sidebar background). */
.sidebar-brand-link { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.sidebar-brand-img {
    max-width: 180px;
    max-height: 56px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}
.sidebar-collapsed .sidebar-brand-img { max-width: 38px; }

/* "Powered by SMARTVIZ" credit pinned at the bottom of the sidebar. */
.sidebar-powered-by {
    text-align: center;
    padding: 10px 16px 14px;
    font-size: 12px;
    color: var(--gray-3);
    letter-spacing: 1.2px;
    border-top: 1px solid var(--gray-6);
}
.sidebar-powered-by-mark {
    font-weight: 800;
    color: var(--brand-grey);
    letter-spacing: 2px;
}
.sidebar-collapsed .sidebar-powered-by { font-size: 0; padding: 8px; }
.sidebar-collapsed .sidebar-powered-by::before {
    content: '\f1ad'; /* fa-building */
    font: 700 14px 'Font Awesome 6 Free';
    color: var(--gray-3);
}
.sidebar-collapsed .sidebar-powered-by-mark { display: none; }

/* OLD: .brand-logo / .brand-info / .brand-name / .brand-version - kept unused, replaced by .sidebar-brand-img. */
.brand-logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 16px;
    font-family: 'Aptos', 'Segoe UI Variable', 'Segoe UI', 'Inter', sans-serif;
    flex-shrink: 0;
}

.brand-info { display: flex; flex-direction: column; overflow: hidden; white-space: nowrap; }
.brand-name { font-weight: 700; font-size: 19px; color: var(--dark); font-family: 'Aptos', 'Segoe UI Variable', 'Segoe UI', 'Inter', sans-serif; }
.brand-version { font-size: 15px; color: var(--gray-3); }

.sidebar-nav { padding: 12px 0; flex: 1; }

.nav-section { padding: 0 16px; margin-bottom: 4px; }
.section-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--gray-3);
    padding: 16px 8px 8px;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 16px;
    color: var(--gray-2);
    text-decoration: none;
    border-radius: 6px;
    margin: 1px 8px;
    font-size: 15.5px;
    font-weight: 500;
    transition: var(--transition);
    border-left: 3px solid transparent;
    white-space: nowrap;
    overflow: hidden;
}
.sidebar .nav-link i { width: 20px; text-align: center; font-size: 19px; flex-shrink: 0; }
.sidebar .nav-link:hover { background: var(--gray-6); color: var(--dark); }
.sidebar .nav-link.active {
    background: var(--primary-light);
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
}

/* Sidebar accordions */
.nav-accordion-toggle {
    cursor: pointer;
    position: relative;
}
.nav-accordion-toggle::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 12px;
    margin-left: auto;
    transition: transform 0.2s;
}
.nav-accordion-toggle.open::after { transform: rotate(180deg); }
.nav-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.nav-submenu.open { max-height: 500px; }
.nav-submenu .nav-link {
    padding-left: 48px;
    font-size: 15px;
}

/* Sidebar user card */
.sidebar-user {
    padding: 16px;
    border-top: 1px solid var(--gray-5);
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar-user-info { overflow: hidden; white-space: nowrap; flex: 1; }
.sidebar-user-name { font-weight: 600; font-size: 17px; color: var(--dark); }
.sidebar-user-role { font-size: 15px; color: var(--gray-3); }
/* Quick-access "Change Password" key icon at the right edge of the sidebar user widget. */
.sidebar-user-action {
    width: 32px; height: 32px;
    border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--gray-2);
    background: var(--gray-7);
    border: 1px solid var(--gray-5);
    text-decoration: none;
    flex-shrink: 0;
    transition: var(--transition);
}
.sidebar-user-action:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-light);
}
.sidebar-collapsed .sidebar-user-action { display: none; }

/* Sidebar collapsed */
.sidebar-collapsed .sidebar { width: var(--sidebar-collapsed); }
.sidebar-collapsed .brand-name,
.sidebar-collapsed .brand-version,
.sidebar-collapsed .nav-label,
.sidebar-collapsed .section-label,
.sidebar-collapsed .sidebar-user-info,
.sidebar-collapsed .nav-accordion-toggle::after { display: none; }
.sidebar-collapsed .sidebar .nav-link { justify-content: center; padding: 10px; margin: 2px 8px; }
.sidebar-collapsed .sidebar .nav-link span { display: none; }
.sidebar-collapsed .nav-submenu { display: none !important; }
.sidebar-collapsed .sidebar-brand { justify-content: center; padding: 16px 8px; }
.sidebar-collapsed .sidebar-user { justify-content: center; }

/* ===== MAIN WRAPPER ===== */
.main-wrapper {
    margin-left: var(--sidebar-width);
    flex: 1;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
    max-width: 100%;
}
.sidebar-collapsed .main-wrapper { margin-left: var(--sidebar-collapsed); }

/* ===== HEADER ===== */
.app-header {
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid var(--gray-5);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 1030;
}
.header-left { display: flex; align-items: center; gap: 16px; }
.header-right { display: flex; align-items: center; gap: 8px; }

#sidebarToggle {
    width: 36px; height: 36px;
    border: none; background: none;
    color: var(--gray-2);
    font-size: 18px;
    cursor: pointer;
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
}
#sidebarToggle:hover { background: var(--gray-6); }

.breadcrumb-nav { display: flex; align-items: center; gap: 8px; font-size: 18px; }
.breadcrumb-nav a { color: var(--gray-3); text-decoration: none; }
.breadcrumb-nav a:hover { color: var(--primary); }
.breadcrumb-nav span { color: var(--gray-4); }
.breadcrumb-nav .current { color: var(--dark); font-weight: 500; }

.header-btn {
    width: 40px; height: 40px;
    border-radius: 8px;
    border: 1px solid var(--gray-5);
    background: white;
    color: var(--gray-2);
    display: flex; align-items: center; justify-content: center;
    position: relative;
    cursor: pointer;
    font-size: 17px;
    transition: var(--transition);
}
.header-btn:hover { background: var(--gray-6); color: var(--dark); }
.header-btn .badge-dot {
    position: absolute; top: 8px; right: 8px;
    width: 8px; height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid white;
}
.notification-count {
    position: absolute; top: 4px; right: 4px;
    background: var(--danger);
    color: white; font-size: 12px; font-weight: 700;
    width: 18px; height: 18px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}

.header-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
}

/* ===== MAIN CONTENT ===== */
.main-content { flex: 1; }
.content-container {
    padding: 24px;
    background: var(--gray-7);
    min-height: calc(100vh - var(--header-height));
    overflow-x: hidden;
}

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-5);
}
.page-header h1 { font-size: 24px; font-weight: 700; margin: 0; color: var(--dark); }
.page-header-subtitle { font-size: 18px; color: var(--gray-2); margin-top: 2px; }

/* ===== CARDS ===== */
.card {
    border: 1px solid var(--gray-5);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.04);
    transition: box-shadow 0.25s ease;
}
.card:hover { box-shadow: 0 2px 6px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.06); }
.card-header {
    background: white;
    border-bottom: 1px solid var(--gray-5);
    font-weight: 600;
    padding: 16px 20px;
}

.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 20px rgba(0,0,0,0.1); }
.stat-card-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
}
.stat-card-value { font-size: 28px; font-weight: 700; color: var(--dark); font-family: 'Aptos', 'Segoe UI Variable', 'Segoe UI', 'Inter', sans-serif; }
.stat-card-label { font-size: 15px; color: var(--gray-2); margin-top: 2px; }
.stat-card-sub { font-size: 14px; margin-top: 8px; }

/* ===== STATUS BADGES ===== */
.badge-inside { background: var(--success-light); color: var(--success); }
.badge-checkedout { background: var(--gray-6); color: var(--gray-2); }
.badge-pending { background: var(--warning-light); color: var(--warning); }
.badge-confirmed { background: var(--primary-light); color: var(--primary); }
.badge-cancelled { background: var(--danger-light); color: var(--danger); }
.badge-active { background: var(--success-light); color: var(--success); }
.badge-vip { background: #FEF3C7; color: #92400E; }
.badge-status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.badge-status::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* NEW (form #14 follow-up): visit / appointment status pill — used by Check pages + filterable tables. */
.status-pill {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.2px;
}
.badge-checkedin { background: var(--success-light); color: var(--success); }
.badge-approved  { background: var(--primary-light); color: var(--primary); }
.badge-rejected  { background: var(--danger-light);  color: var(--danger); }
.badge-noshow    { background: #FEF3C7;              color: #92400E; }
.badge-default   { background: var(--gray-6);        color: var(--gray-2); }

/* NEW: filter tab buttons (All / Today / Upcoming / Completed / Cancelled). */
.status-filter-tab {
    background: transparent;
    border: 1px solid var(--gray-5);
    color: var(--gray-2);
    border-radius: 999px;
    padding: 4px 14px;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.status-filter-tab:hover { background: var(--gray-7); color: var(--primary); border-color: var(--primary); }
.status-filter-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.status-filter-tab.active:hover { background: var(--primary); color: #fff; }

/* ===== AVATAR CIRCLES ===== */
.avatar-circle {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 600;
    color: white;
    flex-shrink: 0;
}
.avatar-sm { width: 32px; height: 32px; font-size: 14px; }
.avatar-md { width: 48px; height: 48px; font-size: 18px; }
.avatar-lg { width: 72px; height: 72px; font-size: 26px; }
.avatar-xl { width: 100px; height: 100px; font-size: 36px; }

/* ===== ICON BUTTONS ===== */
.btn-icon {
    width: 32px; height: 32px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center; justify-content: center;
    border: 1px solid var(--gray-5);
    color: var(--gray-2);
    background: white;
    transition: var(--transition);
    cursor: pointer;
    font-size: 15px;
}
.btn-icon:hover { background: var(--primary); color: white; border-color: var(--primary); }
.btn-icon.btn-icon-danger:hover { background: var(--danger); border-color: var(--danger); }
.btn-icon.btn-icon-success:hover { background: var(--success); border-color: var(--success); }

/* ===== GRADIENT BUTTONS ===== */
.btn-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 11px 28px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 16px;
    transition: all 0.25s ease;
    box-shadow: 0 2px 6px rgba(46, 148, 203,0.25);
    letter-spacing: 0.01em;
}
.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 148, 203,0.4);
    color: white;
}
.btn-gradient:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(46, 148, 203,0.3);
}

/* Cancel / outline buttons */
.btn-outline-secondary {
    border: 1.5px solid var(--gray-4);
    color: var(--gray-2);
    font-weight: 500;
    transition: all 0.2s ease;
}
.btn-outline-secondary:hover {
    background: var(--gray-6);
    border-color: var(--gray-3);
    color: var(--dark);
}

/* ===== WELCOME BANNER ===== */
.welcome-banner {
    background: linear-gradient(135deg, #2E94CB 0%, #1E6E9C 50%, #155678 100%);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.welcome-banner h2 { font-size: 22px; font-weight: 700; margin: 0; }
.welcome-banner p { margin: 4px 0 0; opacity: 0.85; font-size: 16px; }

/* ===== FILTER CARD ===== */
.filter-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

/* ===== TABLES ===== */
.table-card { background: white; border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.table-card .card-body { padding: 0; }
.table-card table { margin: 0; }
.table-card thead th {
    background: var(--gray-6);
    border: none;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-2);
    padding: 12px 16px;
    white-space: nowrap;
}
.table-card tbody td {
    padding: 12px 16px;
    vertical-align: middle;
    border-color: var(--gray-5);
    font-size: 13.5px;
}
.table-card tbody tr:hover { background: var(--gray-7); }

/* DataTables custom */
.dataTables_wrapper { padding: 16px; }
.dataTables_wrapper .dataTables_filter input {
    border-radius: 6px;
    border: 1px solid var(--gray-4);
    padding: 6px 12px;
    font-size: 15px;
}
.dataTables_wrapper .dataTables_length select {
    border-radius: 6px;
    border: 1px solid var(--gray-4);
    padding: 6px 32px 6px 12px;
    min-width: 70px;
}
.dataTables_wrapper .dataTables_info { font-size: 15px; color: var(--gray-2); }
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
    border-radius: 6px;
}
.dataTables_wrapper .dataTables_paginate .paginate_button { border-radius: 6px; }

/* ===== FORM STYLES — PREMIUM ===== */

/* --- Inputs & Selects --- */
.form-control {
    border-radius: var(--radius);
    border: 1.5px solid var(--gray-4);
    padding: 11px 14px;
    font-size: 16px;
    transition: all 0.25s ease;
    background: var(--gray-7);
    color: var(--dark);
}
.form-select {
    border-radius: var(--radius);
    border: 1.5px solid var(--gray-4);
    padding: 11px 36px 11px 14px;
    font-size: 16px;
    transition: all 0.25s ease;
    background-color: var(--gray-7);
    color: var(--dark);
}
.form-control:hover, .form-select:hover {
    border-color: var(--primary);
    background: white;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(46, 148, 203,0.12);
    background: white;
}
.form-control::placeholder {
    color: var(--gray-3);
    font-weight: 400;
    font-style: italic;
    font-size: 15px;
}
textarea.form-control { min-height: 90px; resize: vertical; line-height: 1.6; }

/* --- Labels --- */
.form-label {
    font-weight: 600;
    font-size: 14.5px;
    color: var(--gray-1);
    margin-bottom: 7px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.form-label .text-danger { font-weight: 400; }
.form-text {
    font-size: 16px;
    color: var(--gray-3);
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* --- Required field auto-asterisk --- */
.required::after {
    content: ' *';
    color: var(--danger);
    font-weight: 400;
}

/* --- Readonly fields --- */
.form-control[readonly], .form-control:disabled {
    background: var(--gray-6);
    color: var(--gray-2);
    border-style: dashed;
    cursor: not-allowed;
    font-style: italic;
}

/* --- Toggle switches --- */
.form-check-input { cursor: pointer; transition: all 0.2s ease; }
.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(46, 148, 203,0.15);
}
.form-switch .form-check-input {
    width: 46px;
    height: 24px;
    cursor: pointer;
    border-radius: 24px;
}

/* --- Input groups --- */
.input-group .input-group-text {
    border: 1.5px solid var(--gray-4);
    background: var(--gray-6);
    color: var(--gray-2);
    font-size: 16px;
    transition: all 0.25s ease;
}
.input-group:focus-within .input-group-text {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

/* ===== FORM SECTIONS ===== */
.form-section {
    margin-bottom: 32px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--gray-5);
    position: relative;
}
.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.form-section-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Aptos', 'Segoe UI Variable', 'Segoe UI', 'Inter', sans-serif;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--gray-6);
}
.form-section-title i {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
}
.form-section-title .icon-blue { background: var(--primary-light); color: var(--primary); }
.form-section-title .icon-green { background: var(--success-light); color: var(--success); }
.form-section-title .icon-orange { background: var(--warning-light); color: var(--warning); }
.form-section-title .icon-purple { background: #F3E8FF; color: #7C3AED; }
.form-section-title .icon-red { background: var(--danger-light); color: var(--danger); }

/* ===== FORM CARD — PREMIUM ===== */
.form-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 6px 24px rgba(0,0,0,0.06);
    border: 1px solid var(--gray-5);
    overflow: hidden;
}
.form-card .card-header {
    background: linear-gradient(135deg, var(--gray-7) 0%, white 100%);
    border-bottom: 1px solid var(--gray-5);
    padding: 20px 28px;
}
.form-card .card-body {
    padding: 28px;
}
.form-card .card-footer {
    background: var(--gray-7);
    border-top: 1px solid var(--gray-5);
    padding: 18px 28px;
}

/* ===== TOGGLE GROUP — PREMIUM ===== */
.toggle-group {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}
.toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px;
    border: 1.5px solid var(--gray-5);
    border-radius: 10px;
    background: var(--gray-7);
    transition: all 0.25s ease;
    min-width: 200px;
    flex: 1;
    cursor: pointer;
}
.toggle-item:hover {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 2px 8px rgba(46, 148, 203,0.08);
}
.toggle-item:has(.form-check-input:checked) {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 2px 12px rgba(46, 148, 203,0.12);
}
.toggle-item-label {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--dark);
}
.toggle-item-desc {
    font-size: 11.5px;
    color: var(--gray-3);
    margin-top: 2px;
    line-height: 1.4;
}

/* ===== FORM PAGE HEADER — PREMIUM ===== */
.form-page-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--gray-5);
}
.form-page-header .back-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1.5px solid var(--gray-4);
    background: white;
    color: var(--gray-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    transition: all 0.25s ease;
    text-decoration: none;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.form-page-header .back-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateX(-2px);
    box-shadow: 0 4px 12px rgba(46, 148, 203,0.25);
}
.form-page-header h1 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    color: var(--dark);
}
.form-page-header .breadcrumb {
    margin: 2px 0 0;
    font-size: 15px;
}
.form-page-header .breadcrumb a {
    color: var(--gray-3);
    text-decoration: none;
    transition: color 0.15s;
}
.form-page-header .breadcrumb a:hover { color: var(--primary); }

/* ===== QUICK ACTION CARDS ===== */
.quick-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px 12px;
    background: white;
    border: 1.5px solid var(--gray-5);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--dark);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.quick-action-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--qa-color, var(--primary));
    opacity: 0;
    transition: opacity 0.3s ease;
}
.quick-action-card:hover {
    border-color: var(--qa-color, var(--primary));
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    color: var(--dark);
    text-decoration: none;
}
.quick-action-card:hover::before { opacity: 1; }
.quick-action-card .qa-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--qa-color, var(--primary));
    background: color-mix(in srgb, var(--qa-color, var(--primary)) 10%, white);
    transition: all 0.3s ease;
}
.quick-action-card:hover .qa-icon {
    background: var(--qa-color, var(--primary));
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--qa-color, var(--primary)) 30%, transparent);
}
.quick-action-card .qa-label {
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
}

/* Form page header */
.form-page-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}
.form-page-header .back-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1.5px solid var(--gray-4);
    background: white;
    color: var(--gray-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    transition: var(--transition);
    text-decoration: none;
    flex-shrink: 0;
}
.form-page-header .back-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.form-page-header h1 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    color: var(--dark);
}
.form-page-header .breadcrumb {
    margin: 0;
    font-size: 15px;
}
.form-page-header .breadcrumb a { color: var(--gray-3); text-decoration: none; }
.form-page-header .breadcrumb a:hover { color: var(--primary); }

/* Required field indicator */
.required::after {
    content: ' *';
    color: var(--danger);
    font-weight: 400;
}

/* Readonly fields */
.form-control[readonly], .form-control:disabled {
    background: var(--gray-7);
    color: var(--gray-2);
    border-style: dashed;
    cursor: not-allowed;
}

/* ===== APPROVAL CARDS ===== */
.approval-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border-left: 4px solid var(--warning);
    margin-bottom: 16px;
    transition: var(--transition);
}
.approval-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.1); }

/* ===== CHARTS ===== */
.chart-container { position: relative; height: 300px; }

/* ===== LOGIN PAGE ===== */
.login-page { min-height: 100vh; display: flex; }
.login-left {
    flex: 1;
    background: linear-gradient(135deg, #FFFFFF 0%, #E3F2FB 60%, #CDE7F5 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--dark);
    padding: 48px;
    position: relative;
    overflow: hidden;
}
.login-left::before {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    border-radius: 50%;
    background: rgba(46, 148, 203, 0.07);
    top: -100px; right: -100px;
}
.login-left::after {
    content: '';
    position: absolute;
    width: 300px; height: 300px;
    border-radius: 50%;
    background: rgba(63, 163, 74, 0.06);
    bottom: -50px; left: -50px;
}
.login-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    background: white;
}
.login-form-card { width: 100%; max-width: 420px; }

/* Al Haditha logo on the light left panel. */
.login-brand-logo {
    width: 100%;
    max-width: 320px;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto 8px;
}
/* Colored variant centred above the sign-in form on the white right panel. */
.login-form-logo {
    display: block;
    max-width: 200px;
    height: auto;
    margin: 0 auto 24px;
}
/* "Powered by SMARTVIZ" credit anchored to the bottom of the light left panel. */
.login-powered-by {
    position: absolute;
    bottom: 24px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 13px;
    color: var(--gray-2);
    letter-spacing: 1.2px;
    z-index: 1;
}
.login-powered-by-mark {
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 2px;
}

/* OLD: .login-logo-mark - replaced by .login-brand-logo, kept so legacy refs don't 404. */
.login-logo-mark {
    width: 64px; height: 64px;
    background: rgba(46, 148, 203, 0.12);
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; font-weight: 800;
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
}
.login-feature { display: flex; align-items: center; gap: 12px; margin: 12px 0; font-size: 17px; color: var(--gray-1); }
.login-feature i { font-size: 18px; color: var(--primary); }

/* Input with icon — Premium */
.input-icon-wrapper { position: relative; }
.input-icon-wrapper .form-control,
.input-icon-wrapper .form-select { padding-left: 42px; }
.input-icon-wrapper > .field-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-3);
    font-size: 17px;
    transition: color 0.25s ease;
    z-index: 4;
    pointer-events: none;
}
.input-icon-wrapper:focus-within > .field-icon {
    color: var(--primary);
}
.input-icon-wrapper .toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--gray-3);
    background: none;
    border: none;
    z-index: 4;
    transition: color 0.2s ease;
}
.input-icon-wrapper .toggle-password:hover { color: var(--primary); }

/* Textarea with icon — icon at top */
.input-icon-wrapper textarea.form-control { padding-left: 42px; padding-top: 12px; }
.input-icon-wrapper:has(textarea) > .field-icon {
    top: 14px;
    transform: none;
}

.or-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: var(--gray-3);
    font-size: 15px;
}
.or-divider::before, .or-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-5);
}
.or-divider span { padding: 0 12px; }

/* ===== KIOSK ===== */
.kiosk-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #2E94CB 0%, #12506E 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    padding: 32px;
}
.kiosk-logo {
    width: 80px; height: 80px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; font-weight: 800;
    backdrop-filter: blur(10px);
    margin-bottom: 16px;
}
.kiosk-time { font-size: 64px; font-weight: 700; font-family: 'Aptos', 'Segoe UI Variable', 'Segoe UI', 'Inter', sans-serif; letter-spacing: -2px; }
.kiosk-date { font-size: 20px; opacity: 0.9; margin-bottom: 32px; }
.kiosk-btn {
    width: 280px;
    height: 80px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 16px;
    border: none;
    background: white;
    color: var(--primary);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 8px 0;
    cursor: pointer;
    text-decoration: none;
}
.kiosk-btn:hover { transform: scale(1.03); box-shadow: 0 8px 32px rgba(0,0,0,0.2); color: var(--primary); }

.kiosk-form-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 600px;
    color: var(--dark);
}
.kiosk-form-card .form-control {
    height: 56px;
    font-size: 17px;
    border-radius: 12px;
}
.kiosk-form-card .form-select {
    height: 56px;
    font-size: 17px;
    border-radius: 12px;
}
.kiosk-purpose-tile {
    padding: 16px 24px;
    border: 2px solid var(--gray-4);
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
}
.kiosk-purpose-tile:hover, .kiosk-purpose-tile.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}

/* ===== WORKFLOW STEPPER ===== */
.workflow-stepper {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 16px 0;
}
.workflow-step {
    display: flex;
    align-items: center;
    gap: 8px;
}
.workflow-step-number {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700;
    flex-shrink: 0;
}
.workflow-step-label { font-size: 15px; font-weight: 500; color: var(--dark); white-space: nowrap; }
.workflow-step-arrow { color: var(--gray-4); font-size: 14px; margin: 0 4px; }

/* ===== PERMISSION MATRIX ===== */
.permission-list .list-group-item {
    cursor: pointer;
    border-radius: 0;
    border-left: 3px solid transparent;
    transition: var(--transition);
}
.permission-list .list-group-item:hover { background: var(--gray-7); }
.permission-list .list-group-item.active {
    background: var(--primary-light);
    border-left-color: var(--primary);
    color: var(--primary);
}

/* ===== BADGE PREVIEW ===== */
.badge-preview {
    border: 2px dashed var(--gray-4);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
}
.badge-preview-card {
    max-width: 280px;
    margin: 0 auto;
    border: 1px solid var(--gray-5);
    border-radius: var(--radius);
    padding: 20px;
    background: white;
}
.badge-preview-banner {
    background: var(--danger);
    color: white;
    padding: 6px;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 2px;
    margin: 12px -20px;
}

/* ===== GUARD DASHBOARD ===== */
.guard-action-tile {
    background: white;
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: var(--dark);
    display: block;
}
.guard-action-tile:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.12); color: var(--dark); }
.guard-action-tile .tile-icon { font-size: 36px; margin-bottom: 12px; }
.guard-action-tile .tile-label { font-size: 17px; font-weight: 600; }

/* ===== TABS CUSTOM ===== */
.nav-pills-custom .nav-link {
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 15px;
    font-weight: 500;
    color: var(--gray-2);
    transition: var(--transition);
}
.nav-pills-custom .nav-link.active {
    background: var(--primary);
    color: white;
}

/* ===== TIMELINE ===== */
.timeline-item {
    position: relative;
    padding-left: 28px;
    padding-bottom: 20px;
    border-left: 2px solid var(--gray-5);
    margin-left: 8px;
}
.timeline-item::before {
    content: '';
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid white;
    position: absolute;
    left: -7px;
    top: 2px;
}
.timeline-item.pending::before { background: var(--warning); }
.timeline-item:last-child { border-left-color: transparent; }

/* ===== PHOTO UPLOAD — PREMIUM ===== */
.photo-upload-area {
    width: 120px; height: 120px;
    border-radius: 50%;
    border: 2.5px dashed var(--gray-4);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    color: var(--gray-3);
    cursor: pointer;
    margin: 0 auto 16px;
    transition: all 0.3s ease;
    background: var(--gray-7);
    position: relative;
    overflow: hidden;
}
.photo-upload-area::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(46, 148, 203,0.05), rgba(46, 148, 203,0.02));
    opacity: 0;
    transition: opacity 0.3s ease;
}
.photo-upload-area:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(46, 148, 203,0.15);
}
.photo-upload-area:hover::after { opacity: 1; }
.photo-upload-area i { font-size: 28px; margin-bottom: 4px; position: relative; z-index: 1; }
.photo-upload-area span { position: relative; z-index: 1; font-size: 13px; }

/* ===== SPARKLINE ===== */
.sparkline-container { display: flex; align-items: end; gap: 3px; height: 30px; }
.sparkline-bar { width: 4px; border-radius: 2px; background: var(--primary); opacity: 0.6; }

/* ===== TOAST ===== */
.toast-container-custom {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}
.custom-toast {
    padding: 12px 20px;
    border-radius: var(--radius);
    color: white;
    font-weight: 500;
    font-size: 16px;
    margin-top: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: slideInRight 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}
.custom-toast.success { background: var(--success); }
.custom-toast.error { background: var(--danger); }
.custom-toast.warning { background: var(--warning); }
.custom-toast.info { background: var(--info); }

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ================================================================
   RESPONSIVE DESIGN
   ================================================================ */

/* --- Sidebar overlay backdrop (mobile) --- */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 1039;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
body.sidebar-mobile-open .sidebar-overlay { display: block; }

/* ======================== XL (>= 1200px) ======================== */
/* Default desktop — no changes needed */

/* ======================== LG (992 – 1199px) ======================== */
@media (max-width: 1199.98px) {
    :root {
        --sidebar-width: 240px;
    }
    .content-container { padding: 20px; }
    .stat-card { padding: 20px; }
    .stat-card-value { font-size: 24px; }
    .welcome-banner { padding: 22px 24px; }
    .welcome-banner h2 { font-size: 20px; }
}

/* ======================== MD (768 – 991px) — TABLET ======================== */
@media (max-width: 991.98px) {
    /* Sidebar: off-canvas on tablet */
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }
    body.sidebar-mobile-open .sidebar {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    }
    .main-wrapper { margin-left: 0 !important; }
    .sidebar-collapsed .main-wrapper { margin-left: 0 !important; }

    /* Content */
    .content-container { padding: 16px; }

    /* Page header stacks on tablet */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .page-header h1 { font-size: 20px; }

    /* Welcome banner stacks */
    .welcome-banner {
        flex-direction: column;
        gap: 16px;
        text-align: center;
        padding: 20px;
    }

    /* Stat cards */
    .stat-card { padding: 16px; }
    .stat-card-value { font-size: 22px; }
    .stat-card-icon { width: 40px; height: 40px; font-size: 17px; }

    /* Tables: horizontal scroll */
    .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_length { margin-bottom: 8px; }

    /* Login page: hide left panel */
    .login-left { display: none; }
    .login-right { padding: 32px 24px; }

    /* Guard dashboard tiles */
    .guard-action-tile { padding: 24px 16px; }
    .guard-action-tile .tile-icon { font-size: 28px; }
    .guard-action-tile .tile-label { font-size: 16px; }

    /* Filter cards */
    .filter-card { padding: 16px; }

    /* Charts */
    .chart-container { height: 250px; }

    /* Kiosk */
    .kiosk-time { font-size: 48px; }
    .kiosk-btn { width: 260px; height: 70px; font-size: 17px; }

    /* Workflow stepper: wrap */
    .workflow-stepper { flex-wrap: wrap; gap: 8px; }

    /* Approval cards: full width */
    .approval-card .card-body { padding: 16px !important; }

    /* Sticky bottom bar */
    .sticky-bottom-bar {
        padding: 12px 16px;
        flex-wrap: wrap;
    }

    /* Breadcrumbs: hide text on tablet, keep icon */
    .breadcrumb-nav .current {
        max-width: 160px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* ======================== SM (576 – 767px) — LARGE PHONE ======================== */
@media (max-width: 767.98px) {
    /* Header */
    .app-header { padding: 0 12px; height: 56px; }
    .header-right { gap: 4px; }
    .header-btn { width: 36px; height: 36px; font-size: 16px; }
    .breadcrumb-nav { display: none; }

    /* Content */
    .content-container { padding: 12px; min-height: calc(100vh - 56px); }

    /* Page header */
    .page-header {
        margin-bottom: 16px;
        padding-bottom: 12px;
    }
    .page-header h1 { font-size: 18px; }
    .page-header .btn { font-size: 15px; padding: 6px 14px; }

    /* Stat cards: 2-column grid */
    .stat-card { padding: 14px; }
    .stat-card-value { font-size: 20px; }
    .stat-card-label { font-size: 14px; }
    .stat-card-sub { font-size: 13px; }
    .stat-card-icon { width: 36px; height: 36px; font-size: 16px; border-radius: 8px; }
    .sparkline-container { display: none; }

    /* Welcome banner */
    .welcome-banner { padding: 16px; border-radius: 8px; }
    .welcome-banner h2 { font-size: 17px; }
    .welcome-banner p { font-size: 15px; }

    /* Cards */
    .card { border-radius: 8px; }
    .card-header { padding: 12px 16px; font-size: 16px; }
    .card-body { padding: 12px 16px; }

    /* Tables */
    .table-card thead th { padding: 10px 12px; font-size: 13px; }
    .table-card tbody td { padding: 10px 12px; font-size: 12.5px; }
    .dataTables_wrapper { padding: 12px; }
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_length {
        float: none !important;
        text-align: left !important;
        margin-bottom: 12px;
    }
    .dataTables_wrapper .dataTables_filter input { width: 100%; }
    .dataTables_wrapper .dataTables_info { font-size: 14px; }
    .dataTables_wrapper .dataTables_paginate { margin-top: 12px; }
    .dataTables_wrapper .dataTables_paginate .paginate_button { padding: 4px 10px !important; font-size: 14px; }

    /* Avatars smaller on mobile */
    .avatar-circle { width: 32px; height: 32px; font-size: 14px; }
    .avatar-md { width: 40px; height: 40px; font-size: 17px; }
    .avatar-lg { width: 56px; height: 56px; font-size: 20px; }

    /* Icon buttons */
    .btn-icon { width: 28px; height: 28px; font-size: 13px; }

    /* Badge status */
    .badge-status { font-size: 13px; padding: 3px 8px; }

    /* Forms */
    .form-control { padding: 8px 12px; font-size: 15px; }
    .form-select { padding: 8px 32px 8px 12px; font-size: 15px; }
    .form-label { font-size: 15px; }

    /* Tabs: scrollable */
    .nav-pills-custom {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-bottom: 4px;
    }
    .nav-pills-custom::-webkit-scrollbar { display: none; }
    .nav-pills-custom .nav-link {
        white-space: nowrap;
        font-size: 14px;
        padding: 5px 12px;
    }

    /* Filter card */
    .filter-card { padding: 12px; }

    /* Login page */
    .login-right { padding: 24px 16px; }
    .login-form-card h2 { font-size: 22px !important; }

    /* Kiosk */
    .kiosk-page { padding: 20px; }
    .kiosk-logo { width: 60px; height: 60px; font-size: 22px; }
    .kiosk-time { font-size: 40px; }
    .kiosk-date { font-size: 17px; margin-bottom: 24px; }
    .kiosk-btn { width: 100%; max-width: 300px; height: 64px; font-size: 17px; border-radius: 12px; }
    .kiosk-form-card { padding: 24px; border-radius: 16px; }
    .kiosk-form-card .form-control,
    .kiosk-form-card .form-select { height: 48px; font-size: 16px; }
    .kiosk-purpose-tile { padding: 12px 16px; font-size: 16px; }

    /* Guard dashboard */
    .guard-action-tile { padding: 20px 12px; }
    .guard-action-tile .tile-icon { font-size: 24px; margin-bottom: 8px; }
    .guard-action-tile .tile-label { font-size: 15px; }

    /* Approval cards */
    .approval-card { border-radius: 8px; }

    /* Workflow stepper: vertical on mobile */
    .workflow-stepper {
        flex-direction: column;
        align-items: flex-start;
    }
    .workflow-step-arrow {
        transform: rotate(90deg);
        margin: 4px 0 4px 8px;
    }

    /* Photo upload */
    .photo-upload-area { width: 100px; height: 100px; }
    .photo-upload-area i { font-size: 20px; }

    /* Badge preview */
    .badge-preview { padding: 16px; }
    .badge-preview-card { padding: 16px; }

    /* Sticky bottom bar */
    .sticky-bottom-bar {
        padding: 10px 12px;
        gap: 8px;
    }
    .sticky-bottom-bar .btn { font-size: 15px; padding: 8px 16px; }

    /* Charts */
    .chart-container { height: 200px; }

    /* Search result cards */
    .search-result-card { padding: 10px 12px; gap: 10px; }

    /* Info banner */
    .info-banner { font-size: 15px; padding: 10px 12px; }

    /* Permission panels: stack */
    .permission-list .list-group-item { padding: 10px 12px; font-size: 15px; }

    /* Timeline */
    .timeline-item { padding-left: 24px; }

    /* Dropdown menus */
    .dropdown-menu { font-size: 15px; }

    /* Hide less important table columns on small phones */
    .hide-sm { display: none !important; }
}

/* ======================== XS (< 576px) — SMALL PHONE ======================== */
@media (max-width: 575.98px) {
    .content-container { padding: 8px; }

    .page-header h1 { font-size: 17px; }
    .page-header-subtitle { font-size: 14px; }

    /* Stat cards: single value focus */
    .stat-card { padding: 12px; }
    .stat-card-value { font-size: 18px; }
    .stat-card-label { font-size: 13px; }
    .stat-card-icon { width: 32px; height: 32px; font-size: 15px; border-radius: 6px; }

    /* Welcome banner */
    .welcome-banner { padding: 14px; border-radius: 8px; }
    .welcome-banner h2 { font-size: 17px; }
    .welcome-banner .btn { font-size: 14px; padding: 6px 12px; }

    /* Full-width buttons on tiny screens */
    .page-header {
        gap: 8px;
    }
    .page-header .btn {
        width: 100%;
        text-align: center;
    }

    /* Tables: tighter */
    .table-card thead th { padding: 8px 8px; font-size: 12px; letter-spacing: 0.3px; }
    .table-card tbody td { padding: 8px 8px; font-size: 14px; }

    /* Cards */
    .card { border-radius: 6px; }
    .card-header { padding: 10px 12px; }

    /* Login */
    .login-right { padding: 16px 12px; }
    .login-form-card h2 { font-size: 20px !important; }

    /* Kiosk */
    .kiosk-time { font-size: 32px; letter-spacing: -1px; }
    .kiosk-date { font-size: 16px; }
    .kiosk-form-card { padding: 20px 16px; }

    /* Chart */
    .chart-container { height: 180px; }

    /* Guard tiles: full width single column */
    .guard-action-tile { padding: 16px; }
    .guard-action-tile .tile-icon { font-size: 20px; }
    .guard-action-tile .tile-label { font-size: 14px; }

    /* Header */
    .app-header { height: 52px; padding: 0 8px; }
    .header-avatar { width: 30px; height: 30px; font-size: 13px; }
    .notification-count { width: 16px; height: 16px; font-size: 11px; top: 2px; right: 2px; }

    /* Buttons */
    .btn-gradient { padding: 8px 16px; font-size: 15px; }

    /* Forms */
    .form-control { padding: 7px 10px; font-size: 15px; }
    .form-select { padding: 7px 30px 7px 10px; font-size: 15px; }

    /* Sidebar user */
    .sidebar-user { padding: 12px; }

    /* Compact icon buttons */
    .btn-icon { width: 26px; height: 26px; font-size: 12px; }
}

/* ===== DRAGGABLE DASHBOARD WIDGETS ===== */
.dashboard-widgets {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.dashboard-widget {
    position: relative;
    transition: box-shadow 0.2s ease;
}
.dashboard-widget .widget-drag-handle {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-4);
    cursor: grab;
    z-index: 10;
    font-size: 14px;
    opacity: 0;
    transition: all 0.2s ease;
    background: white;
    border: 1px solid var(--gray-5);
}
.dashboard-widget:hover .widget-drag-handle { opacity: 1; }
.dashboard-widget .widget-drag-handle:hover { color: var(--primary); border-color: var(--primary); }
.dashboard-widget .widget-drag-handle:active { cursor: grabbing; }
.dashboard-widget.sortable-ghost {
    opacity: 0.4;
    border: 2px dashed var(--primary) !important;
    border-radius: var(--radius-lg);
}
.dashboard-widget.sortable-chosen {
    box-shadow: 0 8px 32px rgba(46, 148, 203,0.15) !important;
    border-radius: var(--radius-lg);
}
.widget-lock-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 12px;
}
.widget-lock-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid var(--gray-4);
    background: white;
    color: var(--gray-2);
    transition: all 0.2s ease;
}
.widget-lock-btn:hover { border-color: var(--primary); color: var(--primary); }
.widget-lock-btn.locked { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.widget-lock-btn i { font-size: 13px; }

/* ===== NOTIFICATION SOUND SYSTEM ===== */
.notif-sound-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid var(--gray-4);
    background: white;
    color: var(--gray-2);
    transition: all 0.2s ease;
}
.notif-sound-toggle:hover { border-color: var(--success); color: var(--success); }
.notif-sound-toggle.active { background: var(--success-light); border-color: var(--success); color: var(--success); }
.notif-sound-toggle i { font-size: 13px; }

.notif-popup {
    position: fixed;
    top: 80px;
    right: 24px;
    width: 340px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    border: 1px solid var(--gray-5);
    z-index: 9999;
    animation: notifSlideIn 0.4s ease;
    overflow: hidden;
}
.notif-popup-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-5);
}
.notif-popup-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
}
.notif-popup-body { padding: 12px 16px; font-size: 15px; color: var(--gray-2); }
.notif-popup-time { font-size: 13px; color: var(--gray-3); padding: 0 16px 12px; }

@keyframes notifSlideIn {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes notifSlideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(120%); opacity: 0; }
}

/* ================================================================
   INTERACTIVE UI FEATURES — CSS
   ================================================================ */

/* --- Password strength meter --- */
.password-strength-meter {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.strength-bar {
    flex: 1;
    height: 4px;
    background: var(--gray-5);
    border-radius: 4px;
    overflow: hidden;
}
.strength-fill {
    height: 100%;
    border-radius: 4px;
    transition: all 0.4s ease;
    width: 0%;
}
.strength-text {
    font-size: 13px;
    font-weight: 600;
    min-width: 72px;
    text-align: right;
}

/* --- Char counter --- */
.char-counter {
    text-align: right;
    font-size: 13px;
    color: var(--gray-3);
    margin-top: 4px;
    transition: color 0.2s;
}
.char-counter.near-limit { color: var(--warning); }
.char-counter.at-limit { color: var(--danger); font-weight: 600; }

/* --- Scroll to top --- */
.scroll-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    font-size: 17px;
    cursor: pointer;
    z-index: 1050;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(46, 148, 203,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}
.scroll-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}
.scroll-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(46, 148, 203,0.4);
    background: var(--primary-dark);
}

/* --- Header clock --- */
.header-clock {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 8px;
    background: var(--gray-7);
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-1);
    font-family: 'Aptos', 'Segoe UI Variable', 'Segoe UI', 'Inter', sans-serif;
    border: 1px solid var(--gray-5);
}
.header-clock i {
    font-size: 14px;
    color: var(--primary);
}
@media (max-width: 767.98px) {
    .header-clock { display: none; }
}

/* --- Ripple effect --- */
.quick-action-card, .guard-action-tile, .kiosk-btn {
    position: relative;
    overflow: hidden;
}
.ripple-effect {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(46, 148, 203,0.25);
    transform: scale(0);
    animation: rippleAnim 0.6s ease-out;
    pointer-events: none;
}
@keyframes rippleAnim {
    to { transform: scale(60); opacity: 0; }
}

/* --- Chart fullscreen --- */
.chart-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 9999 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    max-width: none !important;
    width: 100% !important;
    height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
    background: white !important;
}
.chart-fullscreen .card-header {
    flex-shrink: 0;
    border-radius: 0 !important;
}
.chart-fullscreen .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 24px !important;
}
.chart-fullscreen .chart-container {
    height: 100% !important;
    max-height: none !important;
    flex: 1;
}

/* --- Table row hover cursor for clickable rows --- */
.table-card tbody tr[style*="cursor"] { transition: background 0.15s ease; }

/* --- Form invalid shake --- */
.is-invalid {
    animation: shakeField 0.4s ease;
    border-color: var(--danger) !important;
}
@keyframes shakeField {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

/* ======================== PRINT STYLES ======================== */
@media print {
    .sidebar,
    .app-header,
    .sticky-bottom-bar,
    .sidebar-overlay,
    .btn,
    .btn-icon,
    .dataTables_filter,
    .dataTables_length,
    .dataTables_paginate,
    .dataTables_info,
    .filter-card,
    .nav-pills-custom { display: none !important; }

    .main-wrapper { margin-left: 0 !important; }
    .content-container {
        padding: 0 !important;
        background: white !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        break-inside: avoid;
    }

    .stat-card { box-shadow: none !important; border: 1px solid #ddd; }

    body { background: white !important; font-size: 14px; }

    .page-header { border-bottom: 2px solid #333; }

    table { font-size: 13px; }
    thead th { background: #f0f0f0 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

    .badge-status {
        border: 1px solid currentColor;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ===== SCROLLBAR ===== */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--gray-4); border-radius: 4px; }

/* ===== Select2 custom ===== */
.select2-container--bootstrap-5 .select2-selection { border-radius: var(--radius); border-color: var(--gray-4); min-height: 42px; }

/* ===== FLATPICKR CUSTOM THEME ===== */
.flatpickr-calendar {
    border-radius: 12px !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06) !important;
    border: 1px solid var(--gray-5) !important;
    font-family: 'Inter', sans-serif !important;
    overflow: hidden;
}
.flatpickr-calendar::before,
.flatpickr-calendar::after { display: none !important; }
.flatpickr-months {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
    border-radius: 12px 12px 0 0;
    padding: 4px 0;
}
.flatpickr-months .flatpickr-month { color: white !important; fill: white !important; height: 40px !important; }
.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    fill: white !important;
    color: white !important;
    padding: 8px 12px !important;
    transition: all 0.2s ease;
}
.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
    background: rgba(255,255,255,0.15) !important;
    border-radius: 8px;
}
.flatpickr-months .flatpickr-prev-month svg,
.flatpickr-months .flatpickr-next-month svg { fill: white !important; }
.flatpickr-current-month {
    color: white !important;
    font-weight: 600 !important;
    font-size: 17px !important;
    font-family: 'Aptos', 'Segoe UI Variable', 'Segoe UI', 'Inter', sans-serif !important;
}
.flatpickr-current-month .flatpickr-monthDropdown-months {
    background: transparent !important;
    color: white !important;
    font-weight: 600 !important;
    border: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}
.flatpickr-current-month .flatpickr-monthDropdown-months option {
    background: white;
    color: var(--dark);
}
.flatpickr-current-month input.cur-year {
    color: white !important;
    font-weight: 600 !important;
}
span.flatpickr-weekday {
    color: var(--gray-2) !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.flatpickr-day {
    border-radius: 8px !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    color: var(--dark) !important;
    transition: all 0.15s ease !important;
    line-height: 38px !important;
    height: 38px !important;
    max-width: 38px !important;
}
.flatpickr-day:hover {
    background: var(--primary-light) !important;
    border-color: var(--primary-light) !important;
    color: var(--primary) !important;
}
.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(46, 148, 203,0.3) !important;
    font-weight: 600 !important;
}
.flatpickr-day.today:not(.selected) {
    border-color: var(--primary) !important;
    color: var(--primary) !important;
    background: transparent !important;
    font-weight: 700 !important;
}
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
    color: var(--gray-4) !important;
}
.flatpickr-day.disabled,
.flatpickr-day.disabled:hover {
    color: var(--gray-4) !important;
    background: transparent !important;
}
.dayContainer { padding: 4px; }
.flatpickr-innerContainer { padding: 4px 8px 8px !important; }

/* Time picker */
.flatpickr-time {
    border-top: 1px solid var(--gray-5) !important;
    padding: 8px 0 !important;
    max-height: 48px !important;
}
.flatpickr-time input {
    font-size: 17px !important;
    font-weight: 600 !important;
    color: var(--dark) !important;
    font-family: 'Aptos', 'Segoe UI Variable', 'Segoe UI', 'Inter', sans-serif !important;
}
.flatpickr-time input:hover,
.flatpickr-time input:focus {
    background: var(--primary-light) !important;
    border-radius: 6px;
}
.flatpickr-time .flatpickr-time-separator {
    color: var(--gray-3) !important;
    font-weight: 700 !important;
    font-size: 18px !important;
}
.flatpickr-time .flatpickr-am-pm {
    font-size: 15px !important;
    font-weight: 600 !important;
    color: var(--primary) !important;
    border-radius: 6px;
}
.flatpickr-time .flatpickr-am-pm:hover {
    background: var(--primary-light) !important;
}
.numInputWrapper span.arrowUp,
.numInputWrapper span.arrowDown {
    border: none !important;
    opacity: 0;
    transition: opacity 0.2s;
}
.numInputWrapper:hover span.arrowUp,
.numInputWrapper:hover span.arrowDown { opacity: 1; }
.numInputWrapper span.arrowUp::after { border-bottom-color: var(--primary) !important; }
.numInputWrapper span.arrowDown::after { border-top-color: var(--primary) !important; }

/* Flatpickr input styling — override native appearance */
input[data-flatpickr],
input.flatpickr-input {
    cursor: pointer !important;
}

/* ===== STICKY BOTTOM BAR ===== */
.sticky-bottom-bar {
    position: sticky;
    bottom: 0;
    background: white;
    padding: 16px 24px;
    border-top: 1px solid var(--gray-5);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    z-index: 100;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-3);
}
.empty-state i { font-size: 48px; margin-bottom: 16px; }
.empty-state h5 { color: var(--gray-2); }

/* ===== DURATION BADGES ===== */
.duration-short { background: var(--success-light); color: var(--success); }
.duration-medium { background: var(--warning-light); color: var(--warning); }
.duration-long { background: var(--danger-light); color: var(--danger); }

/* ===== INFO BANNER ===== */
.info-banner {
    background: var(--primary-light);
    border: 1px solid rgba(46, 148, 203,0.2);
    border-radius: var(--radius);
    padding: 12px 16px;
    color: var(--primary);
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

/* ===== SEARCH RESULT CARD ===== */
.search-result-card {
    border: 1px solid var(--gray-5);
    border-radius: var(--radius);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: var(--transition);
}
.search-result-card:hover { border-color: var(--primary); background: var(--primary-light); }

/* ===== LOG TYPE BADGES ===== */
.log-checkin { background: var(--success-light); color: var(--success); }
.log-checkout { background: var(--primary-light); color: var(--primary); }
.log-error { background: var(--danger-light); color: var(--danger); }
.log-login { background: #F3E8FF; color: #7C3AED; }

/* ===== FORM-SWITCH spacing fix (toggle and label were touching across all forms) ===== */
.form-check.form-switch { display: inline-flex; align-items: center; gap: 12px; padding-left: 0; min-height: 28px; }
.form-check.form-switch .form-check-input { margin: 0; flex: 0 0 auto; width: 2.6em; height: 1.4em; cursor: pointer; }
.form-check.form-switch .form-check-label { margin: 0; padding: 0; cursor: pointer; user-select: none; }

/* ===== FEATURE GATE (graceful-disable) ===== */
/* Banner that renders above page content when [FeatureGate] is hit. */
.feature-disabled-banner {
    background: #FEF3C7;
    border: 1px solid #FCD34D;
    color: #92400E;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 15px;
    box-shadow: 0 1px 3px rgba(146, 64, 14, 0.06);
    position: sticky;
    top: 8px;
    z-index: 100;
}
.feature-disabled-banner i { color: #D97706; font-size: 17px; }
.feature-disabled-banner .text-muted { color: #92400E !important; opacity: 0.85; }
.feature-disabled-banner a { color: #B45309; text-decoration: underline; font-weight: 600; }

/* Sidebar links for screens whose feature flag is off. */
.nav-link-disabled,
.nav-link.nav-link-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
    position: relative;
}
.nav-link-disabled::after {
    content: "\f023";   /* fa-lock */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-left: auto;
    font-size: 13px;
    color: var(--gray-3);
}

/* Body classed when banner is present so JS doesn't have to walk the DOM more than once. */
body.feature-gate-disabled .feature-gate-readonly {
    pointer-events: none;
    opacity: 0.6;
    user-select: none;
}
