body {
    margin: 0;
    background: #111;
    color: #fff;
    font-family: Arial, sans-serif;
}

.topbar {
    background: #c62828;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: bold;
    position: relative;
}

.topbar .logo {
    font-size: 18px;
    font-weight: bold;
}

.top-nav {
    display: flex;
    gap: 8px;
    flex: 1;
    justify-content: center;
    margin: 0 12px;
}

.nav-tab {
    padding: 6px 12px;
    color: #fff;
    text-decoration: none;
    font-size: 12px;
    border-radius: 4px;
    white-space: nowrap;
}

.nav-tab:hover,
.nav-tab.active {
    background: rgba(255, 255, 255, 0.2);
}

.topbar .user {
    font-size: 12px;
    white-space: nowrap;
}

.content {
    padding: 16px;
    min-height: calc(100vh - 120px);
}

/* Form Styles */
.form-container {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: #ccc;
}

.form-group input {
    width: 100%;
    padding: 12px;
    margin-bottom: 0;
    border-radius: 6px;
    border: 1px solid #444;
    background: #222;
    color: #fff;
    font-size: 14px;
    box-sizing: border-box;
}

/* QR Code Styles */
.qr-container {
    margin: 20px 0;
    text-align: center;
}

.qr-box {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin: 0 auto 16px;
    max-width: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-image {
    width: 100%;
    max-width: 250px;
    height: auto;
}

.vin-number {
    font-size: 14px;
    color: #fff;
    margin-top: 12px;
    font-family: monospace;
    letter-spacing: 1px;
}

.qr-info {
    color: #fff;
    margin-top: 16px;
}

.plate-no {
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 8px;
}

.vehicle-info {
    font-size: 14px;
    color: #ccc;
    margin-bottom: 16px;
}

.htmx-indicator {
    display: none;
    color: #4caf50;
    font-size: 14px;
    margin-top: 12px;
    text-align: center;
}

.htmx-indicator.htmx-request {
    display: block;
}

.btn-generate,
.btn-regenerate {
    width: 100%;
    padding: 14px;
    background: #c62828;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    margin-top: 12px;
}

.btn-regenerate {
    max-width: 300px;
    margin: 0 auto;
    display: block;
}

/* Camera Styles */
.camera-container {
    position: relative;
    width: 100%;
    margin-bottom: 24px;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

#reader {
    width: 100%;
    min-height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.camera-scanner {
    width: 100%;
    min-height: 300px;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

#reader video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 8px;
}

.scan-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.scan-frame {
    width: 250px;
    height: 250px;
    border: 3px solid #4caf50;
    border-radius: 8px;
    position: relative;
}

.corner-tl,
.corner-tr,
.corner-bl,
.corner-br {
    position: absolute;
    width: 30px;
    height: 30px;
    border: 3px solid #4caf50;
}

.corner-tl {
    top: -3px;
    left: -3px;
    border-right: none;
    border-bottom: none;
    border-top-left-radius: 8px;
}

.corner-tr {
    top: -3px;
    right: -3px;
    border-left: none;
    border-bottom: none;
    border-top-right-radius: 8px;
}

.corner-bl {
    bottom: -3px;
    left: -3px;
    border-right: none;
    border-top: none;
    border-bottom-left-radius: 8px;
}

.corner-br {
    bottom: -3px;
    right: -3px;
    border-left: none;
    border-top: none;
    border-bottom-right-radius: 8px;
}

.scan-text {
    margin-top: 20px;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
}

.scan-controls {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    background: rgba(0, 0, 0, 0.7);
}

.start-scan-btn {
    padding: 15px 30px;
    background: #c62828;
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: bold;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
}

.start-scan-btn:active {
    transform: scale(0.95);
}

/* Update Location Styles */
.update-section {
    margin-top: 20px;
}

.section-title {
    font-size: 20px;
    margin: 0 0 4px 0;
    color: #fff;
}

.section-subtitle {
    font-size: 14px;
    color: #aaa;
    margin: 0 0 16px 0;
}

.stall-input {
    width: 100%;
    padding: 12px;
    margin-bottom: 16px;
    border-radius: 6px;
    border: 1px solid #444;
    background: #fff;
    color: #000;
    font-size: 14px;
    box-sizing: border-box;
}

.btn-update {
    width: 100%;
    padding: 14px;
    background: #c62828;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
}

.vehicle-details {
    margin-top: 24px;
    text-align: left;
}

.vehicle-details .section-title {
    margin-bottom: 16px;
    text-align: left;
}

.vehicle-details .history-details strong {
    color: #333 !important;
    font-weight: 700;
    text-align: left !important;
}

.vehicle-details .history-card {
    text-align: left;
}

/* History Styles */
.history-title {
    font-size: 20px;
    margin: 0 0 8px 0;
    color: #fff;
}

.date {
    font-size: 14px;
    color: #aaa;
    margin: 0 0 20px 0;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-card {
    background: #fff;
    color: #000;
    padding: 16px;
    border-radius: 8px;
    text-align: left !important;
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.history-plate {
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 8px;
    text-align: left !important;
    display: block;
    color: #000;
}

.history-details {
    font-size: 14px;
    color: #555;
    text-align: left !important;
    line-height: 1.5;
    display: block;
}

.history-details strong {
    color: #000 !important;
    font-weight: 800 !important;
    text-align: left !important;
}

.search-result-row {
    display: flex !important;
    justify-content: flex-start !important;
    align-items: flex-start !important;
    width: 100% !important;
    text-align: left !important;
    margin-bottom: 6px !important;
}

.search-result-label {
    min-width: 90px !important;
    font-weight: 800 !important;
    color: #000 !important;
    text-align: left !important;
}

.search-result-value {
    color: #333 !important;
    text-align: left !important;
    flex: 1;
}

.status-in {
    color: #2e7d32;
    font-weight: bold;
}

.status-out {
    color: #c62828;
    font-weight: bold;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    width: 100%;
    background: #222;
    display: flex;
    border-top: 1px solid #333;
    z-index: 100;
}

.nav-link {
    flex: 1;
    padding: 12px 8px;
    text-align: center;
    color: #fff;
    text-decoration: none;
    font-size: 12px;
    transition: background 0.2s;
}

.nav-link:hover,
.nav-link.active {
    background: #c62828;
}

/* Sidebar & Mobile Menu */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0 8px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

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

.sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 260px;
    height: 100vh;
    background: #a41b1b;
    z-index: 1000;
    transition: left 0.3s ease;
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    color: #fff;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.sidebar.active {
    left: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar-title {
    font-size: 20px;
    font-weight: bold;
    color: #fff;
}

.close-sidebar {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sidebar-link {
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    padding: 12px;
    border-radius: 6px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: rgba(255, 255, 255, 0.2);
    /* White overlay on hover */
    color: #fff;
    font-weight: bold;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .topbar {
        padding: 12px 16px;
        justify-content: space-between;
    }

    .top-nav {
        display: none;
        /* Hide horizontal nav on mobile */
    }

    .menu-toggle {
        display: block;
        /* Show hamburger menu */
    }

    .topbar .logo {
        font-size: 18px;
    }

    .topbar .user {
        display: block;
        font-size: 11px;
    }

    /* Content adjustments */
    .content {
        padding: 16px;
        min-height: calc(100vh - 60px);
    }

    /* Form adjustments */
    .form-group input,
    .stall-input {
        font-size: 16px;
    }

    /* QR Code & Camera adjustments */
    .qr-box {
        max-width: 100%;
        box-sizing: border-box;
    }

    .qr-image {
        max-width: 100%;
    }

    .camera-container,
    .camera-scanner {
        min-height: 250px;
    }

    /* Section titles */
    .section-title {
        font-size: 20px;
    }
}