/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --amber-50: #FFFBEB;
    --amber-100: #FEF3C7;
    --amber-200: #FDE68A;
    --amber-400: #FBBF24;
    --amber-500: #F59E0B;
    --amber-600: #D97706;
    --amber-700: #B45309;
    --green-50: #F0FDF4;
    --green-100: #DCFCE7;
    --green-500: #22C55E;
    --green-600: #16A34A;
    --green-700: #15803D;
    --red-50: #FEF2F2;
    --red-100: #FEE2E2;
    --red-500: #EF4444;
    --red-600: #DC2626;
    --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;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--amber-600); text-decoration: none; }
a:hover { color: var(--amber-700); text-decoration: underline; }

/* ===== HEADER ===== */
.header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}
.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.25rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.logo-icon { width: 40px; height: 40px; flex-shrink: 0; }
.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
}
.logo-text span { color: var(--amber-600); }
.logo-sub { font-size: 0.75rem; color: var(--gray-500); font-weight: 500; }

.nav { display: flex; gap: 0.25rem; }
.nav-link {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-600);
    transition: all 0.15s;
}
.nav-link:hover { background: var(--gray-100); color: var(--gray-900); text-decoration: none; }
.nav-link.active { background: var(--amber-50); color: var(--amber-700); }

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
    color: var(--gray-600);
    cursor: pointer;
    border-radius: var(--radius-sm);
}
.mobile-menu-btn:hover { background: var(--gray-100); }

/* ===== MOBILE NAV ===== */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 200;
}
.mobile-nav-overlay.open { display: block; }
.mobile-nav {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100%;
    background: white;
    z-index: 201;
    transition: right 0.25s ease;
    box-shadow: var(--shadow-lg);
}
.mobile-nav.open { right: 0; }
.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
    font-weight: 600;
    color: var(--gray-800);
}
.mobile-nav-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-500);
    padding: 0.25rem;
}
.mobile-nav-link {
    display: block;
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-100);
}
.mobile-nav-link:hover { background: var(--gray-50); text-decoration: none; }
.mobile-nav-link.active { color: var(--amber-700); background: var(--amber-50); }

/* ===== MAIN ===== */
.main {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem;
    width: 100%;
    flex: 1;
}
.page { display: none; }
.page.active { display: block; }
.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1.5rem;
}

/* ===== SAFETY BANNER ===== */
.safety-banner {
    background: var(--amber-50);
    border: 1px solid var(--amber-200);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    color: var(--amber-700);
    line-height: 1.6;
}
.safety-icon { width: 20px; height: 20px; flex-shrink: 0; margin-top: 2px; stroke: var(--amber-500); }
.safety-link { font-weight: 600; text-decoration: underline; }

/* ===== STATS ROW ===== */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
}
.stat-number { font-size: 2rem; font-weight: 700; color: var(--amber-600); line-height: 1; }
.stat-label { font-size: 0.8125rem; color: var(--gray-500); font-weight: 500; margin-top: 0.375rem; }

/* ===== FILTER BAR ===== */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.filter-group { display: flex; gap: 0.375rem; }
.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: white;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.15s;
}
.filter-btn:hover { border-color: var(--gray-300); color: var(--gray-800); }
.filter-btn.active { background: var(--amber-500); color: white; border-color: var(--amber-500); }

.search-box {
    position: relative;
    flex: 0 1 260px;
}
.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    stroke: var(--gray-400);
}
.search-box input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2.25rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
}
.search-box input:focus { border-color: var(--amber-400); box-shadow: 0 0 0 3px rgba(251,191,36,0.15); }

/* ===== DEPOT GRID ===== */
.depot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1rem;
}

/* ===== DEPOT CARD ===== */
.depot-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.2s;
}
.depot-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.depot-card-header {
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--gray-100);
}
.depot-name { font-size: 1.125rem; font-weight: 700; color: var(--gray-900); }
.depot-status {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.depot-status.open { background: var(--green-50); color: var(--green-700); }
.depot-status.open::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green-500);
    animation: pulse 2s infinite;
}
.depot-status.closed { background: var(--gray-100); color: var(--gray-500); }
.depot-status.season { background: var(--red-50); color: var(--red-600); }

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

