/* ============================================
   PostEx Portal — Professional Light Design System
   Clean ops dashboard | Outfit + JetBrains Mono
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
    /* Core Palette — Light */
    --color-bg:              #f0f4f8;
    --color-surface:         #ffffff;
    --color-surface-2:       #f7f9fc;
    --color-surface-hover:   #eef2f7;
    --color-border:          #e2e8f0;
    --color-border-bright:   #c8d3e0;

    /* Text */
    --color-text:            #0f1c2e;
    --color-text-secondary:  #4a5d72;
    --color-text-muted:      #8fa0b2;

    /* Accent – Teal */
    --color-accent:          #0ea5a0;
    --color-accent-dim:      rgba(14,165,160,0.10);
    --color-accent-glow:     rgba(14,165,160,0.20);

    /* Semantic colors */
    --color-blue:            #2563eb;
    --color-blue-light:      #dbeafe;
    --color-blue-dark:       #1e40af;
    --color-green:           #16a34a;
    --color-green-light:     #dcfce7;
    --color-green-dark:      #14532d;
    --color-red:             #dc2626;
    --color-red-light:       #fee2e2;
    --color-red-dark:        #991b1b;
    --color-amber:           #d97706;
    --color-amber-light:     #fef3c7;
    --color-amber-dark:      #92400e;
    --color-purple:          #7c3aed;
    --color-purple-light:    #ede9fe;

    /* Sidebar — light */
    --sidebar-bg:            #ffffff;
    --sidebar-hover:         #f0f4f8;
    --sidebar-active:        var(--color-accent);
    --sidebar-width:         220px;
    --sidebar-collapsed:     60px;

    /* Geometry */
    --radius-sm:   6px;
    --radius-md:   10px;
    --radius-lg:   14px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm:  0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md:  0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg:  0 10px 30px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.06);
    --shadow-accent: 0 4px 16px rgba(14,165,160,0.20);

    /* Typography */
    --font:      'Outfit', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Timing */
    --transition: 0.18s ease;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--color-bg);
    background-image:
        radial-gradient(ellipse 120% 60% at 70% 0%, rgba(14,165,160,0.04) 0%, transparent 50%),
        radial-gradient(ellipse 80% 40% at 10% 90%, rgba(37,99,235,0.03) 0%, transparent 50%);
    color: var(--color-text);
    display: flex;
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

/* ============================================
   Sidebar
   ============================================ */

.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--color-border);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: width var(--transition);
    overflow: hidden;
}

/* Accent top stripe */
.sidebar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-accent), #06b6d4);
}

/* Right border shadow */
.sidebar {
    box-shadow: 2px 0 8px rgba(0,0,0,0.06);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 16px 18px;
    border-bottom: 1px solid var(--color-border);
}

.brand-icon {
    width: 32px;
    height: 32px;
    background: var(--color-accent);
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 900;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: var(--shadow-accent);
    letter-spacing: -1px;
}

.brand-text {
    color: var(--color-text);
    font-weight: 700;
    font-size: 15px;
    white-space: nowrap;
    letter-spacing: -0.2px;
}

.sidebar-nav {
    flex: 1;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow-y: auto;
    scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    color: var(--color-text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.15s ease;
    font-size: 13.5px;
    font-weight: 500;
    white-space: nowrap;
    position: relative;
    margin: 1px 4px;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: var(--color-text);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(14,165,160,0.12), rgba(6,182,212,0.08));
    color: var(--color-accent);
    font-weight: 600;
    border: 1px solid rgba(14,165,160,0.18);
}

/* Left accent bar for active item */
.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 20%; bottom: 20%;
    width: 2px;
    background: var(--color-accent);
    border-radius: 0 2px 2px 0;
}

.nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity var(--transition);
}
.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
    opacity: 1;
}

.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid var(--color-border);
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    color: var(--color-text-muted);
    font-family: var(--font-mono);
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--color-amber);
    flex-shrink: 0;
    transition: background var(--transition);
}
.status-dot.connected {
    background: var(--color-accent);
    box-shadow: 0 0 6px var(--color-accent);
}
.status-dot.error { background: var(--color-red); }

/* ============================================
   Main Content
   ============================================ */

