/* ========================================================
   BizSolution Modern Monitoring Design System (v7)
   Clean, Responsive, Light & Dark Mode Synchronized
   ======================================================== */

:root {
    --bg-main: #080b11;
    --header-bg: rgba(8, 11, 17, 0.88);
    --header-border: rgba(255, 255, 255, 0.08);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-sub: #cbd5e1;
    --card-bg: rgba(15, 23, 42, 0.75);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-hover: rgba(56, 189, 248, 0.4);
    --accent: #38bdf8;
    --accent-hover: #0ea5e9;
    --accent-glow: rgba(56, 189, 248, 0.25);
    --accent-gradient: linear-gradient(135deg, #0284c7 0%, #2563eb 50%, #4f46e5 100%);
    --accent-emerald: #10b981;
    --table-header: rgba(30, 41, 59, 0.9);
    --table-border: rgba(255, 255, 255, 0.06);
    --input-bg: rgba(15, 23, 42, 0.9);
    --input-border: rgba(255, 255, 255, 0.12);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
    --empty-bg: rgba(15, 23, 42, 0.4);
}

body.light-mode {
    --bg-main: #f8fafc;
    --header-bg: rgba(255, 255, 255, 0.88);
    --header-border: #e2e8f0;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-sub: #334155;
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --card-hover: #cbd5e1;
    --accent: #0284c7;
    --accent-hover: #0369a1;
    --accent-glow: rgba(2, 132, 199, 0.15);
    --accent-gradient: linear-gradient(135deg, #0284c7 0%, #2563eb 50%, #4f46e5 100%);
    --accent-emerald: #059669;
    --table-header: #f1f5f9;
    --table-border: #e2e8f0;
    --input-bg: #ffffff;
    --input-border: #cbd5e1;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --empty-bg: #f8fafc;
}

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

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    transition: background-color 0.25s ease, color 0.25s ease;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Background mesh */
.bg-mesh {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-size: 32px 32px;
    background-image: linear-gradient(to right, rgba(148, 163, 184, 0.08) 1px, transparent 1px),
                      linear-gradient(to bottom, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
}
body:not(.light-mode) .bg-mesh {
    background-image: linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
                      linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
}

/* ========================================================
   ECOSYSTEM HEADER (Clean Glassmorphism)
   ======================================================== */
.ecosystem-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--header-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--header-border);
    padding: 12px 20px;
    transition: background 0.25s, border-color 0.25s;
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: opacity 0.2s;
}
.brand-link:hover { opacity: 0.9; }

.logo-dark { display: block; height: 32px; width: auto; }
.logo-light { display: none; height: 32px; width: auto; }
body.light-mode .logo-dark { display: none; }
body.light-mode .logo-light { display: block; }

.brand-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.brand-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.brand-name {
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--text-main);
    letter-spacing: -0.02em;
}
.route-badge {
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-glow);
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid rgba(56, 189, 248, 0.25);
}
.live-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted);
}
.pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    animation: pulse-dot-anim 2s infinite ease-in-out;
}
@keyframes pulse-dot-anim {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

/* Nav Links */
.nav-links {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 600;
}
.nav-item {
    color: var(--text-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 10px;
    transition: all 0.2s ease;
}
.nav-item svg, .nav-item i { width: 14px; height: 14px; stroke-width: 2.2; }
.nav-item:hover {
    color: var(--text-main);
    background: rgba(148, 163, 184, 0.1);
}

.nav-catalog {
    color: var(--accent);
    background: var(--accent-glow);
    border: 1px solid rgba(56, 189, 248, 0.3);
}
.nav-catalog:hover {
    background: rgba(56, 189, 248, 0.2);
    color: var(--accent);
}

.theme-toggle-btn {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 7px 11px;
    cursor: pointer;
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.theme-toggle-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: var(--shadow-sm);
}
.theme-toggle-btn svg, .theme-toggle-btn i { width: 16px; height: 16px; }

/* ========================================================
   PAGE CONTAINER & HERO
   ======================================================== */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 20px 48px;
    position: relative;
    z-index: 1;
}

.hero-section {
    text-align: center;
    margin-bottom: 32px;
    margin-top: 8px;
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 9999px;
    background: var(--accent-glow);
    border: 1px solid rgba(56, 189, 248, 0.25);
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.04em;
    margin-bottom: 12px;
}
.hero-badge svg, .hero-badge i { width: 13px; height: 13px; }

.hero-section h1 {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.03em;
    line-height: 1.25;
}
.subtitle {
    color: var(--text-muted);
    margin-top: 8px;
    font-size: 14.5px;
    font-weight: 500;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

/* ========================================================
   TABS
   ======================================================== */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: var(--card-bg);
    padding: 6px;
    border-radius: 14px;
    border: 1px solid var(--card-border);
    width: fit-content;
}
.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.tab-btn svg, .tab-btn i { width: 16px; height: 16px; }
.tab-btn:hover {
    color: var(--text-main);
}
.tab-btn.active {
    background: var(--accent-gradient);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

/* Section Title */
.section-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 14px;
    letter-spacing: -0.01em;
}

/* Picker Toolbar */
.picker-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.search-box {
    position: relative;
    flex: 1;
    max-width: 420px;
}
.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
}
.picker-toolbar input[type="search"] {
    width: 100%;
    padding: 10px 14px 10px 38px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 13.5px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.picker-toolbar input[type="search"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.count-badge {
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-muted);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 5px 10px;
    border-radius: 8px;
}

/* ========================================================
   CARDS GRID (Tyre & Disk)
   ======================================================== */
.tyre-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
    max-height: 400px;
    overflow-y: auto;
    padding: 4px;
}
.tyre-grid::-webkit-scrollbar { width: 6px; }
.tyre-grid::-webkit-scrollbar-thumb {
    background: var(--card-border);
    border-radius: 4px;
}

