/* ============================================
   VENDRIG SEQUENCING DASHBOARD
   Industrial Precision × Dutch Minimalism
   ============================================ */

/* Import fonts */
@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;500;600&display=swap');

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
    /* Core palette */
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f7;
    --bg-elevated: #eef0f3;
    --bg-card: #ffffff;

    /* Text hierarchy */
    --text-primary: #333333;
    --text-secondary: #676767;
    --text-muted: #999999;

    /* Accent colors — Vendrig brand */
    --accent-gold: #AD0067;
    --accent-gold-dim: rgba(173, 0, 103, 0.15);
    --accent-gold-glow: rgba(173, 0, 103, 0.4);
    --accent-secondary: #51C0DC;
    --accent-secondary-dim: rgba(81, 192, 220, 0.15);

    /* Status colors */
    --status-excellent: #00d9a5;
    --status-excellent-bg: rgba(0, 217, 165, 0.08);
    --status-good: #ffc857;
    --status-good-bg: rgba(255, 200, 87, 0.08);
    --status-poor: #ff6b6b;
    --status-poor-bg: rgba(255, 107, 107, 0.08);

    /* Structural */
    --border-subtle: rgba(0, 0, 0, 0.06);
    --border-medium: rgba(0, 0, 0, 0.1);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 40px rgba(173, 0, 103, 0.15);

    /* Typography */
    --font-display: 'Barlow', -apple-system, sans-serif;
    --font-mono: 'Open Sans', sans-serif;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 40px;
    --space-2xl: 64px;

    /* Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Animation */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-display);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Subtle noise texture overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
    z-index: 10000;
}

a {
    color: var(--accent-gold);
    text-decoration: none;
    transition: color 0.2s var(--ease-out);
}

a:hover {
    color: var(--text-primary);
}

::selection {
    background: var(--accent-gold);
    color: var(--bg-primary);
}

/* ============================================
   HEADER
   ============================================ */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
}

.header-content {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
    padding: 0 var(--space-xl);
}

.logo {
    display: flex;
    align-items: center;
    flex: 1;
}

.logo a {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 32px;
    width: auto;
}

.nav {
    display: flex;
    gap: var(--space-xs);
    background: var(--bg-elevated);
    padding: var(--space-xs);
    border-radius: var(--radius-md);
}

.nav-link {
    color: var(--text-secondary);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s var(--ease-out);
    position: relative;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: var(--bg-primary);
    background: var(--accent-gold);
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-md);
    flex: 1;
}

.info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border-medium);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 14px;
    font-style: italic;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.info-btn:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    background: var(--accent-gold-dim);
}

.date-picker {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.date-picker label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 500;
}

.date-picker select {
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-medium);
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
}

.date-picker select:hover {
    border-color: var(--accent-gold);
}

.date-picker select:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px var(--accent-gold-dim);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    flex: 1;
    padding: var(--space-xl);
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-subtle);
    text-align: center;
    padding: var(--space-lg);
}

.footer p {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    letter-spacing: 0.02em;
}

/* ============================================
   DASHBOARD HEADER
   ============================================ */
.dashboard-header {
    margin-bottom: var(--space-xl);
    animation: fadeIn 0.6s var(--ease-out);
}

.date-info {
    margin-bottom: var(--space-lg);
}

.date-info h2 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    line-height: 1.2;
}

.week-info {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

/* ============================================
   SUMMARY CARDS
   ============================================ */
.summary-cards {
    display: flex;
    gap: var(--space-md);
    margin: var(--space-lg) 0;
    flex-wrap: wrap;
}

.summary-card {
    background: #51C0DC;
    color: #ffffff;
    border: 1px solid rgba(81, 192, 220, 0.3);
    border-radius: var(--radius-lg);
    padding: var(--space-lg) var(--space-xl);
    min-width: 140px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s var(--ease-out);
    animation: slideUp 0.5s var(--ease-out) backwards;
}

.summary-card:nth-child(1) { animation-delay: 0.1s; }
.summary-card:nth-child(2) { animation-delay: 0.15s; }
.summary-card:nth-child(3) { animation-delay: 0.2s; }
.summary-card:nth-child(4) { animation-delay: 0.25s; }

.summary-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-medium);
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gold);
    opacity: 0;
    transition: opacity 0.3s var(--ease-out);
}

