/* ================================================================
   ALZA TRADE DASHBOARD - STYLES
   ================================================================
   Design tokens jsou v :root níže. Při novém kódu používej je
   (var(--space-4) místo "16px", var(--color-accent) místo "#2563eb").
   Legacy hardcoded hodnoty budou postupně migrovat při úpravách.
   ================================================================ */

:root {
    /* SPACING (4px base) */
    --space-1: 0.25rem;   /* 4px  */
    --space-2: 0.5rem;    /* 8px  */
    --space-3: 0.75rem;   /* 12px */
    --space-4: 1rem;      /* 16px */
    --space-5: 1.25rem;   /* 20px */
    --space-6: 1.5rem;    /* 24px */
    --space-8: 2rem;      /* 32px */
    --space-10: 2.5rem;   /* 40px */
    --space-12: 3rem;     /* 48px */

    /* TYPOGRAPHY */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace;
    --text-xs: 11px;
    --text-sm: 12px;
    --text-md: 13px;       /* tabulkový default */
    --text-base: 14px;
    --text-lg: 16px;
    --text-xl: 20px;
    --text-2xl: 24px;
    --text-3xl: 28px;
    --leading-tight: 1.15;
    --leading-normal: 1.5;

    /* COLOR — semantic (povolené hardcoded jsou jen tyto base) */
    --color-bg: #f0f2f5;
    --color-surface: #ffffff;
    --color-surface-alt: #f9fafb;
    --color-fg: #111827;
    --color-fg-muted: #6b7280;
    --color-fg-subtle: #9ca3af;
    --color-border: #e5e7eb;
    --color-border-strong: #d1d5db;

    /* SEMANTIC STATE COLORS */
    --color-accent: #2563eb;          /* primary action / link */
    --color-accent-hover: #1d4ed8;
    --color-accent-bg: rgba(37, 99, 235, 0.1);
    --color-success: #059669;
    --color-success-bg: rgba(5, 150, 105, 0.1);
    --color-warning: #f59e0b;
    --color-warning-bg: rgba(245, 158, 11, 0.1);
    --color-danger: #dc2626;
    --color-danger-bg: rgba(220, 38, 38, 0.1);
    --color-info: #7c3aed;
    --color-info-bg: rgba(124, 58, 237, 0.1);
    --color-neutral: #6b7280;
    --color-neutral-bg: rgba(107, 114, 128, 0.1);

    /* BRAND (ALZA green = header) */
    --color-brand: #76b900;
    --color-brand-dark: #5a9e00;

    /* RADIUS */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --radius-full: 999px;

    /* SHADOWS */
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);

    /* TRANSITIONS */
    --transition-fast: 120ms ease;
    --transition-base: 180ms ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-fg);
    line-height: var(--leading-normal);
}