#app {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 28px 32px;
    min-height: 100vh;
    transition: margin-left var(--transition);
    overflow-x: hidden;
    animation: pageEnter 0.3s ease;
}

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

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--color-border);
}

.page-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--color-text);
    letter-spacing: -0.6px;
}

.page-subtitle {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-top: 3px;
}

/* ============================================
   Cards
   ============================================ */

.card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    padding: 22px;
    transition: box-shadow 0.22s ease, border-color 0.22s ease;
    box-shadow: var(--shadow-sm);
}

.card:hover {
    border-color: var(--color-border-bright);
    box-shadow: var(--shadow-md);
}

.card-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--color-text-secondary);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 14px;
    background: var(--color-accent);
    border-radius: 2px;
    flex-shrink: 0;
}

/* Chart Legend */
.chart-legend {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0;
    margin-top: 12px;
    border-top: 1px solid var(--color-border);
    padding-top: 12px;
}
.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 5px;
    transition: background 0.15s;
    cursor: default;
}
.chart-legend-item:hover { background: var(--color-surface-hover); }
.chart-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.chart-legend-label {
    font-size: 11.5px;
    color: var(--color-text-secondary);
    white-space: nowrap;
}
.chart-legend-value {
    font-size: 11.5px;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--color-text);
    margin-left: auto;
}
.chart-legend-pct {
    font-size: 10.5px;
    color: var(--color-text-muted);
    font-family: var(--font-mono);
    min-width: 36px;
    text-align: right;
}

/* Stat Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.stat-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    padding: 20px 22px 18px;
    position: relative;
    overflow: hidden;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
    cursor: default;
    animation: cardIn 0.35s ease both;
}

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

/* Colored top bar */
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--accent, var(--color-accent));
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* Light wash background tint */
.stat-card::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 100px; height: 100px;
    background: radial-gradient(circle at 85% 10%, var(--accent-bg, rgba(14,165,160,0.08)) 0%, transparent 70%);
    pointer-events: none;
    border-radius: 0 var(--radius-lg) 0 0;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.10);
    border-color: var(--color-border-bright);
}

.stat-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--color-text-muted);
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--color-text);
    line-height: 1.1;
    letter-spacing: -1.5px;
    position: relative;
    z-index: 1;
}

.stat-sub {
    font-size: 11.5px;
    color: var(--color-text-muted);
    margin-top: 6px;
    position: relative;
    z-index: 1;
}

/* ============================================
   Grid Layouts
   ============================================ */

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 22px;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px;
    margin-bottom: 22px;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 15px;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition);
    white-space: nowrap;
    text-decoration: none;
    letter-spacing: 0.1px;
}

/* Compact action button — used in dense tables (pending-lists, etc.) */
.btn-mini {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    color: #374151;
    transition: all var(--transition);
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.2;
}
.btn-mini:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}
.btn-mini:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}
.btn-primary:hover {
    background: #0c9490;
    box-shadow: var(--shadow-accent);
}

.btn-success {
    background: var(--color-green);
    color: #fff;
}
.btn-success:hover {
    background: #15803d;
    box-shadow: 0 4px 12px rgba(22,163,74,0.3);
}

.btn-danger {
    background: var(--color-red);
    color: #fff;
}
.btn-danger:hover {
    background: #b91c1c;
    box-shadow: 0 4px 12px rgba(220,38,38,0.3);
}

.btn-outline {
    background: transparent;
    color: var(--color-text-secondary);
    border-color: var(--color-border-bright);
}
.btn-outline:hover {
    background: var(--color-surface-hover);
    border-color: rgba(255,255,255,0.2);
    color: var(--color-text);
}
.btn-outline.active {
    background: var(--color-accent-dim);
    color: var(--color-accent);
    border-color: var(--color-accent);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-lg {
    padding: 10px 22px;
    font-size: 14px;
}

.btn-icon {
    padding: 6px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--color-text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}
.btn-icon:hover {
    background: var(--color-surface-hover);
    color: var(--color-text);
}

/* ============================================
   Forms
   ============================================ */

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

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.2px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--color-border-bright);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 13.5px;
    color: var(--color-text);
    background: var(--color-surface-2);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input::placeholder,