.summary-card:hover::before {
    opacity: 1;
}

.summary-card.excellent::before { background: var(--status-excellent); opacity: 1; }
.summary-card.good::before { background: var(--status-good); opacity: 1; }
.summary-card.poor::before { background: var(--status-poor); opacity: 1; }

.summary-value {
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 600;
    color: #ffffff;
    line-height: 1;
    margin-bottom: var(--space-xs);
}

.summary-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
}

/* ============================================
   ACTION BUTTONS
   ============================================ */
.action-buttons {
    margin-top: var(--space-lg);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-sm);
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
}

.btn-primary {
    background: var(--accent-gold);
    color: var(--bg-primary);
}

.btn-primary:hover {
    background: #ffb820;
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
}

.btn-secondary:hover {
    background: var(--bg-card);
    border-color: var(--text-muted);
}

.btn-small {
    padding: var(--space-xs) var(--space-md);
    font-size: 0.75rem;
}

.inline-form {
    display: inline;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-xs) var(--space-md);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 500;
    font-family: var(--font-mono);
}

.status-badge.saved {
    background: var(--status-excellent-bg);
    color: var(--status-excellent);
    border: 1px solid rgba(0, 217, 165, 0.3);
}

.status-badge.warning {
    background: var(--status-poor-bg);
    color: var(--status-poor);
    border: 1px solid rgba(255, 107, 107, 0.3);
}

/* ============================================
   ROUTES GRID
   ============================================ */
.routes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: var(--space-lg);
}

/* ============================================
   ROUTE CARD
   ============================================ */
.route-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s var(--ease-out);
    animation: slideUp 0.5s var(--ease-out) backwards;
}

.route-card:nth-child(1) { animation-delay: 0.1s; }
.route-card:nth-child(2) { animation-delay: 0.15s; }
.route-card:nth-child(3) { animation-delay: 0.2s; }
.route-card:nth-child(4) { animation-delay: 0.25s; }
.route-card:nth-child(5) { animation-delay: 0.3s; }
.route-card:nth-child(6) { animation-delay: 0.35s; }
.route-card:nth-child(7) { animation-delay: 0.4s; }
.route-card:nth-child(8) { animation-delay: 0.45s; }

.route-card:hover {
    border-color: var(--accent-secondary);
    box-shadow: var(--shadow-md), 0 0 40px rgba(81, 192, 220, 0.15);
    transform: translateY(-4px);
}

.route-header {
    background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-secondary) 100%);
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.route-header h3 {
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.route-header h3 a {
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.route-header h3 a::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--accent-gold);
    border-radius: 50%;
}

.route-header h3 a:hover {
    color: var(--accent-gold);
}

.route-stats {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-align: right;
}

/* ============================================
   BATCH SUGGESTIONS
   ============================================ */
.batch-suggestions {
    background: var(--accent-gold-dim);
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid rgba(173, 0, 103, 0.2);
}

.batch-header {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-gold);
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.batch-icon {
    font-size: 0.875rem;
}