.tyre-card {
    text-align: left;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 14px 16px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}
.tyre-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.tyre-card.selected {
    border-color: var(--accent);
    background: var(--accent-glow);
    box-shadow: 0 0 0 2px var(--accent);
}
.card-brand {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.05em;
}
.card-model {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 4px;
    line-height: 1.35;
}
.card-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
    font-family: 'JetBrains Mono', monospace;
}
.card-skip {
    font-size: 10px;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 1px 6px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 6px;
    width: fit-content;
}
.card-icons {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 4px;
}
.card-icon {
    font-size: 11px;
    padding: 3px 6px;
    border-radius: 6px;
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}
.card-icon svg { width: 12px; height: 12px; }
.card-icon:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-glow);
}
.card-icon.card-del:hover {
    color: #ef4444;
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* ========================================================
   CONTROLS BAR
   ======================================================== */
.controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    background: var(--card-bg);
    padding: 12px 18px;
    border-radius: 16px;
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background: var(--accent-gradient);
    color: #ffffff;
    padding: 9px 18px;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-primary svg, .btn-primary i { width: 15px; height: 15px; }
.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45);
}
.btn-primary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-secondary {
    background: var(--input-bg);
    color: var(--text-main);
    border: 1px solid var(--input-border);
    padding: 8.5px 16px;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}
.btn-secondary svg, .btn-secondary i { width: 15px; height: 15px; }
.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-glow);
}

.btn-danger {
    background: #ef4444;
    color: white;
    padding: 8.5px 16px;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}
.btn-danger:hover {
    background: #dc2626;
}

.status-bar {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--accent);
    font-weight: 600;
    background: var(--accent-glow);
    padding: 6px 12px;
    border-radius: 10px;
    border: 1px solid rgba(56, 189, 248, 0.2);
    transition: opacity 0.3s ease, border-color 0.3s ease;
}
.status-bar .spinner {
    display: none;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(56, 189, 248, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.status-bar.running .spinner {
    display: inline-block !important;
}
.status-bar.done .spinner,
.status-bar.stopped .spinner,
.status-bar.success .spinner,
.status-bar.error .spinner {
    display: none !important;
}
.status-bar.stopped {
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.35);
    background: rgba(245, 158, 11, 0.12);
}
.status-bar.success {
    color: var(--accent-emerald);
    border-color: rgba(16, 185, 129, 0.35);
    background: rgba(16, 185, 129, 0.12);
}
.status-bar.error {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.12);
}