.form-textarea::placeholder { color: var(--color-text-muted); }

.form-select {
    color-scheme: light;
    cursor: pointer;
}

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

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

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

/* ============================================
   Tables
   ============================================ */

.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
    scrollbar-width: thin;
    scrollbar-color: var(--color-border-bright) transparent;
}
.table-wrapper::-webkit-scrollbar { height: 5px; }
.table-wrapper::-webkit-scrollbar-track { background: transparent; }
.table-wrapper::-webkit-scrollbar-thumb { background: var(--color-border-bright); border-radius: 10px; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}

.data-table th {
    background: #f8fafc;
    padding: 11px 14px;
    text-align: left;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--color-text-secondary);
    border-bottom: 2px solid var(--color-border);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    transition: color var(--transition);
}
.data-table th:hover { color: var(--color-accent); }
.data-table th.sorted-asc::after { content: ' ↑'; color: var(--color-accent); }
.data-table th.sorted-desc::after { content: ' ↓'; color: var(--color-accent); }

.data-table td {
    padding: 9px 14px;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
    transition: background var(--transition);
}

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

.data-table tbody tr:hover td {
    background: var(--color-surface-hover);
}

/* Zebra striping */
.data-table tbody tr:nth-child(even) td {
    background: rgba(255,255,255,0.015);
}
.data-table tbody tr:nth-child(even):hover td {
    background: var(--color-surface-hover);
}

.data-table .col-num {
    text-align: right;
    font-family: var(--font-mono);
    font-size: 12px;
}
.data-table .col-center { text-align: center; }
.data-table .col-track {
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-weight: 600;
    color: var(--color-accent);
    cursor: pointer;
}
.data-table .col-track:hover { text-decoration: underline; text-underline-offset: 2px; }

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    gap: 12px;
    flex-wrap: wrap;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}

.table-search {
    padding: 7px 12px;
    border: 1px solid var(--color-border-bright);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: var(--font);
    width: 240px;
    max-width: 100%;
    background: var(--color-surface-2);
    color: var(--color-text);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.table-search::placeholder { color: var(--color-text-muted); }
.table-search:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-dim);
}

.table-pagination {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    font-size: 12px;
    font-family: var(--font-mono);
    color: var(--color-text-muted);
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
}

.table-pagination button {
    padding: 4px 10px;
    border: 1px solid var(--color-border-bright);
    border-radius: var(--radius-sm);
    background: var(--color-surface-2);
    color: var(--color-text-secondary);
    cursor: pointer;
    font-family: var(--font);
    font-size: 11.5px;
    transition: all var(--transition);
}
.table-pagination button:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}
.table-pagination button:disabled { opacity: 0.3; cursor: not-allowed; }
.table-pagination .page-info { margin: 0 auto; }

/* ============================================
   Badges
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: var(--radius-full);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.4px;
    white-space: nowrap;
    font-family: var(--font);
}

.badge-delivered {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}
.badge-returned {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
.badge-transit {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}
.badge-return-intransit {
    background: #fef9c3;
    color: #854d0e;
    border: 1px solid #fef08a;
}
.badge-unbooked {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}
.badge-cancelled {
    background: #f3e8ff;
    color: #6b21a8;
    border: 1px solid #e9d5ff;
}
.badge-blue {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}
.badge-purple {
    background: #ede9fe;
    color: #5b21b6;
    border: 1px solid #ddd6fe;
}
.badge-default {
    background: rgba(255,255,255,0.05);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border-bright);
}

/* ============================================
   Filter Bar
   ============================================ */

.filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.filter-bar .form-input,
.filter-bar .form-select {
    width: auto;
    min-width: 140px;
}

/* ============================================
   Modal
   ============================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    animation: fadeIn 0.15s ease;
}

.modal-content {
    background: var(--color-surface);
    border: 1px solid var(--color-border-bright);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg), 0 0 80px rgba(0,0,0,0.5);
    width: 90%;
    max-width: 580px;
    max-height: 85vh;
    overflow-y: auto;
    animation: slideUp 0.22s ease;
    scrollbar-width: thin;
    scrollbar-color: var(--color-border-bright) transparent;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface-2);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.2px;
}

.modal-close {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border-bright);
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}
.modal-close:hover {
    background: var(--color-surface-hover);
    color: var(--color-text);
    border-color: var(--color-border-bright);
}

.modal-body { padding: 22px 24px; }
.modal-footer {
    padding: 14px 24px;
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    background: var(--color-surface-2);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ============================================
   Toast
   ============================================ */

