/* MyParkingManager - Mobile-First Responsive Design */

/* ======================
   BASE / MOBILE STYLES (320px+)
   ====================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #0f172a;
    color: #e2e8f0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: calc(100vw - 40px);
}

.toast {
    background: #1e293b;
    color: #e2e8f0;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    border-left: 4px solid #3b82f6;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    max-width: 400px;
    animation: slideIn 0.3s ease-out;
    word-wrap: break-word;
}

.toast.success {
    border-left-color: #10b981;
}

.toast.error {
    border-left-color: #ef4444;
}

.toast.warning {
    border-left-color: #f59e0b;
}

.toast.info {
    border-left-color: #3b82f6;
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.toast-close:hover {
    background: rgba(148, 163, 184, 0.1);
    color: #e2e8f0;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.toast.removing {
    animation: slideOut 0.3s ease-out forwards;
}

/* Login Page */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 16px;
}

.login-card {
    background: #1e293b;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
}

.login-card h1 {
    font-size: 24px;
    margin-bottom: 8px;
    color: #fff;
}

.subtitle {
    color: #cbd5e1;
    margin-bottom: 24px;
    font-size: 14px;
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 4px;
    color: #ffffff;
    font-size: 16px; /* 16px prevents zoom on iOS */
    min-height: 44px; /* Better touch target */
}

/* Date input specific styling */
input[type="date"] {
    color: #ffffff !important;
    color-scheme: dark;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

input[type="date"]::-webkit-datetime-edit-text,
input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-day-field,
input[type="date"]::-webkit-datetime-edit-year-field {
    color: #ffffff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.contact-section {
    background: #1e293b;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 12px;
    border-left: 3px solid #4a90e2;
}

.contact-section h5 {
    color: #e2e8f0;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 600;
}

/* License Splash Screen */
.license-splash {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #0f172a;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.license-splash-content {
    text-align: center;
    padding: 40px;
}

.license-splash-content h1 {
    font-size: 32px;
    margin-bottom: 24px;
    color: #fff;
}

.license-splash-text {
    font-size: 20px;
    color: #3b82f6;
    font-weight: 600;
}

/* Buttons - Mobile-First with Better Touch Targets */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s;
    min-height: 44px; /* Better touch target */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: #3b82f6;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-secondary {
    background: #475569;
    color: white;
}

.btn-secondary:hover {
    background: #334155;
}