.depot-card-body { padding: 1rem 1.25rem; }

.depot-trucks {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.truck-stat {
    text-align: center;
    padding: 0.5rem;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
}
.truck-stat-num { font-size: 1.25rem; font-weight: 700; color: var(--gray-800); }
.truck-stat-label { font-size: 0.6875rem; color: var(--gray-500); font-weight: 500; }

.depot-varieties {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}
.variety-tag {
    padding: 0.1875rem 0.625rem;
    background: var(--amber-50);
    color: var(--amber-700);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.depot-card-footer {
    padding: 0.75rem 1.25rem;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--gray-500);
}
.depot-card-footer .depot-hours {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}
.depot-card-footer svg { width: 14px; height: 14px; flex-shrink: 0; }
.depot-note {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    background: var(--amber-50);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--amber-700);
    margin-bottom: 0.75rem;
}
.depot-note svg { width: 14px; height: 14px; flex-shrink: 0; }
.data-age { font-style: italic; color: var(--gray-400); font-size: 0.6875rem; margin-top: 0.5rem; }

/* ===== DEPOT DETAIL PAGE ===== */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: none;
    border: none;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-600);
    cursor: pointer;
    padding: 0.5rem 0;
    margin-bottom: 1rem;
    font-family: inherit;
}
.back-btn:hover { color: var(--amber-600); }

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.detail-title { font-size: 1.75rem; font-weight: 700; color: var(--gray-900); }
.detail-updated { font-size: 0.8125rem; color: var(--gray-400); margin-top: 0.25rem; }

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.detail-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.detail-card-title {
    padding: 0.875rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.detail-card-title svg { width: 16px; height: 16px; stroke: var(--gray-500); }
.detail-card-body { padding: 1.25rem; }
.detail-card.full-width { grid-column: 1 / -1; }

/* Contact table */
.contact-table { width: 100%; }
.contact-table tr { border-bottom: 1px solid var(--gray-100); }
.contact-table tr:last-child { border-bottom: none; }
.contact-table td { padding: 0.625rem 0; font-size: 0.875rem; vertical-align: top; }
.contact-table .label {
    font-weight: 600;
    color: var(--gray-500);
    width: 140px;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.contact-table .value { color: var(--gray-800); }
.contact-table a { color: var(--amber-600); font-weight: 500; }
.contact-table a:hover { text-decoration: underline; }

/* Hours grid */
.hours-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.5rem;
}
.hours-day {
    text-align: center;
    padding: 0.75rem 0.5rem;
    border-radius: var(--radius-sm);
    background: var(--gray-50);
}
.hours-day-name { font-size: 0.6875rem; font-weight: 600; color: var(--gray-500); text-transform: uppercase; margin-bottom: 0.25rem; }
.hours-day-time { font-size: 0.8125rem; font-weight: 600; color: var(--gray-800); }
.hours-day-time.closed-text { color: var(--red-500); }

/* Truck queue */
.queue-display {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}
.queue-item { text-align: center; }
.queue-num {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-800);
    line-height: 1;
}
.queue-num.total { color: var(--amber-600); }
.queue-label {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

/* Varieties table */
.variety-table { width: 100%; border-collapse: collapse; }
.variety-table th {
    text-align: left;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5rem 0.75rem;
    border-bottom: 2px solid var(--gray-200);
}
.variety-table td {
    padding: 0.75rem;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--gray-100);
}
.variety-table tr:last-child td { border-bottom: none; }
.moisture-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.1875rem 0.5rem;
    background: var(--green-50);
    color: var(--green-700);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Camera section */
.camera-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}
.camera-thumb {
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    aspect-ratio: 16/9;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    border: 2px solid transparent;
    color: var(--gray-400);
}
.camera-thumb:hover { border-color: var(--amber-400); color: var(--amber-600); }
.camera-thumb svg { width: 32px; height: 32px; margin-bottom: 0.375rem; }
.camera-thumb span { font-size: 0.75rem; font-weight: 500; }