#toast-root {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 11px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.25s ease;
    max-width: 360px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid transparent;
    backdrop-filter: blur(8px);
}

.toast-message { flex: 1; }

.toast-dismiss {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity var(--transition);
}
.toast-dismiss:hover { opacity: 1; }

.toast-success {
    background: rgba(21,128,61,0.9);
    color: #bbf7d0;
    border-color: rgba(34,197,94,0.3);
}
.toast-error {
    background: rgba(185,28,28,0.9);
    color: #fca5a5;
    border-color: rgba(248,81,73,0.3);
}
.toast-info {
    background: rgba(29,109,179,0.9);
    color: #bae6fd;
    border-color: rgba(61,155,242,0.3);
}

/* ============================================
   Job Progress Float
   ============================================ */

#job-progress-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 400;
    background: var(--color-surface);
    border: 1px solid var(--color-border-bright);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 14px 18px;
    min-width: 280px;
    max-width: 340px;
    animation: slideInRight 0.25s ease;
}

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

.jp-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
}

.jp-close {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color var(--transition);
}
.jp-close:hover { color: var(--color-text); }

.jp-bar {
    height: 4px;
    background: var(--color-surface-2);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}

.jp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-accent), #00f0c2);
    border-radius: 2px;
    transition: width 0.4s ease;
    box-shadow: 0 0 8px var(--color-accent);
}

.jp-status {
    font-size: 11.5px;
    color: var(--color-text-muted);
    font-family: var(--font-mono);
}

.jp-done .jp-title::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--color-accent);
    box-shadow: 0 0 6px var(--color-accent);
    margin-right: 6px;
}

/* ============================================
   Timeline
   ============================================ */

.timeline {
    position: relative;
    padding-left: 26px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px; top: 4px; bottom: 4px;
    width: 1px;
    background: var(--color-border-bright);
}

.timeline-item {
    position: relative;
    padding-bottom: 18px;
}
.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
    position: absolute;
    left: -26px; top: 3px;
    width: 17px; height: 17px;
    border-radius: 50%;
    border: 2px solid var(--color-border-bright);
    background: var(--color-surface-2);
}

.timeline-item:first-child .timeline-dot {
    border-color: var(--color-accent);
    background: var(--color-accent);
    box-shadow: 0 0 10px var(--color-accent);
}

.timeline-dot.dot-delivered {
    border-color: var(--color-green);
    background: var(--color-green);
    box-shadow: 0 0 8px rgba(34,197,94,0.5);
}
.timeline-dot.dot-returned {
    border-color: var(--color-red);
    background: var(--color-red);
    box-shadow: 0 0 8px rgba(248,81,73,0.4);
}
.timeline-dot.dot-transit {
    border-color: var(--color-amber);
    background: var(--color-amber);
    box-shadow: 0 0 8px rgba(251,191,36,0.4);
}

.timeline-label {
    font-weight: 600;
    font-size: 13.5px;
    color: var(--color-text);
}

.timeline-date {
    font-size: 11.5px;
    color: var(--color-text-muted);
    margin-top: 2px;
    font-family: var(--font-mono);
}

/* ============================================
   Loader
   ============================================ */

.loader-fullpage {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 2px solid var(--color-border-bright);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 0.65s linear infinite;
    box-shadow: 0 0 12px var(--color-accent-glow);
}

.skeleton {
    background: linear-gradient(90deg,
        var(--color-surface-2) 25%,
        var(--color-surface-hover) 50%,
        var(--color-surface-2) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.6s infinite;
    border-radius: var(--radius-sm);
}

.skeleton-text { height: 13px; margin-bottom: 8px; }
.skeleton-title { height: 20px; width: 40%; margin-bottom: 12px; }
.skeleton-card { height: 90px; }

/* ============================================
   Slide Panel
   ============================================ */

.slide-panel {
    position: fixed;
    top: 0; right: 0;
    width: 480px;
    max-width: 92vw;
    height: 100vh;
    background: var(--color-surface);
    border-left: 1px solid var(--color-border-bright);
    box-shadow: -8px 0 40px rgba(0,0,0,0.5);
    z-index: 150;
    overflow-y: auto;
    animation: slideInRight 0.25s ease;
    scrollbar-width: thin;
    scrollbar-color: var(--color-border-bright) transparent;
}

.slide-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    background: var(--color-surface);
    z-index: 1;
    backdrop-filter: blur(8px);
}