.batch-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    padding: var(--space-xs) 0;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.batch-id {
    font-weight: 600;
    color: var(--accent-gold);
    background: rgba(173, 0, 103, 0.2);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.batch-more {
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

/* Expandable batch suggestions */
.batch-suggestions {
    cursor: pointer;
}

.batch-suggestions:hover {
    background: rgba(173, 0, 103, 0.2);
}

.batch-chevron {
    margin-left: auto;
    font-size: 0.625rem;
    opacity: 0.7;
    transition: transform 0.2s var(--ease-out);
}

.batch-suggestions.expanded .batch-chevron {
    transform: rotate(180deg);
}

.batch-details {
    display: none !important;
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid rgba(173, 0, 103, 0.15);
}

.batch-suggestions.expanded .batch-details {
    display: block !important;
    animation: slideDown 0.3s var(--ease-out);
}

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

.batch-detail-card {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-sm);
}

.batch-detail-card:last-of-type {
    margin-bottom: var(--space-md);
}

.batch-detail-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.batch-detail-header .batch-id {
    font-size: 0.75rem;
}

.batch-wash-type {
    font-size: 0.6875rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    background: var(--bg-elevated);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

.batch-detail-header .batch-volume {
    margin-left: auto;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

.batch-customer-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.batch-customer-name {
    font-size: 0.6875rem;
    color: var(--text-secondary);
    background: var(--bg-elevated);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}

.batch-summary {
    display: flex;
    justify-content: space-between;
    font-size: 0.6875rem;
    color: var(--text-muted);
    padding-top: var(--space-sm);
    border-top: 1px solid rgba(173, 0, 103, 0.1);
}

.batch-volume-total {
    font-family: var(--font-mono);
    color: var(--accent-gold);
}

/* ============================================
   CUSTOMER LIST
   ============================================ */
.customer-list {
    max-height: 380px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--bg-elevated) transparent;
}

.customer-list::-webkit-scrollbar {
    width: 6px;
}

.customer-list::-webkit-scrollbar-track {
    background: transparent;
}

.customer-list::-webkit-scrollbar-thumb {
    background: var(--bg-elevated);
    border-radius: 3px;
}

.customer-row {
    display: flex;
    align-items: center;
    padding: var(--space-sm) var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.8125rem;
    transition: background 0.15s var(--ease-out);
}

.customer-row:hover {
    background: rgba(255, 255, 255, 0.02);
}

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

.customer-row.large .customer-volume {
    color: var(--status-poor);
    font-weight: 600;
}

.seq-badge {
    width: 28px;
    height: 28px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-medium);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.75rem;
    flex-shrink: 0;
}


.customer-name {
    flex: 1;
    margin-left: var(--space-md);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-secondary);
}

.customer-volume {
    font-family: var(--font-mono);
    font-weight: 500;
    min-width: 48px;
    text-align: right;
    color: var(--text-muted);
}

.multi-day-badge {
    background: var(--status-poor-bg);
    color: var(--status-poor);
    font-size: 0.625rem;
    font-family: var(--font-mono);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    margin-left: var(--space-sm);
    white-space: nowrap;
}

/* ============================================
   BATCH CATEGORY TAGS
   ============================================ */
.batch-category-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.6875rem;
    font-weight: 600;
    font-family: var(--font-mono);
    letter-spacing: 0.03em;
}

.tag-route_aligned {
    background: var(--status-excellent-bg);
    color: var(--status-excellent);
}

.tag-special {
    background: var(--status-poor-bg);
    color: var(--status-poor);
}

.tag-companion {
    background: var(--status-good-bg);
    color: var(--status-good);
}

.tag-overflow {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
}

/* ============================================
   MULTI-BATCH BADGE
   ============================================ */
.multi-batch-badge {
    background: var(--accent-gold-dim);
    color: var(--accent-gold);
    font-size: 0.625rem;
    font-family: var(--font-mono);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    margin-left: var(--space-sm);
    white-space: nowrap;
}

/* ============================================
   ZERO-VOLUME TOGGLE
   ============================================ */
.zero-volume-toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-elevated);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    margin-bottom: var(--space-lg);
}

.zero-volume-toggle:hover {
    border-color: var(--accent-gold);
    color: var(--text-secondary);
}

.batch-card-zero {
    display: none;
    opacity: 0.5;
}

.batch-card-zero.visible {
    display: block;
}

/* ============================================
   BATCH CARD FOOTER (replaces route footer)
   ============================================ */
.batch-card-footer {
    padding: var(--space-sm) var(--space-lg);
    background: var(--bg-elevated);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-muted);
}

.empty-state p {
    margin-bottom: var(--space-sm);
}