.scrape-time-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.76rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent);
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.18);
    padding: 2px 7px;
    border-radius: 5px;
    white-space: nowrap;
}
.scrape-time-badge svg, .scrape-time-badge .time-icon {
    width: 11px;
    height: 11px;
    stroke: currentColor;
    flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Auto Update Toggle */
.auto-update {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}
.auto-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.auto-label svg, .auto-label i { width: 13px; height: 13px; }
#auto-interval {
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
}
.toggle {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 20px;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--input-border);
    border-radius: 20px;
    cursor: pointer;
    transition: 0.25s;
}
.toggle-slider::before {
    content: "";
    position: absolute;
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.25s;
}
.toggle input:checked + .toggle-slider { background: #0284c7; }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ========================================================
   ADD PANELS (Modal-style Drawer)
   ======================================================== */
.add-panel {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(12px);
}
.add-panel.hidden { display: none; }
.add-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--card-border);
}
.add-panel-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
}
.btn-close {
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-close:hover {
    color: var(--text-main);
    border-color: var(--accent);
}
.add-panel-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 150px;
}
.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}
.form-group select, .form-group input {
    padding: 8.5px 12px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 10px;
    color: var(--text-main);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group select:focus, .form-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.btn-add {
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 9px 20px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: opacity 0.2s;
}
.btn-add:hover { opacity: 0.9; }
.add-panel-msg {
    margin-top: 12px;
    font-size: 13px;
}

/* ========================================================
   EMPTY STATE (Modern Illustration Card)
   ======================================================== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
    background: var(--empty-bg);
    border: 1px dashed var(--card-border);
    border-radius: 16px;
    margin-bottom: 24px;
    transition: all 0.2s;
}
.empty-state.hidden { display: none; }
.empty-icon-wrap {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--accent-glow);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}
.empty-icon-wrap svg, .empty-icon-wrap i { width: 28px; height: 28px; }
.empty-state h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}
.empty-state p {
    font-size: 14px;
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.5;
}

/* ========================================================
   TABLE & COMPARISON
   ======================================================== */
.hidden-table { display: none; }
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}
.table-caption {
    caption-side: top;
    text-align: left;
    font-size: 12px;
    color: var(--text-muted);
    padding: 12px 18px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--card-border);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
}
thead th {
    position: sticky;
    top: 0;
    background: var(--table-header);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 18px;
    border-bottom: 1px solid var(--table-border);
}
th.sortable { cursor: pointer; transition: color 0.2s; }
th.sortable:hover, th.sortable.active-sort { color: var(--accent); }
.sort-arrow { color: var(--accent); margin-left: 4px; display: inline-flex; align-items: center; }

td {
    padding: 13px 18px;
    border-bottom: 1px solid var(--card-border);
    font-size: 13.5px;
    color: var(--text-sub);
}
tr:last-child td { border-bottom: none; }
tr:hover td {
    background: rgba(14, 165, 233, 0.04);
}
tr.group-row td {
    background: var(--table-header);
    color: var(--accent);
    font-weight: 700;
    font-size: 13.5px;
    border-bottom: 1px solid var(--table-border);
    padding-top: 14px;
    padding-bottom: 14px;
}
tr.best-row td:first-child {
    box-shadow: inset 4px 0 0 #10b981;
}

.tyre-name { font-weight: 700; color: var(--text-main); }
.tyre-size { font-size: 11px; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }
.store-name { font-weight: 600; color: var(--text-sub); }
.price { font-weight: 700; font-size: 15px; color: var(--accent); font-family: 'JetBrains Mono', monospace; }
.currency { font-size: 13px; color: var(--text-muted); }