.slide-panel-body { padding: 22px 24px; }

.slide-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(2px);
    z-index: 149;
}

/* ============================================
   Quick Actions
   ============================================ */

.quick-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.quick-action-card {
    flex: 1;
    min-width: 150px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 16px;
    cursor: pointer;
    text-align: center;
    transition: all var(--transition);
}

.quick-action-card:hover {
    border-color: var(--color-accent);
    box-shadow: 0 0 20px var(--color-accent-dim);
    transform: translateY(-2px);
}

.quick-action-icon {
    width: 36px;
    height: 36px;
    margin: 0 auto 8px;
    color: var(--color-accent);
}

.quick-action-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--color-text-secondary);
}

/* ============================================
   Empty State
   ============================================ */

.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--color-text-muted);
}

.empty-state svg {
    width: 56px;
    height: 56px;
    margin-bottom: 14px;
    opacity: 0.25;
}

.empty-state p {
    font-size: 14.5px;
    margin-bottom: 16px;
    color: var(--color-text-secondary);
}

/* ============================================
   Financial Breakdown
   ============================================ */

.breakdown-list { list-style: none; }

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 13.5px;
}
.breakdown-item:last-child { border-bottom: none; }

.breakdown-item.total {
    font-weight: 700;
    font-size: 15px;
    border-top: 1px solid var(--color-border-bright);
    margin-top: 4px;
    padding-top: 14px;
    color: var(--color-accent);
}

.breakdown-item .deduction { color: var(--color-red); font-family: var(--font-mono); }
.breakdown-item .addition  { color: var(--color-green); font-family: var(--font-mono); }

/* ============================================
   Tabs
   ============================================ */

.tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 20px;
}

.tab-btn {
    padding: 9px 18px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all var(--transition);
    letter-spacing: 0.1px;
}
.tab-btn:hover { color: var(--color-text-secondary); }
.tab-btn.active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

/* ============================================
   Animations
   ============================================ */

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

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

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

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

@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

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

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); }
    .grid-3 { grid-template-columns: 1fr 1fr; }
    #app { padding: 22px 20px; }
}

@media (max-width: 768px) {
    .sidebar { width: var(--sidebar-collapsed); }
    .sidebar .nav-label,
    .sidebar .brand-text { display: none; }
    .sidebar-brand { justify-content: center; padding: 16px 8px; }
    .nav-item { justify-content: center; padding: 10px; }
    .nav-item.active::before { display: none; }
    .connection-status .nav-label { display: none; }

    #app {
        margin-left: var(--sidebar-collapsed);
        padding: 18px 14px;
    }

    .stats-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .filter-bar { flex-direction: column; align-items: stretch; }
    .filter-bar .form-input,
    .filter-bar .form-select { width: 100%; min-width: unset; }
    .stat-value { font-size: 20px; }
    .page-title { font-size: 18px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stat-card { padding: 13px; }
    .stat-value { font-size: 18px; }
}

/* ============================================
   Utilities
   ============================================ */

