/* Enhanced Alarms Page - Modern Top Navigation Design */

:root {
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #6366f1;
    --secondary-color: #6b7280;

    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    min-height: 100vh;
    color: var(--gray-900);
}

/* Top Navigation Bar */
.btn-logout {
    padding: 0.5rem 1rem;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.top-navbar {
    background: white;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
    animation: slideDown 0.5s ease;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary-color);
}

.brand-icon {
    font-size: 1.5rem;
    animation: pulse 2s infinite;
}

.nav-menu {
    display: flex;
    gap: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: var(--gray-600);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: var(--gray-100);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.nav-link.active {
    background: var(--primary-color);
    color: white;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--gray-100);
    border-radius: 2rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-dot.online {
    background: var(--success-color);
}

.btn-load-all {
    padding: 0.5rem 1rem;
    background: var(--warning-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-load-all:hover {
    background: var(--warning-color);
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

/* Main Container */
.alarms-container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* Header Section */
.alarms-header {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Statistics Cards */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: 0.75rem;
    border-left: 4px solid;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.stat-card.critical {
    border-left-color: var(--danger-color);
}

.stat-card.warning {
    border-left-color: var(--warning-color);
}

.stat-card.info {
    border-left-color: var(--info-color);
}

.stat-card.success {
    border-left-color: var(--success-color);
}

.stat-card-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 0.5rem;
}

.stat-card-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    animation: countUp 1s ease;
}

.stat-card-label {
    font-size: 0.875rem;
    color: var(--gray-600);
}

/* Filters and Analytics Section */
.filters-analytics-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.filter-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}

.filter-card h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Trend Card */
.mini-chart {
    background: var(--gray-50);
    border-radius: 0.5rem;
    padding: 0.5rem;
    margin-bottom: 1rem;
}

.trend-summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.trend-indicator {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--success-color);
}

.trend-label {
    color: var(--gray-600);
}

/* Filter Buttons */
.filter-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 0.5rem;
}

.filter-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem 0.5rem;
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.75rem;
    color: var(--gray-700);
}

.filter-btn:hover {
    background: var(--gray-50);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.filter-btn.critical:hover {
    background: var(--danger-color);
    color: white;
    border-color: var(--danger-color);
}

.filter-icon {
    font-size: 1.25rem;
}

/* Top Vehicles Lists */
.top-vehicles-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
}