.stock-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
}
.stock-badge svg { width: 12px; height: 12px; }
.stock-in { background: rgba(16, 185, 129, 0.15); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.25); }
.stock-out { background: rgba(239, 68, 68, 0.12); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.2); }

.btn-table-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 12.5px;
    padding: 4px 10px;
    border-radius: 8px;
    background: var(--accent-glow);
    border: 1px solid rgba(56, 189, 248, 0.2);
    transition: all 0.2s;
}
.btn-table-link:hover {
    background: rgba(56, 189, 248, 0.25);
    transform: translateX(2px);
}
.btn-table-link svg { width: 12px; height: 12px; }

/* ========================================================
   SUMMARY KPI BAR
   ======================================================== */
.summary {
    display: none;
    margin-bottom: 24px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 16px 20px;
    font-size: 13.5px;
    color: var(--text-muted);
    box-shadow: var(--shadow-sm);
    line-height: 1.6;
}
.summary.visible { display: block; }
.summary strong { color: var(--text-main); font-weight: 700; }

/* ========================================================
   CHARTS & HISTORY SECTIONS
   ======================================================== */
.charts-section, .history-section {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 22px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}
.charts-section h2, .history-section h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    margin-bottom: 8px;
    font-size: 13px;
}
.history-item:last-child { margin-bottom: 0; }
.history-brand { font-weight: 700; color: var(--text-main); }
.history-store { color: var(--text-muted); }
.history-price { font-weight: 700; font-family: 'JetBrains Mono', monospace; color: var(--accent); }

/* ========================================================
   SITE FOOTER
   ======================================================== */
.site-footer {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--card-border);
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.6;
}
.footer-meta {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--card-border);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 12.5px;
}
.footer-links {
    display: flex;
    gap: 14px;
}
.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}
.footer-links a:hover {
    color: var(--accent);
}

/* ========================================================
   RESPONSIVENESS
   ======================================================== */
.hidden { display: none !important; }

@media (max-width: 860px) {
    .header-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
    .nav-links { width: 100%; justify-content: space-between; }
    .live-pill { display: none; }
}

@media (max-width: 720px) {
    .container { padding: 16px 12px; }
    .hero-section h1 { font-size: 24px; }
    .tyre-grid { grid-template-columns: 1fr; }
    table { display: block; overflow-x: auto; }
    .controls { gap: 8px; }
    .auto-update { margin-left: 0; width: 100%; justify-content: space-between; padding-top: 8px; border-top: 1px solid var(--card-border); }
    .picker-toolbar { flex-direction: column; align-items: stretch; }
    .search-box { max-width: 100%; }
}

/* ========================================================
   REPRICER PILLS & ACTION BADGES
   ======================================================== */
.pill-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 999px;
    border: 1px solid var(--card-border);
    background: var(--empty-bg);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.pill-btn:hover {
    background: var(--input-bg);
    color: var(--text-main);
    border-color: var(--input-border);
}
.pill-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(56, 189, 248, 0.3);
}
.pill-btn.pill-danger:hover {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.4);
}
.pill-btn.pill-danger.active {
    background: #ef4444;
    color: #fff;
    border-color: #ef4444;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}
.pill-btn.pill-success:hover {
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.4);
}
.pill-btn.pill-success.active {
    background: #10b981;
    color: #fff;
    border-color: #10b981;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}
.pill-btn.pill-primary:hover {
    color: #0284c7;
    border-color: rgba(2, 132, 199, 0.4);
}
.pill-btn.pill-primary.active {
    background: #0284c7;
    color: #fff;
    border-color: #0284c7;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

.action-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.badge-reduce {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.badge-increase {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.badge-optimal {
    background: rgba(14, 165, 233, 0.12);
    color: #0284c7;
    border: 1px solid rgba(14, 165, 233, 0.3);
}
.badge-protected {
    background: rgba(168, 85, 247, 0.12);
    color: #a855f7;
    border: 1px solid rgba(168, 85, 247, 0.3);
}
.badge-awaiting {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-muted);
    border: 1px solid var(--card-border);
}