.btn-small {
    padding: 10px 14px;
    font-size: 13px;
    min-height: 44px;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-warning {
    background: #f59e0b;
    color: white;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-violations {
    background: #dc2626;
    color: white;
    font-weight: 600;
    margin: 4px 0;
    width: 100%;
}

.btn-violations:hover {
    background: #b91c1c;
}

.error-message {
    color: #ef4444;
    font-size: 14px;
    margin: 10px 0;
    display: none;
}

.error-message.show {
    display: block;
}

.help-text {
    margin-top: 16px;
    font-size: 13px;
    color: #cbd5e1;
    text-align: center;
}

.settings-info {
    background: #1e293b;
    border: 2px solid #475569;
    border-left: 4px solid #3b82f6;
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.settings-info .help-text {
    color: #e2e8f0;
    margin-top: 0;
    text-align: left;
}

.settings-info strong {
    color: #93c5fd;
    font-weight: 600;
}

/* App Header - Mobile First (Max 56px height) */
.app-header {
    background: #1e293b;
    padding: 8px 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    width: 100%;
    height: 56px;
    min-height: 56px;
    max-height: 56px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.header-logo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
}

.header-brand-content {
    display: flex;
    flex-direction: column;
    gap: 0px;
}

.header-brand-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    line-height: 1.2;
}

.header-brand-version {
    font-size: 10px;
    color: #94a3b8;
    line-height: 1;
}

.header-clock {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0px;
    flex-shrink: 0;
}

.header-date {
    font-size: 11px;
    color: #94a3b8;
    line-height: 1;
}

.header-time {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

/* Navbar - Mobile First (Max 48px height, positioned below header) */
.navbar {
    background: #334155;
    padding: 6px 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    z-index: 1000;
    width: 100%;
    min-height: 48px;
    max-height: 48px;
}

/* Legacy nav-brand styles removed - now using header-brand */

.license-badge {
    display: none;
    font-size: 8px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 4px;
    vertical-align: middle;
    letter-spacing: 0.3px;
}

.license-badge.trial,
.license-badge.expired {
    display: inline-block;
}

.license-badge.trial {
    background: #1e3a8a;
    color: #60a5fa;
    border: 1px solid #3b82f6;
}

.license-badge.expired {
    background: #7f1d1d;
    color: #fca5a5;
    border: 1px solid #dc2626;
}

/* Legacy brand-logo removed - now using header-logo */

/* Container - Mobile First (adjusted for header + navbar) */
.container {
    width: 100%;
    margin: 0 auto;
    margin-top: 112px;
    padding: 16px;
}

.page-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.page-header h2 {
    font-size: 20px;
    color: #fff;
}

.header-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

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

/* Navigation Dropdown Menu */
.nav-dropdown-container {
    position: relative;
    width: auto;
    order: 3;
    flex-shrink: 0;
}

.nav-dropdown-toggle {
    width: auto;
    background: #1e293b;
    color: #e2e8f0;
    border: 2px solid #334155;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
    white-space: nowrap;
}

.nav-dropdown-toggle:hover {
    border-color: #3b82f6;
    background: #2d3748;
}

.dropdown-arrow {
    font-size: 10px;
    transition: transform 0.2s;
}

#currentSectionName {
    font-size: 12px;
}

.nav-dropdown-toggle.active .dropdown-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: fixed;
    top: 104px;
    left: 8px;
    right: 8px;
    background: #1e293b;
    border: 2px solid #334155;
    border-radius: 8px;
    overflow: hidden;
    z-index: 1001;
    display: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.nav-dropdown-menu.show {
    display: block;
}

.nav-dropdown-item {
    width: 100%;
    background: transparent;
    color: #94a3b8;
    border: none;
    padding: 14px 16px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    border-bottom: 1px solid #334155;
}

.nav-dropdown-item:last-child {
    border-bottom: none;
}

.nav-dropdown-item:hover {
    background: #2d3748;
    color: #e2e8f0;
}

.nav-dropdown-item.active {
    background: #1e3a8a;
    color: #3b82f6;
}

.nav-dropdown-divider {
    height: 2px;
    background: #334155;
    margin: 8px 0;
}

.nav-dropdown-user {
    padding: 12px 16px;
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 500;
    background: #0f172a;
}

.nav-dropdown-item.nav-logout {
    color: #ef4444;
    font-weight: 600;
}

.nav-dropdown-item.nav-logout:hover {
    background: #991b1b;
    color: #fca5a5;
}

.tab-content {
    display: none;
}

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

/* Settings Sub-tabs (sticky below header + navbar) */
.settings-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    padding: 12px;
    background: #1e293b;
    border-radius: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: sticky;
    top: 112px;
    z-index: 100;
}

.settings-tab-btn {
    background: transparent;
    color: #94a3b8;
    border: none;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.settings-tab-btn:hover {
    background: #2d3748;
    color: #e2e8f0;
}

.settings-tab-btn.active {
    background: #1e3a8a;
    color: #3b82f6;
}

.settings-tab-content {
    display: none;
}

.settings-tab-content.active {
    display: block;
}

/* Search Bar - Mobile First */
.search-bar {
    background: #1e293b;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-bar input,
.search-bar select {
    width: 100%;
    flex: none;
}

/* Vehicle Grid - Mobile First (Single Column) */
.vehicle-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.vehicle-card {
    background: #1e293b;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #334155;
}

.vehicle-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.vehicle-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.property-badge {
    background: #3b82f6;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    align-self: flex-start;
}

.vehicle-details {
    display: grid;
    gap: 6px;
    font-size: 13px;
}

.detail-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.detail-label {
    color: #94a3b8;
    font-size: 12px;
}

.detail-value {
    color: #e2e8f0;
}

.vehicle-actions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #334155;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vehicle-actions .btn {
    width: 100%;
}

.no-results {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
}

/* Data Tables - Mobile Responsive */
.data-table {
    width: 100%;
    background: #1e293b;
    border-radius: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.data-table table {
    width: 100%;
    border-collapse: collapse;
    min-width: 500px; /* Prevent squishing on mobile */
}

.data-table th {
    background: #0f172a;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: #cbd5e1;
    border-bottom: 1px solid #334155;
    font-size: 13px;
}

.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #334155;
    font-size: 13px;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover {
    background: #334155;
}

.table-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* Badges */
.role-badge, .badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.badge-success {
    background: #10b981;
    color: white;
}

.badge-inactive {
    background: #6b7280;
    color: white;
}

.role-admin {
    background: #7c3aed;
    color: white;
}

.role-user {
    background: #3b82f6;
    color: white;
}

.role-operator {
    background: #64748b;
    color: white;
}

/* Modal - Mobile First */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
}

.modal.show {
    display: block;
}

.modal-content {
    background-color: #1e293b;
    margin: 20px;
    padding: 0;
    border: 1px solid #334155;
    border-radius: 8px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.modal-large {
    max-width: 600px;
    margin: 20px auto;
}

.modal-header {
    padding: 16px;
    border-bottom: 1px solid #334155;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: #1e293b;
    z-index: 1;
}

.modal-header h3 {
    font-size: 18px;
    color: #fff;
}

.close {
    color: #94a3b8;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    background: none;
    border: none;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close:hover {
    color: #fff;
}

.modal form {
    padding: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.modal-footer {
    padding: 16px;
    border-top: 1px solid #334155;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    position: sticky;
    bottom: 0;
    background: #1e293b;
}

.modal-footer .btn {
    width: 100%;
}

/* Violation Modal Styles */
.violation-vehicle-info {
    background: #1e293b !important;
    padding: 16px !important;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 18px !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    border: 2px solid #3b82f6;
    line-height: 1.7;
    min-height: 50px;
}

.violation-checkboxes {
    max-height: 250px;
    overflow-y: auto;
    border: 2px solid #64748b;
    border-radius: 6px;
    padding: 16px;
    background: #0f172a;
}

.checkbox-item {
    margin-bottom: 10px;
}

.checkbox-item label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px 12px;
    border-radius: 6px;
    transition: background 0.2s;
    min-height: 36px;
    color: #ffffff !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    background: #1e293b !important;
    border: 1px solid #334155;
    margin-bottom: 0 !important;
}

.checkbox-item label:hover {
    background: #334155 !important;
    border-color: #475569;
}

.checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    cursor: pointer;
    flex-shrink: 0;
}

/* Violation History Styles */
.violation-history-list {
    max-height: 400px;
    overflow-y: auto;
}

.violation-history-item {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 12px;
}

.violation-history-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #334155;
}

.violation-history-header strong {
    color: #3b82f6;
    font-size: 15px;
}

.violation-date {
    color: #94a3b8;
    font-size: 13px;
}

.violation-history-details p {
    margin-bottom: 6px;
    color: #cbd5e1;
    font-size: 13px;
}

.violation-history-details strong {
    color: #e2e8f0;
}

.violation-list {
    list-style: none;
    padding-left: 0;
    margin: 8px 0;
}

.violation-list li {
    background: #1e293b;
    padding: 8px 10px;
    margin-bottom: 6px;
    border-radius: 4px;
    border-left: 3px solid #ef4444;
    color: #e2e8f0;
    font-size: 13px;
}

.violation-checkboxes {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.violation-checkbox-item {
    padding: 10px;
    margin-bottom: 8px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: background 0.2s;
}

.violation-checkbox-item:hover {
    background: #f5f5f5;
    border-color: #4a90e2;
}

.violation-checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.violation-checkbox-item label {
    flex: 1;
    margin: 0 0 0 8px;
    font-size: 14px;
    cursor: pointer;
}

.violation-vehicle-info {
    padding: 12px;
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    margin-bottom: 20px;
    border-radius: 4px;
    font-size: 14px;
}

/* ================================
   TABLET (768px+)
   ================================ */

@media (min-width: 768px) {
    .login-card {
        padding: 40px;
    }

    .login-card h1 {
        font-size: 28px;
    }

    .container {
        padding: 24px;
    }

    .page-header {
        flex-direction: row;
        align-items: center;
    }

    .page-header h2 {
        font-size: 24px;
    }

    .header-actions {
        flex-direction: row;
        width: auto;
    }

    .header-actions .btn {
        width: auto;
    }

    .container {
        margin-top: 140px;
    }

    /* App Header - Desktop/Tablet */
    .app-header {
        padding: 12px 24px;
        height: 72px;
        min-height: 72px;
        max-height: 72px;
    }
    
    .header-logo {
        width: 48px;
        height: 48px;
    }
    
    .header-brand-name {
        font-size: 20px;
    }
    
    .header-brand-version {
        font-size: 12px;
    }
    
    .header-date {
        font-size: 13px;
    }
    
    .header-time {
        font-size: 22px;
    }
    
    .license-badge {
        display: inline-block;
        font-size: 10px;
        padding: 3px 8px;
        margin-left: 8px;
    }

    /* Navbar - Desktop/Tablet */
    .navbar {
        padding: 12px 24px;
        min-height: auto;
        max-height: none;
        top: 72px;
    }
    
    .settings-tabs {
        top: 140px;
    }
    
    .nav-dropdown-container {
        width: 100%;
        order: 10;
    }
    
    .nav-dropdown-toggle {
        width: 100%;
        padding: 14px 16px;
        font-size: 16px;
        border-radius: 8px;
        justify-content: space-between;
    }
    
    #currentSectionName {
        font-size: 16px;
    }
    
    .dropdown-arrow {
        font-size: 12px;
    }
    
    .nav-dropdown-menu {
        position: absolute;
        top: calc(100% + 8px);
        left: 16px;
        right: 16px;
    }

    .nav-menu {
        gap: 16px;
        font-size: 14px;
    }

    #userInfo {
        max-width: none;
    }

    .tab-btn {
        padding: 12px 24px;
        font-size: 15px;
    }

    .search-bar {
        padding: 20px;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .search-bar input {
        flex: 1;
        min-width: 200px;
    }

    .search-bar select {
        min-width: 200px;
    }

    .vehicle-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 16px;
    }

    .vehicle-card {
        padding: 20px;
    }

    .vehicle-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .vehicle-title {
        font-size: 18px;
    }

    .vehicle-details {
        font-size: 14px;
    }

    .detail-row {
        flex-direction: row;
    }

    .detail-label {
        min-width: 120px;
        font-size: 14px;
    }

    .vehicle-actions {
        flex-direction: row;
        justify-content: flex-end;
    }

    .vehicle-actions .btn {
        width: auto;
    }

    .btn-violations {
        margin: 0 10px;
        width: auto;
    }

    .data-table th,
    .data-table td {
        padding: 12px 16px;
        font-size: 14px;
    }

    .modal-content {
        margin: 50px auto;
    }

    .modal-header {
        padding: 20px 24px;
    }

    .modal-header h3 {
        font-size: 20px;
    }

    .modal form {
        padding: 24px;
    }

    .form-row {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }

    .modal-footer {
        flex-direction: row;
        justify-content: flex-end;
    }

    .modal-footer .btn {
        width: auto;
    }

    .violation-checkboxes {
        max-height: 300px;
    }

    .violation-history-list {
        max-height: 500px;
    }

    .violation-history-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .violation-history-header strong {
        font-size: 16px;
    }

    .violation-date {
        font-size: 14px;
    }

    .violation-history-details p,
    .violation-list li {
        font-size: 14px;
    }
}

/* ================================
   DESKTOP (1024px+)
   ================================ */

@media (min-width: 1024px) {
    .container {
        max-width: 1200px;
    }

    .vehicle-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }

    .modal-content {
        width: 90%;
        max-width: 600px;
    }

    .toast-container {
        max-width: 400px;
    }
}