.hint {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.hint ol {
    list-style-position: inside;
    text-align: left;
    max-width: 400px;
    margin: var(--space-md) auto 0;
}

.hint li {
    margin-bottom: var(--space-xs);
}

/* ============================================
   DATA TABLES
   ============================================ */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.data-table th,
.data-table td {
    padding: var(--space-md) var(--space-lg);
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
}

.data-table th {
    background: var(--bg-elevated);
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.data-table tbody tr {
    transition: background 0.15s var(--ease-out);
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

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

.col-num {
    text-align: right;
    font-family: var(--font-mono);
}

.col-seq {
    width: 60px;
}

/* Row highlighting */
.row-anomaly {
    background: rgba(255, 107, 107, 0.05) !important;
    border-left: 3px solid var(--status-poor);
}

/* ============================================
   ROUTE DETAIL
   ============================================ */
.route-detail {
    max-width: 1100px;
    animation: fadeIn 0.5s var(--ease-out);
}

.breadcrumb {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
    font-family: var(--font-mono);
}

.breadcrumb a {
    color: var(--text-secondary);
}

.route-detail-header {
    margin-bottom: var(--space-xl);
}

.route-detail-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.route-detail-header h2::before {
    content: '';
    width: 8px;
    height: 40px;
    background: var(--accent-gold);
    border-radius: 2px;
}

.section {
    margin: var(--space-xl) 0;
}

.section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    letter-spacing: -0.01em;
}

.section-description {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: var(--space-lg);
}

/* ============================================
   BATCH CARDS
   ============================================ */
.batch-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-md);
}

.batch-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    position: relative;
    overflow: hidden;
    transition: all 0.3s var(--ease-out);
}

.batch-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-secondary);
}

.batch-card:hover {
    border-color: var(--accent-secondary);
    transform: translateY(-2px);
}

.batch-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-md);
}

.batch-id-large {
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-gold);
}

.batch-meta {
    text-align: right;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.batch-meta span {
    display: block;
}

.batch-customers-list {
    margin-bottom: var(--space-md);
}

.customer-tag {
    display: inline-block;
    background: var(--bg-elevated);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    margin: 2px;
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

.batch-wash-types {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* ============================================
   ROUTE DETAIL ENHANCED
   ============================================ */
.route-nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-subtle);
}

.back-link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
    transition: color 0.2s var(--ease-out);
}

.back-link:hover {
    color: var(--accent-gold);
}

.back-arrow {
    font-size: 1.25rem;
}

.route-nav {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.route-nav-btn {
    font-size: 0.8125rem;
    color: var(--text-muted);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    transition: all 0.2s var(--ease-out);
}

.route-nav-btn:hover {
    color: var(--accent-gold);
    background: var(--accent-gold-dim);
}

.route-nav-current {
    font-weight: 600;
    color: var(--text-primary);
    padding: var(--space-sm) var(--space-md);
}

.route-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-xl);
}

.route-title-section h2 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: var(--space-xs);
}

.route-date {
    color: var(--text-muted);
    font-size: 0.9375rem;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.week-badge {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-family: var(--font-mono);
}

.anomaly-alert {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    background: var(--status-poor-bg);
    color: var(--status-poor);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
}

.anomaly-icon {
    width: 20px;
    height: 20px;
    background: var(--status-poor);
    color: var(--bg-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.route-stats-row {
    display: flex;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.route-stats-row .summary-cards {
    flex: 1;
}

.summary-card.highlight {
    border-color: var(--accent-gold);
    background: var(--accent-gold-dim);
}

.summary-card.highlight .summary-value {
    color: var(--accent-gold);
}

/* Wash Process Breakdown (horizontal bar chart) */
.wash-breakdown-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    min-width: 280px;
}

.wash-breakdown-header {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-md);
}

.wash-bar-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
    font-size: 0.75rem;
}

.wash-bar-label {
    width: 60px;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    text-align: right;
    flex-shrink: 0;
}

.wash-bar-track {
    flex: 1;
    height: 10px;
    background: var(--bg-elevated);
    border-radius: 5px;
    overflow: hidden;
}

.wash-bar-fill {
    height: 100%;
    background: var(--accent-gold);
    border-radius: 5px;
    transition: width 0.5s var(--ease-out);
}

.wash-bar-value {
    width: 40px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    text-align: right;
    flex-shrink: 0;
}

/* Section styling */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.section-header h3 {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: 0;
}

.section-icon {
    color: var(--accent-gold);
}

.section-badge {
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    background: var(--bg-elevated);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
}

/* Batch Grid */
.batch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--space-md);
}

