/* Dashboard Section Styles */
/* Traffic Analysis Dashboard for Cement Factory */

/* ==========================================
   SECTION BASE STYLES
   ========================================== */

#monitoring-section {
    padding-top: 100px;
    padding-bottom: 100px;
    min-height: 100vh;
}

/* Hide global footer (marquee bar) when dashboard is active */
body.monitoring-active .marquee-bar {
    display: none !important;
}

.dashboard-page {
    
    margin: 0 auto;
   
}

/* ==========================================
   DATE RANGE BUTTONS (in global header)
   ========================================== */

.dashboard-date-range {
    display: flex;
    background: white;
    border-radius: 8px;
    padding: 3px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.date-btn {
    padding: 6px 14px;
    border: none;
    background: transparent;
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.date-btn:hover {
    color: #1a1a2e;
    background: rgba(0, 0, 0, 0.03);
}

.date-btn.active {
    background: linear-gradient(135deg, #E85E53 0%, #8E31BB 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(142, 49, 187, 0.3);
}

/* ==========================================
   DASHBOARD GRID
   ========================================== */

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
    gap: 24px;
    margin-bottom: 32px;
}

/* ==========================================
   PANEL BASE STYLES
   ========================================== */

.dashboard-panel {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.04);
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.dashboard-panel:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* Load Analysis panel (left) */
.dashboard-panel-wide {
    grid-column: 1;
    grid-row: 1;
}

/* Loads chart panel (right) - same row as Load Analysis */
.dashboard-grid > .dashboard-panel:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
}

/* Make both panels in first row equal height */
.dashboard-grid > .dashboard-panel-wide,
.dashboard-grid > .dashboard-panel:nth-child(2) {
    min-height: 480px;
}

/* Panel content should fill available space */
.dashboard-panel .panel-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.dashboard-panel-stats {
    grid-column: 1 / 3;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    background: transparent;
    border: none;
    box-shadow: none;
}

.dashboard-panel-stats:hover {
    box-shadow: none;
    transform: none;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 0;
    flex-wrap: wrap;
    gap: 12px;
}

.panel-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.panel-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-title i {
    font-size: 20px;
    color: #8E31BB;
}

.panel-nav {
    display: flex;
    gap: 8px;
}

.panel-nav-btn {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #6b7280;
    transition: all 0.2s ease;
}

.panel-nav-btn:hover {
    border-color: #E85E53;
    color: #E85E53;
    background: rgba(232, 94, 83, 0.05);
}

.panel-content {
    padding: 20px 24px 24px;
}

/* ==========================================
   PLANT STATS (LOAD ANALYSIS)
   ========================================== */

.plant-stats {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.plant-row {
    display: grid;
    grid-template-columns: 120px 1fr 100px;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
}

.plant-row:last-child {
    border-bottom: none;
}

.plant-row:hover {
    background: rgba(0, 0, 0, 0.01);
    margin: 0 -16px;
    padding: 12px 16px;
    border-radius: 8px;
}

.plant-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.plant-name {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
}

.plant-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: fit-content;
}

.plant-badge-primary {
    background: rgba(102, 173, 214, 0.15);
    color: #3a9fd4;
}

.plant-badge-success {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
}

.plant-badge-warning {
    background: rgba(234, 179, 8, 0.15);
    color: #ca8a04;
}

.plant-bar-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.plant-bar {
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.04);
    position: relative;
}