/* ================================
   DATABASE TAB SUBSECTIONS
   ================================ */

.database-subsection {
    background: #1e293b;
    border: 2px solid #334155;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.subsection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.subsection-header h3 {
    margin: 0;
    color: #60a5fa;
    font-size: 1.3em;
}

/* License Management Cards */
.license-status-card,
.license-activation-card {
    background: #1e293b;
    border: 2px solid #475569;
    border-left: 4px solid #3b82f6;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
}

.license-status-card h4,
.license-activation-card h4 {
    margin: 0 0 15px 0;
    color: #60a5fa;
    font-size: 1.1em;
}

.license-status-info {
    display: grid;
    gap: 12px;
    margin-top: 15px;
}

.license-status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #0f172a;
    border-radius: 6px;
}

.license-status-label {
    font-weight: 600;
    color: #94a3b8;
}

.license-status-value {
    color: #e2e8f0;
    font-weight: 500;
}

.license-status-value.status-trial {
    color: #fbbf24;
}

.license-status-value.status-licensed {
    color: #34d399;
}

.license-status-value.status-expired {
    color: #f87171;
}

.license-status-value.status-unlicensed {
    color: #94a3b8;
}

.loading-spinner {
    text-align: center;
    padding: 20px;
    color: #94a3b8;
}