.vehicle-item-mini {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: var(--gray-50);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.vehicle-item-mini:hover {
    background: var(--primary-color);
    color: white;
}

.vehicle-count {
    background: var(--danger-color);
    color: white;
    padding: 0.125rem 0.375rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Search Section */
.search-section {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
}

.search-wrapper {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
}

.search-input {
    width: 100%;
    padding: 0.75rem 3rem;
    border: 2px solid var(--gray-200);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-clear {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.3s ease;
}

.search-clear:hover {
    color: var(--danger-color);
    transform: translateY(-50%) rotate(90deg);
}

/* Table Container */
.table-container {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.alarms-table {
    width: 100%;
    border-collapse: collapse;
}

.alarms-table thead {
    background: var(--gray-50);
}

.alarms-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--gray-200);
}

.alarms-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.alarms-table th.sortable:hover {
    background: var(--gray-100);
}

.alarms-table tbody tr {
    border-bottom: 1px solid var(--gray-100);
    transition: all 0.3s ease;
    cursor: pointer;
}

.alarms-table tbody tr:hover {
    background: var(--gray-50);
}

.alarms-table td {
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
}

/* Badges */
.type-badge,
.vehicle-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.type-badge.speed {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.type-badge.geofence {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.type-badge.disconnect {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
}

.type-badge.night-travel {
    background: linear-gradient(135deg, #1e3a5f 0%, #3b5998 100%);
    color: white;
}

.type-badge.speed-violation {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    color: white;
}

.vehicle-badge {
    background: var(--primary-color);
    color: white;
}

.speed-display.over-limit {
    color: var(--danger-color);
    font-weight: 600;
}

/* Action Buttons */
.action-btn-small {
    padding: 0.25rem 0.5rem;
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.3s ease;
}

.action-btn-small:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Pagination */
.pagination-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: white;
    border-radius: 1rem;
    margin-top: 1.5rem;
    box-shadow: var(--shadow-md);
}

.pagination-controls {
    display: flex;
    gap: 0.5rem;
}

.page-btn {
    padding: 0.5rem 0.75rem;
    background: white;
    border: 1px solid var(--gray-300);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-numbers {
    display: flex;
    gap: 0.25rem;
}

/* Bulk Actions Bar */
.bulk-actions-bar {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 1rem 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 2rem;
    z-index: 100;
    animation: slideUp 0.3s ease;
}

.bulk-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.bulk-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.bulk-btn.resolve {
    background: var(--success-color);
    color: white;
}

.bulk-btn.acknowledge {
    background: var(--primary-color);
    color: white;
}

.bulk-btn.export {
    background: var(--secondary-color);
    color: white;
}

.bulk-btn.delete {
    background: var(--danger-color);
    color: white;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 1rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--gray-400);
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-close:hover {
    color: var(--gray-600);
    transform: rotate(90deg);
}

.modal-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.btn-action,
.btn-secondary {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-action {
    background: var(--primary-color);
    color: white;
}

.btn-action.resolve {
    background: var(--success-color);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

/* Loading & Empty States */
.loading-state,
.empty-state {
    text-align: center;
    padding: 4rem;
    color: var(--gray-500);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }

    to {
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: scale(0.5);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-in {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* ============================================
   Speed Violations Section
   ============================================ */

/* Base section styles */
.speed-violations-section,
.night-report-section {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
    border: 1px solid #f1f5f9;
}

/* Speed Violations - Purple/Indigo Theme */
.speed-violations-section {
    border-top: 4px solid #667eea;
}

/* Night Report - Deep Blue/Midnight Theme */
.night-report-section {
    border-top: 4px solid #1e3a5f;
}

.speed-violations-header,
.night-report-header {
    margin-bottom: 1rem;
}

.speed-violations-header h3,
.night-report-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.speed-violations-header h3 {
    color: #667eea;
}

.night-report-header h3 {
    color: #1e3a5f;
}

.speed-violations-description,
.night-report-description {
    color: var(--gray-500);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.speed-violations-controls,
.night-report-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: flex-end;
}

.speed-violations-controls .control-group,
.night-report-controls .control-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.speed-violations-controls label,
.night-report-controls label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.speed-violations-controls .form-control,
.night-report-controls .form-control {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    min-width: 120px;
}

.speed-violations-controls .form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.night-report-controls .form-control:focus {
    outline: none;
    border-color: #1e3a5f;
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.15);
}

/* Speed Summary Cards */
.speed-summary {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.speed-summary .summary-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    text-align: center;
    min-width: 120px;
    flex: 1;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.speed-summary .summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.speed-summary .summary-card:nth-child(1) .summary-value { color: #3b82f6; }
.speed-summary .summary-card:nth-child(2) .summary-value { color: #8b5cf6; }
.speed-summary .summary-card:nth-child(3) .summary-value { color: #f59e0b; }
.speed-summary .summary-card:nth-child(4) .summary-value { color: #ef4444; }

.speed-summary .summary-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
}

.speed-summary .summary-label {
    display: block;
    font-size: 0.7rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
    font-weight: 500;
}

/* Speed Violations Table - Modern Design */
.speed-violations-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.speed-violations-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: sticky;
    top: 0;
    z-index: 10;
}

.speed-violations-table th {
    padding: 1rem 1rem;
    text-align: left;
    font-weight: 600;
    color: white;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
}

.speed-violations-table th:first-child {
    border-radius: 0.5rem 0 0 0;
}

.speed-violations-table th:last-child {
    border-radius: 0 0.5rem 0 0;
}

.speed-violations-table td {
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
    border-bottom: 1px solid #f1f5f9;
    background: white;
    color: var(--gray-700);
}

.speed-violations-table tbody tr {
    transition: all 0.2s ease;
}

.speed-violations-table tbody tr:hover td {
    background: #fafaff;
}

.speed-violations-table tbody tr:last-child td {
    border-bottom: none;
}

/* Speed over badge - softer gradient */
.speed-over-badge {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    color: white;
    padding: 0.3rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

/* Night Report Table - Deep Blue/Midnight Theme */
.night-report-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.night-report-table thead {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d4a6f 100%);
    position: sticky;
    top: 0;
    z-index: 10;
}

.night-report-table th {
    padding: 1rem 1rem;
    text-align: left;
    font-weight: 600;
    color: white;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
}

.night-report-table th:first-child {
    border-radius: 0.5rem 0 0 0;
}

.night-report-table th:last-child {
    border-radius: 0 0.5rem 0 0;
}

.night-report-table td {
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
    border-bottom: 1px solid #f1f5f9;
    background: white;
    color: var(--gray-700);
}

.night-report-table tbody tr {
    transition: all 0.2s ease;
}

.night-report-table tbody tr:hover td {
    background: #f8fafc;
}

.night-report-table tbody tr:last-child td {
    border-bottom: none;
}

/* Night Report Results */
.night-report-results {
    margin-top: 1rem;
}

.night-violations-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.night-violations-header h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #1e3a5f;
}

.violations-count-badge {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d4a6f 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(30, 58, 95, 0.3);
}

/* Night Report Summary - Enhanced */
.night-report-summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #1e3a5f 0%, #2d4a6f 100%);
    color: white;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.25);
}

.night-report-summary .summary-icon {
    font-size: 1.75rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

/* Night Vehicle Header Row */
.night-vehicle-header-row {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d4a6f 100%) !important;
}

.night-vehicle-header-row td {
    color: white !important;
    font-weight: 600;
    padding: 12px 16px !important;
    background: transparent !important;
}

/* Night Duration Badge */
.night-duration-badge {
    display: inline-block;
    padding: 4px 10px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border-radius: 2rem;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

/* Night Speed Badge */
.night-speed-badge {
    display: inline-block;
    padding: 4px 10px;
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
    border-radius: 2rem;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(6, 182, 212, 0.3);
}

/* Night Incident Count Badge */
.night-incident-badge {
    display: inline-block;
    padding: 4px 10px;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    border-radius: 2rem;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(139, 92, 246, 0.3);
}

/* Night Map Link */
.night-map-link {
    color: #1e3a5f !important;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 4px 8px;
    background: #e0f2fe;
    border-radius: 4px;
}

.night-map-link:hover {
    color: #0c4a6e !important;
    background: #bae6fd;
    text-decoration: none;
}

/* Button Styling for Controls */
.speed-violations-controls .btn,
.night-report-controls .btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Speed Violations Buttons - Purple Theme */
.speed-violations-controls .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.speed-violations-controls .btn-primary:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
}

/* Night Report Buttons - Deep Blue Theme */
.night-report-controls .btn-primary {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d4a6f 100%);
    color: white;
}

.night-report-controls .btn-primary:hover {
    background: linear-gradient(135deg, #1a3352 0%, #264060 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.35);
}

.speed-violations-controls .btn-success,
.night-report-controls .btn-success {
    background: var(--success-color);
    color: white;
}

.speed-violations-controls .btn-success:hover,
.night-report-controls .btn-success:hover {
    background: #059669;
    transform: translateY(-1px);
}

.speed-violations-controls .btn-warning,
.night-report-controls .btn-warning {
    background: #f59e0b;
    color: white;
}

.speed-violations-controls .btn-warning:hover,
.night-report-controls .btn-warning:hover {
    background: #d97706;
    transform: translateY(-1px);
}

/* Night Travel Badge for Alarms Table */
.type-badge.night-travel {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d4a6f 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(30, 58, 95, 0.25);
}

/* Results Container with overflow */
.speed-violations-results {
    max-height: 600px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(102, 126, 234, 0.08), 0 2px 4px -1px rgba(102, 126, 234, 0.04);
}

.night-report-results {
    max-height: 600px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(30, 58, 95, 0.08), 0 2px 4px -1px rgba(30, 58, 95, 0.04);
}

/* Loading and Empty States */
.speed-violations-loading,
.speed-violations-empty,
.night-report-loading,
.night-report-empty {
    text-align: center;
    padding: 3rem;
    color: var(--gray-500);
}

.speed-violations-loading .spinner,
.night-report-loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.speed-violations-empty .empty-icon,
.night-report-empty .empty-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .filters-analytics-section {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }

    .filters-analytics-section {
        grid-template-columns: 1fr;
    }

    .stats-cards {
        grid-template-columns: 1fr;
    }

    .filter-buttons {
        grid-template-columns: repeat(3, 1fr);
    }

    .alarms-table th.th-description,
    .alarms-table td.td-description,
    .alarms-table th.th-location,
    .alarms-table td.td-location {
        display: none;
    }

    .pagination-section {
        flex-direction: column;
        gap: 1rem;
    }

    .bulk-actions-bar {
        flex-direction: column;
        width: calc(100% - 2rem);
        left: 1rem;
        transform: none;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.5rem;
    }

    .filter-buttons {
        grid-template-columns: repeat(2, 1fr);
    }

    .alarms-table th.th-speed,
    .alarms-table td.td-speed {
        display: none;
    }
}

/* =============================================
   Vehicle Grouped View Styles (Speed Violations)
   ============================================= */

/* Vehicle group header row - Light theme with purple accent */
.vehicle-group-header {
    background: linear-gradient(135deg, #f8f9ff 0%, #eef1ff 100%) !important;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.vehicle-group-header:hover {
    background: linear-gradient(135deg, #f0f3ff 0%, #e8ecff 100%) !important;
    transform: scale(1.002);
}

.vehicle-header-cell {
    padding: 0 !important;
}

.vehicle-header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 12px 16px;
    color: #1f2937;
}

.vehicle-expand-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #667eea;
    color: white;
    border-radius: 6px;
    font-size: 12px;
    transition: all 0.3s ease;
    font-weight: bold;
}

.vehicle-group-header:hover .vehicle-expand-icon {
    background: #5a67d8;
    transform: scale(1.1);
}

.vehicle-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.vehicle-name-header {
    font-weight: 600;
    font-size: 1rem;
}

.vehicle-device {
    font-size: 0.85rem;
    opacity: 0.8;
}

.vehicle-stats {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.stat-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.stat-badge.violations-count {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.stat-badge.max-speed {
    background: rgba(255,255,255,0.2);
    color: white;
}

.stat-badge.avg-over {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(6, 182, 212, 0.3);
}

/* Detail rows (nested violations) */
.violation-detail-row {
    background: linear-gradient(135deg, #fafbff 0%, #f5f7ff 100%) !important;
    animation: fadeIn 0.3s ease;
    border-left: 3px solid #a5b4fc;
}

.violation-detail-row:hover {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8edff 100%) !important;
}

.violation-detail-row td:first-child {
    padding-left: 40px !important;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Speed cell styling */
.speed-cell {
    font-weight: 600;
    color: #7c3aed;
}

/* Speed over badge - in grouped view */
.violation-detail-row .speed-over-badge {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.2);
}

/* Map link styling */
.map-link {
    color: #7c3aed !important;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 4px 8px;
    background: #f5f3ff;
    border-radius: 4px;
}

.map-link:hover {
    color: #5b21b6 !important;
    background: #ede9fe;
    text-decoration: none;
}

/* Expand/Collapse all buttons container */
.expand-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 0.5rem;
    align-items: center;
}

.expand-btn {
    padding: 8px 16px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #667eea;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.expand-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.25);
}

/* Mobile adjustments for grouped view */
@media (max-width: 768px) {
    .vehicle-header-content {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .vehicle-info {
        width: 100%;
    }
    
    .vehicle-stats {
        width: 100%;
        justify-content: flex-start;
    }
    
    .violation-detail-row td:first-child {
        padding-left: 20px !important;
    }
}