.batch-stat {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.batch-stat.primary {
    color: var(--accent-gold);
    font-weight: 600;
}

.batch-customers-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: var(--space-md);
}

.customer-chip {
    background: var(--bg-elevated);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.6875rem;
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

.batch-footer {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--border-subtle);
}

.wash-type-badge {
    font-size: 0.6875rem;
    font-family: var(--font-mono);
    background: var(--accent-gold-dim);
    color: var(--accent-gold);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.wash-types-detail {
    font-size: 0.6875rem;
    color: var(--text-muted);
}

/* Table enhancements */
.table-container {
    overflow-x: auto;
}

.customer-table .col-customer {
    min-width: 200px;
}

.customer-info {
    display: flex;
    flex-direction: column;
}

.customer-info .customer-name {
    font-weight: 500;
}

.customer-info .customer-id {
    font-size: 0.6875rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

.col-wow {
    width: 80px;
    text-align: center;
}

.col-total {
    font-weight: 600;
}

.has-value {
    color: var(--accent-gold);
}

.wow-badge {
    display: inline-block;
    font-size: 0.6875rem;
    font-family: var(--font-mono);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

.wow-badge.up {
    background: var(--status-excellent-bg);
    color: var(--status-excellent);
}

.wow-badge.down {
    background: var(--status-poor-bg);
    color: var(--status-poor);
}

.wow-badge.neutral {
    background: var(--bg-elevated);
    color: var(--text-muted);
}

.note-badge {
    display: inline-block;
    font-size: 0.625rem;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    margin-right: 4px;
}

.note-badge.anomaly {
    background: var(--status-poor-bg);
    color: var(--status-poor);
}

.note-badge.multi-day {
    background: var(--accent-gold-dim);
    color: var(--accent-gold);
}

.row-anomaly {
    background: rgba(255, 107, 107, 0.05) !important;
    border-left: 3px solid var(--status-poor);
}

/* Legend Bar */
.legend-bar {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-lg);
    margin-top: var(--space-xl);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
}

.legend-group {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.legend-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.legend-bar .legend-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* (Size legend removed - S/M/L classification no longer used) */

/* ============================================
   COMPARISON PAGE
   ============================================ */
.comparison-page {
    max-width: 1200px;
    animation: fadeIn 0.5s var(--ease-out);
}

.page-header {
    margin-bottom: var(--space-xl);
}

.page-header h2 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.page-description {
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

.upload-toggle-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-bottom: var(--space-lg);
}

.upload-toggle-btn {
    font-size: 0.8125rem;
}

.upload-panel {
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-top: var(--space-sm);
    box-shadow: var(--shadow-sm);
    width: 100%;
    max-width: 480px;
}

.upload-panel.open {
    display: block;
}

.upload-section {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.upload-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
}

.upload-form {
    display: flex;
    align-items: flex-end;
    gap: var(--space-lg);
    flex-wrap: wrap;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.form-group label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 500;
}

.form-group input {
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    transition: all 0.2s var(--ease-out);
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px var(--accent-gold-dim);
}

.form-group input[type="file"] {
    padding: var(--space-sm);
}

.or-divider {
    text-align: center;
    color: var(--text-muted);
    margin: var(--space-lg) 0;
    position: relative;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.or-divider::before,
.or-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--border-subtle);
}

.or-divider::before { left: 0; }
.or-divider::after { right: 0; }

/* ============================================
   METRICS SECTION
   ============================================ */
.metrics-section {
    margin-bottom: var(--space-xl);
}

.volume-summary {
    margin-top: var(--space-lg);
    padding: var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
}

.volume-summary p {
    margin-bottom: var(--space-xs);
    font-size: 0.875rem;
}

.text-red { color: var(--status-poor); }
.text-green { color: var(--status-excellent); }

.warning {
    color: var(--status-good);
    font-size: 0.8125rem;
}

/* ============================================
   BATCH / ROUTE METRICS GRID
   ============================================ */
.route-metrics-section,
.batch-metrics-section {
    margin-bottom: var(--space-xl);
}

.route-metrics-grid,
.batch-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--space-md);
}