.success-message {
    background: #065f46;
    color: #d1fae5;
    border: 1px solid #10b981;
    padding: 12px 16px;
    border-radius: 6px;
    margin-top: 10px;
}

.bulk-operation-card {
    background: #1e293b;
    border: 2px solid #475569;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
}

.bulk-operation-card h4 {
    margin: 0 0 10px 0;
    color: #e2e8f0;
    font-size: 1.1em;
}

.form-inline {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 15px;
}

.form-inline .form-control {
    flex: 1;
    min-width: 200px;
    padding: 10px 15px;
    background: #1e293b;
    border: 1px solid #475569;
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 14px;
}

.form-inline .btn {
    flex-shrink: 0;
}

#duplicatesResults {
    background: #1e293b;
    border-radius: 6px;
    padding: 15px;
    min-height: 60px;
}

.duplicate-group {
    background: #1e293b;
    border: 2px solid #ef4444;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
}

.duplicate-group h5 {
    color: #fca5a5;
    margin: 0 0 10px 0;
    font-size: 1em;
    font-weight: 600;
}

.duplicate-item {
    background: #0f172a;
    padding: 10px;
    margin: 8px 0;
    border-radius: 4px;
    border: 1px solid #334155;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.duplicate-info {
    flex: 1;
    color: #e2e8f0;
}