/* Testing stands */
.testing-stands { display: flex; gap: 1rem; flex-wrap: wrap; }
.stand-card {
    flex: 1;
    min-width: 200px;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    text-align: center;
}
.stand-name { font-size: 0.875rem; font-weight: 600; color: var(--gray-700); margin-bottom: 0.25rem; }
.stand-status { font-size: 0.75rem; color: var(--gray-400); }

/* Detail note */
.detail-note {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--amber-50);
    border: 1px solid var(--amber-200);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--amber-700);
    margin-bottom: 1.5rem;
}
.detail-note svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ===== DOCUMENTS PAGE ===== */
.docs-grid { display: flex; flex-direction: column; gap: 0.75rem; }
.doc-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.15s;
}
.doc-card:hover { box-shadow: var(--shadow-md); }
.doc-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.doc-icon svg { width: 24px; height: 24px; }
.doc-icon.pdf { background: #FEE2E2; }
.doc-icon.pdf svg { stroke: #DC2626; }
.doc-icon.link { background: #DBEAFE; }
.doc-icon.link svg { stroke: #2563EB; }
.doc-icon.training { background: var(--green-100); }
.doc-icon.training svg { stroke: var(--green-600); }
.doc-info { flex: 1; }
.doc-info h3 { font-size: 0.9375rem; font-weight: 600; color: var(--gray-800); margin-bottom: 0.25rem; }
.doc-info p { font-size: 0.8125rem; color: var(--gray-500); }
.doc-download {
    padding: 0.5rem 1rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-700);
    white-space: nowrap;
    transition: all 0.15s;
}
.doc-download:hover { background: var(--amber-50); border-color: var(--amber-200); color: var(--amber-700); text-decoration: none; }

/* ===== CONTACT PAGE ===== */
.contact-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}
.contact-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
}
.contact-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    background: var(--amber-50);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.contact-icon svg { width: 24px; height: 24px; stroke: var(--amber-600); }
.contact-card h3 { font-size: 0.875rem; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.5rem; }
.contact-value { display: block; font-size: 1.125rem; font-weight: 600; color: var(--amber-600); margin-bottom: 0.5rem; }
.contact-value:hover { color: var(--amber-700); }
.contact-note { font-size: 0.8125rem; color: var(--gray-400); }

/* ===== MODAL ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 300;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}
.modal-overlay.open { display: flex; }
.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 640px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
}
.modal-header h3 { font-size: 1rem; font-weight: 600; }
.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
}
.modal-close:hover { color: var(--gray-700); }
.modal-body { padding: 2rem; }
.camera-placeholder {
    text-align: center;
    color: var(--gray-400);
    padding: 2rem 0;
}
.camera-placeholder svg { margin-bottom: 0.75rem; }
.camera-placeholder p { font-size: 0.9375rem; font-weight: 500; color: var(--gray-600); }
.camera-note { font-size: 0.8125rem; color: var(--gray-400); margin-top: 0.25rem; font-weight: 400 !important; }

/* ===== FOOTER ===== */
.footer {
    text-align: center;
    padding: 1.5rem;
    font-size: 0.8125rem;
    color: var(--gray-400);
    border-top: 1px solid var(--gray-200);
    margin-top: auto;
}

/* ===== NO RESULTS ===== */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray-400);
}
.no-results svg { width: 48px; height: 48px; margin-bottom: 0.75rem; }
.no-results p { font-size: 0.9375rem; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .nav { display: none; }
    .mobile-menu-btn { display: block; }

    .stats-row { grid-template-columns: repeat(3, 1fr); gap: 0.625rem; }
    .stat-card { padding: 0.875rem; }
    .stat-number { font-size: 1.5rem; }

    .filter-bar { flex-direction: column; align-items: stretch; }
    .search-box { flex: 1 1 100%; }

    .depot-grid { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .queue-display { grid-template-columns: repeat(2, 1fr); }

    .doc-card { flex-direction: column; text-align: center; }
    .doc-download { width: 100%; text-align: center; display: block; }

    .detail-title { font-size: 1.375rem; }
}

@media (max-width: 480px) {
    .header-inner { height: 56px; }
    .logo-text { font-size: 1.0625rem; }
    .main { padding: 1rem; }
    .hours-grid { grid-template-columns: repeat(3, 1fr); }
    .camera-grid { grid-template-columns: repeat(2, 1fr); }
}