.route-metric-card,
.batch-metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.2s var(--ease-out);
}

.route-metric-card:hover,
.batch-metric-card:hover {
    border-color: var(--border-medium);
}

.route-metric-header,
.batch-metric-header {
    background: var(--bg-elevated);
    padding: var(--space-sm) var(--space-md);
    font-weight: 600;
    font-size: 0.8125rem;
    border-bottom: 1px solid var(--border-subtle);
}

.route-metric-body,
.batch-metric-body {
    padding: var(--space-md);
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-xs) var(--space-md);
    font-size: 0.75rem;
}

.metric-label {
    color: var(--text-muted);
}

.metric-value {
    font-family: var(--font-mono);
    text-align: right;
}

.metric-value.excellent { color: var(--status-excellent); }
.metric-value.good { color: var(--status-good); }
.metric-value.poor { color: var(--status-poor); }

/* ============================================
   ACCURACY BADGES
   ============================================ */
.accuracy-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.625rem;
    font-weight: 600;
    font-family: var(--font-mono);
    letter-spacing: 0.05em;
}

.accuracy-badge.excellent {
    background: var(--status-excellent-bg);
    color: var(--status-excellent);
}

.accuracy-badge.good {
    background: var(--status-good-bg);
    color: var(--status-good);
}

.accuracy-badge.poor {
    background: var(--status-poor-bg);
    color: var(--status-poor);
}

/* Comparison table row highlighting */
.accuracy-excellent {
    background: var(--status-excellent-bg);
}

.accuracy-good {
    background: var(--status-good-bg);
}

.accuracy-poor {
    background: var(--status-poor-bg);
}

/* ============================================
   ACCURACY PAGE
   ============================================ */
.accuracy-page {
    max-width: 1200px;
    animation: fadeIn 0.5s var(--ease-out);
}

.trend-summary {
    margin-bottom: var(--space-xl);
}

.best-worst {
    margin-top: var(--space-lg);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.trend-arrow {
    font-size: 1.25rem;
    font-weight: 700;
}

.trend-arrow.up { color: var(--status-excellent); }
.trend-arrow.down { color: var(--status-poor); }

/* ============================================
   MAPE CHART
   ============================================ */
.chart-section {
    margin: var(--space-xl) 0;
}

.mape-chart {
    display: flex;
    align-items: flex-end;
    height: 180px;
    gap: 4px;
    padding: var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
}

.chart-bar-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
}

.chart-bar {
    width: 100%;
    max-width: 24px;
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    transition: all 0.3s var(--ease-out);
}

.chart-bar.excellent { background: var(--status-excellent); }
.chart-bar.good { background: var(--status-good); }
.chart-bar.poor { background: var(--status-poor); }

.chart-bar-container:hover .chart-bar {
    opacity: 0.8;
    transform: scaleY(1.05);
    transform-origin: bottom;
}

.chart-label {
    font-size: 0.625rem;
    color: var(--text-muted);
    margin-top: var(--space-sm);
    font-family: var(--font-mono);
}

.chart-legend {
    display: flex;
    gap: var(--space-xl);
    justify-content: center;
    margin-top: var(--space-md);
    font-size: 0.75rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-muted);
}

.legend-item.excellent { color: var(--status-excellent); }
.legend-item.good { color: var(--status-good); }
.legend-item.poor { color: var(--status-poor); }

/* MAPE value styling in history table */
.mape-value {
    font-weight: 600;
}