.text-muted      { color: var(--color-text-muted); }
.text-secondary  { color: var(--color-text-secondary); }
.text-green      { color: var(--color-green); }
.text-red        { color: var(--color-red); }
.text-blue       { color: var(--color-blue); }
.text-right      { text-align: right; }
.text-center     { text-align: center; }
.font-mono       { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.mt-4  { margin-top: 16px; }
.mt-6  { margin-top: 24px; }
.mb-4  { margin-bottom: 16px; }
.mb-6  { margin-bottom: 24px; }
.gap-3 { gap: 12px; }
.flex  { display: flex; }
.flex-wrap   { flex-wrap: wrap; }
.items-center    { align-items: center; }
.justify-between { justify-content: space-between; }
.hidden          { display: none !important; }

/* ============================================
   Critical & Courier Badges
   ============================================ */

.badge-critical {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    font-weight: 700;
}

.badge-critical-severe {
    background: #dc2626;
    color: #fff;
    border: 1px solid #b91c1c;
    font-weight: 700;
    animation: pulse 2s ease infinite;
}

.badge-critical-overweight {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
    font-weight: 700;
}
.badge-critical-review {
    background: #ede9fe;
    color: #5b21b6;
    border: 1px solid #ddd6fe;
    font-weight: 700;
}

/* Nav badge (critical count) */
.nav-badge {
    background: var(--color-red);
    color: #fff;
    font-size: 9.5px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: var(--radius-full);
    margin-left: auto;
    min-width: 17px;
    text-align: center;
    line-height: 15px;
    font-family: var(--font-mono);
}
.nav-badge:empty { display: none; }

/* Critical alert bar */
.critical-alert {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #991b1b;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-weight: 600;
    font-size: 13.5px;
    box-shadow: 0 2px 8px rgba(220,38,38,0.10);
}
.critical-alert a {
    color: #991b1b;
    text-decoration: underline;
    font-weight: 700;
}

/* Courier pills */
.courier-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.courier-pill {
    padding: 4px 13px;
    border-radius: var(--radius-full);
    border: 1px solid var(--color-border-bright);
    background: var(--color-surface-2);
    font-family: var(--font);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    color: var(--color-text-secondary);
    transition: all var(--transition);
}
.courier-pill:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}
.courier-pill.active {
    background: var(--color-accent-dim);
    border-color: var(--color-accent);
    color: var(--color-accent);
}

/* Status pills */
.status-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.status-pill {
    padding: 4px 13px;
    border-radius: var(--radius-full);
    border: 1px solid var(--color-border-bright);
    background: var(--color-surface-2);
    font-family: var(--font);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    color: var(--color-text-secondary);
    transition: all var(--transition);
}
.status-pill:hover { border-color: rgba(255,255,255,0.25); color: var(--color-text); }

.status-pill.active {
    background: var(--color-accent-dim);
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.status-pill[data-status="delivered"].active {
    background: rgba(34,197,94,0.12);
    border-color: rgba(34,197,94,0.4);
    color: #4ade80;
}
.status-pill[data-status="transit"].active {
    background: rgba(251,191,36,0.12);
    border-color: rgba(251,191,36,0.4);
    color: #fcd34d;
}
.status-pill[data-status="returned"].active {
    background: rgba(248,81,73,0.12);
    border-color: rgba(248,81,73,0.4);
    color: #fb7185;
}
.status-pill[data-status="cancelled"].active {
    background: rgba(167,139,250,0.12);
    border-color: rgba(167,139,250,0.3);
    color: #c4b5fd;
}

/* Month scroller */
.month-scroller {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    flex: 1;
    min-width: 0;
}
.month-scroller::-webkit-scrollbar { display: none; }

.month-pill {
    padding: 4px 13px;
    border-radius: var(--radius-full);
    border: 1px solid var(--color-border-bright);
    background: var(--color-surface-2);
    font-family: var(--font);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    color: var(--color-text-secondary);
    transition: all var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
}
.month-pill:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}
.month-pill.active {
    background: var(--color-accent-dim);
    border-color: var(--color-accent);
    color: var(--color-accent);
}

#finMonthSelect,
#dashMonthSelect,
#reportMonthSelect,
#parcelsMonthSelect {
    padding: 8px 34px 8px 14px;
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text);
    border: 1px solid var(--color-accent);
    border-radius: var(--radius-full);
    background: var(--color-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%230ea5a0' d='M2 4l4 4 4-4'/%3E%3C/svg%3E") no-repeat right 14px center;
    appearance: none;
    -webkit-appearance: none;
    color-scheme: light;
    cursor: pointer;
    min-width: 190px;
    transition: all var(--transition);
    font-family: var(--font);
}
#finMonthSelect:hover,
#dashMonthSelect:hover,
#reportMonthSelect:hover,
#parcelsMonthSelect:hover {
    box-shadow: 0 0 14px var(--color-accent-glow);
    background-color: var(--color-surface-hover);
}
#finMonthSelect:focus,
#dashMonthSelect:focus,
#reportMonthSelect:focus,
#parcelsMonthSelect:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--color-accent-dim);
}