.plant-bar-fill {
    height: 100%;
    width: var(--bar-width, 50%);
    border-radius: 4px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Bar Colors */
.plant-bar-red .plant-bar-fill {
    background: linear-gradient(90deg, #E85E53 0%, #f87171 100%);
}

.plant-bar-orange .plant-bar-fill {
    background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
}

.plant-bar-blue .plant-bar-fill {
    background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
}

.plant-bar-light-blue .plant-bar-fill {
    background: linear-gradient(90deg, #66ADD6 0%, #93c5fd 100%);
}

.plant-bar-purple .plant-bar-fill {
    background: linear-gradient(90deg, #8E31BB 0%, #a855f7 100%);
}

.plant-bar-green .plant-bar-fill {
    background: linear-gradient(90deg, #22c55e 0%, #4ade80 100%);
}

.plant-bar-amber .plant-bar-fill {
    background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
}

.plant-bar-yellow .plant-bar-fill {
    background: linear-gradient(90deg, #eab308 0%, #facc15 100%);
}

.plant-tonnage {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.plant-tonnage small {
    font-size: 11px;
    font-weight: 500;
    color: #9ca3af;
    margin-left: 4px;
}

.plant-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: fit-content;
    margin-top: 4px;
}

.plant-type-concrete {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.plant-type-cement {
    background: rgba(142, 49, 187, 0.15);
    color: #8E31BB;
}

/* Material badges in results table and grid */
.material-cell {
    text-align: center;
}

.material-cell .result-badge {
    margin: 0 auto;
}

.analysis-material {
    margin: 8px 0;
    display: flex;
    justify-content: center;
}

.analysis-material .result-badge {
    font-size: 10px;
    padding: 4px 10px;
}

/* Traffic Filters */
.traffic-filters {
    display: flex;
    gap: 8px;
    align-items: center;
}

.traffic-filter-select {
    padding: 6px 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    color: #1a1a2e;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.traffic-filter-select:hover {
    border-color: #E85E53;
    background: rgba(232, 94, 83, 0.02);
}

.traffic-filter-select:focus {
    outline: none;
    border-color: #E85E53;
    box-shadow: 0 0 0 3px rgba(232, 94, 83, 0.1);
}

/* Export Excel Button */
.export-excel-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.2);
}

.export-excel-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.export-excel-btn:active {
    transform: translateY(0);
}

.export-excel-btn i {
    font-size: 16px;
}

/* Material Loads Panel */
.material-loads-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.material-load-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.material-load-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.material-load-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    flex-shrink: 0;
}

.material-load-icon.material-load-gravel {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.material-load-icon.material-load-sacks {
    background: linear-gradient(135deg, #8E31BB 0%, #6b21a8 100%);
}

.material-load-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.material-load-value {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a2e;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.material-load-label {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}

/* Gravel and Sacks Panel positioning */
.dashboard-grid > .dashboard-panel:nth-child(4) {
    grid-column: 1 / 3;
    grid-row: 3;
}

/* ==========================================
   CHART SECTION
   ========================================== */

.chart-wrapper {
    flex: 1;
    min-height: 220px;
    position: relative;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #6b7280;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.legend-dot-blue {
    background: #3b82f6;
}

.legend-dot-red {
    background: #E85E53;
}

.legend-dot-yellow {
    background: #eab308;
}

/* ==========================================
   STAT CARDS
   ========================================== */

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.stat-card-gradient-1::before {
    background: linear-gradient(90deg, #E85E53 0%, #f87171 100%);
}

.stat-card-gradient-2::before {
    background: linear-gradient(90deg, #8E31BB 0%, #a855f7 100%);
}

.stat-card-gradient-3::before {
    background: linear-gradient(90deg, #66ADD6 0%, #93c5fd 100%);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-card-gradient-1 .stat-icon {
    background: rgba(232, 94, 83, 0.1);
    color: #E85E53;
}

.stat-card-gradient-2 .stat-icon {
    background: rgba(142, 49, 187, 0.1);
    color: #8E31BB;
}

.stat-card-gradient-3 .stat-icon {
    background: rgba(102, 173, 214, 0.1);
    color: #66ADD6;
}

.stat-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-value {
    font-size: 32px;
    font-weight: 800;
    color: #1a1a2e;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.stat-value small {
    font-size: 16px;
    font-weight: 500;
    color: #9ca3af;
}

.stat-label {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}

.stat-trend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    width: fit-content;
}

.stat-trend-up {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.stat-trend-down {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.stat-trend i {
    font-size: 14px;
}

/* ==========================================
   ANALYSIS HISTORY
   ========================================== */

.dashboard-history {
    margin-top: 8px;
}

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

.history-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.history-title i {
    font-size: 22px;
    color: #8E31BB;
}

.history-view-all-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.history-view-all-btn:hover {
    border-color: #8E31BB;
    color: #8E31BB;
    background: rgba(142, 49, 187, 0.05);
}

.history-view-all-btn i {
    font-size: 14px;
    transition: transform 0.2s ease;
}

.history-view-all-btn:hover i {
    transform: translateX(4px);
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* ==========================================
   ANALYSIS CARDS
   ========================================== */

.analysis-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.analysis-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

.analysis-thumbnail {
    position: relative;
    height: 160px;
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
    overflow: hidden;
}

.analysis-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.analysis-thumbnail-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 48px;
    color: #9ca3af;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}

.analysis-detection-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: 50%;
    border: 2px solid #22c55e;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.3);
    pointer-events: none;
}

.analysis-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 10px;
    background: rgba(34, 197, 94, 0.9);
    color: white;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

.analysis-badge-warning {
    background: rgba(234, 179, 8, 0.9);
}

.analysis-details {
    padding: 16px;
}

.analysis-time {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.analysis-time i {
    font-size: 18px;
    color: #9ca3af;
}

.analysis-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 12px;
}

.analysis-plant {
    font-size: 13px;
    color: #6b7280;
}

.analysis-tonnage {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
}

.analysis-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
    padding: 8px 0;
}

.analysis-wheels,
.analysis-confidence {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6b7280;
}

.analysis-wheels i,
.analysis-confidence i {
    font-size: 14px;
    color: #9ca3af;
}

.analysis-confidence {
    color: #3b82f6;
}

.analysis-confidence i {
    color: #3b82f6;
}

.analysis-notes {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 11px;
    color: #6b7280;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    line-height: 1.4;
}

.analysis-notes i {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 2px;
    flex-shrink: 0;
}

.analysis-notes span {
    flex: 1;
}

.analysis-axles {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 10px 12px;
    background: #f8f9fc;
    border-radius: 8px;
}

.axle-dots {
    display: flex;
    gap: 6px;
}

.axle-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.axle-count {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
}

.analysis-video-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #1a1a2e;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.analysis-video-btn i {
    font-size: 14px;
    color: #E85E53;
}

.analysis-video-btn:hover {
    background: linear-gradient(135deg, #E85E53 0%, #8E31BB 100%);
    color: white;
    border-color: transparent;
}

.analysis-video-btn:hover i {
    color: white;
}

/* ==========================================
   ANIMATIONS
   ========================================== */

@keyframes dashboardSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes dashboardFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes barGrow {
    from {
        width: 0;
    }
    to {
        width: var(--bar-width, 50%);
    }
}

/* Panel animations when section becomes active */
#monitoring-section.active .dashboard-animate {
    animation: dashboardSlideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    animation-delay: calc(var(--animation-order, 1) * 0.1s);
    opacity: 0;
}

#monitoring-section.active .analysis-card-animate {
    animation: dashboardSlideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    animation-delay: calc(0.4s + (var(--card-order, 1) * 0.08s));
    opacity: 0;
}

/* Bar fill animation */
#monitoring-section.active .plant-bar-fill {
    animation: barGrow 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    animation-delay: 0.5s;
    width: 0;
}

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

@media (max-width: 1400px) {
    .history-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .history-grid .analysis-card:last-child {
        display: none;
    }
}

@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-panel-wide {
        grid-column: 1;
        grid-row: auto;
    }
    
    .dashboard-grid > .dashboard-panel:nth-child(2) {
        grid-column: 1;
        grid-row: auto;
    }
    
    .dashboard-grid > .dashboard-panel-wide,
    .dashboard-grid > .dashboard-panel:nth-child(2) {
        min-height: auto;
    }
    
    .dashboard-panel-stats {
        grid-column: 1;
        grid-template-columns: repeat(3, 1fr);
    }
    
    .dashboard-grid > .dashboard-panel:nth-child(4) {
        grid-column: 1;
        grid-row: auto;
    }
    
    .panel-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .panel-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .traffic-filters {
        flex-wrap: wrap;
    }
    
    .material-loads-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    .history-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .history-grid .analysis-card:nth-child(3),
    .history-grid .analysis-card:last-child {
        display: block;
    }
    
    .history-grid .analysis-card:last-child {
        display: none;
    }
}

@media (max-width: 768px) {
    #monitoring-section {
        padding-top: 90px;
    }
    
    .dashboard-page {
        padding: 0 16px 40px;
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .dashboard-header-right {
        justify-content: space-between;
    }
    
    .dashboard-title {
        font-size: 26px;
    }
    
    .dashboard-panel-stats {
        grid-template-columns: 1fr;
    }
    
    .plant-row {
        grid-template-columns: 80px 1fr 70px;
        gap: 12px;
    }
    
    .plant-tonnage {
        font-size: 15px;
    }
    
    .history-grid {
        grid-template-columns: 1fr;
    }
    
    .history-grid .analysis-card:nth-child(3),
    .history-grid .analysis-card:last-child {
        display: none;
    }
}

@media (max-width: 480px) {
    .dashboard-date-range {
        width: 100%;
    }
    
    .date-btn {
        flex: 1;
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .plant-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .plant-info {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }
    
    .plant-tonnage {
        text-align: left;
    }
    
    .stat-value {
        font-size: 26px;
    }
    
    .panel-header {
        padding: 16px 16px 0;
    }
    
    .panel-actions {
        width: 100%;
        margin-top: 12px;
    }
    
    .traffic-filters {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }
    
    .traffic-filter-select {
        width: 100%;
    }
    
    .export-excel-btn {
        width: 100%;
        justify-content: center;
    }
    
    .material-loads-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   DARK MODE SUPPORT (if implemented)
   ========================================== */

body.dark-mode #monitoring-section {
    background: #0a0a0a;
}

body.dark-mode .dashboard-panel,
body.dark-mode .stat-card,
body.dark-mode .analysis-card {
    background: #171717;
    border-color: rgba(255, 255, 255, 0.06);
}

body.dark-mode .dashboard-title {
    -webkit-text-fill-color: #e5e5e5;
    background: none;
}

body.dark-mode .panel-title,
body.dark-mode .plant-name,
body.dark-mode .stat-value,
body.dark-mode .analysis-time,
body.dark-mode .analysis-tonnage,
body.dark-mode .history-title {
    color: #f1f1f1;
}

body.dark-mode .dashboard-subtitle,
body.dark-mode .stat-label,
body.dark-mode .analysis-plant,
body.dark-mode .legend-item,
body.dark-mode .axle-count {
    color: #9ca3af;
}

body.dark-mode .dashboard-date-range,
body.dark-mode .dashboard-refresh-btn,
body.dark-mode .panel-nav-btn,
body.dark-mode .history-view-all-btn,
body.dark-mode .analysis-video-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #d1d5db;
}

body.dark-mode .date-btn {
    color: #9ca3af;
}

body.dark-mode .date-btn:hover {
    color: #f1f1f1;
    background: rgba(255, 255, 255, 0.1);
}

body.dark-mode .plant-bar {
    background: rgba(255, 255, 255, 0.1);
}

body.dark-mode .analysis-axles {
    background: #121212;
}

body.dark-mode .analysis-thumbnail-placeholder {
    background: linear-gradient(135deg, #1a1a1a 0%, #121212 100%);
}

body.dark-mode .plant-tonnage {
    color: #f1f1f1;
}

body.dark-mode .plant-tonnage small,
body.dark-mode .stat-value small {
    color: #6b7280;
}

body.dark-mode .traffic-filter-select {
    background: #171717;
    border-color: rgba(255, 255, 255, 0.1);
    color: #e5e5e5;
}

body.dark-mode .traffic-filter-select:hover {
    border-color: #E85E53;
    background: rgba(232, 94, 83, 0.1);
}

body.dark-mode .traffic-filter-select:focus {
    border-color: #E85E53;
    box-shadow: 0 0 0 3px rgba(232, 94, 83, 0.2);
}

body.dark-mode .material-load-card {
    background: #171717;
    border-color: rgba(255, 255, 255, 0.06);
}

body.dark-mode .material-load-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

body.dark-mode .material-load-value {
    color: #f1f1f1;
}

body.dark-mode .material-load-label {
    color: #9ca3af;
}

body.dark-mode .analysis-details {
    background: #171717;
}

body.dark-mode .analysis-notes {
    border-color: rgba(255, 255, 255, 0.1);
    color: #9ca3af;
}

body.dark-mode .analysis-notes i {
    color: #6b7280;
}

body.dark-mode .analysis-wheels,
body.dark-mode .analysis-confidence {
    color: #9ca3af;
}

body.dark-mode .analysis-wheels i,
body.dark-mode .analysis-confidence i {
    color: #6b7280;
}

body.dark-mode .analysis-confidence {
    color: #60a5fa;
}

body.dark-mode .analysis-confidence i {
    color: #60a5fa;
}

body.dark-mode .results-title {
    color: #f1f1f1;
}

body.dark-mode .model-selector-section label,
body.dark-mode .selector-group label,
body.dark-mode .sampling-row label {
    color: #d1d5db;
}

body.dark-mode .no-results-row .no-results {
    color: #6b7280;
}

body.dark-mode .dashboard-panel:hover,
body.dark-mode .stat-card:hover,
body.dark-mode .analysis-card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

body.dark-mode .plant-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

body.dark-mode .plant-row {
    border-color: rgba(255, 255, 255, 0.06);
}

/* ==========================================
   MEDIA ANALYSIS PANEL
   ========================================== */

.dashboard-media-panel {
    margin-bottom: 32px;
}

#monitoring-media-container {
    padding: 20px;
}

/* Source Selector */
.media-source-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.source-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    font-family: 'Inter', sans-serif;
}

.source-btn:hover {
    border-color: #E85E53;
    color: #E85E53;
    background: rgba(232, 94, 83, 0.05);
}

.source-btn.active {
    border-color: #E85E53;
    background: linear-gradient(135deg, #E85E53 0%, #8E31BB 100%);
    color: white;
}

.source-btn i {
    font-size: 18px;
}

/* Media Input Section */
.media-input-section {
    margin-bottom: 24px;
}

#monitoring-url-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.url-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s ease;
}

.url-input:focus {
    outline: none;
    border-color: #E85E53;
}

.load-url-btn {
    padding: 12px 24px;
    border: none;
    background: linear-gradient(135deg, #E85E53 0%, #8E31BB 100%);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
}

.load-url-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(232, 94, 83, 0.3);
}


/* Media Preview */
.media-preview-container {
    margin-bottom: 24px;
    position: relative;
}

.preview-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f9fafb;
    border-radius: 12px;
    padding: 20px;
    border: 2px dashed rgba(0, 0, 0, 0.1);
    min-height: 200px;
}

.remove-media-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    color: #dc2626;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.remove-media-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
}

/* Model Selector */
.model-selector-section {
    margin-bottom: 24px;
}

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

.selector-group {
    display: flex;
    flex-direction: column;
}

.model-selector-section label,
.selector-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    font-family: 'Inter', sans-serif;
}

.model-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.model-select:focus {
    outline: none;
    border-color: #E85E53;
}

@media (max-width: 768px) {
    .selector-row {
        grid-template-columns: 1fr;
    }
}

/* Sampling Controls */
.sampling-controls {
    margin-bottom: 24px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.sampling-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.sampling-row label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    font-family: 'Inter', sans-serif;
}

.interval-select {
    padding: 8px 12px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    background: white;
    cursor: pointer;
}

.sampling-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.sampling-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    background: linear-gradient(135deg, #E85E53 0%, #8E31BB 100%);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.sampling-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(232, 94, 83, 0.3);
}

.sampling-btn:active {
    transform: translateY(0);
}

/* Analyze Button Section */
.analyze-button-section {
    margin-bottom: 24px;
}

.analyze-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    border: none;
    background: linear-gradient(135deg, #E85E53 0%, #8E31BB 100%);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.analyze-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(232, 94, 83, 0.3);
}

/* Help Text */
.media-help-text {
    margin-bottom: 24px;
    padding: 16px;
    background: #f0f9ff;
    border-left: 4px solid #3b82f6;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.6;
    color: #1e40af;
    font-family: 'Inter', sans-serif;
}

.media-help-text strong {
    color: #1e3a8a;
}

.media-help-text ul {
    margin: 8px 0 0 20px;
    padding: 0;
}

.media-help-text li {
    margin-bottom: 6px;
}

.media-help-text code {
    background: rgba(59, 130, 246, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 12px;
}

/* Analysis Results */
.analysis-results-container {
    margin-top: 32px;
}

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

.results-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0;
    font-family: 'Inter', sans-serif;
}

.view-toggle {
    display: flex;
    gap: 8px;
    background: white;
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.view-toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.view-toggle-btn:hover {
    color: #1a1a2e;
    background: rgba(0, 0, 0, 0.03);
}

.view-toggle-btn.active {
   
    color: #000;

}

.view-toggle-btn i {
    font-size: 16px;
}

.results-grid-wrapper {
    margin-top: 16px;
}

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

.results-table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: white;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Inter', sans-serif;
}

.results-table thead {
    background: #f9fafb;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

.results-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.results-table tbody tr {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: background-color 0.2s ease;
}

.results-table tbody tr:hover {
    background-color: #f9fafb;
}

.results-table tbody tr:last-child {
    border-bottom: none;
}

.results-table td {
    padding: 12px 16px;
    font-size: 14px;
    color: #1a1a2e;
    vertical-align: middle;
}

.no-results-row .no-results {
    text-align: center;
    padding: 40px;
    color: #9ca3af;
    font-size: 14px;
    font-style: italic;
    font-family: 'Inter', sans-serif;
}

.loading-results-row .loading-results,
.results-grid .loading-results {
    text-align: center;
    padding: 40px;
    color: #6b7280;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.loading-results-row .loading-results i,
.results-grid .loading-results i {
    font-size: 18px;
    color: #3b82f6;
}

body.dark-mode .loading-results-row .loading-results,
body.dark-mode .results-grid .loading-results {
    color: #9ca3af;
}

.result-row {
    transition: all 0.2s ease;
}

/* Table cell styles */
.time-cell {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
    white-space: nowrap;
}

.snapshot-cell {
    padding: 8px !important;
    width: 120px;
}

.result-snapshot-img {
    width: 100px;
    height: 75px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.result-snapshot-img:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0.9;
}

.result-snapshot-img-grid {
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.result-snapshot-img-grid:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

/* Snapshot Modal Styles */
.snapshot-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.snapshot-modal.active {
    opacity: 1;
    visibility: visible;
}

.snapshot-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(4px);
}

.snapshot-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.snapshot-modal-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.snapshot-modal-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    font-size: 20px;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.snapshot-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

body.dark-mode .snapshot-modal-overlay {
    background: rgba(0, 0, 0, 0.95);
}

body.dark-mode .snapshot-modal-close {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
}

body.dark-mode .snapshot-modal-close:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
}

.status-cell {
    white-space: nowrap;
}

.result-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'Inter', sans-serif;
    display: inline-block;
}

.result-badge-success {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.result-badge-error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.wheels-cell,
.axles-cell {
    text-align: center;
    font-weight: 600;
    color: #1a1a2e;
}

.type-cell {
    text-transform: capitalize;
    color: #4b5563;
}

.capacity-cell {
    font-weight: 500;
    color: #1a1a2e;
}

.confidence-cell {
    font-weight: 500;
    color: #3b82f6;
}

.notes-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #6b7280;
    font-size: 13px;
}

.loading-status,
.error-status {
    color: #9ca3af;
    font-style: italic;
}

.error-status {
    color: #dc2626;
    display: flex;
    align-items: center;
    gap: 6px;
}

.result-loading,
.result-error {
    padding: 20px;
}

.result-loading {
    color: #3b82f6;
    padding: 8px 0;
}

.progress-container {
    width: 100%;
    min-width: 150px;
}

.progress-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: #3b82f6;
}

.progress-message {
    font-size: 12px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
}

.progress-header i {
    font-size: 16px;
    animation: spin 1s linear infinite;
}

.progress-bar-wrapper {
    width: 100%;
    height: 4px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 100%);
    border-radius: 2px;
    transition: width 0.3s ease;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

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

/* Dark Mode Support for Media Panel */
body.dark-mode .source-btn {
    background: #171717;
    border-color: rgba(255, 255, 255, 0.1);
    color: #a3a3a3;
}

body.dark-mode .source-btn:hover {
    border-color: #E85E53;
    color: #E85E53;
}

body.dark-mode .source-btn.active {
    background: linear-gradient(135deg, #E85E53 0%, #8E31BB 100%);
    color: white;
}

body.dark-mode .url-input,
body.dark-mode .model-select,
body.dark-mode .interval-select {
    background: #171717;
    border-color: rgba(255, 255, 255, 0.1);
    color: #e5e5e5;
}

body.dark-mode .load-url-btn {
    background: linear-gradient(135deg, #E85E53 0%, #8E31BB 100%);
}

body.dark-mode .preview-wrapper {
    background: #121212;
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .sampling-controls {
    background: #121212;
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .media-help-text {
    background: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
    color: #93c5fd;
}

body.dark-mode .results-table-wrapper {
    background: #171717;
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .results-table thead {
    background: #121212;
}

body.dark-mode .results-table th {
    color: #a3a3a3;
}

body.dark-mode .results-table tbody tr {
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .results-table tbody tr:hover {
    background-color: #1a1a1a;
}

body.dark-mode .results-table td {
    color: #f1f1f1;
}

body.dark-mode .time-cell,
body.dark-mode .notes-cell {
    color: #9ca3af;
}

body.dark-mode .wheels-cell,
body.dark-mode .axles-cell,
body.dark-mode .capacity-cell {
    color: #f1f1f1;
}

body.dark-mode .type-cell {
    color: #d1d5db;
}

body.dark-mode .progress-header {
    color: #60a5fa;
}

body.dark-mode .progress-bar-wrapper {
    background: rgba(59, 130, 246, 0.2);
}

body.dark-mode .progress-bar {
    background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 100%);
}

body.dark-mode .results-header {
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .view-toggle {
    background: #171717;
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .view-toggle-btn {
    color: #a3a3a3;
}

body.dark-mode .view-toggle-btn:hover {
    color: #f1f1f1;
    background: rgba(255, 255, 255, 0.1);
}

body.dark-mode .view-toggle-btn.active {
    background: transparent;
    color: #667eea;
}

/* Edit functionality styles */
.actions-cell {
    text-align: center;
    white-space: nowrap;
}

.edit-btn,
.save-btn,
.cancel-btn,
.delete-btn {
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    margin: 0 2px;
}

.edit-btn:hover {
    background: #f3f4f6;
    border-color: #3b82f6;
    color: #3b82f6;
}

.save-btn {
    color: #10b981;
    border-color: #10b981;
}

.save-btn:hover {
    background: #10b981;
    color: white;
}

.cancel-btn {
    color: #ef4444;
    border-color: #ef4444;
}

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

.delete-btn {
    color: #ef4444;
    border-color: #ef4444;
}

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

.editable-cell {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.editable-cell:hover {
    background-color: #f3f4f6;
}

.edit-input {
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    background: white;
    color: #1a1a2e;
    transition: border-color 0.2s ease;
}

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

.edit-input[type="number"] {
    text-align: right;
}

body.dark-mode .edit-btn,
body.dark-mode .save-btn,
body.dark-mode .cancel-btn,
body.dark-mode .delete-btn {
    border-color: rgba(255, 255, 255, 0.2);
    color: #d1d5db;
}

body.dark-mode .edit-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #3b82f6;
    color: #3b82f6;
}

body.dark-mode .save-btn {
    color: #10b981;
    border-color: #10b981;
}

body.dark-mode .save-btn:hover {
    background: #10b981;
    color: white;
}

body.dark-mode .cancel-btn {
    color: #ef4444;
    border-color: #ef4444;
}

body.dark-mode .cancel-btn:hover {
    background: #ef4444;
    color: white;
}

body.dark-mode .delete-btn {
    color: #ef4444;
    border-color: #ef4444;
}

body.dark-mode .delete-btn:hover {
    background: #ef4444;
    color: white;
}

body.dark-mode .editable-cell:hover {
    background-color: #1a1a1a;
}

body.dark-mode .edit-input {
    background: #121212;
    border-color: rgba(255, 255, 255, 0.1);
    color: #e5e5e5;
}

body.dark-mode .edit-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}


/* Responsive Design */
@media (max-width: 768px) {
    .media-source-selector {
        flex-direction: column;
    }

    .source-btn {
        width: 100%;
        justify-content: center;
    }

    .results-table-wrapper {
        overflow-x: scroll;
    }

    .results-table {
        min-width: 800px;
    }

    .results-table th,
    .results-table td {
        padding: 8px 12px;
        font-size: 12px;
    }

    .result-snapshot-img {
        width: 80px;
        height: 60px;
    }

    .sampling-buttons {
        flex-direction: column;
    }

    .sampling-btn {
        width: 100%;
        justify-content: center;
    }

}

