        :root {
            --primary: #00458C;
            /* ACS Blue */
            --primary-hover: #003366;
            --accent: #C5A14A;
            /* ACS Gold */
            --accent-hover: #b08f3e;
            --secondary: #162136;
            /* Deep Navy */
            --bg: #f5f8fa;
            --card-bg: #ffffff;
            --text: #162136;
            /* Deep Navy for text */
            --text-dim: #546e7a;
            --danger: #d32f2f;
            --success: #2e7d32;
            --border: rgba(0, 69, 140, 0.1);
            --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
            --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Inter', sans-serif;
        }

        body {
            background: var(--bg);
            background-image:
                radial-gradient(circle at 0% 0%, rgba(0, 69, 140, 0.05) 0%, transparent 50%),
                radial-gradient(circle at 100% 100%, rgba(197, 161, 74, 0.05) 0%, transparent 50%);
            min-height: 100vh;
            color: var(--text);
            overflow-x: hidden;
        }

        #app {
            width: 100%;
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        /* Utils */
        .hidden {
            display: none !important;
        }

        .processing {
            pointer-events: none;
            opacity: 0.7;
        }

        .security-grid {
            display: flex;
            flex-direction: column;
            gap: 0;
        }

        .inline-checkin {
            width: 100% !important;
            padding: 0.4rem 0.6rem !important;
            font-size: 0.8rem !important;
            border-radius: 0.5rem !important;
            border: 1px solid var(--border) !important;
            min-height: auto !important;
            box-sizing: border-box;
        }

        .checkout-box {
            background: rgba(0, 69, 140, 0.02);
            border: 2px dashed var(--border);
            border-radius: 1rem;
            padding: 1.5rem;
            text-align: center;
            position: relative;
            overflow: visible;
        }

        .checkout-result {
            margin-top: 1.5rem;
            padding: 1rem;
            background: white;
            border-radius: 0.75rem;
            border: 1px solid var(--border);
            text-align: left;
            animation: fadeIn 0.3s ease;
        }

        /* Login Card */
        .login-card {
            background: var(--card-bg);
            border: 1px solid var(--border);
            padding: 2.5rem;
            border-radius: 1.5rem;
            width: 100%;
            max-width: 400px;
            box-shadow: var(--shadow-lg);
            animation: fadeIn 0.6s ease-out;
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(20px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .header {
            text-align: center;
            margin-bottom: 2rem;
        }

        .header h1 {
            font-family: 'Outfit', sans-serif;
            font-size: 1.875rem;
            font-weight: 700;
            margin-bottom: 0.5rem;
            color: var(--primary);
        }

        .header p {
            color: var(--text-dim);
            font-size: 0.875rem;
        }

        .form-group {
            margin-bottom: 1.25rem;
            position: relative;
        }

        .form-group:focus-within {
            z-index: 100;
        }

        .form-group label {
            display: block;
            font-size: 0.875rem;
            font-weight: 600;
            margin-bottom: 0.5rem;
            color: var(--text);
        }

        .form-group input,
        .form-group select {
            width: 100%;
            background: #ffffff;
            border: 1px solid #cfd8dc;
            border-radius: 0.75rem;
            padding: 0.75rem 1rem;
            color: var(--text);
            font-size: 1rem;
            transition: all 0.2s;
        }

        .form-group input:focus,
        .form-group select:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(0, 69, 140, 0.1);
        }

        .form-group input:read-only:not(#visitDate),
        .form-group select:disabled {
            background: var(--bg) !important;
            cursor: not-allowed;
            color: var(--text-dim);
            opacity: 1;
            /* Fix for mobile/safari washed out look */
        }

        #visitDate[readonly] {
            background: #ffffff !important;
            cursor: pointer;
            color: var(--text);
        }

        /* Custom Select */
        .custom-select-wrapper {
            position: relative;
            width: 100%;
        }

        .custom-select-trigger {
            width: 100%;
            background: #ffffff;
            border: 1px solid #cfd8dc;
            border-radius: 0.75rem;
            padding: 0.75rem 1rem;
            color: var(--text);
            font-size: 1rem;
            cursor: pointer;
            display: flex;
            justify-content: space-between;
            align-items: center;
            transition: all 0.2s;
        }

        .custom-select-trigger:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(0, 69, 140, 0.1);
        }

        .dropdown-arrow {
            font-size: 0.7rem;
            color: var(--text-dim);
            transition: transform 0.2s;
        }

        .custom-select-wrapper.open .dropdown-arrow {
            transform: rotate(180deg);
        }

        .custom-select-options {
            position: absolute;
            top: 110%;
            left: 0;
            right: 0;
            background: #ffffff;
            border: 1px solid var(--border);
            border-radius: 0.75rem;
            margin: 0;
            padding: 0.5rem 0;
            list-style: none;
            z-index: 1000;
            box-shadow: var(--shadow-lg);
            max-height: 250px;
            overflow-y: auto;
            animation: fadeIn 0.2s ease-out;
        }

        .custom-option {
            padding: 0.7rem 1rem;
            cursor: pointer;
            transition: background 0.2s;
            font-size: 0.95rem;
            color: var(--text);
        }

        .custom-option:hover {
            background: rgba(0, 69, 140, 0.05);
            color: var(--primary);
        }

        .custom-option.selected {
            background: rgba(0, 69, 140, 0.08);
            color: var(--primary);
            font-weight: 600;
        }

        .custom-option.highlighted {
            background: rgba(0, 69, 140, 0.05);
        }

        .checklist-container {
            max-height: 150px;
            overflow-y: auto;
            border: 1px solid #cfd8dc;
            border-radius: 0.75rem;
            padding: 0.75rem;
            background: #ffffff;
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }

        .checklist-item {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            font-size: 0.875rem;
            color: var(--text);
            cursor: pointer;
            padding: 0.25rem 0;
        }

        .checklist-item input[type="checkbox"] {
            width: 18px;
            height: 18px;
            cursor: pointer;
            flex-shrink: 0;
        }

        /* Input Group with Toggle */
        .input-group {
            display: flex;
            gap: 0.5rem;
            align-items: center;
        }

        .input-group input {
            flex: 1;
            margin-bottom: 0;
        }

        /* Hide native icons to prioritize custom buttons */
        input::-webkit-calendar-picker-indicator {
            display: none;
            -webkit-appearance: none;
        }

        .input-group .btn-icon {
            background: #f8fafc;
            border: 1px solid #cfd8dc;
            color: var(--text-dim);
        }

        .input-group .btn-icon:hover {
            background: #f1f5f9;
            color: var(--primary);
        }

        /* Flatpickr Customization */
        .flatpickr-calendar {
            background: #ffffff !important;
            border: 1px solid var(--primary) !important;
            box-shadow: var(--shadow-lg) !important;
            color: var(--text) !important;
            border-radius: 0.75rem !important;
            overflow: hidden;
        }

        .flatpickr-day.selected,
        .flatpickr-day.selected:hover {
            background: var(--primary) !important;
            border-color: var(--primary) !important;
            color: #ffffff !important;
        }

        .flatpickr-day.today {
            border-color: var(--accent) !important;
            font-weight: 700;
        }

        .flatpickr-day.today:hover {
            background: var(--accent) !important;
            color: #ffffff !important;
        }

        .flatpickr-months,
        .flatpickr-weekdays {
            background: var(--primary) !important;
        }

        .flatpickr-month,
        .flatpickr-next-month,
        .flatpickr-prev-month {
            color: white !important;
            fill: white !important;
        }

        span.flatpickr-weekday {
            color: rgba(255, 255, 255, 0.9) !important;
            font-weight: 700 !important;
            background: var(--primary) !important;
        }

        .flatpickr-day {
            color: var(--text) !important;
        }

        button {
            width: 100%;
            background: var(--primary);
            color: white;
            border: 1px solid transparent;
            border-radius: 0.75rem;
            padding: 0.6rem 1.25rem;
            font-size: 0.9375rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            min-height: 40px;
            line-height: 1.2;
        }

        button:hover {
            background: var(--primary-hover);
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(0, 69, 140, 0.2);
        }

        button.secondary {
            background: white;
            border: 1.5px solid var(--primary);
            color: var(--primary);
        }

        button.secondary:hover {
            background: rgba(0, 69, 140, 0.05);
        }

        button.accent {
            background: var(--accent);
            color: white;
        }

        button.accent:hover {
            background: var(--accent-hover);
            box-shadow: 0 4px 12px rgba(197, 161, 74, 0.2);
        }

        button.danger {
            background: rgba(211, 47, 47, 0.05);
            border: 1px solid rgba(211, 47, 47, 0.2);
            color: var(--danger);
        }

        button.danger:hover {
            background: rgba(211, 47, 47, 0.1);
        }

        .error-message {
            background: #ffebee;
            border: 1px solid #ffcdd2;
            color: #b71c1c;
            padding: 0.75rem;
            border-radius: 0.75rem;
            font-size: 0.875rem;
            margin-bottom: 1.25rem;
            display: none;
        }

        .error-message.visible {
            display: block !important;
        }

        /* Scrollbar Styling */
        /* Removed as requested - using default or modal-wide scrolling */

        /* Dashboard */
        .dashboard {
            width: 100%;
            max-width: 1200px;
            padding: 2rem;
            align-self: flex-start;
            margin-top: 2rem;
        }

        .navbar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1rem;
            padding: 0.75rem 1.5rem;
            background: var(--primary);
            background-image: linear-gradient(to right, var(--primary), #0056b3);
            border-radius: 1rem;
            box-shadow: var(--shadow);
            color: white;
            min-height: 70px;
            position: relative;
            /* Added for absolute positioning of children like nav-items */
        }

        .navbar-header-brand,
        .navbar-actions {
            display: flex;
            align-items: center;
            gap: 1.5rem;
        }

        .navbar-logo {
            height: 45px;
            width: auto;
        }

        .nav-user-info-mobile {
            display: none;
        }

        .nav-items {
            display: flex;
            gap: 0.3rem;
            align-items: center;
            flex-wrap: nowrap;
        }

        .nav-link {
            padding: 0.5rem 0.8rem;
            border-radius: 0.75rem;
            cursor: pointer;
            font-size: 0.875rem;
            font-weight: 600;
            color: rgba(255, 255, 255, 0.85);
            transition: all 0.2s;
            white-space: nowrap;
        }

        .nav-link:hover {
            color: white;
            background: rgba(255, 255, 255, 0.1);
        }

        .nav-link.active {
            color: white;
            background: var(--accent);
            /* ACS Gold for active links */
        }

        /* Tables */
        .card {
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: 1.5rem;
            padding: 2rem;
            margin-bottom: 1rem;
            box-shadow: var(--shadow);
        }

        table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 1.5rem;
        }

        th {
            text-align: left;
            padding: 1rem;
            color: var(--text);
            font-weight: 700;
            font-size: 0.875rem;
            border-bottom: 2px solid var(--bg);
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        td {
            padding: 1rem;
            border-bottom: 1px solid var(--bg);
            font-size: 0.9375rem;
        }

        tr:hover td {
            background: rgba(0, 69, 140, 0.02);
        }

        tr:last-child td {
            border-bottom: none;
        }

        .role-pill {
            padding: 0.25rem 0.75rem;
            border-radius: 9999px;
            font-size: 0.75rem;
            font-weight: 700;
            text-transform: uppercase;
            background: #eceff1;
            color: #455a64;
            white-space: nowrap;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }

        .role-pill.admin {
            background: #e3f2fd;
            color: var(--primary);
        }

        .role-pill.success,
        .role-pill.active {
            background: #e8f5e9;
            color: var(--success);
        }

        .role-pill.inactive {
            background: #ffebee;
            color: var(--danger);
        }

        .role-pill.info {
            background: var(--secondary);
            color: white;
        }

        /* ACS/Gov ID info icon + body-level fixed tooltip */
        .acs-id-tooltip-wrap {
            display: inline-flex;
            align-items: center;
        }

        .acs-id-icon {
            font-style: normal;
            font-size: 0.85rem;
            cursor: default;
            opacity: 0.7;
            line-height: 1;
        }

        .info-tooltip {
            font-style: normal;
            font-size: 0.9rem;
            cursor: default;
            opacity: 0.6;
            line-height: 1;
            margin-left: 0.4rem;
            color: var(--primary);
            transition: opacity 0.2s;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            background: rgba(0, 69, 140, 0.05);
        }

        .info-tooltip:hover {
            opacity: 1;
            background: rgba(0, 69, 140, 0.1);
        }

        #acs-global-tooltip {
            position: fixed;
            z-index: 99999;
            background: #1e293b;
            color: #f1f5f9;
            font-size: 0.75rem;
            font-weight: 500;
            white-space: normal;
            max-width: 250px;
            line-height: 1.4;
            padding: 0.6rem 0.9rem;
            border-radius: 0.6rem;
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.15s ease;
            letter-spacing: 0.01em;
            text-align: center;
        }

        #acs-global-tooltip.visible {
            opacity: 1;
        }

        #acs-global-tooltip::after {
            content: '';
            position: absolute;
            top: 100%;
            left: 50%;
            transform: translateX(-50%);
            border: 5px solid transparent;
            border-top-color: #1e293b;
        }

        /* Modal */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(22, 33, 54, 0.6);
            /* Translucent Deep Navy */
            backdrop-filter: blur(4px);
            display: flex;
            align-items: flex-start;
            /* Start from top to allow scrolling */
            justify-content: center;
            z-index: 100;
            overflow-y: auto;
            padding: 2rem 0;
            transition: all 0.3s;
        }

        .modal-overlay.processing {
            pointer-events: none;
            cursor: wait;
        }

        .modal-overlay.processing .card {
            opacity: 0.6;
            filter: blur(1px);
        }

        .action-btns {
            display: flex;
            gap: 0.5rem;
        }

        .action-btns button {
            padding: 0.4rem 0.8rem;
            margin-top: 0;
            width: auto;
            font-size: 0.75rem;
            min-height: 32px;
        }

        .modal-footer {
            display: flex;
            gap: 1rem;
            margin-top: 2rem;
            align-items: center;
        }

        .modal-footer button {
            flex: 1;
            margin-top: 0 !important;
        }

        /* Visitor Row Logic */
        .visitor-row .add-btn {
            display: none !important;
        }

        .visitor-row:last-child .add-btn {
            display: flex !important;
        }

        /* Hide remove button if it's the only one */
        .visitor-party-container .visitor-row:first-child:last-child .remove-btn {
            display: none !important;
        }

        .section-title {
            font-family: 'Outfit', sans-serif;
            font-size: 1.5rem;
            color: var(--primary);
            margin-bottom: 1.5rem;
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }

        .section-title::before {
            content: '';
            display: block;
            width: 4px;
            height: 1.5rem;
            background: var(--accent);
            border-radius: 2px;
        }

        .nav-user-details {
            font-size: 0.875rem;
            color: rgba(255, 255, 255, 0.8);
            font-weight: 500;
        }

        .logout-btn {
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
            color: white;
            padding: 0.4rem 1.2rem;
            border-radius: 0.75rem;
            font-size: 0.875rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            width: auto;
            min-height: auto;
        }

        .logout-btn:hover {
            background: white;
            color: var(--primary);
            transform: translateY(-1px);
        }

        /* Responsive Wrapper for Tables */
        .table-responsive {
            width: 100%;
            overflow-x: clip;
            -webkit-overflow-scrolling: touch;
            margin-top: 1.5rem;
            border-radius: 0.75rem;
        }

        /* Mobile Adjustments */
        @media (max-width: 768px) {
            .dashboard {
                padding: 1rem;
                margin-top: 1rem;
            }

            .card {
                padding: 1.25rem !important;
                border-radius: 1rem;
            }

            .section-title {
                font-size: 1.25rem;
            }

            .hide-mobile {
                display: none !important;
            }

            /* Responsive visitor row layout */
            .visitor-row {
                grid-template-columns: 1fr 1fr !important;
                grid-template-areas:
                    "lname fname"
                    "actions actions";
                gap: 0.75rem 0.5rem !important;
                padding: 1rem !important;
                border: 1px solid var(--border);
                border-radius: 0.75rem;
                background: white;
            }

            .vis-fname {
                grid-area: fname;
            }

            .vis-lname {
                grid-area: lname;
            }

            .visitor-row-actions {
                grid-area: actions;
                justify-content: flex-end;
            }

            .modal-overlay {
                padding: 1rem 0;
            }
        }

        @media (max-width: 480px) {
            .login-card {
                padding: 1.5rem;
                border-radius: 1rem;
            }

            .header h1 {
                font-size: 1.5rem;
            }

            .visitor-row {
                grid-template-columns: 1fr !important;
                grid-template-areas:
                    "lname"
                    "fname"
                    "actions";
            }
        }

        .btn-icon {
            width: 38px;
            height: 38px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 0.75rem;
            cursor: pointer;
            transition: all 0.2s;
            border: none;
            margin-top: 0;
            font-size: 1.1rem;
        }

        .empty-state-row td {
            text-align: center;
            padding: 2rem;
            color: var(--text-dim);
        }

        .minor-pill {
            display: flex;
            width: 100%;
            margin-top: 0.3rem;
            font-size: 0.7rem;
            background: #fff8e1;
            color: #b45309;
            border: 1px solid #fde68a;
        }

        .minor-pill.checked-out {
            background: #e8f5e9;
            color: var(--success);
            border: 1px solid #c8e6c9;
        }

        .time-stack {
            font-size: 0.8rem;
            color: var(--text-dim);
            line-height: 1.2;
            text-align: right;
        }

        .time-stack .scheduled {
            white-space: nowrap;
            font-weight: 600;
        }

        .time-stack .check-in {
            color: var(--primary);
            font-weight: 600;
            white-space: nowrap;
        }

        .time-stack .check-out {
            color: var(--success);
            font-weight: 600;
            white-space: nowrap;
        }

        .id-badge {
            background: var(--primary);
            color: white;
            position: relative;
            display: flex;
            width: 100%;
            align-items: center;
            justify-content: center;
            gap: 0.3rem;
        }

        .td-top {
            vertical-align: top;
        }

        .no-margin-bottom {
            margin-bottom: 0 !important;
        }

        .text-bold {
            font-weight: 600;
        }

        .accent-border {
            border: 1.5px solid var(--accent) !important;
        }

        .checkin-visitor-card {
            border: 1px solid var(--border);
            padding: 1rem;
            border-radius: 0.75rem;
            margin-bottom: 1rem;
        }

        .checkin-visitor-card .header-div {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .alert-pill {
            display: block;
            text-align: center;
            padding: 1rem;
            font-weight: 700;
            color: white;
            border-radius: 0.75rem;
            margin-top: 1rem;
        }

        .alert-pill.success {
            background: var(--success);
        }

        .alert-pill.info {
            background: var(--secondary);
            padding: 1.5rem;
        }

        .sub-info {
            margin-top: 0.5rem;
            color: var(--text-dim);
            font-size: 0.85rem;
        }

        .btn-icon.add {
            background: var(--primary);
            color: white;
            flex-shrink: 0;
        }

        .btn-icon.add:hover {
            background: var(--primary-hover);
        }

        .btn-icon.remove {
            background: #ffebee;
            border: 1px solid #ffcdd2;
            color: var(--danger);
            flex-shrink: 0;
        }

        .btn-icon.remove:hover {
            background: #ffcdd2;
        }

        .visitor-row {
            display: grid;
            grid-template-columns: 1fr 1fr 40px;
            gap: 0.5rem;
            margin-bottom: 0.75rem;
            align-items: center;
        }

        .visitor-row-actions {
            display: flex;
            gap: 0.25rem;
            justify-content: center;
            align-items: center;
            width: 40px;
        }

        /* Logic to expand ID field when only one button is visible */
        .visitor-row.single-row {
            grid-template-columns: 1fr 1fr;
        }

        .visitor-row.single-row .visitor-row-actions {
            display: none;
        }

        /* Custom Scrollbar for white theme */
        ::-webkit-scrollbar {
            width: 8px;
        }

        ::-webkit-scrollbar-track {
            background: #f1f5f9;
        }

        /* Logo Styling */
        .logo-container {
            margin-bottom: 1.5rem;
            display: flex;
            justify-content: center;
        }

        .main-logo {
            max-width: 280px;
            width: 100%;
            height: auto;
        }

        .logo-blue {
            filter: brightness(0) saturate(100%) invert(18%) sepia(91%) saturate(2227%) hue-rotate(198deg) brightness(97%) contrast(101%);
        }

        .navbar-logo {
            height: 32px;
            width: auto;
            margin-right: 1rem;
        }

        @media (max-width: 768px) {
            .navbar-logo {
                margin-right: 0;
                margin-bottom: 0.5rem;
                height: 28px;
            }
        }

        /* Tag/Chip System for Co-Owners */
        .tags-input-container {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            padding: 0.5rem;
            border: 1px solid #cfd8dc;
            border-radius: 0.75rem;
            background: #ffffff;
            min-height: 50px;
            cursor: text;
        }

        .tag-chip {
            background: var(--primary);
            color: white;
            padding: 0.25rem 0.75rem;
            border-radius: 999px;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.875rem;
            font-weight: 500;
        }

        .tag-chip .remove-tag {
            cursor: pointer;
            font-weight: 800;
            font-size: 1.1rem;
            opacity: 0.8;
            line-height: 1;
        }

        .tag-chip .remove-tag:hover {
            opacity: 1;
        }

        .tags-input {
            border: none !important;
            outline: none !important;
            box-shadow: none !important;
            padding: 0.25rem !important;
            min-width: 120px;
            flex: 1;
        }

        .autocomplete-dropdown {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            background: white;
            border: 1px solid var(--border);
            border-radius: 0.75rem;
            box-shadow: var(--shadow-lg);
            max-height: 320px;
            overflow-y: auto;
            z-index: 1000;
            width: 100%;
            margin-top: 6px;
            text-align: left;
        }

        .no-matches-message {
            padding: 1.5rem;
            text-align: center;
            color: var(--text);
            font-size: 1rem;
            line-height: 1.6;
            background: #f8fafc;
        }

        .no-matches-message strong {
            display: block;
            color: var(--primary);
            font-size: 1.15rem;
            margin-bottom: 0.25rem;
        }

        .no-matches-message .sub {
            color: var(--text-dim);
            font-size: 0.9rem;
        }

        .autocomplete-item {
            padding: 0.75rem 1rem;
            cursor: pointer;
            font-size: 0.875rem;
            transition: background 0.2s;
            text-align: left;
        }

        .autocomplete-item:hover,
        .autocomplete-item.active {
            background: #f1f5f9;
        }

        .autocomplete-item .sub {
            color: var(--text-dim);
            font-size: 0.75rem;
            display: block;
        }

        .security-badge {
            display: inline-flex;
            align-items: center;
            padding: 0.2rem 0.5rem;
            border-radius: 0.4rem;
            font-size: 0.7rem;
            font-weight: 700;
            margin-left: 0.5rem;
        }

        .security-badge.active {
            background: var(--primary);
            color: white;
        }

        .security-badge.out {
            background: var(--success);
            color: white;
        }

        .app-footer {
            margin-top: 0;
            padding: 0.5rem 1rem;
            background: var(--primary);
            background-image: linear-gradient(to right, var(--primary), #0056b3);
            border-radius: 0.75rem;
            color: rgba(255, 255, 255, 0.8);
            text-align: center;
            font-size: 0.75rem;
            font-weight: 500;
            box-shadow: var(--shadow-sm);
        }

        .flex-center {
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .flex-between {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .flex-column {
            display: flex;
            flex-direction: column;
        }

        .flex-align-center {
            display: flex;
            align-items: center;
        }

        .items-start {
            align-items: start !important;
        }

        .mh-auto {
            margin-left: auto;
            margin-right: auto;
        }

        .mv-1 {
            margin: 1rem 0 !important;
        }

        .hr-border {
            flex: 1;
            border: none;
            border-top: 1px solid var(--border);
        }

        .login-header-text {
            font-size: 1.25rem;
            margin-top: -0.5rem;
            opacity: 0.8;
        }

        .grid-2 {
            display: grid;
            grid-template-columns: 1fr 1fr;
        }

        .grid-details {
            display: grid;
            grid-template-columns: 5fr 4fr;
        }

        .danger-text {
            color: var(--danger) !important;
        }

        .gap-05 {
            gap: 0.25rem;
        }

        .gap-1 {
            gap: 0.5rem;
        }

        .gap-2 {
            gap: 1rem;
        }

        .w-full {
            width: 100% !important;
        }

        .w-auto {
            width: auto !important;
        }

        .mb-0 {
            margin-bottom: 0 !important;
        }

        .mb-1 {
            margin-bottom: 0.5rem !important;
        }

        .mb-2 {
            margin-bottom: 1rem !important;
        }

        .mb-3 {
            margin-bottom: 1.5rem !important;
        }

        .mb-4 {
            margin-bottom: 2rem !important;
        }

        .mt-0 {
            margin-top: 0 !important;
        }

        .mt-1 {
            margin-top: 0.5rem !important;
        }

        .mt-2 {
            margin-top: 1rem !important;
        }

        .mt-3 {
            margin-top: 1.5rem !important;
        }

        .badge-accent {
            border: 2px solid var(--accent);
            font-weight: 600;
        }

        .text-center {
            text-align: center;
        }

        .text-right {
            text-align: right;
        }

        .text-white {
            color: white !important;
        }

        .text-nowrap {
            white-space: nowrap;
        }

        .ls-1 {
            letter-spacing: 1px;
        }

        .lh-15 {
            line-height: 1.5;
        }

        .pre-wrap {
            white-space: pre-wrap;
        }

        .p-0 {
            padding: 0 !important;
        }

        .p-04-08 {
            padding: 0.4rem 0.8rem !important;
        }

        .w-90 {
            width: 90% !important;
        }

        .w-95 {
            width: 95% !important;
        }

        .w-80 {
            width: 80px !important;
        }

        .w-100 {
            width: 100px !important;
        }

        .min-w-100 {
            min-width: 100px;
        }

        .min-w-150 {
            min-width: 150px;
        }

        .flex-wrap {
            flex-wrap: wrap;
        }

        .grid-header {
            display: grid;
            grid-template-columns: 1fr 120px;
            gap: 1rem;
        }

        .sub-text-dim {
            color: var(--text-dim) !important;
        }

        .ql-search {
            font-size: 1.25rem;
            padding: 1.25rem 4rem 1.25rem 1.5rem;
            border-radius: 1rem;
            transition: all 0.25s ease;
            height: auto;
            border: 2px solid var(--accent);
            background: #fff;
        }

        .ql-search:focus {
            border-color: var(--primary) !important;
            box-shadow: 0 10px 25px rgba(0, 69, 140, 0.1) !important;
            outline: none;
            transform: translateY(-1px);
        }

        .ql-search:hover {
            border-color: var(--primary);
        }

        .checkout-box {
            position: relative;
            width: 100%;
        }

        .ql-scanner-actions {
            position: absolute;
            right: 2.25rem;
            top: 50%;
            transform: translateY(-50%);
            display: flex;
            align-items: center;
            gap: 0.5rem;
            z-index: 10;
        }

        .scanner-btn-inline {
            width: 44px !important;
            height: 44px !important;
            padding: 0 !important;
            border-radius: 0.75rem !important;
            box-shadow: none !important;
            margin: 0 !important;
        }

        .btn-large-pill {
            padding: 0.6rem 2rem;
            border-radius: 9999px;
        }

        .max-w-450 {
            max-width: 450px;
        }

        .max-w-500 {
            max-width: 500px;
        }

        .max-w-550 {
            max-width: 550px;
        }

        .max-w-800 {
            max-width: 800px;
        }

        .pointer-none {
            pointer-events: none;
        }

        .relative {
            position: relative;
        }

        .absolute-top {
            position: absolute;
            bottom: calc(100% + 6px);
            left: 0;
            right: 0;
        }

        .z-10 {
            z-index: 10;
        }

        .p-2 {
            padding: 2rem;
        }

        .rounded-pill {
            border-radius: 9999px;
        }

        .shadow-sm {
            box-shadow: var(--shadow-sm);
        }

        .ci-id {
            width: 140px !important;
            padding: 0.4rem !important;
            border-color: var(--primary) !important;
        }

        .text-left {
            text-align: left !important;
        }

        .btn-small {
            width: auto;
            min-height: auto;
            padding: 0.4rem 0.75rem;
            font-size: 0.75rem;
            border-radius: 0.6rem;
            background: var(--primary);
            color: white;
            font-weight: 600;
        }

        .btn-danger {
            background: var(--danger) !important;
            color: white !important;
        }

        /* Visitor Card Lookup Feature */
        #quickLookupScanner,
        #lookupScanner {
            width: 100%;
            max-width: 500px;
            margin: 0 auto;
            border-radius: 1rem;
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: center;
            background: transparent;
        }

        #quickLookupScanner:not(:empty),
        #lookupScanner:not(:empty) {
            margin: 1rem auto;
            border: 2px solid var(--border);
            background: #000;
            min-height: 250px;
        }

        #quickLookupScanner video,
        #lookupScanner video {
            width: 100% !important;
            height: auto !important;
            border-radius: 0.75rem;
            display: block;
        }

        .lookup-card {
            background: white;
            border: 1px solid var(--border);
            border-radius: 1rem;
            padding: 1.5rem;
            box-shadow: var(--shadow);
            margin-top: 1.5rem;
            animation: fadeIn 0.3s ease;
        }

        .lookup-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 1rem;
            padding-bottom: 1rem;
            border-bottom: 1px solid var(--border);
        }

        .lookup-header h3 {
            font-family: 'Outfit', sans-serif;
            font-size: 1.25rem;
            color: var(--primary);
            margin: 0;
        }

        .lookup-body {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1.25rem;
        }

        .lookup-info-item label {
            display: block;
            font-size: 0.7rem;
            font-weight: 700;
            color: var(--text-dim);
            text-transform: uppercase;
            margin-bottom: 0.25rem;
            letter-spacing: 0.05em;
        }

        .lookup-info-item p {
            font-size: 1rem;
            color: var(--text);
            font-weight: 500;
            margin: 0;
        }

        @media (max-width: 600px) {
            .lookup-body {
                grid-template-columns: 1fr;
            }
        }

        /* Mobile Menu & General Responsiveness */
        .mobile-menu-btn {
            display: none;
            background: transparent;
            border: none;
            color: white;
            font-size: 1.5rem;
            cursor: pointer;
            padding: 0.5rem;
            margin-top: 0;
            width: auto;
            min-height: auto;
        }

        @media (max-width: 900px) {
            .navbar {
                padding: 0.5rem 1rem;
                min-height: 60px;
                border-radius: 0.75rem;
            }

            .navbar-header-brand {
                gap: 0.5rem;
            }

            .navbar-logo {
                height: 32px;
            }

            .mobile-menu-btn {
                display: block;
                order: -1;
                font-size: 2rem;
                /* Larger icon */
                padding: 0.8rem;
                /* Larger touch area */
                z-index: 1001;
                /* Above nav-items if needed */
                line-height: 1;
                min-width: 44px;
                min-height: 44px;
            }

            .nav-items {
                display: none !important;
                position: absolute;
                top: calc(100% + 5px);
                left: 0.5rem;
                right: 0.5rem;
                background: var(--primary);
                flex-direction: column;
                padding: 1rem;
                border-radius: 1rem;
                box-shadow: var(--shadow-lg);
                z-index: 9999;
                /* Insanely high z-index */
                gap: 0.5rem;
                border: 1px solid rgba(255, 255, 255, 0.1);
            }

            .nav-items.active {
                display: flex !important;
                animation: slideInDown 0.2s ease-out;
            }

            .nav-user-info-mobile {
                display: block !important;
                padding: 0.5rem 1rem;
                border-bottom: 1px solid rgba(255, 255, 255, 0.1);
                margin-bottom: 0.5rem;
            }

            .nav-user-info-mobile .nav-user-details {
                font-weight: 700;
                color: var(--accent);
                font-size: 1rem;
            }

            .nav-link {
                width: 100%;
                text-align: left;
                padding: 0.8rem 1rem;
                border-radius: 0.5rem;
            }

            .navbar-actions .nav-user-details {
                display: none;
            }

            .logout-btn {
                padding: 0.4rem 0.8rem;
                font-size: 0.8rem;
            }
        }

        @keyframes slideInDown {
            from {
                opacity: 0;
                transform: translateY(-10px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /* Enhanced Table Responsiveness (Card View) */
        @media (max-width: 768px) {
            .table-responsive {
                border: none;
            }

            table,
            thead,
            tbody,
            th,
            td,
            tr {
                display: block;
            }

            thead tr {
                position: absolute;
                top: -9999px;
                left: -9999px;
            }

            tr {
                background: white;
                border: 1px solid var(--border);
                border-radius: 1rem;
                margin-bottom: 1rem;
                padding: 1rem;
                box-shadow: var(--shadow-sm);
            }

            td {
                border: none;
                border-bottom: 1px solid rgba(0, 0, 0, 0.05);
                position: relative;
                padding-left: 50% !important;
                text-align: right !important;
                min-height: 3rem;
                display: flex;
                align-items: center;
                justify-content: flex-end;
            }

            td:last-child {
                border-bottom: none;
            }

            td::before {
                content: attr(data-label);
                position: absolute;
                left: 1rem;
                width: 45%;
                padding-right: 10px;
                white-space: nowrap;
                text-align: left;
                font-weight: 700;
                color: var(--text-dim);
                font-size: 0.75rem;
                text-transform: uppercase;
            }

            /* Exceptions for specific tables/rows that shouldn't be card-view */
            .no-card-mobile td {
                padding-left: 0.5rem !important;
                text-align: left !important;
                display: table-cell;
            }
        }

        /* Form & Modal Adjustments for Touch */
        @media (max-width: 480px) {
            .modal-overlay {
                padding: 0.5rem;
            }

            .card {
                padding: 1rem;
            }

            input,
            select,
            button {
                font-size: 16px !important;
                /* Prevent iOS zoom */
            }

            .btn-icon {
                width: 44px;
                height: 44px;
                /* Larger touch target */
            }
        }

        /* Debug Console Styles */
        .debug-console {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            height: 40vh;
            background: #1e293b;
            color: #f1f5f9;
            z-index: 99999;
            padding: 1rem;
            box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3);
            display: flex;
            flex-direction: column;
            font-family: 'Courier New', Courier, monospace;
            font-size: 0.8rem;
            border-top: 2px solid var(--accent);
        }

        .debug-console-header {
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            padding-bottom: 0.5rem;
            margin-bottom: 0.5rem;
            font-weight: bold;
            color: var(--accent);
        }

        .debug-console-output {
            flex: 1;
            overflow-y: auto;
            white-space: pre-wrap;
            word-break: break-all;
        }

        .debug-log-item {
            margin-bottom: 0.25rem;
            border-bottom: 1px solid rgba(255, 255, 255, 0.05);
            padding: 2px 0;
        }

        .debug-log-error {
            color: #f87171;
        }

        .debug-log-warn {
            color: #fbbf24;
        }

        .debug-log-info {
            color: #60a5fa;
        }

        .fs-07 {
            font-size: 0.7rem !important;
        }

        .p-02-06 {
            padding: 0.2rem 0.6rem !important;
        }