.mape-value.excellent { color: var(--status-excellent); }
.mape-value.good { color: var(--status-good); }
.mape-value.poor { color: var(--status-poor); }

/* ============================================
   AVAILABLE DATES
   ============================================ */
.available-dates {
    margin-top: var(--space-xl);
}

.date-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.date-chip {
    display: inline-flex;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 100px;
    font-size: 0.8125rem;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    transition: all 0.2s var(--ease-out);
}

.date-chip:hover {
    background: var(--accent-gold);
    border-color: var(--accent-gold);
    color: var(--bg-primary);
}

.date-chip.more {
    background: var(--bg-elevated);
    color: var(--text-muted);
    cursor: default;
}

.date-chip.more:hover {
    background: var(--bg-elevated);
    color: var(--text-muted);
    border-color: var(--border-subtle);
}

/* ============================================
   INFO TOOLTIP
   ============================================ */
.info-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: help;
    color: var(--text-muted);
    font-size: 1rem;
    margin-left: var(--space-xs);
    vertical-align: middle;
}

.info-tooltip:hover {
    color: var(--accent-gold);
}

.tooltip-text {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    font-size: 0.8125rem;
    font-weight: 400;
    line-height: 1.5;
    width: 320px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    text-transform: none;
    letter-spacing: normal;
}

.tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--border-medium);
}

.info-tooltip:hover .tooltip-text {
    display: block;
    animation: fadeIn 0.2s var(--ease-out);
}

/* ============================================
   QUICK ACTIONS
   ============================================ */
.quick-actions {
    margin-top: var(--space-md);
}

/* ============================================
   DATE CHIPS GROUP
   ============================================ */
.date-chips-group {
    margin-bottom: var(--space-md);
}