.date-input-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--color-border-bright);
    border-radius: var(--radius-sm);
    background: var(--color-surface-2);
    cursor: pointer;
    transition: all var(--transition);
}
.date-input-wrap:hover {
    border-color: var(--color-accent);
}
.date-input-wrap .date-display {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    font-family: var(--font-mono);
}
.date-input-hidden {
    position: absolute;
    opacity: 0;
    width: 0; height: 0;
    pointer-events: none;
}

/* Days elapsed */
.days-elapsed {
    font-weight: 800;
    font-family: var(--font-mono);
}
.days-elapsed.critical { color: var(--color-red); }
.days-elapsed.severe {
    color: #fca5a5;
    background: rgba(248,81,73,0.15);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(248,81,73,0.25);
}

/* Phone link */
.phone-link {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 500;
    font-family: var(--font-mono);
}
.phone-link:hover { text-decoration: underline; text-underline-offset: 2px; }

/* Courier status cards */
.courier-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--color-surface);
    transition: border-color var(--transition);
}
.courier-card.connected {
    border-color: rgba(34,197,94,0.3);
    background: rgba(34,197,94,0.05);
}

.courier-card-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    color: #ffffff;
    flex-shrink: 0;
}

/* Stats strip (critical page) */
.stats-strip {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.stats-strip-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--color-text-secondary);
}
.stats-strip-value {
    font-size: 18px;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--color-text);
}

/* Sync indicator */
.sync-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-family: var(--font-mono);
    color: var(--color-text-muted);
    padding: 5px 12px;
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    transition: border-color var(--transition);
}
.sync-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--color-green);
    flex-shrink: 0;
    box-shadow: 0 0 6px rgba(34,197,94,0.5);
}
.sync-dot.syncing {
    background: var(--color-amber);
    box-shadow: 0 0 6px rgba(251,191,36,0.4);
    animation: syncPulse 1.5s infinite;
}
.sync-dot.stale {
    background: var(--color-red);
    box-shadow: 0 0 6px rgba(248,81,73,0.4);
    animation: syncPulse 2s infinite;
}
@keyframes syncPulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.25; }
}

.sync-status-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 12.5px;
}
.sync-status-row:last-child { border-bottom: none; }

/* ============================================
   Calendar Page
   ============================================ */

.cal-grid {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: none;
    box-shadow: none;
    background: transparent;
    padding: 0;
}

.cal-header-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-bottom: 5px;
}

.cal-header-cell {
    padding: 9px 8px;
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--color-text-muted);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
}