/* HEADER */
.header {
    background: linear-gradient(135deg, #76b900 0%, #5a9e00 100%);
    color: white;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.header h1 { font-size: 20px; font-weight: 700; }
.header-info { display: flex; align-items: center; gap: 16px; font-size: 13px; }
.header-info span { opacity: 0.9; }

/* TAB NAVIGATION */
.tab-bar {
    background: white;
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e0e0e0;
    padding: 0 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.tab-button {
    padding: 12px 20px;
    border: none;
    background: none;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.tab-button:hover { color: #333; }
.tab-button.active {
    color: #76b900;
    border-bottom-color: #76b900;
}
.tab-button .tab-badge {
    background: #e8f5e9;
    color: #2e7d32;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 700;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* SUB-TABS */
.sub-tab-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    background: white;
    border-radius: 10px;
    padding: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    width: fit-content;
}
.sub-tab {
    padding: 8px 16px;
    border: none;
    background: none;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.15s;
}
.sub-tab:hover { background: #f0f2f5; color: #333; }
.sub-tab.active {
    background: #76b900;
    color: white;
    font-weight: 600;
}
.sub-tab-content { display: none; }
.sub-tab-content.active { display: block; }

/* UPLOAD + IMPORT HISTORIE */
.top-panel {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
/* Sync panel */
.sync-panel {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.sync-header {
    display: flex;
    align-items: center;
    gap: 10px;
}
.sync-hint { font-size: 11px; color: #888; }
.sync-progress { display: flex; flex-direction: column; gap: 8px; }
.sync-steps { display: flex; flex-direction: column; gap: 4px; }
.sync-step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 6px;
    background: #f5f5f5;
}
.sync-step.active { background: #e3f2fd; color: #1565c0; font-weight: 600; }
.sync-step.done { background: #e8f5e9; color: #2e7d32; }
.sync-step.error { background: #ffebee; color: #c62828; }
.step-icon { font-size: 14px; width: 20px; text-align: center; }
.step-label { flex-shrink: 0; }
.step-detail { margin-left: auto; font-weight: 400; font-size: 11px; color: #666; }
.sync-live-log {
    max-height: 180px;
    overflow-y: auto;
    font-size: 11px;
    font-family: 'Consolas', monospace;
    background: #1a1a2e;
    color: #a0e080;
    border-radius: 6px;
    padding: 8px 10px;
    line-height: 1.6;
}
.sync-live-log .log-ok { color: #76b900; }
.sync-live-log .log-warn { color: #ff9800; }
.sync-live-log .log-err { color: #f44336; }
.sync-live-log .log-info { color: #90caf9; }
.sync-summary {
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 12px;
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
}
.sync-summary.error { background: #ffebee; border-color: #ffcdd2; }

.import-history {
    background: white;
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    overflow-x: auto;
}
.import-history h3 { font-size: 13px; color: #333; margin-bottom: 6px; }
.import-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.import-table th {
    background: #f8f8f8; padding: 5px 8px; text-align: right;
    font-weight: 600; color: #666; border-bottom: 2px solid #e0e0e0;
    white-space: nowrap; font-size: 11px;
}
.import-table th:first-child { text-align: left; }
.import-table td {
    padding: 4px 8px; border-bottom: 1px solid #f0f0f0;
    text-align: right; white-space: nowrap;
}
.import-table td:first-child { text-align: left; }
.import-table tr:hover { background: #fafafa; }
.arrow-up { color: #4caf50; font-size: 10px; margin-left: 2px; }
.arrow-down { color: #f44336; font-size: 10px; margin-left: 2px; }
.arrow-same { color: #bbb; font-size: 10px; margin-left: 2px; }
.import-status-badge {
    padding: 2px 6px; border-radius: 6px; font-size: 10px; font-weight: 600;
}
.import-status-badge.ok { background: #e8f5e9; color: #2e7d32; }
.import-status-badge.err { background: #ffebee; color: #c62828; }

/* MAIN CONTENT */
.container { max-width: 1440px; margin: 0 auto; padding: 16px 24px; }

/* STATISTIKY - kompaktní lišta */
/* STATS BAR – analytické karty + status chipy */
.stats-bar {
    margin-bottom: 12px;
}
.stats-section-label { min-height: 18px; margin-bottom: 4px; }
.stats-filtered-badge {
    display: inline-block;
    font-size: 11px;
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
    border-radius: 4px;
    padding: 1px 8px;
    font-weight: 600;
}

/* Velké karty – první řada */
.stats-cards {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid #eee;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 110px;
    transition: transform 0.15s, box-shadow 0.15s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.stat-card-value { font-size: 24px; font-weight: 700; line-height: 1.1; }
.stat-card-label { font-size: 11px; color: #888; margin-top: 2px; }
.stat-card-sub { font-size: 10px; color: #bbb; margin-top: 2px; }

/* Card colour variants */
.stat-card.total .stat-card-value { color: #1a1a1a; }
.stat-card.total { border-left: 3px solid #9c27b0; }
.stat-card.stock .stat-card-value { color: #2e7d32; }
.stat-card.stock { border-left: 3px solid #4caf50; }
.stat-card.alza-price .stat-card-value { color: #1565c0; }
.stat-card.alza-price { border-left: 3px solid #2196f3; }
.stat-card.alza-stock .stat-card-value { color: #00695c; }
.stat-card.alza-stock { border-left: 3px solid #009688; }
.stat-card.supplier-stock .stat-card-value { color: #e65100; }
.stat-card.supplier-stock { border-left: 3px solid #ff9800; }
.stat-card.unavailable .stat-card-value { color: #b71c1c; }
.stat-card.unavailable { border-left: 3px solid #f44336; }
.stat-card.no-data .stat-card-value { color: #616161; }
.stat-card.no-data { border-left: 3px solid #9e9e9e; }

/* Status chipy – druhá řada */
.status-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: opacity 0.15s, box-shadow 0.15s;
}
.status-chip:hover { opacity: 0.85; box-shadow: 0 1px 4px rgba(0,0,0,0.12); }
.chip-selling { background: #e8f5e9; color: #2e7d32; border-color: #c8e6c9; }
.chip-alza { background: #e3f2fd; color: #1565c0; border-color: #bbdefb; }
.chip-expensive { background: #ffebee; color: #b71c1c; border-color: #ffcdd2; }
.chip-blocked { background: #fff3e0; color: #e65100; border-color: #ffe0b2; }
.chip-inactive { background: #f5f5f5; color: #616161; border-color: #e0e0e0; }
.chip-nostatus { background: #f3e5f5; color: #6a1b9a; border-color: #e1bee7; }

/* STATISTIKY - plné karty (pro záložku Statistiky) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.stat-card .label { font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 2px; }
.stat-card .value { font-size: 26px; font-weight: 700; margin-bottom: 1px; }
.stat-card .sub { font-size: 10px; color: #aaa; }
.stat-card.total .value { color: #333; }
.stat-card.selling .value { color: #4caf50; }
.stat-card.expensive .value { color: #f44336; }
.stat-card.blocked .value { color: #ff9800; }
.stat-card.alza .value { color: #2196f3; }
.stat-card.other .value { color: #9e9e9e; }

/* SEKCE */
.section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.section-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.section-title .title-filters {
    display: flex;
    gap: 8px;
    align-items: center;
}
.section-title select {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 12px;
    background: white;
}

/* Refresh button in section-title (list reload) */
.refresh-btn {
    min-width: 28px;
    padding: 4px 9px;
    font-size: 15px;
    line-height: 1;
    font-weight: 700;
    color: #555;
    background: #f4f4f6;
    border: 1px solid #dcdce0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.refresh-btn:hover {
    background: #e8e8ec;
    color: #1a1a2e;
    border-color: #bfbfc5;
}
.refresh-btn.spinning {
    animation: refreshSpin 0.6s ease;
    pointer-events: none;
    color: #4f8cff;
}
@keyframes refreshSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* GRAFY */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
.chart-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.chart-container h3 { font-size: 14px; font-weight: 600; margin-bottom: 12px; color: #555; }

/* TABULKY */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
    background: #f5f5f5; padding: 8px 10px; text-align: left;
    font-weight: 600; color: #555; border-bottom: 2px solid #e0e0e0;
    white-space: nowrap; cursor: pointer; position: sticky; top: 0;
}
.data-table th:hover { background: #eee; }
.data-table th.sortable { cursor: pointer; user-select: none; }
.data-table th.sortable:hover { background: #e8e8e8; }
.data-table td { padding: 6px 10px; border-bottom: 1px solid #f0f0f0; }
.data-table tr:hover { background: #fafafa; }

/* Editable EAN */
.ean-display { cursor: default; }
.ean-display:hover { text-decoration: underline dotted; cursor: pointer; }
.ean-saved { color: #2e7d32; font-weight: 600; transition: color 2s, font-weight 2s; }
.ean-input.ean-empty { background: #fff8e1; }
.ean-input:focus { outline: none; border-color: #76b900 !important; box-shadow: 0 0 0 2px rgba(118,185,0,0.2); }

.ean-empty-wrap { display: inline-flex; align-items: center; gap: 4px; }
.btn-fill-ean {
    font-size: 11px;
    padding: 2px 6px;
    background: #f0f7e0;
    color: #4a7c00;
    border: 1px solid #c5e09a;
    border-radius: 3px;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.4;
}
.btn-fill-ean:hover:not(:disabled) { background: #dff0b0; }
.btn-fill-ean:disabled { opacity: 0.6; cursor: default; }
.ean-just-filled { color: #2e7d32; font-weight: 600; }

/* Column picker */
.column-picker-wrapper { position: relative; display: inline-block; margin-bottom: 8px; }
.column-picker-btn { font-size: 11px !important; padding: 4px 10px !important; }
.column-picker-dropdown {
    position: absolute; top: 100%; left: 0; z-index: 100;
    background: white; border: 1px solid #ddd; border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15); padding: 8px 10px;
    display: flex; flex-direction: column; gap: 4px;
    min-width: 180px; max-height: 400px; overflow-y: auto;
}
.column-picker-dropdown label {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; color: #333; cursor: pointer; padding: 2px 0;
    white-space: nowrap;
}
.column-picker-dropdown label:hover { color: #76b900; }
.column-picker-dropdown input[type="checkbox"] { accent-color: #76b900; }

/* STATUS BADGE */
.sale-status { padding: 2px 8px; border-radius: 8px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.sale-status.selling { background: #e8f5e9; color: #2e7d32; }
.sale-status.expensive { background: #ffebee; color: #c62828; }
.sale-status.blocked { background: #fff3e0; color: #e65100; }
.sale-status.alza-sells { background: #e3f2fd; color: #1565c0; }
.sale-status.ended { background: #f5f5f5; color: #757575; }
.sale-status.preparation { background: #fff8e1; color: #f57f17; }
.sale-status.inactive { background: #fafafa; color: #bdbdbd; }
.sale-status.not-selling { background: #fce4ec; color: #ad1457; }
.sale-status.removed { background: #efebe9; color: #795548; }

.change-arrow { margin: 0 6px; color: #999; }

/* FILTRY */
.filters { display: flex; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; align-items: flex-end; }
.filter-group { display: flex; flex-direction: column; gap: 3px; }
.filter-group.filter-checkbox { justify-content: flex-end; }
.filter-label { font-size: 11px; font-weight: 600; color: #666; text-transform: uppercase; letter-spacing: 0.3px; }
.checkbox-label { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; color: #444; cursor: pointer; white-space: nowrap; padding: 7px 0; }
.checkbox-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: #76b900; cursor: pointer; }
.filters select, .filters input {
    padding: 7px 10px; border: 1px solid #ddd; border-radius: 8px; font-size: 12px; background: white;
}
.filters input:not([type="checkbox"]):not([type="radio"]):not(.min-profit-input) { min-width: 220px; }
.filters input[type="checkbox"], .filters input[type="radio"] { min-width: 0; width: auto; }
.filters select:focus, .filters input:focus { outline: none; border-color: #76b900; box-shadow: 0 0 0 2px rgba(118,185,0,0.15); }
.btn { padding: 7px 14px; border: none; border-radius: 8px; font-size: 12px; font-weight: 500; cursor: pointer; transition: background 0.2s; }
.btn-primary { background: #76b900; color: white; }
.btn-primary:hover { background: #5a9e00; }
.btn-secondary { background: #e0e0e0; color: #333; }
.btn-secondary:hover { background: #d0d0d0; }
.btn-danger { background: #f44336; color: white; }
.btn-danger:hover { background: #d32f2f; }
.btn-sync { background: linear-gradient(135deg, #1976d2, #42a5f5); color: white; font-weight: 600; padding: 8px 18px !important; font-size: 13px !important; }
.btn-sync:hover { background: linear-gradient(135deg, #1565c0, #1976d2); }
.btn-sync:disabled { background: #bbb; cursor: not-allowed; }
.btn-sm { padding: 4px 10px; font-size: 11px; }

.quick-wins-list { max-height: 400px; overflow-y: auto; }

/* TOP KATEGORIE / VÝROBCI */
.top-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; font-size: 12px; }
.bar-row .bar-label { width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex-shrink: 0; }
.bar-row .bar-track { flex: 1; height: 18px; background: #f0f0f0; border-radius: 4px; overflow: hidden; display: flex; }
.bar-row .bar-fill { height: 100%; transition: width 0.3s; }
.bar-row .bar-fill.selling { background: #4caf50; }
.bar-row .bar-fill.expensive { background: #f44336; }
.bar-row .bar-fill.blocked { background: #ff9800; }
.bar-row .bar-fill.alza-fills { background: #2196f3; }
.bar-row .bar-fill.other-fill { background: #e0e0e0; }
.bar-row .bar-count { width: 45px; text-align: right; font-weight: 600; flex-shrink: 0; }

/* STRÁNKOVÁNÍ */
.pagination { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; font-size: 13px; color: #666; }
.pagination-top { margin-bottom: 8px; }

/* LOADING */
.loading { text-align: center; padding: 30px; color: #999; }
.spinner { display: inline-block; width: 28px; height: 28px; border: 3px solid #e0e0e0; border-top-color: #76b900; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; background: #f0fff0; } to { opacity: 1; background: transparent; } }

/* LOADING */
.loadable-section {
    position: relative;
    min-height: 60px;
}

/* Sticky loading bar - always visible */
.loading-bar {
    position: sticky;
    top: 0;
    z-index: 50;
    height: 3px;
    background: linear-gradient(90deg, #76b900, #a3d900, #76b900);
    background-size: 200% 100%;
    animation: loading-slide 1.2s ease-in-out infinite;
    border-radius: 2px;
}
@keyframes loading-slide {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Semi-transparent overlay (keeps table visible) */
.loading-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.5);
    z-index: 10;
    border-radius: 12px;
    pointer-events: none;
}

/* Skeleton loader */
.skeleton-table { width: 100%; }
.skeleton-row { display: flex; gap: 12px; padding: 10px; border-bottom: 1px solid #f0f0f0; }
.skeleton-cell {
    height: 14px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    border-radius: 4px;
    flex: 1;
}
.skeleton-cell:first-child { flex: 0.7; }
.skeleton-cell:nth-child(3) { flex: 2; }
@keyframes skeleton-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* PAGINATION */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 13px;
    color: #666;
    flex-wrap: wrap;
    gap: 8px;
}
.pagination-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}
.pagination button {
    min-width: 36px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.15s;
    color: #333;
}
.pagination button:hover:not(:disabled) {
    background: #f0f0f0;
    border-color: #ccc;
}
.pagination button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.pagination button.active {
    background: #76b900;
    color: white;
    border-color: #76b900;
    font-weight: 700;
}
.pagination .page-info {
    font-size: 12px;
    color: #888;
}
.pagination .per-page {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #888;
}
.pagination .per-page select {
    padding: 4px 6px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 12px;
    background: white;
    cursor: pointer;
}
.pagination .page-jump {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #888;
}
.pagination .page-jump input {
    width: 50px;
    padding: 4px 6px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 12px;
    text-align: center;
}

/* PRICE SCRAPING */
.scrape-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}
.scrape-controls select {
    padding: 7px 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 12px;
    background: white;
}
.scrape-controls input[type="number"] {
    width: 80px;
    padding: 7px 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 12px;
}
.progress-container {
    margin: 12px 0;
    display: none;
}
.progress-container.active {
    display: block;
}
.progress-bar-track {
    height: 24px;
    background: #f0f0f0;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}
.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #76b900, #5a9e00);
    border-radius: 12px;
    transition: width 0.5s ease;
    min-width: 0;
}
.progress-bar-text {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: #333;
}
.scrape-stats {
    display: flex;
    gap: 16px;
    margin-top: 8px;
    font-size: 12px;
    color: #666;
}
.scrape-stats span { display: flex; align-items: center; gap: 4px; }
.scrape-stats .stat-ok { color: #4caf50; font-weight: 600; }
.scrape-stats .stat-fail { color: #f44336; font-weight: 600; }
.price-link { color: #1565c0; text-decoration: none; font-size: 12px; }
.price-link:hover { text-decoration: underline; }
.price-value { font-weight: 600; }
.price-value.found { color: #2e7d32; }
.price-value.missing { color: #999; }

/* MARGIN INDICATORS */
.margin-positive { color: #2e7d32; font-weight: 600; }
.margin-warning { color: #e65100; font-weight: 600; }
.margin-negative { color: #c62828; font-weight: 600; }
.margin-cell { white-space: nowrap; }
.price-compare { font-size: 11px; }
.price-compare .cheaper { color: #2e7d32; }
.price-compare .more-expensive { color: #c62828; }

/* SOUHRN PŘECHODŮ */
.transition-summary {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 10px 14px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 13px;
    flex-wrap: wrap;
}
.transition-summary .ts-item {
    display: flex;
    align-items: center;
    gap: 6px;
}
.transition-summary .ts-value {
    font-weight: 700;
    font-size: 15px;
}
.transition-summary .ts-label { color: #666; }
.transition-summary .ts-net-positive { color: #4caf50; font-weight: 700; font-size: 15px; }
.transition-summary .ts-net-negative { color: #f44336; font-weight: 700; font-size: 15px; }
.transition-summary .ts-net-zero { color: #999; font-weight: 700; font-size: 15px; }
.transition-summary .ts-divider { width: 1px; height: 24px; background: #ddd; }
.ts-breakdown {
    width: 100%;
    padding: 6px 0 2px 0;
    font-size: 12px;
    color: #555;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    align-items: center;
}
.ts-breakdown .ts-breakdown-label {
    font-weight: 600;
    color: #888;
    font-size: 11px;
    margin-right: 2px;
}
.ts-breakdown .ts-breakdown-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.ts-breakdown .ts-breakdown-item .ts-breakdown-arrow {
    color: #999;
    font-size: 11px;
}
.ts-breakdown .ts-breakdown-item .ts-breakdown-count {
    font-weight: 700;
    font-size: 12px;
    color: #333;
}

/* SUPPLIERS */
.supplier-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.kpi-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    border: 1px solid #eee;
}
.kpi-card:hover { background: #f0f2f5; transform: translateY(-1px); }
.kpi-card.active { border-color: #76b900; background: #f9fef0; }
.kpi-card .kpi-value { font-size: 22px; font-weight: 700; color: #333; }
.kpi-card .kpi-label { font-size: 11px; color: #888; margin-top: 2px; }
.kpi-card .kpi-pct { font-size: 12px; color: #666; font-weight: 600; }

.supplier-funnel {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 10px;
}
.funnel-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}
.funnel-step .funnel-value { font-size: 18px; font-weight: 700; }
.funnel-step .funnel-label { font-size: 11px; color: #888; }
.funnel-step .funnel-pct { font-size: 12px; color: #76b900; font-weight: 600; }
.funnel-arrow { font-size: 20px; color: #ccc; }

.breadcrumb {
    font-size: 13px;
    margin-bottom: 12px;
    color: #666;
}
.breadcrumb a {
    color: #76b900;
    text-decoration: none;
}
.breadcrumb a:hover { text-decoration: underline; }

/* MODAL */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal {
    background: white;
    border-radius: 12px;
    padding: 24px;
    min-width: 400px;
    max-width: 500px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.modal h3 { font-size: 16px; margin-bottom: 16px; }
.modal-field { margin-bottom: 12px; }
.modal-field label { display: block; font-size: 12px; color: #666; margin-bottom: 4px; }
.modal-field input, .modal-field textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 13px;
}
.modal-field textarea { resize: vertical; min-height: 60px; }
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

/* RESPONSIVE */
/* PRODUCT SCRAPE BAR */
.product-scrape-bar {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 0;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    margin: 8px 0 12px;
}
.product-scrape-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.btn-scrape {
    background: #76b900;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-scrape:hover { background: #5a8f00; }
.btn-scrape:disabled { background: #aaa; cursor: not-allowed; }
.scrape-count { font-size: 12px; color: #888; }
.scrape-elapsed { font-size: 12px; color: #76b900; font-weight: 600; font-variant-numeric: tabular-nums; }
.progress-bar-wrap {
    height: 3px;
    background: #f0f0f0;
    border-radius: 2px;
    overflow: hidden;
    display: none;
}
.progress-bar-wrap.active { display: block; }
.progress-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, #76b900, #a0d900);
    transition: width 0.3s;
    width: 0;
}
.product-scrape-log {
    max-height: 120px;
    overflow-y: auto;
    font-size: 11px;
    font-family: monospace;
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 6px 8px;
}

/* ALZA AVAILABILITY BADGE */
.avail-badge {
    display: inline-block;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
}
.avail-instock { background: #e8f5e9; color: #2e7d32; font-weight: 600; }
.avail-alza { background: #e3f2fd; color: #1565c0; }
.avail-supplier { background: #fff3e0; color: #e65100; }
.avail-unavailable { background: #ffebee; color: #b71c1c; }
.avail-preorder { background: #f3e5f5; color: #6a1b9a; }
.avail-unknown { background: #f5f5f5; color: #666; }

.alza-code-badge {
    display: inline-block;
    font-size: 11px;
    font-family: monospace;
    padding: 2px 5px;
    background: #f0f7e0;
    color: #4a7c00;
    border-radius: 3px;
    letter-spacing: 0.2px;
}

/* STATIC ACTION COLUMN */
.col-actions { width: 52px; min-width: 52px; }

/* PER-ROW ACTION ICONS */
.action-icons { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    border: none;
    background: transparent;
    transition: background 0.15s, color 0.15s;
    color: #666;
}
.action-icon:hover { background: #f0f0f0; color: #333; }
.action-link { color: #1565c0; }
.action-link.disabled { color: #ccc; cursor: default; pointer-events: none; }
.action-scrape { color: #76b900; }
.action-scrape:disabled { color: #ccc; cursor: not-allowed; }

/* SCRAPE LOG LINES */
.scrape-log-line { padding: 1px 0; }
.scrape-log-line.ok .log-icon { color: #4caf50; }
.scrape-log-line.skipped .log-icon { color: #999; }
.scrape-log-line.failed .log-icon { color: #f44336; }
.log-icon { display: inline-block; width: 14px; margin-right: 4px; }

/* SCRAPE RESULT MODAL */
.scrape-modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.45);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999; animation: fadeIn .15s ease;
}
.scrape-modal {
    background: #fff; border-radius: 10px; padding: 28px 32px;
    min-width: 460px; max-width: 620px; width: 90vw;
    box-shadow: 0 8px 40px rgba(0,0,0,.22);
    animation: slideUp .18s ease;
}
.scrape-modal-title {
    font-size: 18px; font-weight: 700; margin-bottom: 18px;
    display: flex; align-items: center; gap: 8px;
}
.scrape-modal-stats {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
    margin-bottom: 18px;
}
.scrape-stat-box {
    background: #f5f5f5; border-radius: 7px; padding: 10px 12px; text-align: center;
}
.scrape-stat-box .val { font-size: 22px; font-weight: 700; line-height: 1.2; }
.scrape-stat-box .lbl { font-size: 11px; color: #888; margin-top: 2px; }
.scrape-stat-box.ok .val { color: #4caf50; }
.scrape-stat-box.skip .val { color: #ff9800; }
.scrape-stat-box.fail .val { color: #f44336; }
.scrape-avail-grid {
    display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px;
}
.scrape-avail-pill {
    background: #f0f0f0; border-radius: 20px; padding: 3px 10px;
    font-size: 12px; display: flex; align-items: center; gap: 5px;
}
.scrape-avail-pill strong { font-weight: 700; }
.scrape-errors-toggle {
    font-size: 12px; color: #e53935; cursor: pointer; margin-bottom: 6px;
    background: none; border: none; padding: 0; text-decoration: underline;
}
.scrape-errors-list {
    max-height: 130px; overflow-y: auto; font-size: 11px; color: #555;
    background: #fafafa; border: 1px solid #eee; border-radius: 5px;
    padding: 6px 8px; margin-bottom: 14px; display: none;
}
.scrape-modal-footer { display: flex; justify-content: flex-end; gap: 8px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* POTENTIAL TAB */
.tab-badge {
    display: inline-block;
    background: var(--color-brand);
    color: white;
    border-radius: var(--radius-lg);
    padding: 1px 6px;
    font-size: var(--text-xs);
    font-weight: 700;
    margin-left: var(--space-1);
    vertical-align: middle;
}
.potential-supplier-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 0 8px 0;
}
.potential-supplier-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    background: #f5f5f5;
    border: 1.5px solid transparent;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.15s;
    user-select: none;
}
.potential-supplier-pill:hover { background: #eef7e0; border-color: #76b900; }
.potential-supplier-pill.active { background: #eef7e0; border-color: #76b900; font-weight: 600; }
.potential-supplier-pill .pill-count {
    background: #76b900;
    color: white;
    border-radius: 10px;
    padding: 0 6px;
    font-size: 10px;
    font-weight: 700;
}

/* ================================================================
   COLUMN DRAG-AND-DROP REORDERING
   ================================================================ */

.col-draggable { user-select: none; cursor: default; }

.col-drag-handle {
    display: inline-block;
    color: #bbb;
    font-size: 14px;
    margin-right: 4px;
    cursor: grab;
    vertical-align: middle;
    line-height: 1;
}
.col-drag-handle:hover { color: #76b900; }
.col-drag-handle:active { cursor: grabbing; }

.data-table th.col-dragging {
    opacity: 0.45;
    background: #e8f5d0 !important;
    outline: 2px dashed #76b900;
}
.data-table th.col-drag-over {
    background: #f0f9e0 !important;
    border-left: 3px solid #76b900;
    outline: none;
}

/* Keep pointer cursor on sortable text, grab only on handle */
.col-draggable.sortable { cursor: default; }
.col-draggable.sortable:hover { background: #f5f5f5; }

/* ================================================================
   ALZA PRICER – vlastní ceny, checkboxy, bulk toolbar
   ================================================================ */

.pricer-table td { vertical-align: middle; }
.pricer-table tbody tr.pricer-selected { background: #f0f9e0; }
.pricer-table tbody tr.pricer-selected:hover { background: #e8f5d0; }
.data-table tbody tr.pricer-selected { background: #f0f9e0; }
.data-table tbody tr.pricer-selected:hover { background: #e8f5d0; }

.col-check { width: 32px; text-align: center; padding: 4px 6px !important; }
.col-check input[type=checkbox] { cursor: pointer; width: 15px; height: 15px; }

/* Bulk toolbar */
.pricer-bulk-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #eef7e0;
    border: 1px solid #b5d97a;
    border-radius: 8px;
    margin: 8px 0;
    flex-wrap: wrap;
}
.pricer-sel-count {
    font-weight: 700;
    color: #4a8000;
    font-size: 14px;
    white-space: nowrap;
}
.pricer-bulk-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn-accent {
    background: #76b900;
    color: white;
    border: none;
}
.btn-accent:hover { background: #5a9e00; }
.btn-ghost {
    background: transparent;
    color: #666;
    border: 1px solid #ddd;
}
.btn-ghost:hover { background: #f5f5f5; }

/* Own price cell */
.own-price-badge {
    display: inline-block;
    background: #eef7e0;
    color: #4a8000;
    border: 1px solid #b5d97a;
    border-radius: 4px;
    padding: 1px 7px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}
.own-price-editable {
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.own-price-editable:hover { background: #d6f0a0; border-color: #8ec010; }

/* Own price currently leads to loss (purchase price rose, fee, etc.) */
.own-price-badge-loss {
    background: #ffe4e4;
    color: #b0261c;
    border-color: #f5a9a0;
}
.own-price-badge-loss:hover { background: #ffd0cf; border-color: #e66d60; }
.own-price-loss {
    display: inline-block;
    color: #d32f2f;
    font-size: 13px;
    font-weight: 700;
    margin-left: 2px;
    cursor: help;
    animation: lossPulse 2s ease-in-out infinite;
}
@keyframes lossPulse {
    0%, 100% { opacity: 0.65; }
    50%      { opacity: 1; }
}

/* Compact inline checkbox column (Rychlý filtr: Bez EAN + V minusu) */
.filter-group.filter-inline-checks {
    flex: 0 0 auto;
    align-items: flex-start;
    width: auto;
    min-width: 0;
    max-width: max-content;
}
.inline-check-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 4px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    min-height: 36px;
    box-sizing: border-box;
    width: auto;
    align-self: flex-start;
}
.inline-check {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 500;
    color: #444;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1;
}
.inline-check input[type="checkbox"] {
    width: 14px; height: 14px;
    margin: 0;
    accent-color: #76b900;
    cursor: pointer;
}
.inline-check-loss { color: #a03020; }
.inline-check-loss input[type="checkbox"] { accent-color: #d32f2f; }

.chip-count {
    display: inline-block;
    min-width: 16px;
    text-align: center;
    background: #d32f2f;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 0 5px;
    border-radius: 8px;
    line-height: 1.5;
    margin-left: 2px;
}
.chip-count:empty { display: none; }

/* Wrapper for set price + clear button */
.own-price-set-wrap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.own-price-clear-btn {
    background: none;
    border: none;
    color: #bbb;
    cursor: pointer;
    font-size: 12px;
    padding: 0 2px;
    line-height: 1;
    transition: color 0.15s;
}
.own-price-clear-btn:hover { color: #f44336; }

/* 1st-click quick-set button (shown when no own_price) */
.own-price-set-btn {
    background: #f5f5f5;
    border: 1px dashed #ccc;
    border-radius: 4px;
    color: #888;
    cursor: pointer;
    font-size: 11px;
    padding: 2px 8px;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.own-price-set-btn:hover { background: #eef7e0; border-color: #76b900; color: #4a8000; }

/* Own-price floating popup editor */
.own-price-popup {
    position: absolute;
    z-index: 9999;
    background: white;
    border: 1px solid #ddd;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    padding: 14px 16px;
    width: 310px;
    font-size: 13px;
}
.ope-header { margin-bottom: 8px; display: flex; flex-direction: column; gap: 2px; }
.ope-header strong { font-size: 15px; color: #1a1a2e; }
.ope-meta { font-size: 11px; color: #888; }
.ope-input-row { display: flex; gap: 6px; align-items: center; }
.ope-input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
}
.ope-input:focus { outline: none; border-color: #76b900; box-shadow: 0 0 0 2px #eef7e0; }
.ope-input.input-error { border-color: #f44336; }
.ope-preview {
    margin-top: 8px;
    font-size: 12px;
    color: #666;
    min-height: 16px;
}
.ope-preview .margin-positive { color: #388e3c; font-weight: 700; }
.ope-preview .margin-warning { color: #f57c00; font-weight: 700; }
.ope-preview .margin-negative { color: #d32f2f; font-weight: 700; }

/* Toast notification */
/* Single-product scrape: progress bar (fixed bottom-center, stays until done) */
.single-scrape-bar {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1a1a2e;
    color: #fff;
    padding: 12px 24px;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 6px 24px rgba(0,0,0,0.35);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 99990;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
    white-space: nowrap;
}
.single-scrape-bar.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}
.single-scrape-bar .single-scrape-hint {
    font-size: 11px;
    color: #aaa;
    font-weight: 400;
}
.single-scrape-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #76b900;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

/* Spinning scrape button */
.action-scrape.spinning { animation: spin 0.7s linear infinite; }

/* Row highlight animation on price update */
@keyframes highlightCell {
    0%   { background: #e8f5e9; }
    100% { background: transparent; }
}

/* Single scrape result popup */
.scrape-result-modal { max-width: 520px; }
.scrape-result-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}
.scrape-result-card {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 12px 10px;
    text-align: center;
}
.scrape-result-card.ok { background: #e8f5e9; }
.scrape-result-card.fail { background: #ffebee; }
.scrape-result-card-val {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    color: #222;
}
.scrape-result-card.ok .scrape-result-card-val { color: #2e7d32; }
.scrape-result-card.fail .scrape-result-card-val { color: #c62828; }
.scrape-result-card-lbl { font-size: 11px; color: #888; margin-top: 4px; }
.scrape-result-card .avail-wrap { font-size: 12px; }
.scrape-result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-top: 1px solid #f0f0f0;
    font-size: 13px;
}
.scrape-result-lbl { color: #666; }
.scrape-result-val { font-weight: 600; }
.scrape-result-hint {
    font-size: 11px;
    color: #999;
    justify-content: center;
    padding: 4px 0 8px;
    border-top: none;
}
.scrape-result-alza-link {
    display: inline-block;
    margin-top: 10px;
    font-size: 12px;
    color: #2196f3;
    text-decoration: none;
}
.scrape-result-error {
    margin-top: 10px;
    padding: 8px 12px;
    background: #fff3e0;
    border-left: 3px solid #ff9800;
    border-radius: 4px;
    font-size: 12px;
    color: #e65100;
}
.scrape-trace {
    margin-top: 10px;
    font-size: 11px;
    color: #666;
}
.scrape-trace summary {
    cursor: pointer;
    color: #888;
    font-size: 11px;
    padding: 4px 0;
    user-select: none;
}
.scrape-trace pre {
    margin: 6px 0 0;
    padding: 8px;
    background: #f5f5f5;
    border-radius: 4px;
    font-size: 10px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 200px;
    overflow-y: auto;
    color: #333;
}
.scrape-result-alza-link:hover { text-decoration: underline; }

/* Alza price cell with history button */
.alza-price-cell { display: inline-flex; align-items: center; gap: 4px; }
.price-history-btn { background: none; border: none; cursor: pointer; font-size: 13px; padding: 0 2px; opacity: 0.4; transition: opacity 0.15s; line-height: 1; }
.price-history-btn:hover { opacity: 1; }

/* Price history popup */
.price-history-modal { max-width: 520px; width: 92vw; max-height: 90vh; display: flex; flex-direction: column; }
.price-history-modal #priceHistoryContent { display: flex; flex-direction: column; gap: 0; overflow: hidden; flex: 1; }
.price-history-close { margin-left: auto; background: none; border: none; font-size: 18px; cursor: pointer; color: #999; padding: 0 4px; line-height: 1; }
.price-history-close:hover { color: #333; }
.price-history-chart-wrap { position: relative; height: 200px; width: 100%; flex-shrink: 0; margin-bottom: 8px; }
.price-history-stats { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: #666; padding: 8px 0; border-top: 1px solid #f0f0f0; border-bottom: 1px solid #f0f0f0; margin-bottom: 8px; flex-shrink: 0; }
.price-history-stats strong { color: #1a1a2e; }
.price-history-table-wrap { overflow-y: auto; flex: 1; min-height: 80px; max-height: 200px; }
.price-history-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.price-history-table th { text-align: left; padding: 5px 8px; background: #f5f5f5; font-weight: 600; color: #555; font-size: 11px; position: sticky; top: 0; z-index: 1; }
.price-history-table td { padding: 5px 8px; border-top: 1px solid #f5f5f5; }
.price-history-table tr:hover td { background: #fafafa; }

.toast {
    position: fixed;
    top: 70px;
    right: 20px;
    z-index: 99999;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.25s ease;
    pointer-events: none;
}
.toast-visible { opacity: 1; transform: translateY(0); }
.toast-success { background: #4caf50; color: white; }
.toast-error { background: #f44336; color: white; }
.toast-info { background: #2196f3; color: white; }

/* Viability indicator column */
.col-viab { width: 110px; text-align: center; white-space: nowrap; }
.col-auto { width: 44px; text-align: center; }
.viab-cell { display: inline-block; }
.viab-none { color: #ccc; font-size: 12px; }
.viab-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    border: none;
    border-radius: 5px;
    padding: 3px 7px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.15s, transform 0.1s;
}
.viab-btn:active { transform: scale(0.96); }
.viab-green { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.viab-green:hover { background: #c8e6c9; }
.viab-yellow { background: #fff8e1; color: #e65100; border: 1px solid #ffcc02; }
.viab-yellow:hover { background: #fff3cd; }
.viab-red { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; cursor: default; display: inline-flex; align-items: center; gap: 3px; border-radius: 5px; padding: 3px 7px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.viab-done { background: #f1f8e9; color: #558b2f; border: 1px solid #aed581; cursor: default; display: inline-flex; align-items: center; gap: 3px; border-radius: 5px; padding: 3px 7px; font-size: 12px; font-weight: 600; white-space: nowrap; }

/* Min profit input */
.min-profit-input { width: 70px; min-width: 70px; padding: 7px 10px; border: 1px solid #ddd; border-radius: 8px; font-size: 12px; text-align: right; height: 32px; box-sizing: border-box; }
.min-profit-input:focus { outline: none; border-color: #76b900; }

/* Viability filter buttons */
.viab-filter-btns { display: flex; gap: 4px; align-items: flex-end; }
.viab-filter-wrap { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.viab-filter-count { font-size: 11px; font-weight: 700; min-height: 14px; line-height: 14px; color: #555; }
.viab-count-green { color: #2e7d32; }
.viab-count-yellow { color: #e65100; }
.viab-count-red { color: #c62828; }
.viab-filter-btn { background: #f5f5f5; border: 1px solid #ddd; border-radius: 5px; cursor: pointer; font-size: 13px; padding: 3px 9px; transition: all 0.15s; white-space: nowrap; }
.viab-filter-btn:hover { background: #e8e8e8; border-color: #bbb; }
.viab-filter-active { background: #1a1a2e; border-color: #1a1a2e; color: #fff; font-weight: 600; }
.viab-filter-active:hover { background: #2d2d4e; }

/* Green count badge on Viabilita label */
.viab-count-badge { display: inline-block; background: #4caf50; color: #fff; border-radius: 10px; padding: 0 6px; font-size: 11px; font-weight: 700; min-width: 18px; text-align: center; vertical-align: middle; margin-left: 2px; }

/* Auto-price toggle button */
.auto-toggle-btn {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 5px;
    color: #bbb;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 3px 6px;
    transition: all 0.15s;
}
.auto-toggle-btn:hover { border-color: #aaa; color: #888; }
.auto-toggle-btn.auto-on {
    background: #fff8e1;
    border-color: #ffc107;
    color: #f57c00;
    box-shadow: 0 0 0 2px rgba(255,193,7,0.2);
}
.auto-toggle-btn.auto-on:hover { background: #ffecb3; }

/* Pricing-lock toggle (zámek na cenu) */
.lock-toggle-btn {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 5px;
    color: #bbb;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 3px 6px;
    transition: all 0.15s;
}
.lock-toggle-btn:hover { border-color: #aaa; color: #888; }
.lock-toggle-btn.lock-on {
    background: #fff0f0;
    border-color: #d32f2f;
    color: #c62828;
    box-shadow: 0 0 0 2px rgba(211,47,47,0.15);
}
.lock-toggle-btn.lock-on:hover { background: #ffe0e0; }

/* Uzamčený řádek — vizuální hint */
tr.row-locked td { background: #fafafa; }
tr.row-locked .own-price-badge { font-style: italic; opacity: 0.85; }
tr.row-locked:hover td { background: #f0f0f0; }

/* Lock filter chip — varianta inline-check */
.inline-check-lock { color: #c62828; }
.inline-check-lock input[type="checkbox"] { accent-color: #d32f2f; }
.chip-count-lock { background: #c62828; }

/* Mini-select pro tri-state filtry (Vlastní cena: vše/ANO/NE) */
.mini-select {
    border: 1px solid #76b900;
    border-radius: 5px;
    background: #ffffff;
    font-size: 13px;
    font-weight: 700;
    padding: 3px 26px 3px 10px;
    height: 26px;
    min-width: 70px;
    cursor: pointer;
    color: #1a1a2e;
    line-height: 1;
    margin-left: 4px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%23333' d='M0 0l5 6 5-6z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 8px center;
    text-align-last: center;
}
.mini-select:focus { outline: none; box-shadow: 0 0 0 2px rgba(118,185,0,0.25); }
.mini-select:hover { background: #f4faea; }
.mini-select option { font-weight: 600; color: #1a1a2e; background: #fff; }
/* Vizuální zvýraznění aktivního stavu (když není 'vše') */
.mini-select:not([data-empty]) { background: #f4faea; }

/* Rabat kategorií tab */
.rabat-cell-input {
    width: 70px;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    text-align: right;
    background: white;
}
.rabat-cell-input:focus {
    outline: none;
    border-color: #76b900;
    box-shadow: 0 0 0 2px rgba(118,185,0,0.2);
}
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
}
.badge-success { background: #e8f5d0; color: #2f5a00; border: 1px solid #b5d97a; }
.badge-warning { background: #fff3e0; color: #b25500; border: 1px solid #ffb866; }
.badge-official { background: #e3f0ff; color: #0d47a1; border: 1px solid #90caf9; font-weight: 700; }

/* Mini source-save tlačítka u rabat input (✋ manual / 🏛 Alza CSV) */
.rabat-source-btn {
    width: 24px; height: 24px;
    padding: 0;
    margin-left: 2px;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    background: #f5f5f5;
    color: #555;
    vertical-align: middle;
    transition: all 0.15s;
}
.rabat-source-btn:hover { transform: scale(1.1); }
.rabat-source-manual:hover   { background: #e8f5d0; color: #2f5a00; border-color: #b5d97a; }
.rabat-source-official:hover { background: #e3f0ff; color: #0d47a1; border-color: #90caf9; }

.btn-info { background: #e3f0ff; color: #0d47a1; border: 1px solid #90caf9; }
.btn-info:hover { background: #cfe5ff; }

/* Freshness banner — stáří CORE feedu a TRADE XLS */
.freshness-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 16px;
    background: #f7f8fa;
    border-bottom: 1px solid #e2e4e8;
    font-size: 12px;
    color: #555;
    flex-wrap: wrap;
}
.fresh-item { display: inline-flex; align-items: center; gap: 6px; }
.fresh-label { font-weight: 600; color: #1a1a2e; }
.fresh-value { padding: 2px 8px; border-radius: 4px; font-weight: 600; }
.fresh-value.fresh-ok    { background: #e8f5d0; color: #2f5a00; }
.fresh-value.fresh-warn  { background: #fff3e0; color: #b25500; }
.fresh-value.fresh-old   { background: #ffe4e0; color: #b0261c; }
.fresh-divider { color: #c5c7cc; }
.fresh-hint { color: #999; font-size: 11px; }
.fresh-cron-hint { margin-left: auto; color: #888; font-size: 11px; }
.fresh-sync-btn { padding: 2px 8px; font-size: 11px; }

/* Bulk bar auto buttons */
.btn-success { background: #4caf50; color: white; border: none; }
.btn-success:hover { background: #43a047; }
.btn-auto-on { background: #fff8e1; color: #e65100; border: 1px solid #ffc107; }
.btn-auto-on:hover { background: #ffecb3; }
.btn-auto-off { background: #f5f5f5; color: #666; border: 1px solid #ddd; }
.btn-auto-off:hover { background: #eeeeee; }
.btn-export { background: #1565c0; color: white; border: none; }
.btn-export:hover { background: #0d47a1; }

/* Export modal */
.export-modal-overlay .scrape-modal { max-width: 560px; }
.export-col-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 16px;
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 10px 12px;
    background: #fafafa;
}
.export-col-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
    padding: 3px 0;
    white-space: nowrap;
}
.export-col-item input { cursor: pointer; accent-color: #76b900; }
.export-col-item:hover { color: #4a8000; }

@media (max-width: 1200px) {
    .stats-grid { grid-template-columns: repeat(3, 1fr); }
    .charts-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .charts-grid { grid-template-columns: 1fr; }
    .top-grid { grid-template-columns: 1fr; }
    .top-panel { grid-template-columns: 1fr; }
    .header { flex-direction: column; gap: 8px; }
    .tab-bar { overflow-x: auto; }
    .stats-cards { flex-wrap: wrap; }
    .stat-card { min-width: 90px; }
}

/* ============================================================ */
/* ORDERS TAB                                                   */
/* ============================================================ */
.orders-toolbar {
    display: flex; justify-content: space-between; align-items: center;
    gap: 12px; padding: 12px 16px;
}
.orders-toolbar-left { display: flex; align-items: center; gap: 8px; }
.orders-toolbar-right { display: flex; align-items: center; gap: 8px; }
.orders-sync-status { color: #666; font-size: 13px; }
.orders-sync-status.running { color: #2563eb; font-weight: 600; }
.orders-sync-status.error { color: #dc2626; font-weight: 600; }
.orders-sync-status.done { color: #059669; font-weight: 600; }

.orders-subnav {
    display: flex; gap: 4px; border-bottom: 2px solid #e5e7eb;
    margin: 0 16px 16px; padding: 0;
}
.orders-subtab {
    background: none; border: none; padding: 10px 18px; font-size: 14px; color: #6b7280;
    cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px;
    font-weight: 500;
}
.orders-subtab:hover { color: #111827; background: #f3f4f6; }
.orders-subtab.active { color: #2563eb; border-bottom-color: #2563eb; font-weight: 600; }
.orders-subcontent { display: none; padding: 0 16px 16px; }
.orders-subcontent.active { display: block; }

/* ===== RANGE BAR ===== */
.orders-rangebar {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--space-3);
    background: var(--color-surface-alt);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-2);
    flex-wrap: wrap;
}
.orders-range-presets {
    display: flex; align-items: center; gap: var(--space-1);
    flex-wrap: wrap;
}
.orders-range-divider {
    width: 1px; height: 20px;
    background: var(--color-border-strong);
    margin: 0 var(--space-2);
}
.orders-range-btn {
    background: transparent;
    border: 1px solid transparent;
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-md);
    border-radius: var(--radius-md);
    cursor: pointer;
    color: #374151;
    transition: all var(--transition-fast);
}
.orders-range-btn:hover {
    background: var(--color-surface);
    border-color: var(--color-border-strong);
}
.orders-range-btn.active {
    background: var(--color-fg);
    color: var(--color-surface);
    border-color: var(--color-fg);
    font-weight: 500;
}
.orders-range-custom {
    display: flex; align-items: center; gap: var(--space-2);
}
.orders-range-custom input[type="date"] {
    padding: 5px var(--space-2);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-md);
    font-size: var(--text-md);
    background: var(--color-surface);
}
.orders-range-meta {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: var(--space-4);
    padding: 0 var(--space-1);
    font-size: var(--text-md);
}
.orders-range-summary { color: #4b5563; font-weight: 500; }
.orders-range-summary .vs {
    color: var(--color-fg-subtle);
    margin-left: var(--space-2);
    font-weight: 400;
}
.orders-range-granularity { color: var(--color-fg-muted); }
.orders-range-granularity select {
    padding: var(--space-1) var(--space-2);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-md);
    font-size: var(--text-md);
    background: var(--color-surface);
    margin-left: var(--space-1);
}

/* ===== KPI CARDS — univerzální dashboard pattern =====
   Použít kdekoliv v dashboardu (Statistiky, Objednávky, atd.).
   .orders-kpi-card a .orders-kpi-grid jsou aliasy pro zpětnou kompatibilitu. */
.kpi-grid,
.orders-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}
.kpi-card,
.orders-kpi-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-5);
    transition: box-shadow var(--transition-base), transform var(--transition-fast);
    position: relative;
    overflow: hidden;
}
.kpi-card:hover,
.orders-kpi-card:hover { box-shadow: var(--shadow-md); }

.kpi-card .kpi-label,
.orders-kpi-card .kpi-label {
    color: var(--color-fg-muted);
    font-size: var(--text-sm);
    font-weight: 500;
    letter-spacing: 0.02em;
    margin-bottom: var(--space-2);
    display: flex; align-items: center; gap: var(--space-2);
}
.kpi-card .kpi-icon,
.orders-kpi-card .kpi-label .kpi-icon {
    width: 20px; height: 20px;
    border-radius: var(--radius-sm);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: var(--text-sm);
}
.kpi-card .kpi-value,
.orders-kpi-card .kpi-value {
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--color-fg);
    line-height: var(--leading-tight);
    font-variant-numeric: tabular-nums;
}
.kpi-card .kpi-unit,
.orders-kpi-card .kpi-value .kpi-unit {
    font-size: var(--text-base);
    color: var(--color-fg-muted);
    font-weight: 500;
    margin-left: var(--space-1);
}
.kpi-card .kpi-sub,
.orders-kpi-card .kpi-sub {
    color: var(--color-fg-muted);
    font-size: var(--text-sm);
    margin-top: var(--space-2);
    display: flex; align-items: center; gap: var(--space-2);
    flex-wrap: wrap;
}

/* Delta badge — používá se i mimo KPI karty */
.kpi-delta {
    font-size: var(--text-sm);
    font-weight: 600;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    display: inline-flex; align-items: center; gap: 2px;
}
.kpi-delta.up { color: var(--color-success); background: var(--color-success-bg); }
.kpi-delta.down { color: var(--color-danger); background: var(--color-danger-bg); }
.kpi-delta.neutral { color: var(--color-neutral); background: var(--color-neutral-bg); }

/* Accent variants — barevná ikona vlevo nahoře */
.kpi-card.accent-green .kpi-icon,
.orders-kpi-card.accent-green .kpi-icon { background: var(--color-success-bg); color: var(--color-success); }
.kpi-card.accent-blue .kpi-icon,
.orders-kpi-card.accent-blue .kpi-icon { background: var(--color-accent-bg); color: var(--color-accent); }
.kpi-card.accent-purple .kpi-icon,
.orders-kpi-card.accent-purple .kpi-icon { background: var(--color-info-bg); color: var(--color-info); }
.kpi-card.accent-red .kpi-icon,
.orders-kpi-card.accent-red .kpi-icon { background: var(--color-danger-bg); color: var(--color-danger); }
.kpi-card.accent-amber .kpi-icon,
.orders-kpi-card.accent-amber .kpi-icon { background: var(--color-warning-bg); color: var(--color-warning); }
.kpi-card.accent-gray .kpi-icon,
.orders-kpi-card.accent-gray .kpi-icon { background: var(--color-neutral-bg); color: var(--color-neutral); }

.orders-chart-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    box-shadow: var(--shadow-xs);
    margin-bottom: var(--space-4);
}
.orders-chart-card h4 {
    margin: 0 0 var(--space-3);
    color: #374151;
    font-size: var(--text-base);
    font-weight: 600;
}

.orders-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 1024px) { .orders-cols { grid-template-columns: 1fr; } }

.orders-status-row {
    display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid #f3f4f6;
}
.orders-status-pill {
    display: inline-block; padding: 2px 8px;
    border-radius: var(--radius-sm); color: #fff;
    font-size: var(--text-sm); font-weight: 600;
    min-width: 100px; text-align: center;
}
.orders-status-row .stat-val { margin-left: auto; color: #111827; font-weight: 600; }
.orders-status-row .stat-rev { color: #6b7280; font-size: 12px; }

.orders-brand-mini { padding: 6px 0; border-bottom: 1px solid #f3f4f6; }
.orders-brand-mini .brand-bar {
    height: 6px; background: #2563eb; border-radius: 3px; margin-top: 4px;
}

/* Orders list table */
.orders-list-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.orders-list-table th {
    text-align: left; padding: 8px 10px; background: #f9fafb; font-weight: 600; color: #374151;
    border-bottom: 1px solid #e5e7eb; position: sticky; top: 0; z-index: 1;
    white-space: nowrap;
}
.orders-list-table td {
    padding: 8px 10px; border-bottom: 1px solid #f3f4f6; vertical-align: middle;
    white-space: nowrap;
}
/* single-line: dlouhé názvy zkrátit ellipsis místo zalamování */
.orders-list-table td.name-cell { max-width: 340px; overflow: hidden; text-overflow: ellipsis; }
/* detail objednávky (rozbalený řádek) smí zalamovat */
.orders-list-table .expand-row td,
.orders-list-table .items-table th,
.orders-list-table .items-table td { white-space: normal; }
.orders-list-table tr:hover td { background: #f9fafb; }
.orders-list-table .expand-row td {
    background: #f9fafb; padding: 12px 16px 16px;
}
.orders-list-table .items-table { width: 100%; font-size: 12px; border-collapse: collapse; }
.orders-list-table .items-table th { background: #f3f4f6; padding: 6px 8px; font-size: 11px; }
.orders-list-table .items-table td { padding: 4px 8px; border-bottom: 1px solid #e5e7eb; }
.orders-list-table .expand-trigger {
    background: none; border: none; cursor: pointer; color: #2563eb; padding: 0 4px;
}
.orders-list-table .profit-pos { color: #059669; font-weight: 600; }
.orders-list-table .profit-neg { color: #dc2626; font-weight: 600; }
.orders-list-table .ms5-tag { color: #9ca3af; font-style: italic; font-size: 11px; }

/* Heatmap */
.heatmap-table { border-collapse: collapse; font-size: 11px; }
.heatmap-table th, .heatmap-table td {
    border: 1px solid #e5e7eb; padding: 4px 6px; text-align: center; min-width: 28px;
}
.heatmap-table th { background: #f9fafb; font-weight: 600; }
.heatmap-cell { color: #fff; font-weight: 500; }

/* Status admin */
.status-admin-row {
    display: grid; grid-template-columns: 80px 1fr 80px 120px 80px 80px 80px;
    gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid #f3f4f6;
}
.status-admin-row input, .status-admin-row select {
    padding: 4px 6px; border: 1px solid #d1d5db; border-radius: 4px; font-size: 12px;
}
.status-color-swatch {
    width: 24px; height: 24px; border-radius: 4px; border: 1px solid #d1d5db; cursor: pointer;
}

/* ════════════════════════════════════════════════════════════════
   PRICE STRATEGY — modal pro výběr důvodu změny ceny + ikony v tabulce
   ═══════════════════════════════════════════════════════════════ */
.strategy-modal-backdrop {
    position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999; backdrop-filter: blur(2px);
    animation: strategyFadeIn 0.15s ease-out;
}
@keyframes strategyFadeIn { from { opacity: 0; } to { opacity: 1; } }
.strategy-modal {
    background: #fff; border-radius: var(--radius-lg, 12px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    width: min(480px, 92vw); padding: var(--space-6, 24px);
    font-family: var(--font-sans, system-ui);
}
.strategy-modal-title {
    margin: 0 0 var(--space-2, 8px) 0;
    font-size: var(--text-lg, 17px); font-weight: 600;
    color: var(--color-fg, #0f172a);
}
.strategy-modal-subtitle {
    margin: 0 0 var(--space-5, 20px) 0;
    font-size: var(--text-sm, 13px);
    color: var(--color-fg-muted, #64748b);
}
.strategy-options {
    display: flex; flex-direction: column; gap: var(--space-2, 8px);
    margin-bottom: var(--space-5, 20px);
}
.strategy-option {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 10px 12px; border: 2px solid #e5e7eb; border-radius: 8px;
    cursor: pointer; transition: all 0.12s;
}
.strategy-option:hover { background: #f9fafb; border-color: #cbd5e1; }
.strategy-option input[type=radio] { margin-top: 3px; cursor: pointer; }
.strategy-option.checked { border-color: var(--color-accent, #2563eb); background: #eff6ff; }
.strategy-option-text { display: flex; flex-direction: column; flex: 1; }
.strategy-option-label { font-weight: 600; color: var(--color-fg, #0f172a); font-size: 14px; }
.strategy-option-desc { color: var(--color-fg-muted, #64748b); font-size: 12px; margin-top: 2px; }
.strategy-modal-actions {
    display: flex; gap: 8px; justify-content: flex-end;
}
.strategy-modal-actions button {
    padding: 8px 16px; border-radius: 6px; font-size: 14px; font-weight: 500;
    cursor: pointer; border: 1px solid transparent;
}
.strategy-btn-cancel { background: #f3f4f6; color: #374151; border-color: #d1d5db; }
.strategy-btn-cancel:hover { background: #e5e7eb; }
.strategy-btn-confirm { background: var(--color-accent, #2563eb); color: #fff; }
.strategy-btn-confirm:hover { filter: brightness(0.95); }

/* ════════════════════════════════════════════════════════════════
   "SCRAPNUTO" sloupec + chips filtr stáří scrapingu v PRICER
   ═══════════════════════════════════════════════════════════════ */
.scraped-at-cell { display: inline-block; padding: 1px 6px; border-radius: 4px; font-size: 11px; white-space: nowrap; }
.scraped-fresh   { background: #dcfce7; color: #166534; font-weight: 600; }   /* < 1 d — zelená */
.scraped-recent  { background: #ecfccb; color: #3f6212; }                     /* 1-2 d — světle zelená */
.scraped-aging   { background: #fef3c7; color: #92400e; }                     /* 2-7 d — žlutá */
.scraped-old     { background: #f3f4f6; color: #6b7280; }                     /* > 7 d — šedá */
.scraped-never   { color: #9ca3af; font-style: italic; }

/* Chips: filtr stáří scrapingu (nad "Scrapovat seznam") */
.scrape-age-bar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 10px 14px; margin: 8px 0;
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px;
    font-size: 13px;
}
.scrape-age-bar-label {
    font-weight: 600; color: var(--color-fg, #0f172a); margin-right: 4px;
}
.scrape-age-chip {
    display: inline-flex; flex-direction: column; align-items: center;
    padding: 4px 12px; border-radius: 18px;
    background: #fff; border: 1.5px solid #cbd5e1;
    cursor: pointer; transition: all 0.15s;
    min-width: 52px; line-height: 1.15;
    user-select: none;
}
.scrape-age-chip:hover { border-color: #94a3b8; background: #f1f5f9; }
.scrape-age-chip.active {
    background: var(--color-accent, #2563eb); border-color: var(--color-accent, #2563eb); color: #fff;
}
.scrape-age-chip-label { font-weight: 600; font-size: 12px; }
.scrape-age-chip-count { font-size: 10px; opacity: 0.85; }
.scrape-age-chip-desc  { font-size: 10px; color: var(--color-fg-muted, #64748b); margin-top: 2px; }
.scrape-age-chip.active .scrape-age-chip-desc { color: rgba(255,255,255,0.85); }

.scrape-age-custom { display: inline-flex; align-items: center; gap: 6px; margin-left: 4px; }
.scrape-age-custom input {
    width: 56px; padding: 4px 6px; border: 1px solid #cbd5e1; border-radius: 4px;
    font-size: 12px; text-align: right;
}
.scrape-age-clear {
    background: none; border: none; color: var(--color-fg-muted, #64748b);
    cursor: pointer; font-size: 12px; padding: 4px 8px;
}
.scrape-age-clear:hover { color: var(--color-danger, #dc2626); text-decoration: underline; }

/* ════════════════════════════════════════════════════════════════
   FLOATING SCRAPING BADGE — vidět průběh z libovolného tabu
   ═══════════════════════════════════════════════════════════════ */
#scrapingFloatingBadge {
    position: fixed; top: 70px; right: 16px; z-index: 9000;
    display: none; align-items: center; gap: 10px;
    padding: 10px 14px;
    background: #fef3c7; border: 1px solid #fcd34d; color: #92400e;
    border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    font-size: 13px; font-family: var(--font-sans, system-ui);
    cursor: pointer;
    animation: scrapingPulse 2s ease-in-out infinite;
    user-select: none;
}
#scrapingFloatingBadge.visible { display: inline-flex; }
#scrapingFloatingBadge .spin {
    display: inline-block; width: 14px; height: 14px;
    border: 2px solid #fcd34d; border-top-color: #92400e;
    border-radius: 50%; animation: scrapingSpin 1s linear infinite;
}
@keyframes scrapingSpin { to { transform: rotate(360deg); } }
@keyframes scrapingPulse {
    0%, 100% { box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
    50% { box-shadow: 0 4px 20px rgba(220, 152, 0, 0.35); }
}

/* ════════════════════════════════════════════════════════════════
   SELECT-ALL BANNER — GitHub-style nabídka rozšířit výběr napříč stránkami
   ═══════════════════════════════════════════════════════════════ */
.select-all-banner {
    display: flex; align-items: center; gap: var(--space-3, 12px);
    padding: 10px 14px; margin: 8px 0;
    background: #eff6ff; border: 1px solid #bfdbfe;
    border-radius: var(--radius-md, 6px);
    font-size: 13px; color: #1e40af;
    animation: selectAllSlide 0.2s ease-out;
}
@keyframes selectAllSlide { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; } }
.select-all-banner.expanded { background: #f0fdf4; border-color: #86efac; color: #166534; }
.select-all-banner button { padding: 5px 10px; font-size: 12px; }

/* Mini ikona u sloupce "Vlastní cena" */
.price-strategy-icon {
    display: inline-block; font-size: 12px; margin-right: 3px; opacity: 0.85;
    cursor: help; vertical-align: middle;
}
.price-strategy-icon[data-strategy="pricing"]         { color: #2563eb; }   /* 🎯 modrá - autopricing */
.price-strategy-icon[data-strategy="conversion_test"] { color: #ea580c; }   /* 💸 oranžová - test */
.price-strategy-icon[data-strategy="clearance"]       { color: #16a34a; }   /* 📦 zelená - výprodej */
.price-strategy-icon[data-strategy="manual"]          { color: #64748b; }   /* ✋ šedá - ručně */



/* ===== LISTING TAB (interní katalog dlaždic) ===== */
.listing-actionbar { display:flex; align-items:center; gap:12px; flex-wrap:wrap;
    background:#f3f4f6; border:1px solid #e5e7eb; border-radius:8px; padding:8px 12px; margin-bottom:12px; font-size:13px; }
.listing-selcount { font-weight:600; color:#185fa5; }
.listing-actionbar.has-sel { background:#e6f1fb; border-color:#85b7eb; }
.listing-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:14px; margin-bottom:16px; }
.lcard { background:#fff; border:1px solid #e6e3db; border-radius:12px; overflow:hidden; box-shadow:0 1px 3px rgba(0,0,0,.06);
    display:flex; flex-direction:column; position:relative; transition:border-color .12s, box-shadow .12s; }
.lcard.sel { border-color:#185fa5; box-shadow:0 0 0 2px #85b7eb; }
.lcard .lsel { position:absolute; top:8px; left:8px; z-index:2; width:20px; height:20px; cursor:pointer; accent-color:#185fa5; }
.lcard .limg { aspect-ratio:4/3; background:#fff; display:flex; align-items:center; justify-content:center; padding:10px; border-bottom:1px solid #f0efe9; cursor:pointer; }
.lcard .limg img { max-width:100%; max-height:100%; object-fit:contain; }
.lcard .limg .noimg { color:#bbb; font-size:12px; }
.lcard .lbody { padding:10px 12px 12px; display:flex; flex-direction:column; gap:6px; flex:1; }
.lcard .lname { font-size:13px; font-weight:600; line-height:1.3; margin:0; min-height:34px; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.lcard .lmeta { display:flex; align-items:center; gap:6px; flex-wrap:wrap; font-size:11px; color:#6b7280; }
.lcard .lsize { background:#fbe7cf; color:#9a5b00; font-weight:700; border-radius:6px; padding:1px 7px; }
.lcard .lean { font-variant-numeric:tabular-nums; }
.lcard .lcat { background:#eef; color:#534ab7; border-radius:6px; padding:1px 7px; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.lcard .lprices { margin-top:auto; border-top:1px solid #f0efe9; padding-top:7px; display:grid; grid-template-columns:1fr 1fr; gap:4px 8px; font-size:12px; }
.lcard .lp-lbl { color:#9ca3af; font-size:10px; text-transform:uppercase; letter-spacing:.3px; }
.lcard .lp-sell { color:#0f6e56; font-weight:700; font-size:15px; }
.lcard .lp-buy { color:#7a776f; font-weight:600; }
.lcard .lp-margin { font-weight:700; }
.lcard .lp-margin.good { color:#0f6e56; } .lcard .lp-margin.mid { color:#b8860b; } .lcard .lp-margin.bad { color:#c0392b; }
.lcard .lstock { color:#6b7280; }
.listing-pill { font-size:13px; padding:5px 12px; border:1px solid #e5e7eb; background:#fff; border-radius:999px; cursor:pointer; }
.listing-pill.active { background:#185fa5; border-color:#185fa5; color:#fff; font-weight:600; }
.listing-pill .c { opacity:.7; margin-left:4px; }

/* ===== KANONICKÁ stránkovací komponenta (ui-common.js uiPaginate) – JEDNA pro celý projekt ===== */
.pager { display:flex; align-items:center; gap:4px; flex-wrap:wrap; padding:10px 0; font-size:13px; }
.pager-info { color:#6b7280; margin-right:10px; }
.pager-btn { min-width:30px; height:30px; padding:0 8px; border:1px solid #e5e7eb; background:#fff; border-radius:7px; cursor:pointer; color:#374151; font-size:13px; }
.pager-btn:hover { border-color:#2563eb; color:#2563eb; }
.pager-btn.active { background:#2563eb; border-color:#2563eb; color:#fff; font-weight:600; }
.pager-dots { padding:0 4px; color:#9ca3af; }