@media (max-width: 768px) {
    .form-inline {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-inline .form-control {
        min-width: 100%;
    }
    
    .form-inline .btn {
        width: 100%;
    }
}

/* ================================
   VIOLATION SEARCH SECTION
   ================================ */

.violation-search-card {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 20px;
}

.search-filters {
    margin-bottom: 20px;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.filter-row .form-group {
    width: 100%;
}

.filter-row .flex-grow {
    grid-column: 1 / -1;
}

.search-actions {
    display: flex;
    gap: 15px;
    align-items: center;
    padding: 15px;
    background: #1e293b;
    border-radius: 6px;
}

.results-count {
    color: #94a3b8;
    font-size: 0.9em;
    margin-left: auto;
}

.violation-results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: #1e293b;
    border-radius: 6px;
    overflow: hidden;
}

.violation-results-table thead {
    background: #0f172a;
}

.violation-results-table th,
.violation-results-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #334155;
}

.violation-results-table th {
    color: #60a5fa;
    font-weight: 600;
    font-size: 0.9em;
    text-transform: uppercase;
}

.violation-results-table td {
    color: #e2e8f0;
}

.violation-results-table tr:hover {
    background: #0f172a;
}

.violation-types-cell {
    font-size: 0.85em;
    color: #94a3b8;
}

.violation-note {
    font-style: italic;
    color: #64748b;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media print {
    body * {
        visibility: hidden;
    }
    
    #violationSearchResults,
    #violationSearchResults * {
        visibility: visible;
    }
    
    #violationSearchResults {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
    
    .search-actions,
    .search-filters,
    .sidebar,
    .tabs,
    .page-header,
    .btn {
        display: none !important;
    }
    
    .violation-results-table {
        page-break-inside: auto;
    }
    
    .violation-results-table tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }
}

@media (max-width: 768px) {
    .filter-row {
        flex-direction: column;
    }
    
    .filter-row .form-group {
        width: 100%;
        min-width: unset;
    }
    
    .search-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .results-count {
        margin-left: 0;
        text-align: center;
    }
    
    .violation-results-table {
        font-size: 0.85em;
    }
    
    .violation-results-table th,
    .violation-results-table td {
        padding: 8px 6px;
    }
}