.chips-label {
    display: block;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.date-chip.recent {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

.date-chip.recent:hover {
    background: var(--accent-gold);
    color: var(--bg-primary);
}

/* ============================================
   ERROR PAGE
   ============================================ */
.error-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.error-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    text-align: center;
    max-width: 500px;
}

.error-code {
    font-family: var(--font-mono);
    font-size: 4rem;
    font-weight: 700;
    color: var(--status-poor);
    line-height: 1;
    margin-bottom: var(--space-sm);
    opacity: 0.6;
}

.error-card h2 {
    color: var(--status-poor);
    margin-bottom: var(--space-md);
    font-size: 1.5rem;
}

.error-message {
    color: var(--text-muted);
    margin-bottom: var(--space-xl);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .header-content {
        padding: 0 var(--space-lg);
    }

    .main-content {
        padding: var(--space-lg);
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
        height: auto;
        padding: var(--space-md);
        gap: var(--space-md);
    }

    .nav {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .logo {
        flex: 1;
    }

    .summary-cards {
        justify-content: center;
    }

    .routes-grid {
        grid-template-columns: 1fr;
    }

    .upload-form {
        flex-direction: column;
        align-items: stretch;
    }

    .date-info h2 {
        font-size: 1.5rem;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    body {
        background: white;
        color: black;
    }

    body::before {
        display: none;
    }

    .header, .footer, .action-buttons, .upload-section {
        display: none;
    }

    .main-content {
        padding: 0;
        max-width: none;
    }

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

    .customer-list {
        max-height: none;
        overflow: visible;
    }

    .route-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .summary-card {
        background: #f5f5f5;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ============================================
   CUSTOM SCROLLBAR (GLOBAL)
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Customer ID styling in tables */
.customer-id {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-left: var(--space-sm);
}

/* ============================================
   SEARCH BOX
   ============================================ */
.search-box {
    position: relative;
}

.search-box input {
    width: 220px;
    padding: var(--space-sm) var(--space-md);
    padding-left: 36px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-medium);
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-size: 0.8125rem;
    transition: all 0.2s var(--ease-out);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b6b7a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 12px center;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px var(--accent-gold-dim);
    width: 280px;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: var(--space-xs);
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
}

.search-result-item {
    display: block;
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-subtle);
    transition: background 0.15s var(--ease-out);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--bg-elevated);
}

.search-result-name {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.search-result-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.search-no-results {
    padding: var(--space-lg);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ============================================
   SUMMARY ROW (cards + heatmap)
   ============================================ */
.summary-row {
    display: flex;
    gap: var(--space-lg);
    align-items: stretch;
}

.summary-row .summary-cards {
    flex: 1;
}

/* ============================================
   COMPACT HEATMAP CARD
   ============================================ */
.heatmap-card {
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    animation: slideUp 0.5s var(--ease-out);
}

.heatmap-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
}

.heatmap-card-title {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.heatmap-legend-mini {
    display: flex;
    align-items: center;
    gap: 3px;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: color-mix(
        in srgb,
        var(--accent-gold) calc(var(--intensity, 0) * 100%),
        var(--bg-elevated)
    );
}

.heatmap-calendar-compact {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.heatmap-week-compact {
    display: flex;
    align-items: center;
    gap: 3px;
}

.week-label {
    font-size: 0.5625rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    width: 24px;
    text-align: right;
    padding-right: 4px;
}

.heatmap-cell-compact {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    display: block;
    text-decoration: none;
    transition: all 0.15s var(--ease-out);
    background: color-mix(
        in srgb,
        var(--accent-gold) calc(var(--intensity, 0) * 100%),
        var(--bg-elevated)
    );
    border: 1px solid transparent;
}

.heatmap-cell-compact:hover {
    transform: scale(1.15);
    border-color: var(--accent-gold);
    z-index: 1;
}

.heatmap-cell-compact.current {
    border: 2px solid var(--accent-gold);
    box-shadow: 0 0 0 2px var(--accent-gold-dim);
}

/* Responsive: stack on mobile */
@media (max-width: 900px) {
    .summary-row {
        flex-direction: column;
    }

    .heatmap-card {
        min-width: auto;
    }

    .heatmap-week-compact {
        justify-content: center;
    }
}

/* ============================================
   ANOMALY INDICATORS
   ============================================ */
.anomaly-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: var(--status-poor);
    color: var(--bg-primary);
    border-radius: 50%;
    font-size: 0.625rem;
    font-weight: 700;
    margin-left: var(--space-xs);
    flex-shrink: 0;
}

.anomaly-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--status-poor-bg);
    color: var(--status-poor);
    border-radius: 100px;
    font-size: 0.625rem;
    font-weight: 600;
    font-family: var(--font-mono);
    margin-left: var(--space-sm);
}

.customer-row.anomaly {
    background: var(--status-poor-bg);
    border-left: 3px solid var(--status-poor);
    margin-left: -3px;
    padding-left: calc(var(--space-lg) + 3px);
}

.customer-row.anomaly:hover {
    background: rgba(255, 107, 107, 0.15);
}

/* ============================================
   WEEK-OVER-WEEK INDICATORS
   ============================================ */
.customer-wow {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    width: 20px;
    text-align: center;
    color: var(--text-muted);
}

.customer-wow.up {
    color: var(--status-excellent);
}

.customer-wow.down {
    color: var(--status-poor);
}

#wow-card.up::before {
    background: var(--status-excellent);
    opacity: 1;
}

#wow-card.up .summary-value {
    color: var(--status-excellent);
}

#wow-card.down::before {
    background: var(--status-poor);
    opacity: 1;
}

#wow-card.down .summary-value {
    color: var(--status-poor);
}

/* ============================================
   EXPORT BUTTON
   ============================================ */
.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
    text-decoration: none;
}

.btn-secondary:hover {
    background: var(--bg-card);
    border-color: var(--text-muted);
    color: var(--text-primary);
}

.action-buttons {
    display: flex;
    gap: var(--space-md);
    align-items: center;
    flex-wrap: wrap;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS FOR NEW FEATURES
   ============================================ */
@media (max-width: 768px) {
    .search-box input {
        width: 160px;
    }

    .search-box input:focus {
        width: 200px;
    }
}