.cal-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.cal-cell {
    min-height: 140px;
    padding: 10px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.cal-cell:hover {
    border-color: var(--color-accent);
    box-shadow: 0 0 16px var(--color-accent-dim);
    transform: translateY(-1px);
}

.cal-cell.cal-today {
    border-color: rgba(0,212,170,0.4);
    box-shadow: 0 0 0 1px rgba(0,212,170,0.2);
}
.cal-cell.cal-today:hover {
    box-shadow: 0 0 0 1px var(--color-accent), 0 4px 16px var(--color-accent-dim);
}

.cal-cell.cal-outside {
    opacity: 0.35;
    cursor: default;
}
.cal-cell.cal-outside:hover {
    transform: none;
    border-color: var(--color-border);
    box-shadow: none;
}

.cal-date {
    font-size: 12px;
    font-weight: 700;
    color: var(--color-text-secondary);
    margin-bottom: 6px;
    font-family: var(--font-mono);
}
.cal-cell.cal-today .cal-date {
    color: var(--color-accent);
}

.cal-chip {
    font-size: 10.5px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 2px;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cal-chip-delivered { background: rgba(34,197,94,0.15); color: #4ade80; }
.cal-chip-transit   { background: rgba(251,191,36,0.15); color: #fcd34d; }
.cal-chip-returned  { background: rgba(248,81,73,0.15);  color: #fb7185; }
.cal-chip-total     { background: rgba(0,212,170,0.12);  color: var(--color-accent); }

/* Cal modal / detail popup */
.cal-detail-list { list-style: none; }
.cal-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 13px;
}
.cal-detail-item:last-child { border-bottom: none; }

/* ============================================
   Predictions / Reports extended
   ============================================ */

.prediction-bar {
    height: 6px;
    border-radius: 3px;
    background: var(--color-surface-2);
    overflow: hidden;
    margin-top: 4px;
}
.prediction-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--color-accent), #00f0c2);
    transition: width 0.5s ease;
}

.report-highlight {
    padding: 12px 16px;
    background: var(--color-accent-dim);
    border: 1px solid rgba(0,212,170,0.2);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    color: var(--color-accent);
    margin-bottom: 12px;
}

/* Products page */
.product-row-img {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
}

/* Action log */
.action-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 9px;
    border-radius: var(--radius-full);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.3px;
}
.action-type-reattempt { background: rgba(61,155,242,0.15); color: #60aeff; border: 1px solid rgba(61,155,242,0.25); }
.action-type-return    { background: rgba(248,81,73,0.15);  color: #fb7185; border: 1px solid rgba(248,81,73,0.25); }
.action-type-note      { background: rgba(255,255,255,0.06); color: var(--color-text-secondary); border: 1px solid var(--color-border-bright); }

/* Section divider */
.section-divider {
    height: 1px;
    background: var(--color-border);
    margin: 20px 0;
}

/* Info grid inside modals / order details */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    padding: 16px;
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-bottom: 18px;
}
.info-grid-item { }
.info-grid-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--color-text-muted);
    margin-bottom: 3px;
}
.info-grid-value {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--color-text);
}

/* ============================================
   Calendar — Day Cell Components
   (matches calendar.js class names exactly)
   ============================================ */

.cal-month-label {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-text);
    min-width: 160px;
    text-align: center;
    letter-spacing: -0.2px;
}

/* Day number header inside cell */
.cal-day-number {
    font-size: 11px;
    font-weight: 700;
    color: var(--color-text-secondary);
    font-family: var(--font-mono);
    margin-bottom: 7px;
    letter-spacing: 0.2px;
}
.cal-cell.cal-today .cal-day-number {
    color: var(--color-accent);
}

/* Stats block inside a day cell */
.cal-day-stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Big total number */
.cal-stat-total {
    font-size: 22px;
    font-weight: 900;
    font-family: var(--font-mono);
    color: var(--color-text);
    line-height: 1;
    letter-spacing: -1px;
}

/* Progress bar: green=delivered, red=returned, rest=transit */
.cal-progress-bar {
    height: 5px;
    background: var(--color-surface-2);
    border-radius: 3px;
    overflow: hidden;
    display: flex;
    margin: 2px 0;
}
.cal-progress-del {
    height: 100%;
    background: var(--color-green);
    border-radius: 3px 0 0 3px;
    transition: width 0.4s ease;
    min-width: 0;
}
.cal-progress-ret {
    height: 100%;
    background: var(--color-red);
    transition: width 0.4s ease;
    min-width: 0;
}

/* del / ret counts row */
.cal-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.cal-del-text {
    font-size: 10.5px;
    font-weight: 700;
    color: #15803d;
    font-family: var(--font-mono);
}
.cal-ret-text {
    font-size: 10.5px;
    font-weight: 700;
    color: #dc2626;
    font-family: var(--font-mono);
}

/* Transit count */
.cal-transit-row {
    font-size: 10px;
    color: #92400e;
    font-weight: 600;
    font-family: var(--font-mono);
}

/* Delivery rate badge */
.cal-rate {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    font-family: var(--font-mono);
    padding: 1px 6px;
    border-radius: 4px;
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}
.cal-rate.cal-rate-good {
    background: #dcfce7;
    color: #15803d;
    border-color: #bbf7d0;
}
.cal-rate.cal-rate-warn {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}
.cal-rate.cal-rate-bad {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}

/* COD amount at bottom */
.cal-cod {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--color-accent);
    font-family: var(--font-mono);
    margin-top: 1px;
}

/* No data text */
.cal-empty {
    font-size: 11px;
    color: var(--color-text-muted);
    font-style: italic;
    margin-top: 4px;
}
