/* ============================================================
   SKIPPY ADMIN – badm-* prefix, BEM konvence
   blok:       badm-blok
   element:    badm-blok__element
   modifier:   badm-blok--modifier / badm-blok__element--modifier
   ============================================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    /* -- Font -- */
    --badm-font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;

    /* -- Pozadi a povrchy (Neutral paleta) -- */
    --badm-bg: #fafafa;
    --badm-surface: #ffffff;
    --badm-surface-hover: #f5f5f5;

    /* -- Text (Neutral paleta) -- */
    --badm-text: #0a0a0a;
    --badm-text-muted: #737373;

    /* -- Hranice a vstup (Neutral paleta) -- */
    --badm-border: #e5e5e5;
    --badm-input: #e5e5e5;
    --badm-ring: #360066;

    /* -- Primarni (Skippy purple) -- */
    --badm-primary: #360066;
    --badm-primary-hover: #1e0032;
    --badm-primary-light: #c8addf;
    --badm-primary-foreground: #fff;

    /* -- Sekundarni (Skippy yellow) -- */
    --badm-secondary: #ffdc00;
    --badm-secondary-hover: #ffba20;
    --badm-secondary-foreground: #151515;

    /* -- Accent -- */
    --badm-accent: #f5f5f5;
    --badm-accent-foreground: #0a0a0a;

    /* -- Stavove barvy (Skippy paleta) -- */
    --badm-success: #2BA83E;
    --badm-success-light: #edf8f5;
    --badm-danger: #D25339;
    --badm-danger-light: #fceef0;
    --badm-warning: #ffba20;
    --badm-warning-light: #fffbeb;
    --badm-info: #4bb9d7;
    --badm-info-light: #f3fafc;

    /* -- Grafy -- */
    --badm-chart-1: #360066;
    --badm-chart-2: #4bb9d7;
    --badm-chart-3: #2BA83E;
    --badm-chart-4: #B1739E;
    --badm-chart-5: #ffba20;

    /* -- Layout (Mira = kompaktni) -- */
    --badm-radius: 6px;
    --badm-radius-sm: 4px;
    --badm-radius-lg: 10px;
    --badm-shadow: 0 1px 2px rgba(0,0,0,.05);
    --badm-shadow-lg: 0 4px 12px rgba(0,0,0,.08);
    --badm-gap: 16px;
    --badm-sidebar-width: 192px;
}

/* ---------- Button vypadajici jako inline link ----------
   Pouziti tam, kde semanticky potrebujeme <button> (ne navigace na URL),
   ale vizualne ma pusobit jako text-link (napr. uvnitr vety, v info panelu). */
.badm-btn-link {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    color: var(--badm-primary);
    cursor: pointer;
    text-decoration: none;
}
.badm-btn-link:hover { color: var(--badm-primary-hover); text-decoration: underline; }

/* ---------- Back link (sdilena navigace zpet) ----------
   Pouziti nad .badm-page-header na sub-strance / detail strance.
   Vyhradne pro navigaci na primy nadrazeny seznam (Bible -> slozky,
   Orders -> Order detail). Vice viz docs/styles.md. */
.badm-back-link {
    display: inline-block;
    font-size: 12px;
    font-weight: 500;
    color: var(--badm-primary);
    text-decoration: none;
    margin-bottom: 12px;
}
.badm-back-link:hover {
    text-decoration: underline;
}

/* ---------- Skeleton loading (sdilena komponenta) ----------
   Pouziti: .badm-skeleton pro loading placeholder (shimmer animace).
   Pridat tridu .is-loaded kdyz je obsah nacten (nebo odebrat .badm-skeleton).
   Pracuje jako pozadi – obsah (img, text) se nad nim kresli normalne. */
.badm-skeleton {
    background: linear-gradient(110deg, rgba(0,0,0,.03) 30%, rgba(0,0,0,.08) 50%, rgba(0,0,0,.03) 70%);
    background-size: 200% 100%;
    animation: badm-skeleton-shimmer 1.4s linear infinite;
}
.badm-skeleton.is-loaded { background: none; animation: none; }
@keyframes badm-skeleton-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ---------- Body / Shell ---------- */
.badm {
    font-family: var(--badm-font);
    font-size: 12px;
    line-height: 1.45;
    color: var(--badm-text);
    background: var(--badm-bg);
    min-height: 100vh;
}

/* Globalni odkazy – oranzove dle --badm-primary
   :where() = 0 specificita, kazda komponenta s vlastnim colorem prepise (sidebar, card__link, btn...) */
:where(.badm) a { color: var(--badm-primary); text-decoration: none; }
:where(.badm) a:hover { color: var(--badm-primary-hover); text-decoration: underline; }

.badm-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ---------- Layout (sidebar + main) ---------- */
.badm-layout {
    display: flex;
    flex: 1;
    min-height: 0;
    background: var(--badm-bg);
}

/* ---------- Sidebar ---------- */
.badm-sidebar {
    width: var(--badm-sidebar-width);
    flex-shrink: 0;
    background: #0a0a0a;
    border-right: 1px solid #262626;
    overflow-y: auto;
    padding: 12px 0;
    position: sticky;
    top: 48px;
    height: calc(100vh - 48px);
}

.badm-sidebar__nav {
    display: flex;
    flex-direction: column;
}

.badm-sidebar__group {
    margin-bottom: 4px;
}

.badm-sidebar__group-title {
    padding: 12px 16px 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #525252;
}

.badm-sidebar__link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 16px;
    font-size: 12px;
    color: #a3a3a3;
    text-decoration: none;
    transition: background .15s, color .15s;
    border-left: 2px solid transparent;
}

.badm-sidebar__link:hover {
    background: #171717;
    color: #e5e5e5;
}

.badm-sidebar__link--active {
    background: #171717;
    color: #fff;
    border-left-color: var(--badm-primary);
}

.badm-sidebar__link--disabled {
    color: #404040;
    pointer-events: none;
    opacity: .5;
}

.badm-sidebar__link i {
    width: 16px;
    text-align: center;
    font-size: 13px;
    flex-shrink: 0;
}

.badm-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 149;
}
.badm-sidebar-backdrop.is-visible {
    display: block;
}

/* ---------- Header ---------- */
.badm-header {
    display: flex;
    align-items: center;
    gap: var(--badm-gap);
    padding: 0 var(--badm-gap);
    height: 48px;
    background: #0a0a0a;
    border-bottom: 1px solid #262626;
    box-shadow: none;
    position: sticky;
    top: 0;
    z-index: 100;
}

.badm-header__brand { flex-shrink: 0; }

.badm-header__logo {
    font-weight: 700;
    font-size: 14px;
    letter-spacing: -.3px;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.badm-header__mascot {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
}

.badm-header__dev {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    background: #f59e0b;
    color: #fff;
    padding: 1px 4px;
    border-radius: 3px;
    vertical-align: middle;
    letter-spacing: .5px;
}

.badm-header--dev {
    background: #360066;
    border-bottom-color: #360066;
}
.badm-header--dev .badm-header__logo { color: #ffdc00; }
.badm-header--dev .badm-header__user-name { color: #ffdc00; }
.badm-header--dev .badm-header__user-name:hover { color: #ffba20; }
.badm-header--dev .badm-header__logout { color: #ffdc00; }
.badm-header--dev .badm-header__logout:hover { color: #ffba20; }
.badm-header--dev .badm-header__dev { background: #ffdc00; color: #360066; }

.badm-header__user {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
}

.badm-header__user-name {
    color: #a3a3a3;
    text-decoration: none;
}
.badm-header__user-name:hover { color: #fff; text-decoration: underline; }

.badm-header__logout {
    color: var(--badm-primary);
    text-decoration: none;
    font-weight: 500;
}
.badm-header__logout:hover { color: var(--badm-primary-hover); text-decoration: underline; }

/* ---------- Nav ---------- */
.badm-nav {
    display: flex;
    gap: 2px;
    align-items: center;
}

.badm-nav__link {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--badm-radius);
    font-size: 12px;
    font-weight: 500;
    color: var(--badm-text-muted);
    text-decoration: none;
    transition: background .15s, color .15s;
}
.badm-nav__link:hover {
    background: var(--badm-bg);
    color: var(--badm-text);
}
.badm-nav__link--active {
    background: var(--badm-primary);
    color: #fff;
}
.badm-nav__link--active:hover {
    background: var(--badm-primary-hover);
    color: #fff;
}

/* ---------- Main ---------- */
.badm-main {
    position: relative;
    flex: 1;
    min-width: 0;
    padding: var(--badm-gap);
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

/* ---------- Buttons ---------- */
.badm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4em;
    padding: 5px 12px;
    border-radius: var(--badm-radius);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    font-family: var(--badm-font);
    line-height: 1.4;
    transition: background .15s, border-color .15s, box-shadow .15s;
    white-space: nowrap;
}

.badm-btn--sm {
    padding: 4px 8px;
    font-size: 11px;
    height: 26px;
    box-sizing: border-box;
}

.badm-btn--small {
    font-size: 11px;
    padding: 3px 8px;
    height: 24px;
}

.badm-btn--primary {
    background: var(--badm-primary);
    color: #fff;
}
.badm-btn--primary:hover {
    background: var(--badm-primary-hover);
}

.badm-btn--success {
    background: #16a34a;
    color: #fff;
}
.badm-btn--success:hover {
    background: #15803d;
}

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

.badm-btn--danger {
    background: #dc2626;
    color: #fff;
}
.badm-btn--danger:hover {
    background: #b91c1c;
}

.badm-btn--icon {
    padding: 4px;
    width: 28px;
    height: 28px;
    background: var(--badm-surface);
    color: var(--badm-text-secondary, #6b7280);
    border-color: var(--badm-border);
    border-radius: var(--badm-radius);
}
.badm-btn--icon:hover {
    background: var(--badm-bg);
    color: var(--badm-text);
}
.badm-btn--icon.badm-btn--sm {
    width: 24px;
    height: 24px;
    padding: 2px;
    font-size: 11px;
}

/* ---------- Forms (global) ---------- */

/* Honeypot */
.badm-hp {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.badm input[type="text"],
.badm input[type="email"],
.badm input[type="password"],
.badm input[type="number"],
.badm input[type="search"],
.badm input[type="tel"],
.badm input[type="url"],
.badm input[type="date"],
.badm input[type="datetime-local"],
.badm input[type="time"],
.badm select,
.badm textarea {
    display: block;
    width: 100%;
    padding: 5px 8px;
    border: 1px solid var(--badm-border);
    border-radius: var(--badm-radius);
    font-size: 12px;
    font-family: var(--badm-font);
    line-height: 1.4;
    color: var(--badm-text);
    background: var(--badm-surface);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    -webkit-appearance: none;
    appearance: none;
}

.badm input[type="text"]:focus,
.badm input[type="email"]:focus,
.badm input[type="password"]:focus,
.badm input[type="number"]:focus,
.badm input[type="search"]:focus,
.badm input[type="tel"]:focus,
.badm input[type="url"]:focus,
.badm input[type="date"]:focus,
.badm input[type="datetime-local"]:focus,
.badm input[type="time"]:focus,
.badm select:focus,
.badm textarea:focus {
    border-color: var(--badm-primary);
    box-shadow: 0 0 0 2px var(--badm-primary-light);
}

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

.badm input:disabled,
.badm select:disabled,
.badm textarea:disabled {
    background: var(--badm-bg);
    color: var(--badm-text-muted);
    cursor: not-allowed;
}

.badm-textarea--mono {
    width: 100%;
    font-family: monospace;
    font-size: .8rem;
    padding: .5rem;
    border: 1px solid var(--badm-border);
    border-radius: var(--badm-radius);
    resize: vertical;
}

.badm select {
    padding-right: 30px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%236b7a8d' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 10px;
}

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

/* ---------- Switch (segmented control) ---------- */
.badm-switch {
    display: inline-flex;
    gap: 2px;
    background: #e5e5e5;
    border-radius: 5px;
    padding: 2px;
}
.badm-switch__item {
    padding: 4px 12px;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    border-radius: 3px;
    border: none;
    background: none;
    color: #555;
    white-space: nowrap;
    transition: background .15s, color .15s;
    font-family: var(--badm-font);
}
.badm-switch__item input { display: none; }
.badm-switch__item.is-active,
.badm-switch__item:has(input:checked) {
    background: var(--badm-primary);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0,0,0,.15);
}

.badm input[type="checkbox"],
.badm input[type="radio"] {
    accent-color: var(--badm-primary);
}

.badm label:not(.badm-checkbox):not(.badm-switch__item):not(.badm-nl__subject-item) {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--badm-text);
    margin-bottom: 3px;
}

.badm-form-group {
    margin-bottom: 10px;
}

.badm-form-hint {
    font-size: 10px;
    color: var(--badm-text-muted);
    margin-top: 2px;
}

.badm-input--compact,
.badm select.badm-input--compact {
    width: auto;
    min-width: 160px;
}

/* ---------- Form grid (2 sloupce na desktopu) ---------- */
.badm-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0 var(--badm-gap);
    max-width: 560px;
}

@media (min-width: 640px) {
    .badm-form-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.badm-form-grid__footer {
    grid-column: 1 / -1;
    padding-top: 4px;
}

/* ---------- Page Header & Title ---------- */
.badm-page-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: var(--badm-gap);
    flex-wrap: wrap;
}

.badm-page-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 var(--badm-gap);
}

.badm-page-header .badm-page-title {
    margin-bottom: 0;
}

/* ---------- Box (stat karticky) ---------- */
.badm-box-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: var(--badm-gap);
}

.badm-box {
    background: var(--badm-surface);
    border: 1px solid var(--badm-border);
    border-radius: var(--badm-radius);
    padding: 12px 16px;
    text-align: center;
    min-width: 120px;
}

.badm-box__value {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.badm-box__label {
    display: block;
    font-size: 11px;
    color: var(--badm-text-muted);
    margin-top: 2px;
}

/* Toggle – klikaci box ovladajici graf */
.badm-box--toggle {
    cursor: pointer;
    transition: box-shadow .15s, opacity .15s;
    user-select: none;
    opacity: .5;
}

.badm-box--toggle.is-active {
    opacity: 1;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

.badm-box--toggle:not(.is-active):hover {
    opacity: .8;
}

/* Barevne modifikatory */
.badm-box--accent {
    border-color: var(--badm-primary);
    border-width: 2px;
}

.badm-box--positive {
    border-color: var(--badm-success);
    border-width: 2px;
}
.badm-box--positive .badm-box__value { color: var(--badm-success); }

.badm-box--negative {
    border-color: var(--badm-danger);
    border-width: 2px;
}
.badm-box--negative .badm-box__value { color: var(--badm-danger); }

.badm-box--warn .badm-box__value { color: var(--badm-danger); }

/* Porovnani (delty) */
.badm-box__comps {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 6px;
}

.badm-box__comp {
    text-align: center;
}

.badm-box__comp .badm-table__delta {
    display: block;
    font-size: .72rem;
}

.badm-box__comp-abs {
    display: block;
    font-size: .68rem;
    color: #374151;
    white-space: nowrap;
}

/* Warn text pod boxem */
.badm-box__warn {
    color: var(--badm-danger);
    font-size: 10px;
    margin-top: 4px;
}

/* ---------- Card ---------- */
.badm-card {
    background: var(--badm-surface);
    border: 1px solid var(--badm-border);
    border-radius: var(--badm-radius);
    padding: var(--badm-gap);
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: var(--badm-gap);
    transition: box-shadow .15s;
}
.badm-half-grid .badm-card { margin-bottom: 0; }
.badm-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
}

.badm-card__title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 12px;
}

.badm-card__text {
    color: var(--badm-text-muted);
    font-size: 12px;
    flex: 1;
}

.badm-card__link {
    font-size: 12px;
    font-weight: 500;
    color: var(--badm-primary);
    text-decoration: none;
}
.badm-card__link:hover { text-decoration: underline; }
.badm-card__subtitle { font-size: .85rem; font-weight: 600; color: #374151; margin: 14px 0 8px; }
.badm-card__note { font-size: .78rem; color: var(--badm-text-muted); margin: -8px 0 14px; }

/* badm-card extensions – header s ikonou, meta text, action row */
.badm-card__header { display: flex; align-items: center; gap: .75rem; margin-bottom: .5rem; font-weight: 600; font-size: .95rem; flex-wrap: wrap; }
.badm-card__icon { font-size: 1.3rem; width: 1.8rem; text-align: center; flex-shrink: 0; }
.badm-card__meta { font-size: .8rem; color: var(--badm-text-muted); margin-bottom: .6rem; line-height: 1.6; }
.badm-card__actions { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .75rem; }
.badm-card__actions--stack { flex-direction: column; align-items: stretch; }
.badm-card__actions--stack .badm-btn { justify-content: flex-start; }

/* Barevne modifikatory karty – border-left pro stavove podbarveni */
.badm-card--warn   { border-left: 4px solid #f59e0b; }
.badm-card--danger { border-left: 4px solid #ef4444; background: #fff5f5; }
.badm-card--ok     { border-left: 4px solid #22c55e; }

/* ---------- Card stack – vertikalni seznam karet ---------- */
.badm-card-stack { display: flex; flex-direction: column; gap: 12px; margin-top: var(--badm-gap); }
.badm-card-stack .badm-card { margin-bottom: 0; }

/* ---------- Half grid – 2-sloupcovy layout pro karty ---------- */
.badm-half-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--badm-gap); margin-bottom: var(--badm-gap); }
@media (max-width: 900px) { .badm-half-grid { grid-template-columns: 1fr; } }

/* ---------- Third grid – 3-sloupcovy layout pro karty ---------- */
.badm-third-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--badm-gap); margin-bottom: var(--badm-gap); }
.badm-third-grid .badm-card { margin-bottom: 0; }
.badm-third-grid .badm-box { min-width: 0; flex: 1 1 0; }
@media (max-width: 1100px) { .badm-third-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) { .badm-third-grid { grid-template-columns: 1fr; } }

/* ---------- Quarter grid – 4-sloupcovy layout pro karty ---------- */
.badm-quarter-grid { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: var(--badm-gap); margin-bottom: var(--badm-gap); }
.badm-quarter-grid .badm-card { margin-bottom: 0; }
.badm-quarter-grid .badm-box { min-width: 0; flex: 1 1 0; }
@media (max-width: 1200px) { .badm-quarter-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .badm-quarter-grid { grid-template-columns: 1fr; } }

/* ---------- Fifth grid – 5-sloupcovy layout pro karty ---------- */
.badm-fifth-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--badm-gap); margin-bottom: var(--badm-gap); }
.badm-fifth-grid .badm-card { margin-bottom: 0; }
.badm-fifth-grid .badm-box { min-width: 0; flex: 1 1 0; }
@media (max-width: 1400px) { .badm-fifth-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px)  { .badm-fifth-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px)  { .badm-fifth-grid { grid-template-columns: 1fr; } }

/* ---------- Card grid – responzivni grid pro karet ---------- */
/* Vychozi: auto-fill minmax(300px) – karta se "rozleje" na volny prostor */
.badm-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--badm-gap); margin-bottom: var(--badm-gap); }
.badm-card-grid .badm-card { margin-bottom: 0; }
/* Fixni pocty sloupcu */
.badm-card-grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
.badm-card-grid--cols-4 { grid-template-columns: repeat(4, 1fr); }
/* Auto-fill varianty pro ruzne sirky karet */
.badm-card-grid--wide   { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.badm-card-grid--narrow { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.badm-card-grid--tight  { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
/* Responzivni breakpointy pro fixni sloupce */
@media (max-width: 1200px) { .badm-card-grid--cols-4 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1024px) { .badm-card-grid--cols-3 { grid-template-columns: repeat(2, 1fr); } .badm-card-grid--cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 800px)  { .badm-card-grid--cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .badm-card-grid--cols-3, .badm-card-grid--cols-4 { grid-template-columns: 1fr; } }
@media (max-width: 600px)  { .badm-card-grid { grid-template-columns: 1fr; } .badm-card-grid--wide, .badm-card-grid--narrow { grid-template-columns: 1fr; } }

/* ---------- Section label – uppercase muted nadpis skupiny prvku ---------- */
.badm-section-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--badm-text-muted); margin: 0 0 .6rem; }

/* ---------- Page section – margin wrapper pro skupiny karet na strance ---------- */
.badm-page-section { margin-top: 1.5rem; margin-bottom: 1.75rem; }

/* ---------- Stat row – radka ministat uvnitr karty ---------- */
.badm-stat-row { display: flex; gap: 24px; flex-wrap: wrap; }
.badm-stat-row__item { text-align: center; }
.badm-stat-row__value { display: block; font-size: 1.3rem; font-weight: 700; color: #111827; }
.badm-stat-row__label { display: block; font-size: .75rem; color: #6b7280; margin-top: 2px; }

/* ---------- Percent bar – sdileny progress bar pro tabulky ---------- */
/* Pouziti: <div class="badm-pct-bar"><div class="badm-pct-bar__fill badm-pct-bar--good" style="width:75%"></div><span class="badm-pct-bar__val">75 %</span></div> */
/* Modifikatory: --good (zelena), --ok (zluta), --bad (cervena). --sm pro mensi vysku. */
.badm-pct-bar       { position: relative; width: 100%; min-width: 80px; height: 22px; background: var(--badm-bg, #f3f4f6); border-radius: 4px; overflow: hidden; }
.badm-pct-bar__fill  { position: absolute; top: 0; right: 0; height: 100%; border-radius: 4px; transition: width .3s; }
.badm-pct-bar__val   { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: flex-end; padding-right: 6px; font-size: .75rem; font-weight: 600; color: #1f2937; }
.badm-pct-bar--good  { background: #86efac; }
.badm-pct-bar--ok    { background: #fde68a; }
.badm-pct-bar--bad   { background: #fca5a5; }
.badm-pct-bar--sm    { min-width: 60px; height: 18px; }
.badm-pct-bar--sm .badm-pct-bar__val { font-size: .7rem; }

/* ---------- Panel ---------- */
.badm-panel {
    background: var(--badm-surface);
    border: 1px solid var(--badm-border);
    border-radius: var(--badm-radius);
    margin-bottom: var(--badm-gap);
    overflow: hidden;
}

.badm-panel__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px var(--badm-gap);
    border-bottom: 1px solid var(--badm-border);
}

.badm-panel__title {
    font-size: 13px;
    font-weight: 600;
}

.badm-panel__meta {
    font-size: 12px;
    color: var(--badm-text-muted);
}

/* ---------- Activity ---------- */
.badm-activity {
    list-style: none;
    padding: 0;
    margin: 0;
}

.badm-activity__item {
    padding: 6px var(--badm-gap);
    border-bottom: 1px solid var(--badm-border);
    font-size: 12px;
}
.badm-activity__item:last-child { border-bottom: none; }

/* ---------- Footer ---------- */
.badm-footer {
    padding: 10px var(--badm-gap);
    text-align: center;
    font-size: 12px;
    color: var(--badm-text-muted);
    border-top: 1px solid var(--badm-border);
    margin-top: auto;
}

/* ---------- Hamburger Toggle ---------- */
.badm-header__toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 32px;
    height: 32px;
    padding: 6px;
    background: none;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
}
.badm-header__toggle span {
    display: block;
    height: 2px;
    background: #a3a3a3;
    border-radius: 2px;
    transition: transform .2s, opacity .2s;
}
.badm-header__toggle.is-active span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}
.badm-header__toggle.is-active span:nth-child(2) {
    opacity: 0;
}
.badm-header__toggle.is-active span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 960px) {
    :root {
        --badm-gap: 12px;
    }

    .badm-header {
        gap: 10px;
        padding: 0 12px;
    }

    .badm-header__toggle {
        display: flex;
    }

    .badm-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 150;
        transform: translateX(-100%);
        transition: transform .25s ease;
    }
    .badm-sidebar.is-open {
        transform: translateX(0);
    }

    .badm-hero {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px 12px;
    }

    .badm-hero__actions {
        width: 100%;
    }

    .badm-hero__actions .badm-btn {
        flex: 1;
        text-align: center;
    }

    .badm-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 640px) {
    .badm-main {
        padding: 3px;
    }
    .badm-page-title {
        padding-left: 6px;
    }
    .badm-header {
        flex-wrap: wrap;
        height: auto;
        padding: 8px 12px;
        gap: 6px;
    }

    .badm-header__toggle {
        display: flex;
    }

    .badm-header__brand {
        flex: 1;
    }

    .badm-nav {
        display: none;
        flex-direction: column;
        width: 100%;
        order: 10;
        gap: 2px;
        padding-top: 6px;
        border-top: 1px solid var(--badm-border);
    }
    .badm-nav.is-open {
        display: flex;
    }

    .badm-nav__link {
        width: 100%;
        padding: 8px 10px;
        border-radius: var(--badm-radius);
    }

    .badm-header__user {
        margin-left: 0;
        order: 2;
    }

    .badm-header__user-name {
        display: none;
    }

    .badm-hero {
        padding: 14px 12px;
    }

    .badm-hero__title {
        font-size: 18px;
    }

    .badm-hero__actions {
        flex-direction: column;
    }

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

    .badm-card {
        padding: 12px;
    }

    .badm-panel__header {
        padding: 8px 12px;
    }

    .badm-activity__item {
        padding: 8px 12px;
    }
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */

.badm-login-page .badm-main {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: var(--badm-gap);
}

.badm-login {
    width: 100%;
    max-width: 380px;
}

.badm-login__card {
    background: var(--badm-surface);
    border: 1px solid var(--badm-border);
    border-radius: var(--badm-radius);
    padding: 32px 24px 24px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, .08);
}

.badm-login__header {
    text-align: center;
    margin-bottom: 20px;
}

.badm-login__header .badm-header__logo {
    font-size: 18px;
}

.badm-login__error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    border-radius: var(--badm-radius);
    padding: 6px 10px;
    font-size: 12px;
    margin-bottom: 12px;
}

.badm-login__form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.badm-login__field {
    display: flex;
    flex-direction: column;
}

.badm-login__submit {
    width: 100%;
    padding: 7px;
    font-size: 12px;
    margin-top: 2px;
}

/* ============================================================
   ALERTS
   ============================================================ */

.badm-alert {
    border-radius: var(--badm-radius);
    padding: 6px 10px;
    font-size: 12px;
    margin-bottom: 10px;
}

.badm-alert--error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.badm-alert--success {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

/* ============================================================
   ACCOUNT PAGE (ucet)
   ============================================================ */

.badm-account {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--badm-gap);
    max-width: 720px;
}

@media (min-width: 640px) {
    .badm-account {
        grid-template-columns: 1fr 1fr;
    }
}

.badm-account__title {
    grid-column: 1 / -1;
    font-size: 18px;
    font-weight: 700;
}

.badm-account .badm-card {
    padding: 14px var(--badm-gap) var(--badm-gap);
}

.badm-account .badm-card__title {
    padding-bottom: 8px;
    border-bottom: 1px solid var(--badm-border);
}

.badm-account .badm-form-group {
    margin-bottom: 12px;
}

.badm-account__token-form {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--badm-border);
}
.badm-account__config-snippet {
    background: var(--badm-bg);
    padding: 10px 14px;
    border-radius: var(--badm-radius);
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 11px;
    overflow-x: auto;
    margin: 8px 0 12px;
    line-height: 1.5;
}

/* ============================================================
   SECTION (spolecny layout pro sekce na strankach)
   ============================================================ */

.badm-section {
    background: var(--badm-surface);
    border: 1px solid var(--badm-border);
    border-radius: var(--badm-radius);
    padding: var(--badm-gap);
    margin-bottom: var(--badm-gap);
}

.badm-section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--badm-border);
    flex-wrap: wrap;
}

.badm-section__title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 12px;
}

.badm-section__header .badm-section__title {
    margin-bottom: 0;
}
.badm-section__subtitle {
    font-size: 11px;
    color: #888;
    margin: 2px 0 6px;
}

/* ============================================================
   USERS PAGE (sprava spravcu a roli)
   ============================================================ */

/* ── Roles (rozbalovaci layout) ────────────── */

.badm-roles {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--badm-border);
    border: 1px solid var(--badm-border);
    border-radius: var(--badm-radius);
    overflow: hidden;
}

.badm-roles__item {
    background: var(--badm-surface);
}

.badm-roles__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
}

.badm-roles__toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--badm-text);
}

.badm-roles__arrow {
    font-size: 9px;
    transition: transform 0.15s;
    display: inline-block;
}

.badm-roles__toggle.is-open .badm-roles__arrow {
    transform: rotate(90deg);
}

.badm-roles__header-actions {
    display: flex;
    gap: 4px;
}

.badm-roles__body {
    display: none;
    padding: 0 12px 10px;
}

.badm-roles__body.is-open {
    display: block;
}

.badm-roles__pages {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 6px 16px;
}

.badm-roles__footer {
    margin-top: 8px;
}

.badm-roles__widgets-form {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--badm-border);
}

/* ── Checkbox ──────────────────────────────── */

.badm-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    cursor: pointer;
    white-space: nowrap;
}

.badm-checkbox input {
    margin: 0;
    vertical-align: middle;
}

/* ── Table ─────────────────────────────────── */

.badm-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--badm-border);
    border-radius: var(--badm-radius);
    background: var(--badm-surface);
}

.badm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.badm-table th,
.badm-table td {
    padding: 5px 8px;
    text-align: left;
    border-bottom: 1px solid var(--badm-border);
    vertical-align: middle;
    height: 32px;
}

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

.badm-table thead {
    background: var(--badm-bg);
}

.badm-table th {
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--badm-text-muted);
}

.badm-table tbody tr:hover {
    background: #fafbfc;
}

.badm-table__actions {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    align-items: center;
}

.badm-inline-form {
    display: inline-flex;
    gap: 3px;
    align-items: center;
}

/* Users: inline prejmenovani modulu – pencil se objevi pri hoveru radku */
.badm-module-label {
    margin-right: 6px;
}
.badm-module-edit {
    opacity: 0;
    transition: opacity .15s;
}
tr:hover .badm-module-edit,
.badm-module-edit:focus-within {
    opacity: 1;
}
.badm-module-delete__btn:hover {
    color: #dc2626;
    border-color: #dc2626;
}

.badm-text-center { text-align: center; }
.badm-text-right, td.badm-text-right, th.badm-text-right { text-align: right; }
.badm-text-left, td.badm-text-left, th.badm-text-left { text-align: left; }
td.badm-table__num, th.badm-table__num { text-align: right; }

/* ── Table sort (sortovatelne hlavicky) ────── */

.badm-sort {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.badm-sort::after {
    content: "⇅";
    margin-left: 3px;
    opacity: .3;
    font-size: 9px;
}

.badm-sort:hover::after {
    opacity: .6;
}

.badm-sort--asc::after {
    content: "↑";
    opacity: .8;
}

.badm-sort--desc::after {
    content: "↓";
    opacity: .8;
}

/* ── Table modifikatory ───────────────────── */

/* Vetsi pismo (13px misto base 12px) */
.badm-table--lg { font-size: 13px; }
.badm-table--lg th { font-size: 11px; }

/* Relaxed tabulka (vetsi padding, napr. finance) */
.badm-table--relaxed td,
.badm-table--relaxed th { padding: 8px 12px; }
.badm-table--relaxed tr:last-child td { border-bottom: none; }


/* Default right-align (numericke tabulky) */
.badm-table--right-align td,
.badm-table--right-align th { text-align: right; }
.badm-table--right-align td.badm-text-left,
.badm-table--right-align th.badm-text-left { text-align: left; }

/* Sticky prvni sloupec */
.badm-table--sticky-first th:first-child,
.badm-table--sticky-first td:first-child {
    position: sticky; left: 0; z-index: 1;
    background-color: var(--badm-surface, #fff);
}
.badm-table--sticky-first thead th:first-child { z-index: 3; background-color: #f7f7f7; }

/* Svisle delici cary mezi skupinami sloupcu – gradient misto border-left kvuli sticky+border-collapse */
.badm-table__divider { background-image: linear-gradient(to right, var(--badm-border, #e5e5e5) 2px, transparent 2px); }

/* Souhrn na konci tabulky */
.badm-table__summary { border-top: 2px solid #333; background: #f9f9f9; }
.badm-table__summary td { font-weight: 600; }

/* Delta barveni (pozitivni/negativni zmena) */
.badm-table__delta { font-weight: 600; }
.badm-table__delta--pos { color: #16a34a; }
.badm-table__delta--neg { color: #dc2626; }

/* Sticky zahlavi (thead zustane navrchu pri scrollu) */
.badm-table--sticky-header thead { position: sticky; top: 0; z-index: 2; }

/* Nowrap (bunky se nezalamou) */
.badm-table--nowrap td,
.badm-table--nowrap th { white-space: nowrap; }

/* Dvouradkove zahlavi se skupinami sloupcu */
.badm-table__header-groups th {
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 6px 8px;
}
.badm-table__header-sub th {
    font-size: 11px;
    text-align: right;
    padding: 4px 8px;
    color: #666;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
}
.badm-table__header-sub th:hover { color: #333; }
.badm-table__header-sub th:first-child { text-align: right; position: static; }

/* Barevne skupiny sloupcu (border-bottom na group header) */
.badm-table__group { border-bottom: 2px solid; }
.badm-table__group--revenue { border-color: #16a34a; background-color: rgba(22, 163, 74, 0.04); }
.badm-table__group--costs   { border-color: #dc2626; background-color: rgba(220, 38, 38, 0.04); }
.badm-table__group--pno     { border-color: #2563eb; background-color: rgba(37, 99, 235, 0.04); }
.badm-table__group--weather { border-color: #6366f1; background-color: rgba(99, 102, 241, 0.04); }
.badm-table__group--sales   { border-color: #2563eb; background-color: rgba(37, 99, 235, 0.04); }
.badm-table__group--margin  { border-color: #16a34a; background-color: rgba(22, 163, 74, 0.04); }
.badm-table__group--perf    { border-color: #8b5cf6; background-color: rgba(139, 92, 246, 0.04); }
.badm-table__group--orders  { border-color: #0ea5e9; background-color: rgba(14, 165, 233, 0.04); }

/* Sort indikatory (data-sort-dir atribut na th) */
.badm-table th[data-sort-dir]::after { font-size: 9px; color: var(--badm-primary); margin-left: 3px; }
.badm-table th[data-sort-dir="asc"]::after { content: ' ▲'; }
.badm-table th[data-sort-dir="desc"]::after { content: ' ▼'; }

/* Textova/key-value tabulka (bez borderu, hover, tightsi padding) */
.badm-table--text td {
    padding: 2px 0;
    vertical-align: top;
    border-bottom: none;
    height: auto;
}
.badm-table--text tbody tr:hover { background: none; }
.badm-table--text td:first-child {
    color: var(--badm-text-muted);
    padding-right: 10px;
    white-space: nowrap;
    width: 1%;
}

/* ── Badge ─────────────────────────────────── */

.badm-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 10px;
    background: var(--badm-border);
    color: var(--badm-text);
    white-space: nowrap;
}

.badm-badge--super {
    background: #7c3aed;
    color: #fff;
}

.badm-badge--active {
    background: #dcfce7;
    color: #15803d;
}

.badm-badge--inactive {
    background: #fef2f2;
    color: #b91c1c;
}

.badm-badge--none {
    background: #f3f4f6;
    color: #9ca3af;
}
.badm-badge--success { background: #dcfce7; color: #15803d; }
.badm-badge--new { background: #10b981; color: #fff; }
.badm-badge--danger { background: #fef2f2; color: #b91c1c; }
.badm-badge--error { background: #fee2e2; color: #b91c1c; }
.badm-badge--warn, .badm-badge--warning { background: #fef3c7; color: #92400e; }
.badm-badge--info { background: #dbeafe; color: #1e40af; }
.badm-badge--muted { background: #f3f4f6; color: #9ca3af; }
.badm-badge--neutral { background: #f3f4f6; color: #6b7280; }
.badm-badge--tshirt { background: #dbeafe; color: #1e40af; }
.badm-badge--mug { background: #fef3c7; color: #92400e; }
.badm-badge--underwear { background: #fce7f3; color: #9d174d; }
.badm-badge--slippers { background: #d1fae5; color: #065f46; }

/* ── Tag – obdelnikovy chip s borderem (ne pill) ── */
.badm-tag {
    display: inline-block;
    padding: 4px 12px;
    background: #f0f4f8;
    border: 1px solid var(--badm-border);
    border-radius: var(--badm-radius-sm);
    font-size: 13px;
    color: #555;
}

/* ── Dot ──────────────────────────────────── */
.badm-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ── Toolbar ──────────────────────────────── */
.badm-toolbar {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    margin-bottom: var(--badm-gap);
}

/* ── Select small ──────────────────────────── */

.badm select.badm-select--small {
    font-size: 11px;
    padding: 0 20px 0 6px;
    height: 24px;
    line-height: 24px;
    border: 1px solid var(--badm-border);
    border-radius: var(--badm-radius);
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' fill='none'%3E%3Cpath d='M.5.5l3.5 4 3.5-4' stroke='%236b7a8d' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 5px center / 8px;
    -webkit-appearance: none;
    appearance: none;
    width: auto;
}

/* ── Utility ───────────────────────────────── */

.badm-text-muted {
    color: var(--badm-text-muted);
    font-size: 11px;
}
.badm-text-warn    { color: var(--badm-warn); }
.badm-text-sm      { font-size: .8rem; }         /* sjednocuje .7rem / .75rem / .8rem inline fonty */
.badm-clickable    { cursor: pointer; }
.badm-dim          { opacity: .4; }              /* zeslabit sekundarni obsah (byl .35) */
.badm-inactive     { opacity: .5; }              /* neaktivni/ignorovany radek */
.is-hidden         { display: none !important; }
.is-msel-hidden    { display: none !important; }

/* ============================================================
   STATUS BADGE (barevne statusy objednavek, reusable)
   ============================================================ */

.badm-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
    color: #333;
}

/* ============================================================
   FILTER BAR (vyhledavani a filtrace, reusable)
   ============================================================ */

.badm-filter {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: var(--badm-gap);
    background: var(--badm-surface);
    border: 1px solid var(--badm-border);
    border-radius: var(--badm-radius);
    padding: 10px 14px;
}
.badm-section .badm-filter {
    border: none;
    padding: 0;
    margin-bottom: 12px;
}
.badm-filter__row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.badm-filter__group { display: inline-flex; align-items: center; gap: 6px; height: 26px; }
.badm-filter__sep { width: 1px; height: 20px; background: var(--badm-border); margin: 0 4px; flex-shrink: 0; }

.badm-filter__more-btn {
    background: none; border: none; cursor: pointer;
    font-size: 11px; color: var(--badm-text-muted);
    display: inline-flex; align-items: center; gap: 4px;
    padding: 0; font-family: var(--badm-font);
}
.badm-filter__more-btn:hover { color: var(--badm-primary); }
.badm-filter__more-btn .fa-chevron-down { font-size: 9px; transition: transform .2s; }
.badm-filter__more-btn.is-open .fa-chevron-down { transform: rotate(180deg); }

.badm-filter__secondary { display: none; }
.badm-filter__secondary.is-open {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    padding-top: 8px; border-top: 1px solid var(--badm-border);
}

.badm-filter input[type="date"],
.badm-filter input[type="month"] { width: auto; padding: 2px 8px; font-size: 12px; height: 26px; box-sizing: border-box; border: 1px solid var(--badm-border); border-radius: var(--badm-radius); }
.badm-filter input[type="date"] { min-width: 140px; }
.badm-filter input[type="month"] { min-width: 150px; font-family: var(--badm-font); }
.badm-filter label.badm-mkt__checkbox { font-size: 12px; margin-bottom: 0; display: inline-flex; white-space: nowrap; }
.badm-filter label.badm-filter__label { margin-bottom: 0; display: inline; }
.badm-filter .badm-switch { height: 26px; box-sizing: border-box; }
.badm-filter .badm-switch__item { height: 22px; padding: 0 10px; font-size: 12px; line-height: 22px; }
.badm-filter input:not([type="radio"]):not([type="checkbox"]),
.badm-filter select {
    width: auto;
    display: inline-block;
    flex: 0 1 140px;
}
.badm-filter select {
    flex: 0 0 auto;
}
.badm-filter__label {
    font-weight: 600;
    color: var(--badm-text-muted);
    white-space: nowrap;
}
.badm-filter__date {
    display: flex;
    align-items: center;
    gap: 6px;
}
.badm-filter__toggle {
    display: none;
}
@media (max-width: 640px) {
    .badm-filter__toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        padding: 10px;
        margin-bottom: 6px;
        background: var(--badm-bg);
        border: 1px solid var(--badm-border);
        border-radius: var(--badm-radius);
        font-size: 14px;
        font-weight: 600;
        color: var(--badm-text-muted);
        cursor: pointer;
    }
    .badm-filter__toggle .fa-chevron-down {
        transition: transform .2s;
    }
    .badm-filter__toggle.is-open .fa-chevron-down {
        transform: rotate(180deg);
    }
    .badm-filter--collapsible {
        display: none;
    }
    .badm-filter--collapsible.is-open {
        display: flex;
    }
    .badm-filter__row {
        flex-direction: column;
        align-items: stretch;
    }
    .badm-filter__group { flex-wrap: wrap; }
    .badm-filter__sep { display: none; }
    .badm-filter input,
    .badm-filter select {
        flex: 1 1 auto;
    }
    .badm-filter__label--desktop {
        display: none;
    }
    .badm-filter .badm-btn {
        align-self: center;
    }
}
.badm-filter-results {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    margin-top: 6px;
    margin-bottom: var(--badm-gap);
    background: var(--badm-primary-light);
    border-radius: var(--badm-radius);
    font-size: 12px;
    color: var(--badm-text);
}

/* ============================================================
   PAGINATION (strankovani, reusable)
   ============================================================ */

.badm-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 0 4px;
}

.badm-pagination__link {
    font-size: 12px;
    font-weight: 500;
    color: var(--badm-primary);
    text-decoration: none;
}

.badm-pagination__link:hover {
    text-decoration: underline;
}

.badm-pagination__link--disabled {
    color: var(--badm-text-muted);
    pointer-events: none;
}

.badm-pagination__info {
    font-size: 12px;
    color: var(--badm-text-muted);
}

/* ============================================================
   ORDERS LIST (seznam objednavek)
   ============================================================ */

.badm-orders__row:hover {
    background: var(--badm-primary-light) !important;
}

.badm-orders__date {
    white-space: nowrap;
    color: var(--badm-text-muted);
}

.badm-table--orders .badm-orders__status {
    text-align: center;
}

.badm-orders__amount {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.badm-table--orders .badm-orders__amount {
    text-align: right;
}

.badm-table--orders .badm-orders__flag {
    text-align: center;
}

.badm-orders__flag {
    font-size: 16px;
}

.badm-table--orders .badm-orders__paid {
    text-align: center;
}

.badm-table--orders .badm-text-center {
    text-align: center;
}

/* ── Poznamky (ikonky v seznamu) ──────────────────── */

.badm-orders__notes {
    white-space: nowrap;
}

.badm-orders__notes-btn {
    display: inline-flex;
    gap: 3px;
    cursor: pointer;
}

.badm-orders__note--pozn { color: #16a34a; font-size: 13px; }
.badm-orders__note--comment { color: #2563eb; font-size: 13px; }
.badm-orders__note--zaznam { color: #f59e0b; font-size: 13px; }

.badm-hidden { display: none; }

/* ============================================================
   ORDER DETAIL (detail objednavky)
   ============================================================ */

.badm-order-detail__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: var(--badm-gap);
    flex-wrap: wrap;
}

.badm-order-detail__title {
    font-size: 18px;
    font-weight: 700;
}

.badm-order-detail__badges {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

/* ── Info grid (dva sloupce – zakaznik + doruceni) ── */

.badm-info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--badm-gap);
    margin-bottom: var(--badm-gap);
}

@media (min-width: 640px) {
    .badm-info-grid {
        grid-template-columns: 1fr 1fr;
    }
}


/* ── Order pricing (cenovy souhrn v karte) ─────────── */

.badm-order-pricing {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--badm-border);
}
.badm-order-pricing__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    text-align: center;
}
.badm-order-pricing__item strong {
    font-size: 13px;
    color: var(--badm-text);
}
.badm-order-pricing__item small {
    font-size: 10px;
    color: var(--badm-text-muted);
    margin-top: 2px;
}
.badm-order-pricing__item--minor {
    opacity: 0.35;
}
.badm-order-pricing__item--total strong {
    font-weight: 700;
}

/* ── Card divider (oddelovac v karte) ──────────────── */

.badm-card__divider {
    border-top: 1px solid var(--badm-border);
    margin: 10px 0;
}

/* ── Notes (poznamky v detailu) ────────────────────── */

.badm-note {
    margin-bottom: 12px;
}

.badm-note:last-child {
    margin-bottom: 0;
}

.badm-note__label {
    font-size: 11px;
    font-weight: 600;
    color: var(--badm-text-muted);
    margin-bottom: 3px;
}

.badm-note__text {
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
    background: var(--badm-bg);
    border-radius: var(--badm-radius);
    padding: 8px 10px;
}

/* ============================================================
   MODAL (univerzalni, reusable)
   ============================================================ */

.badm-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.badm-modal.is-open {
    display: flex;
}

.badm-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .4);
}

.badm-modal__dialog {
    position: relative;
    background: var(--badm-surface);
    border-radius: var(--badm-radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, .15);
    width: 90%;
    max-width: 520px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.badm-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--badm-border);
    flex-shrink: 0;
}

.badm-modal__title {
    font-size: 13px;
    font-weight: 600;
}

.badm-modal__close {
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: var(--badm-text-muted);
    padding: 0 2px;
}
.badm-modal__close:hover {
    color: var(--badm-text);
}

.badm-modal__body {
    padding: 16px;
    overflow-y: auto;
    font-size: 12px;
}

/* ── Modal poznamky (obsah modalu pro objednavky) ── */

.badm-modal-note {
    margin-bottom: 12px;
}

.badm-modal-note:last-child {
    margin-bottom: 0;
}

.badm-modal-note__label {
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.badm-modal-note__text {
    font-size: 12px;
    line-height: 1.5;
    background: var(--badm-bg);
    border-radius: var(--badm-radius);
    padding: 8px 10px;
}

/* ── Formatovane zaznamy (autor + cas + text) ──── */

.badm-modal-entry {
    padding: 2px 0;
    line-height: 1.5;
}

.badm-modal-entry__meta {
    font-weight: 700;
    color: var(--badm-text-muted);
    font-size: 10px;
}

/* ============================================================
   ANALYTICS (statistiky prodeju)
   ============================================================ */

.badm-analytics__filter {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: var(--badm-gap);
    flex-wrap: wrap;
}

.badm-analytics__filter input[type="date"],
.badm-analytics__filter select {
    width: auto;
    min-width: 140px;
}

.badm-chart-wrap {
    background: var(--badm-surface);
    border: 1px solid var(--badm-border);
    border-radius: var(--badm-radius);
    padding: var(--badm-gap);
    margin-bottom: var(--badm-gap);
    position: relative;
    height: 360px;
}
/* Graf uvnitr existujici karty – bez dekorace, nizsi */
.badm-chart-wrap--flush {
    background: none;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 0;
    height: 280px;
    overflow: hidden;
}

@media (max-width: 640px) {
    .badm-analytics__filter {
        flex-direction: column;
        align-items: stretch;
    }
    .badm-analytics__filter input[type="date"] {
        width: 100%;
    }
    .badm-chart-wrap {
        height: 280px;
    }
}

.badm-analytics__charts-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}
.badm-analytics__chart-col {
    flex: 1 1 calc(25% - 1.2rem);
    min-width: 260px;
}
.badm-analytics__chart-col h3 {
    text-align: center;
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--badm-text-muted);
}
.badm-analytics__chart-col canvas {
    max-height: 250px;
}


.badm-analytics__druh-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
    position: relative;
    top: 5px;
}

/* ── Univerzalni tabs ─────────────────────────────────── */
.badm-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--badm-border);
    margin-bottom: var(--badm-gap);
}

.badm-tabs__btn {
    padding: 8px 20px 2px;
    font-size: 13px;
    font-weight: 600;
    color: var(--badm-text-muted);
    text-decoration: none;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: color .15s, border-color .15s;
}

.badm-tabs__btn:hover {
    color: var(--badm-text);
}

.badm-tabs__btn.is-active {
    color: var(--badm-primary);
    border-bottom-color: var(--badm-primary);
}

.badm-tabs__panel {
    display: none;
}

.badm-tabs__panel.is-active {
    display: block;
}

.badm-text-danger { color: var(--badm-danger); }

/* Digitoo – expand sipka */
.badm-digitoo-arrow {
    display: inline-block;
    width: 1em;
    color: var(--badm-text-muted);
    user-select: none;
}

/* Digitoo – month override select */
.badm-digitoo-month-select {
    font-family: inherit;
    font-size: inherit;
    width: auto;
    padding: 2px 4px;
}

/* Digitoo – indikator v P&L bunce (tecka v pravem hornim rohu) */
.badm-pnl__cell--digitoo {
    position: relative;
}
.badm-pnl__cell--digitoo::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--badm-text-muted);
    opacity: .45;
}

/* Multiselect filtr v zahlavi tabulky */
.badm-msel { position: relative; display: inline-flex; align-items: center; gap: 4px; }
.badm-msel__trigger {
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--badm-text);
    background: var(--badm-surface);
    border: 1px solid var(--badm-border);
    border-radius: 4px;
    padding: 4px 10px;
    cursor: pointer;
    white-space: nowrap;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.badm-msel__trigger::after {
    content: ' \25BE';
    font-size: 0.7em;
    opacity: 0.5;
}
.badm-msel__trigger:hover { border-color: var(--badm-primary); }
.badm-msel__trigger.is-filtered {
    border-color: var(--badm-primary);
    background: var(--badm-primary-light);
    color: var(--badm-primary-hover);
}
.badm-msel__dropdown {
    display: none;
    position: fixed;
    z-index: 100;
    background: var(--badm-surface);
    border: 1px solid var(--badm-border);
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    padding: 6px 0;
    min-width: 180px;
    max-height: 280px;
    overflow-y: auto;
    text-align: left;
}
.badm-msel.is-open .badm-msel__dropdown { display: block; }
.badm-msel__option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 400;
    white-space: nowrap;
}
.badm-msel__option:hover { background: var(--badm-surface-hover); }
.badm-msel__option input[type="checkbox"] {
    margin: 0;
    accent-color: var(--badm-primary);
}
.badm-msel__sort {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--badm-text-muted);
    padding: 2px 4px;
    line-height: 1;
    border-radius: 3px;
}
.badm-msel__sort:hover { color: var(--badm-primary); background: var(--badm-surface-hover); }
/* Skryt sort pseudo-element na th s multiselect (sort ma vlastni tlacitko) */
th:has(.badm-msel)::after { display: none !important; }
th:has(.badm-msel) { cursor: default; }

/* Stav skladu – barevne tecky */
.badm-stock-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 5px;
    vertical-align: middle;
}
.badm-stock-dot--1  { background: var(--badm-success); }       /* Skladem */
.badm-stock-dot--0  { background: #a3a3a3; }                   /* Vyprodano */
.badm-stock-dot--10 { background: var(--badm-warning); }       /* Na ceste */
.badm-stock-dot--11 { background: #f97316; }                   /* Posledni sance */
.badm-stock-dot--12 { background: #d4d4d4; }                   /* Historie */

/* Nowrap utilita */
.badm-text-nowrap { white-space: nowrap; }

/* Duo karty (zakaznici – novi vs stari) */
.badm-analytics__duo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--badm-gap);
}

.badm-analytics__duo-card {
    background: var(--badm-surface);
    border: 1px solid var(--badm-border);
    border-radius: var(--badm-radius);
    padding: 16px 20px;
}

.badm-analytics__duo-title {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 2px;
}

.badm-analytics__duo-subtitle {
    font-size: 11px;
    color: var(--badm-text-muted);
    display: block;
    margin-bottom: 12px;
}

.badm-analytics__duo-rows {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.badm-analytics__duo-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.badm-analytics__duo-row span {
    color: var(--badm-text-muted);
}

/* Split (digitisk vs sitotisk) */
.badm-analytics__split {
    display: flex;
    gap: var(--badm-gap);
    flex-wrap: wrap;
}

.badm-analytics__split-item {
    background: var(--badm-surface);
    border: 1px solid var(--badm-border);
    border-radius: var(--badm-radius);
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 140px;
}

.badm-analytics__split-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--badm-primary);
    font-variant-numeric: tabular-nums;
}

.badm-analytics__split-label {
    font-size: 12px;
    color: var(--badm-text-muted);
    margin-top: 2px;
}

.badm-analytics__split-pct {
    font-size: 13px;
    font-weight: 600;
    margin-top: 4px;
}

@media (max-width: 640px) {
    .badm-analytics__duo {
        grid-template-columns: 1fr;
    }
    .badm-analytics__split-item {
        min-width: 0;
    }
}

/* ── Digitisk pivot tabulka ────────────────────────── */

.badm-analytics__digi-filter {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: var(--badm-gap);
    flex-wrap: nowrap;
}

.badm-analytics__digi-filter span {
    white-space: nowrap;
}

.badm-analytics__digi-filter input {
    width: auto;
    min-width: 240px;
}

.badm-table-wrap--scroll {
    overflow-x: auto;
}

.badm-analytics__pivot {
    font-size: 12px;
    white-space: nowrap;
}

.badm-analytics__pivot-color {
    width: 32px;
    min-width: 32px;
    max-width: 32px;
    padding: 6px 2px !important;
    border: 1px solid var(--badm-border);
}

/* Datove bunky pod barevnymi hlavickami – stejna sirka, zarovnani */
.badm-analytics__pivot td.badm-text-center {
    width: 32px;
    min-width: 32px;
    max-width: 32px;
    text-align: center;
    padding: 4px 2px !important;
}

.badm-analytics__pivot-th-potisk {
    min-width: 160px;
}

.badm-analytics__pivot-potisk {
    font-weight: 600;
    vertical-align: top;
}

.badm-analytics__pivot-pid {
    color: var(--badm-text-muted);
    font-size: 11px;
    vertical-align: top;
}

.badm-analytics__pivot-subtotal {
    background: var(--badm-bg) !important;
    border-bottom: 2px solid var(--badm-primary);
}
.is-sorted .badm-analytics__pivot-subtotal {
    border-bottom: none;
}

.badm-analytics__pivot-row.is-hidden,
.badm-analytics__pivot-subtotal.is-hidden {
    display: none;
}

/* Druh segment skryty – zobrazit jen subtotaly, schovat druh radky */
.is-druh-collapsed .badm-analytics__pivot-row { display: none !important; }
.is-druh-collapsed .badm-analytics__pivot-subtotal .badm-pivot-repeat { display: inline; }

/* Opakovany potisk/PID – ve vychozim stavu skryte, zobrazit pri razeni */
.badm-pivot-repeat { display: none; }
.is-sorted .badm-pivot-repeat { display: inline; }

/* Reset razeni */
.badm-pivot-reset {
    display: none;
    margin-left: 12px;
    color: #dc2626;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
}
.badm-pivot-reset.is-active { display: inline; }
.badm-pivot-reset:hover { text-decoration: underline; }

.badm-text-bold {
    font-weight: 600;
}

@media (max-width: 640px) {
    .badm-analytics__digi-filter {
        flex-direction: column;
        align-items: stretch;
    }
    .badm-analytics__digi-filter input {
        width: 100%;
        min-width: 0;
    }
    .badm-analytics__pivot-color,
    .badm-analytics__pivot td.badm-text-center {
        width: 24px;
        min-width: 24px;
        max-width: 24px;
    }
}

/* ── Srovnani obdobi (comp badges pod stat kartami) ─── */
.badm-comp-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    margin-top: 4px;
    padding: 1px 6px;
    border-radius: 3px;
}

/* ── Tabulka footer ────────────────────────────────── */
.badm-table__footer td {
    background: var(--badm-bg);
    border-top: 2px solid var(--badm-border);
    font-weight: 600;
}

/* ── Barevne marze ─────────────────────────────────── */
.badm-text-success { color: var(--badm-success); }

/* ── Time-series chart controls ────────────────────── */
.badm-analytics__ts-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: var(--badm-gap);
}

.badm-analytics__ts-druhy {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    font-size: 12px;
    overflow: hidden;
}
.badm-analytics__ts-druhy.is-collapsed {
    max-height: 36px;
}
.badm-analytics__ts-druhy .badm-mkt__checkbox {
    padding: 0 2px 2px;
    border-bottom: 2px solid transparent;
    transition: border-bottom-color 0.15s;
}
.badm-analytics__ts-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 4px;
    margin-bottom: 12px;
}
.badm-analytics__ts-toggle,
.badm-analytics__ts-clear {
    font-size: 11px;
    color: var(--badm-text-muted);
    cursor: pointer;
    text-decoration: underline;
}
.badm-analytics__ts-toggle:hover {
    color: var(--badm-primary);
}
.badm-analytics__ts-clear:hover {
    color: var(--badm-danger);
}

@media (max-width: 640px) {
    .badm-analytics__ts-controls {
        flex-direction: column;
    }
}

/* ============================================================
   RFM Analyza
   ============================================================ */

/* -- Přepínače země + období -- */

.badm-rfm__controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.badm-rfm__tabs {
    display: flex;
    gap: 4px;
}

.badm-rfm__tab {
    padding: 6px 14px;
    border-radius: var(--badm-radius);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    color: var(--badm-text-muted);
    background: var(--badm-secondary);
    transition: background .15s, color .15s;
}
.badm-rfm__tab:hover { background: var(--badm-secondary-hover); color: var(--badm-text); }
.badm-rfm__tab--active {
    background: var(--badm-primary);
    color: var(--badm-primary-foreground);
}
.badm-rfm__tab--active:hover { background: var(--badm-primary-hover); color: var(--badm-primary-foreground); }

.badm-rfm__periods {
    display: flex;
    align-items: center;
    gap: 4px;
}

.badm-rfm__periods-label {
    font-size: 12px;
    color: var(--badm-text-muted);
    margin-right: 4px;
}

.badm-rfm__period {
    padding: 4px 10px;
    border-radius: var(--badm-radius-sm);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    color: var(--badm-text-muted);
    background: var(--badm-secondary);
    transition: background .15s, color .15s;
}
.badm-rfm__period:hover { background: var(--badm-secondary-hover); color: var(--badm-text); }
.badm-rfm__period--active {
    background: var(--badm-text);
    color: var(--badm-surface);
}
.badm-rfm__period--active:hover { background: var(--badm-text); color: var(--badm-surface); }

/* -- Souhrn segmentu s CSS bary -- */

.badm-rfm__segments {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 20px;
}

.badm-rfm__segment-row {
    display: grid;
    grid-template-columns: 240px 1fr 56px;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: var(--badm-radius);
    background: var(--badm-surface);
    border: 1px solid var(--badm-border);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}
.badm-rfm__segment-row:hover {
    border-color: var(--badm-primary);
    box-shadow: 0 0 0 1px var(--badm-primary);
}
.badm-rfm__segment-row--active {
    border-color: var(--badm-primary);
    box-shadow: 0 0 0 1px var(--badm-primary);
    background: color-mix(in srgb, var(--badm-primary) 6%, var(--badm-surface));
}

.badm-rfm__segment-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.badm-rfm__segment-icon {
    flex-shrink: 0;
    width: 20px;
    text-align: center;
    font-size: 13px;
}

.badm-rfm__segment-name {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.badm-rfm__segment-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--badm-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.badm-rfm__segment-desc {
    font-size: 10px;
    color: var(--badm-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.badm-rfm__segment-bar-wrap {
    position: relative;
    height: 22px;
    background: var(--badm-secondary);
    border-radius: var(--badm-radius-sm);
    overflow: hidden;
}

.badm-rfm__segment-bar {
    position: absolute;
    inset: 0;
    border-radius: var(--badm-radius-sm);
    transition: width .3s ease;
}

.badm-rfm__segment-bar-label {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    height: 100%;
    padding-left: 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--badm-text);
}

.badm-rfm__segment-count {
    flex-shrink: 0;
    text-align: right;
    font-size: 13px;
    font-weight: 600;
    color: var(--badm-text-muted);
}

.badm-rfm__segment-pct {
    font-size: 12px;
}

.badm-rfm__total {
    font-size: 12px;
    color: var(--badm-text-muted);
    padding: 4px 12px;
}

/* -- Filtr segmentu info bar -- */

.badm-rfm__filter-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 14px;
    margin-bottom: 16px;
    border-radius: var(--badm-radius);
    background: color-mix(in srgb, var(--badm-primary) 8%, var(--badm-surface));
    border: 1px solid color-mix(in srgb, var(--badm-primary) 25%, var(--badm-border));
    font-size: 13px;
    color: var(--badm-text);
}

.badm-rfm__filter-info i:first-child { color: var(--badm-primary); margin-right: 4px; }

.badm-rfm__filter-clear {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
    color: var(--badm-text-muted);
    text-decoration: none;
    padding: 3px 8px;
    border-radius: var(--badm-radius-sm);
    transition: background .15s, color .15s;
}
.badm-rfm__filter-clear:hover {
    background: var(--badm-secondary);
    color: var(--badm-text);
}

@media (max-width: 640px) {
    .badm-rfm__segment-row {
        grid-template-columns: 160px 1fr 48px;
        gap: 8px;
        padding: 4px 8px;
    }
    .badm-rfm__segment-desc { display: none; }
}

/* -- Hranice kvintilu (collapsible) -- */

.badm-rfm__bounds {
    margin-bottom: 20px;
    border: 1px solid var(--badm-border);
    border-radius: var(--badm-radius-lg);
    background: var(--badm-surface);
}

.badm-rfm__bounds-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--badm-text);
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.badm-rfm__bounds-toggle::-webkit-details-marker { display: none; }
.badm-rfm__bounds-toggle i:first-child { color: var(--badm-text-muted); }

.badm-rfm__bounds-chevron {
    margin-left: auto;
    font-size: 11px;
    color: var(--badm-text-muted);
    transition: transform .2s;
}
.badm-rfm__bounds[open] .badm-rfm__bounds-chevron { transform: rotate(180deg); }

.badm-rfm__bounds-grid {
    padding: 0 16px 16px;
}

.badm-rfm__bounds-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (max-width: 860px) {
    .badm-rfm__bounds-grid { grid-template-columns: 1fr; }
}

.badm-rfm__bounds-table { font-size: 12px; }
.badm-rfm__bounds-table thead tr:first-child th {
    font-size: 13px;
    font-weight: 600;
    padding-bottom: 2px;
    border-bottom: none;
}
.badm-rfm__bounds-table thead tr:first-child th .badm-text-muted { font-weight: 400; font-size: 11px; }
.badm-rfm__bounds-table th,
.badm-rfm__bounds-table td { padding: 4px 8px; }

/* -- Tabulka: RFM skóre -- */

.badm-table--rfm td { font-size: 13px; }

.badm-rfm__score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: var(--badm-radius-sm);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.badm-rfm__score--5 { background: #dcfce7; color: #15803d; }
.badm-rfm__score--4 { background: #e0f2fe; color: #0369a1; }
.badm-rfm__score--3 { background: #fef9c3; color: #a16207; }
.badm-rfm__score--2 { background: #ffedd5; color: #c2410c; }
.badm-rfm__score--1 { background: #fee2e2; color: #dc2626; }

/* -- Segment badge v tabulce -- */

.badm-rfm__badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}

.badm-rfm__badge i { font-size: 10px; }

/* -- Rozbalitelny detail zakaznika -- */

.badm-rfm__col-toggle { width: 28px; padding: 0 !important; }

.badm-rfm__cell-toggle {
    width: 28px;
    text-align: center;
    padding: 0 4px !important;
    color: var(--badm-text-muted);
}

.badm-rfm__chevron {
    font-size: 10px;
    transition: transform .2s;
}

.badm-rfm__row {
    cursor: pointer;
    transition: background .1s;
}
.badm-rfm__row:hover { background: var(--badm-secondary); }
.badm-rfm__row--open { background: color-mix(in srgb, var(--badm-primary) 4%, var(--badm-surface)); }
.badm-rfm__row--open .badm-rfm__chevron { transform: rotate(90deg); }

.badm-rfm__detail td {
    padding: 0 0 12px !important;
    border-top: none !important;
    background: var(--badm-bg);
}

.badm-rfm__detail-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 12px 16px 16px;
}

.badm-rfm__detail-card {
    background: var(--badm-surface);
    border: 1px solid var(--badm-border);
    border-radius: var(--badm-radius);
    padding: 12px 14px;
}

.badm-rfm__detail-card-header {
    font-size: 11px;
    font-weight: 500;
    color: var(--badm-text-muted);
    margin-bottom: 6px;
}
.badm-rfm__detail-card-header i {
    margin-right: 4px;
    font-size: 11px;
}

.badm-rfm__detail-card-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--badm-text);
    line-height: 1.2;
}

.badm-rfm__detail-card-sub {
    font-size: 11px;
    color: var(--badm-text-muted);
    margin-top: 2px;
}

/* -- Casova osa objednavek -- */

.badm-rfm__timeline {
    margin: 12px 16px 0;
    padding: 12px 14px 10px;
    background: var(--badm-surface);
    border: 1px solid var(--badm-border);
    border-radius: var(--badm-radius);
}

.badm-rfm__timeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 600;
    color: var(--badm-text);
    margin-bottom: 10px;
}

.badm-rfm__timeline-count {
    font-weight: 400;
    color: var(--badm-text-muted);
}

.badm-rfm__timeline-track {
    position: relative;
    height: 20px;
    margin: 0 6px;
}

.badm-rfm__timeline-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 3px;
    margin-top: -1.5px;
    background: var(--badm-border);
    border-radius: 2px;
}

.badm-rfm__timeline-dot {
    position: absolute;
    top: 50%;
    width: 8px;
    height: 8px;
    margin: -4px 0 0 -4px;
    border-radius: 50%;
    background: var(--badm-primary);
    border: 2px solid var(--badm-surface);
    box-shadow: 0 0 0 1px var(--badm-primary);
    z-index: 1;
    cursor: default;
}
.badm-rfm__timeline-dot:first-of-type {
    background: var(--badm-success);
    box-shadow: 0 0 0 1px var(--badm-success);
    width: 10px;
    height: 10px;
    margin: -5px 0 0 -5px;
}
.badm-rfm__timeline-dot:last-of-type {
    background: var(--badm-danger);
    box-shadow: 0 0 0 1px var(--badm-danger);
    width: 10px;
    height: 10px;
    margin: -5px 0 0 -5px;
}

.badm-rfm__timeline-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--badm-text-muted);
    margin-top: 4px;
    padding: 0 2px;
}

@media (max-width: 860px) {
    .badm-rfm__detail-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .badm-rfm__detail-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- Marketing Dashboard (badm-mkt) ---------- */

.badm-mkt__checkbox {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 13px;
    cursor: pointer;
}
.badm-mkt__checkbox input { margin: 0; }


/* Sync */
.badm-mkt__sync-status { font-size: 13px; color: #666; }
.badm-mkt__sync-status--ok { color: #16a34a; }
.badm-mkt__sync-status--error { color: #dc2626; }


/* Graf (chart section) */
.badm-mkt__chart-section { padding: 0; }

/* Layout: metric boxy nad grafem – plynuly tok, label nad prvnim boxem skupiny */
.badm-mkt__metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-end;
    padding: 12px 0;
    margin-bottom: 12px;
}
.badm-mkt__metric-first {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.badm-mkt__metric-group-label {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--badm-text-muted);
}
/* Metric selector boxy – pouzivaji standard badm-box padding, text nesmí zalamovat */
.badm-mkt__metrics .badm-box--toggle { min-width: 0; }
.badm-mkt__metrics .badm-box--toggle .badm-box__value { white-space: nowrap; }
.badm-mkt__metrics .badm-box--toggle .badm-box__label { white-space: nowrap; }
/* Liska pod metriky: granularita vpravo */
.badm-mkt__chart-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 8px 16px;
    border-bottom: 1px solid var(--badm-border);
}


/* Marketing – tabulkove specificke tridy (zbytek presunuto do sdilenych badm-table modifikatoru) */
.badm-mkt__weather-dev { font-weight: 600; white-space: nowrap; }
.badm-mkt__td-period { font-weight: 600; white-space: nowrap; }
.badm-mkt__th-period { cursor: pointer; user-select: none; }
/* Druhy sloupec (Den) – sticky vedle sticky prvniho sloupce */
.badm-mkt__td-day { text-align: left; }
/* Sticky sloupce v summary radku – nepruhledne pozadi */
.badm-table__summary td:first-child { background: #f9f9f9; }

/* Podbarveni radku podle platformy */
.badm-mkt__row--facebook    { background: rgba(66, 103, 178, 0.06); }
.badm-mkt__row--google      { background: rgba(52, 168, 83, 0.06); }
.badm-mkt__row--sklik       { background: rgba(204, 0, 0, 0.06); }
.badm-mkt__row--tiktok      { background: rgba(128, 128, 128, 0.06); }
/* Sticky sloupce – nepruhledne barvy (rgba by prosvitalo pri scrollu) */
.badm-mkt__row--facebook td:first-child { background: #f4f6fa; }
.badm-mkt__row--google td:first-child   { background: #f3faf5; }
.badm-mkt__row--sklik td:first-child    { background: #fcf0f0; }
.badm-mkt__row--tiktok td:first-child   { background: #f7f7f7; }



/* Disabled taby */
.badm-tabs__btn--disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* Poznamky k tydnum – ikona v period bunce */
.badm-mkt__note-icon {
    opacity: 0.15;
    font-size: 13px;
    cursor: pointer;
    margin-left: 4px;
    transition: opacity 0.15s;
}
.badm-mkt__note-icon:hover {
    opacity: 0.5;
}
.badm-mkt__note-icon--active {
    opacity: 1;
    color: var(--badm-primary);
}
.badm-mkt__note-icon--active:hover {
    opacity: 0.8;
}

/* Modal pro poznamky */
.badm-mkt__note-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}
.badm-mkt__note-modal {
    background: var(--badm-surface, #fff);
    border-radius: var(--badm-radius, 6px);
    padding: 20px;
    width: 420px;
    max-width: 90vw;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}
.badm-mkt__note-modal h3 {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 600;
}
.badm-mkt__note-field {
    margin-bottom: 12px;
}
.badm-mkt__note-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #555;
}
.badm-mkt__note-field textarea {
    width: 100%;
    height: 60px;
    resize: vertical;
    font-size: 13px;
    padding: 6px 8px;
    border: 1px solid var(--badm-border, #e5e5e5);
    border-radius: 4px;
    font-family: inherit;
}
.badm-mkt__note-field textarea:focus {
    outline: none;
    border-color: var(--badm-primary);
}
.badm-mkt__note-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ── Segment toggle (gear ikona + dropdown) ─────── */
.badm-mkt__section-header {
    display: flex;
    justify-content: flex-end;
    padding: 4px 8px 0;
}
.badm-mkt__segment-toggle {
    position: relative;
}
.badm-mkt__gear-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #999;
    padding: 4px;
}
.badm-mkt__gear-btn:hover {
    color: #333;
}
.badm-mkt__segment-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: #fff;
    border: 1px solid var(--badm-border, #e5e5e5);
    border-radius: 6px;
    padding: 8px 12px;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .1);
    min-width: 160px;
}
.badm-mkt__segment-dropdown.is-open {
    display: block;
}
.badm-mkt__segment-dropdown label {
    display: block;
    padding: 4px 0;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
}


/* ══════════════════════════════════════════════════ */
/* AI Analyza kampani                                */
/* ══════════════════════════════════════════════════ */

.badm-mkt__analysis-intro {
    color: var(--badm-text-muted);
    font-size: 12px;
    line-height: 1.5;
    margin: 0 0 1rem;
}

.badm-mkt__analysis-buttons {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.badm-mkt__analysis-run {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.5rem;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: var(--badm-radius);
    color: #fff;
    cursor: pointer;
    transition: opacity 0.15s;
}

.badm-mkt__analysis-run:hover { opacity: 0.85; }
.badm-mkt__analysis-run:disabled { opacity: 0.5; cursor: not-allowed; }

.badm-mkt__analysis-run[data-platform="facebook"] { background: #1877f2; }
.badm-mkt__analysis-run[data-platform="google"] { background: #34a853; }

/* Blok jedne platformy */
.badm-mkt__analysis-block {
    border: 1px solid var(--badm-border);
    border-radius: var(--badm-radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

.badm-mkt__analysis-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.badm-mkt__analysis-block-title {
    font-size: 13px;
    font-weight: 600;
    margin: 0;
    color: var(--badm-text);
}

.badm-mkt__analysis-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.badm-mkt__analysis-refresh {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.badm-mkt__analysis-status {
    font-size: 11px;
    color: var(--badm-text-muted);
}

/* Loading spinner */
.badm-mkt__analysis-loading {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--badm-text-muted);
}

.badm-mkt__analysis-loading p {
    margin: 0.5rem 0;
    font-size: 12px;
}

.badm-spinner {
    width: 1.5rem;
    height: 1.5rem;
    border: 3px solid var(--badm-border);
    border-top-color: var(--badm-primary);
    border-radius: 50%;
    animation: badm-spin 0.8s linear infinite;
    margin: 0 auto 0.75rem;
}

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

/* Error stav */
.badm-mkt__analysis-error {
    padding: 0.75rem 1rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--badm-radius);
    color: #991b1b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 12px;
}

.badm-mkt__analysis-error i {
    color: #dc2626;
    font-size: 1rem;
}

/* Obsah analyzy (vygenerovany HTML z Claude) */
.badm-mkt__analysis-content {
    font-size: 12px;
    line-height: 1.5;
    color: var(--badm-text);
    max-width: 900px;
}

.badm-mkt__analysis-content h3 {
    font-size: 13px;
    font-weight: 600;
    margin: 1.25rem 0 0.4rem;
    color: var(--badm-text);
}

.badm-mkt__analysis-content h3:first-child {
    margin-top: 0;
}

/* AI-generovany obsah – tabulky dostavaji .badm-table pres JS, jen margin navic */
.badm-mkt__analysis-content table {
    margin: 0.5rem 0 1rem;
}

.badm-mkt__analysis-content ul {
    margin: 0.5rem 0;
    padding-left: 1.25rem;
}

.badm-mkt__analysis-content li {
    margin-bottom: 0.3rem;
}

.badm-mkt__analysis-content p {
    margin: 0.5rem 0;
    line-height: 1.5;
}

/* Semanticke CSS tridy pro zvyrazneni */
.badm-mkt__good { color: #16a34a; font-weight: 600; }
.badm-mkt__bad { color: #dc2626; font-weight: 600; }
.badm-mkt__warn { color: #ea580c; font-weight: 600; }

/* ---------- Marketing Targets (Plneni cilu) ---------- */
.badm-mkt__target-cell { cursor: pointer; min-width: 70px; }
.badm-mkt__target-cell:hover { background: rgba(37,99,235,0.06); outline: 1px dashed rgba(37,99,235,0.3); }
.badm-mkt__target-cell:empty::after { content: '–'; color: #ccc; }
.badm-mkt__target-cell--default { color: #9ca3af; font-style: italic; }
.badm-mkt__target-cell--override { font-weight: 600; }
.badm-mkt__target-cell--saving { opacity: 0.5; }
.badm-mkt__target-cell--saved { animation: badm-target-flash 1.5s ease-out; }
@keyframes badm-target-flash { 0% { background: rgba(22,163,74,0.15); } 100% { background: transparent; } }

.badm-mkt__target-input {
    width: 80px; padding: 2px 4px; border: 1px solid var(--badm-primary);
    border-radius: 3px; font-size: 13px; text-align: right;
    outline: none; background: #fff;
}
.badm-mkt__target-input:focus { box-shadow: 0 0 0 2px rgba(255,128,20,0.25); }

.badm-mkt__achievement--good { color: #16a34a; font-weight: 600; }
.badm-mkt__achievement--close { color: #ea580c; font-weight: 600; }
.badm-mkt__achievement--bad { color: #dc2626; font-weight: 600; }

.badm-mkt__defaults-bar {
    display: flex; flex-direction: column; gap: 0.5rem;
    padding: 0.75rem 1rem; background: #f8fafc; border: 1px solid #e2e8f0;
    border-radius: 6px; margin-bottom: 1rem; font-size: 0.82rem;
}
.badm-mkt__defaults-row { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; align-items: center; }
.badm-mkt__defaults-row--eshop { font-size: 0.88rem; }
.badm-mkt__defaults-row--platforms {
    padding-left: 1rem; border-left: 2px solid #e2e8f0;
    display: flex; flex-wrap: wrap; gap: 0.3rem 1.5rem; align-items: center;
}
.badm-mkt__defaults-platform { display: inline-flex; gap: 0.4rem; align-items: center; white-space: nowrap; }
.badm-mkt__defaults-platform-name { color: #64748b; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; }
.badm-mkt__target-cell--default-bar {
    display: inline-block; cursor: pointer; min-width: 50px;
    padding: 1px 6px; border-radius: 3px; color: #475569;
    border-bottom: 1px dashed #94a3b8;
}
.badm-mkt__target-cell--default-bar:hover { background: rgba(37,99,235,0.06); }
.badm-mkt__target-cell--default-bar:empty::after { content: '–'; color: #ccc; }

/* ============================================================
   SOCIAL PAGE (socialni site)
   ============================================================ */

/* ── Alert info ── */
.badm-alert--info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }


/* ── Publish form ── */
.badm-social__publish { max-width: 700px; }
.badm-social__form { display: flex; flex-direction: column; gap: 1rem; }
.badm-social__field { display: flex; flex-direction: column; gap: 0.3rem; }
.badm-social__label { font-weight: 600; font-size: 0.85rem; color: var(--badm-text); }
.badm-social__textarea { resize: vertical; min-height: 80px; }
.badm-social__hint { font-size: 0.75rem; color: var(--badm-text-muted); }
.badm-social__actions { padding-top: 0.5rem; }

/* ── Platform select chips ── */
.badm-social__platforms { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.badm-social__platform-btn input { display: none; }
.badm-social__platform-chip {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.4rem 0.8rem; border-radius: 6px; cursor: pointer;
    border: 2px solid var(--badm-border); font-size: 0.85rem; font-weight: 500;
    transition: border-color 0.15s, background 0.15s;
}
.badm-social__platform-chip:hover { background: var(--badm-surface-hover); }
.badm-social__platform-btn input:checked + .badm-social__platform-chip {
    border-color: var(--platform-color, var(--badm-primary));
    background: color-mix(in srgb, var(--platform-color, var(--badm-primary)) 8%, transparent);
}

/* ── Connection cards ── */
/* badm-social__connections migrovano na badm-card-grid--wide */
.badm-social__conn-card {
    background: var(--badm-surface); border: 1px solid var(--badm-border);
    border-radius: var(--badm-radius); overflow: hidden;
}
.badm-social__conn-header {
    display: flex; align-items: center; gap: 0.8rem;
    padding: 0.8rem 1rem; border-bottom: 1px solid var(--badm-border);
}
.badm-social__conn-icon { font-size: 1.5rem; }
.badm-social__conn-header strong { display: block; font-size: 0.95rem; }
.badm-social__conn-header small { color: var(--badm-text-muted); font-size: 0.75rem; }
.badm-social__conn-body {
    padding: 0.8rem 1rem;
    display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
}
.badm-social__conn-detail { font-size: 0.8rem; color: var(--badm-text-muted); }

/* ── History table ── */
.badm-social__history { overflow-x: auto; }
.badm-social__history-content { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ==========================================================
   ADMIN HELP – rollout napoveda s markdown obsahem
   ========================================================== */
.badm-help { position: relative; z-index: 10; }

.badm-help__trigger {
    position: absolute;
    top: 4px;
    right: 0;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--badm-primary);
    padding: 4px 8px;
    transition: opacity 0.2s;
    z-index: 11;
}
.badm-help__trigger i { font-size: 1.1rem; vertical-align: -1px; margin-left: 2px; }
.badm-help__trigger:hover { opacity: 0.8; }
.badm-help__trigger--empty { opacity: 0.3; color: var(--badm-text-muted); }
.badm-help__trigger--empty:hover { opacity: 0.6; }

.badm-help__panel {
    display: none;
    border: 1px dashed var(--badm-border);
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 16px;
    background: #fefce8;
    font-size: 0.8rem;
    line-height: 1.45;
}
.badm-help.is-open .badm-help__panel,
.badm-help__panel.is-open { display: block; }

/* Markdown obsah */
.badm-help__content p { margin: 0 0 6px; }
.badm-help__content p:last-child { margin-bottom: 0; }
.badm-help__content ul,
.badm-help__content ol { margin: 0 0 6px; padding-left: 20px; }
.badm-help__content li { margin-bottom: 1px; }
.badm-help__content h2 { font-size: 0.88rem; margin: 10px 0 4px; }
.badm-help__content h3 { font-size: 0.84rem; margin: 8px 0 3px; }
.badm-help__content code {
    background: rgba(0,0,0,0.06);
    padding: 1px 3px;
    border-radius: 3px;
    font-size: 0.85em;
}
.badm-help__content strong { font-weight: 600; }
.badm-help__content table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0;
    font-size: inherit;
}
.badm-help__content th,
.badm-help__content td {
    border: 1px solid var(--badm-border);
    padding: 4px 8px;
    text-align: left;
    vertical-align: top;
}
.badm-help__content tr:first-child th,
.badm-help__content tr:first-child td { border-top: none; }
.badm-help__content tr:last-child th,
.badm-help__content tr:last-child td { border-bottom: none; }
.badm-help__content th:first-child,
.badm-help__content td:first-child { border-left: none; }
.badm-help__content th:last-child,
.badm-help__content td:last-child { border-right: none; }
.badm-help__content th {
    background: rgba(0,0,0,0.04);
    font-weight: 600;
}
.badm-help__content tr:hover td {
    background: rgba(0,0,0,0.02);
}

/* Akce (tlacitko Upravit) */
.badm-help__actions { margin-top: 10px; text-align: right; }
.badm-help__actions .badm-btn i,
.badm-help__editor-actions .badm-btn i { margin-right: 4px; }

/* Editor */
.badm-help__textarea {
    width: 100%;
    min-height: 150px;
    font-family: "SFMono-Regular", "Consolas", "Liberation Mono", "Menlo", monospace;
    font-size: 0.82rem;
    line-height: 1.5;
    padding: 10px;
    border: 1px solid var(--badm-border);
    border-radius: 4px;
    resize: vertical;
    background: var(--badm-surface);
    color: var(--badm-text);
}
.badm-help__textarea:focus {
    outline: none;
    border-color: var(--badm-primary);
    box-shadow: 0 0 0 2px rgba(255, 128, 20, 0.15);
}
.badm-help__editor-actions {
    margin-top: 8px;
    display: flex;
    gap: 8px;
}

/* ============================================================
   WEB ANALYTICS TAB (GA4 + GSC)
   ============================================================ */

.badm-flash {
    padding: 10px 16px;
    margin-bottom: 16px;
    border-radius: 4px;
    font-size: 14px;
}
.badm-flash--ok {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.badm-wa__reauth {
    margin-bottom: 16px;
}

/* badm-wa__site-badge migrovano na badm-tag */

.badm-wa__page-url {
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================================
   KREATIVY (badm-crv)
   ============================================================ */

/* -- Hledani potisku -- */
.badm-crv__search { position: relative; max-width: 500px; margin-bottom: 1rem; }
.badm-crv__search-results {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 100;
    background: var(--badm-bg-card, #fff); border: 1px solid var(--badm-border, #ddd);
    border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,.12);
    max-height: 320px; overflow-y: auto;
}
.badm-crv__search-item {
    display: flex; align-items: center; gap: .5rem;
    padding: .5rem .75rem; cursor: pointer; text-decoration: none; color: inherit;
}
.badm-crv__search-item:hover { background: var(--badm-bg-hover, #f5f5f5); }
.badm-crv__search-color {
    width: 20px; height: 20px; border-radius: 4px; flex-shrink: 0;
    border: 1px solid rgba(0,0,0,.1);
}
.badm-crv__search-empty { padding: .75rem; color: var(--badm-text-muted, #999); }

/* -- Vybrany potisk -- */
.badm-crv__selected { margin: 1rem 0; }
.badm-crv__selected-info { margin-bottom: .5rem; }
.badm-crv__preview img { max-width: 300px; max-height: 300px; border-radius: 6px; border: 1px solid var(--badm-border, #ddd); }

/* -- Posledni potisky grid -- */
.badm-crv__recent { margin-top: 1rem; }
.badm-crv__recent h3 { font-size: .9rem; margin-bottom: .5rem; }
.badm-crv__recent-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: .5rem;
}
.badm-crv__recent-item {
    position: relative;
    display: flex; flex-direction: column; align-items: center;
    text-decoration: none; color: inherit; padding: .25rem;
    border-radius: 6px; transition: background .15s;
}
.badm-crv__badge {
    position: absolute; top: 0; right: 0; z-index: 1;
    min-width: 18px; height: 18px; line-height: 18px;
    padding: 0 5px; border-radius: 9px;
    background: #4caf50; color: #fff;
    font-size: .65rem; font-weight: 700; text-align: center;
}
.badm-crv__recent-item:hover { background: var(--badm-bg-hover, #f5f5f5); }
.badm-crv__recent-item img {
    width: 60px; height: 60px; object-fit: contain;
    border-radius: 4px; border: 1px solid var(--badm-border, #ddd);
    margin-bottom: .25rem;
}
.badm-crv__recent-item small { font-size: .7rem; text-align: center; word-break: break-word; }

/* -- Color picker -- */
.badm-crv__color-picker { display: flex; align-items: center; gap: .75rem; }
.badm-crv__color-picker input[type="color"] {
    width: 44px; height: 36px; padding: 2px; border: 1px solid var(--badm-border, #ddd);
    border-radius: 4px; cursor: pointer;
}

/* -- Vyber sablon -- */
.badm-crv__templates { display: flex; flex-wrap: wrap; gap: .5rem; }
.badm-crv__template-option {
    display: flex; align-items: center; gap: .5rem;
    padding: .5rem .75rem; border: 1px solid var(--badm-border, #ddd);
    border-radius: 6px; cursor: pointer; transition: border-color .15s;
}
.badm-crv__template-option:hover { border-color: var(--badm-primary, #2563eb); }
.badm-crv__template-option input:checked + .badm-crv__template-label {
    color: var(--badm-primary, #2563eb); font-weight: 600;
}
.badm-crv__template-label { display: flex; flex-direction: column; align-items: flex-start; }
.badm-crv__template-label small { color: var(--badm-text-muted, #999); font-weight: 400; }
.badm-crv__template-thumb {
    display: block; border: 1px solid #ccc; border-radius: 3px; background: #f5f5f5;
    margin-bottom: .3rem; position: relative; overflow: hidden;
}
.badm-crv__template-thumb-layer {
    position: absolute; border-radius: 2px; opacity: .6;
}

/* -- Vysledky generovani -- */
/* badm-crv__results-grid migrovano na badm-card-grid--narrow */
.badm-crv__result {
    border: 1px solid var(--badm-border, #ddd); border-radius: 8px;
    overflow: hidden; background: var(--badm-bg-card, #fff);
}
.badm-crv__result img { width: 100%; display: block; }
.badm-crv__result-meta { padding: .5rem .75rem; }
.badm-crv__result-meta small { color: var(--badm-text-muted, #999); }
.badm-crv__result-actions { padding: .5rem .75rem; display: flex; gap: .5rem; border-top: 1px solid var(--badm-border, #eee); }

/* -- Knihovna grid -- */
/* badm-crv__library-grid migrovano na badm-card-grid--tight */
.badm-crv__library-item {
    border: 1px solid var(--badm-border, #ddd); border-radius: 8px;
    overflow: hidden; background: var(--badm-bg-card, #fff); position: relative;
}
.badm-crv__library-item img { width: 100%; display: block; object-fit: contain; cursor: pointer; }
.badm-crv__library-item video { width: 100%; display: block; }
.badm-crv__library-meta { padding: .5rem .75rem; }
.badm-crv__library-meta strong { display: block; font-size: .85rem; }
.badm-crv__library-meta small { display: block; color: var(--badm-text-muted, #999); font-size: .75rem; }
.badm-crv__library-actions { position: absolute; top: .4rem; right: .4rem; padding: 0; border: none; opacity: 0; transition: opacity .15s; }
.badm-crv__library-actions--left { right: auto; left: .4rem; }
.badm-crv__library-item:hover .badm-crv__library-actions { opacity: 1; }
.badm-crv__library-actions .badm-btn { box-shadow: 0 1px 3px rgba(0,0,0,.3); }

/* -- Upload formular -- */
.badm-crv__upload-form { margin-bottom: .5rem; }
.badm-crv__upload-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

/* -- Social picker modal -- */
.badm-modal__dialog--wide { max-width: 1050px; }
.badm-crv-picker__grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: .75rem; max-height: 60vh; overflow-y: auto; padding: .5rem 0;
}
.badm-crv-picker__item {
    border: 2px solid transparent; border-radius: 8px; overflow: hidden;
    cursor: pointer; transition: border-color .15s;
}
.badm-crv-picker__item:hover { border-color: var(--badm-primary, #2563eb); }
.badm-crv-picker__item img { width: 100%; display: block; aspect-ratio: 1; object-fit: cover; }
.badm-crv-picker__meta { padding: .25rem .5rem; }
.badm-crv-picker__meta small { display: block; font-size: .7rem; color: var(--badm-text-muted, #999); }

/* Editor sablon */
.badm-crv-tpl-editor__row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; margin-bottom: .75rem; }
.badm-crv-tpl-editor__row label { display: flex; flex-direction: column; gap: .2rem; font-size: .85rem; font-weight: 500; }
.badm-crv-tpl-editor__input--sm { width: 90px !important; }
.badm-crv-tpl-editor__layer {
    border: 1px solid var(--badm-border, #ddd); border-radius: 6px;
    margin-bottom: .5rem; background: var(--badm-bg-alt, #fafafa);
}
.badm-crv-tpl-editor__layer-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: .5rem .75rem; border-bottom: 1px solid var(--badm-border, #eee);
    background: var(--badm-bg-hover, #f5f5f5); border-radius: 6px 6px 0 0;
}
.badm-crv-tpl-editor__layer-header strong { font-size: .85rem; }
.badm-crv-tpl-editor__layer-body {
    padding: .75rem; display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end;
}
.badm-crv-tpl-editor__layer-body label { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; white-space: nowrap; }
.badm-crv-tpl-editor__layer-body br { width: 100%; }
.badm-crv-tpl-editor__druhy { display: flex; flex-wrap: wrap; gap: .25rem .75rem; margin-top: .25rem; }
.badm-crv-tpl-editor__druh-label { font-size: .8rem; display: inline-flex; align-items: center; gap: .2rem; }

/* Video animace */
.badm-crv__video-progress { padding: 1.5rem; background: var(--badm-bg-alt, #f8f9fa); border-radius: 8px; text-align: center; }
.badm-crv__video-progress i { margin-right: .5rem; color: var(--badm-primary, #e8740c); }
.badm-crv__video-progress-bar { margin-top: .75rem; height: 6px; background: var(--badm-border, #ddd); border-radius: 3px; overflow: hidden; }
.badm-crv__video-progress-bar > div { height: 100%; width: 0; background: var(--badm-primary, #e8740c); border-radius: 3px; transition: width .5s ease; }
.badm-crv__video-result { text-align: center; }
.badm-crv__video-result video { border-radius: 8px; border: 1px solid var(--badm-border, #ddd); }
.badm-crv__vtpl-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.badm-crv__vtpl-option { display: flex; align-items: flex-start; gap: .5rem; padding: .75rem 1rem; border: 2px solid var(--badm-border, #ddd); border-radius: 8px; cursor: pointer; transition: border-color .15s; }
.badm-crv__vtpl-option:hover { border-color: var(--badm-primary, #e8740c); }
.badm-crv__vtpl-option input:checked + .badm-crv__vtpl-option-body { color: var(--badm-primary, #e8740c); }
.badm-crv__vtpl-option input { margin-top: .15rem; }
.badm-crv__vtpl-option-body { display: flex; flex-direction: column; }
.badm-crv__vtpl-option-body small { color: var(--badm-text-muted, #999); font-weight: 400; }
.badm-crv-vtpl-editor .badm-crv-tpl-editor__row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; margin-bottom: .75rem; }
.badm-crv-vtpl-editor .badm-crv-tpl-editor__row label { display: flex; flex-direction: column; gap: .2rem; font-size: .85rem; font-weight: 500; }

/* -- Knihovna: play overlay na videu -- */
.badm-crv__library-thumb { position: relative; cursor: pointer; }
.badm-crv__library-thumb video { width: 100%; display: block; }
.badm-crv__library-play {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,.25); opacity: 0; transition: opacity .15s;
    font-size: 2rem; color: #fff;
}
.badm-crv__library-thumb:hover .badm-crv__library-play { opacity: 1; }

/* -- Lightbox -- */
.badm-crv-lightbox__dialog { max-width: 90vw; width: auto; max-height: 90vh; }
.badm-crv-lightbox__body { padding: 0; display: flex; align-items: center; justify-content: center; background: #000; }
.badm-crv-lightbox__body video,
.badm-crv-lightbox__body img { max-width: 85vw; max-height: 80vh; display: block; border-radius: 0; }

/* ═══════════════════════════════════════════════════════
   Advisor – chatbot UI
   ═══════════════════════════════════════════════════════ */
.badm-advisor__meta { font-size: .8rem; color: #999; font-weight: 400; }

/* Centrovani */
.badm-advisor { max-width: 640px; margin: 0 auto; }

.badm-advisor__chat {
    border: 1px solid #ddd; border-radius: 8px; background: #fafafa;
    display: flex; flex-direction: column; min-height: 500px; max-height: 70vh;
}
.badm-advisor__msgs {
    flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px;
}
.badm-advisor__msg { max-width: 85%; display: flex; flex-direction: column; }
.badm-advisor__msg--user { align-self: flex-end; }
.badm-advisor__msg--assistant { align-self: flex-start; }

.badm-advisor__msg-text {
    padding: 10px 14px; border-radius: 12px; font-size: .95rem; line-height: 1.5;
    word-wrap: break-word;
}
.badm-advisor__msg--user .badm-advisor__msg-text {
    background: #007bff; color: #fff; border-bottom-right-radius: 4px;
}
.badm-advisor__msg--assistant .badm-advisor__msg-text {
    background: #fff; border: 1px solid #ddd; border-bottom-left-radius: 4px;
}
.badm-advisor__msg-text em { font-style: italic; color: inherit; opacity: .85; }
.badm-advisor__sep { border: none; border-top: 1px solid #e5e5e5; margin: 8px 0; }
.badm-advisor__examples { font-size: .85rem; color: #888; }

/* Produktove karty */
.badm-advisor__products { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.badm-advisor__product {
    display: flex; flex-direction: column; padding: 8px; background: #f5f5f5; border-radius: 8px;
    border: 1px solid #eee; text-decoration: none; color: inherit; transition: border-color .15s;
}
.badm-advisor__product:hover { border-color: #007bff; }
.badm-advisor__product-img {
    width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 6px; background: #fff;
}
.badm-advisor__product-info { padding-top: 6px; }
.badm-advisor__product-name { font-weight: 600; font-size: .85rem; }
.badm-advisor__product-reason { font-size: .8rem; color: #666; margin-top: 2px; }

/* Akcni tlacitka po doporuceni */
.badm-advisor__actions {
    display: flex; gap: 8px; padding: 12px; border-top: 1px solid #ddd;
    background: #fafafa; border-radius: 0 0 8px 8px; justify-content: center;
}
.badm-advisor__actions .badm-btn { flex: 0 1 auto; min-width: 100px; }

/* Loading */
.badm-advisor__loading {
    align-self: flex-start; padding: 10px 14px; background: #fff; border: 1px solid #ddd;
    border-radius: 12px; border-bottom-left-radius: 4px; color: #999; font-size: .9rem;
}
@keyframes badm-dots { 0%,80%,100% { opacity: .3; } 40% { opacity: 1; } }
.badm-advisor__loading span { animation: badm-dots 1.4s infinite; display: inline-block; }
.badm-advisor__loading span:nth-child(2) { animation-delay: .2s; }
.badm-advisor__loading span:nth-child(3) { animation-delay: .4s; }

/* Input */
.badm-advisor__input {
    display: flex; gap: 8px; padding: 12px; border-top: 1px solid #ddd; background: #fff;
    border-radius: 0 0 8px 8px;
}
.badm-advisor__input .badm-input { flex: 1; }

/* Provider toggle */
.badm-advisor__toggle { display: inline-flex; margin-left: 4px; }
.badm-advisor__toggle-btn {
    padding: 4px 10px; border: 1px solid #ccc; background: #f5f5f5;
    cursor: pointer; font-size: 12px; color: #666; line-height: 1.4;
}
.badm-advisor__toggle-btn:first-child { border-radius: 4px 0 0 4px; }
.badm-advisor__toggle-btn:last-child { border-radius: 0 4px 4px 0; }
.badm-advisor__toggle-btn + .badm-advisor__toggle-btn { border-left: 0; }
.badm-advisor__toggle-btn--active { background: #333; color: #fff; border-color: #333; }

/* Stats bar */
.badm-advisor__stats {
    display: flex; gap: 16px; padding: 8px 12px; margin-top: 8px;
    font-size: .75rem; color: #999; font-family: monospace; justify-content: center;
}
.badm-advisor__stats-item { white-space: nowrap; }


/* ═══════════════════════════════════════════════════════════
   Error Log
   ═══════════════════════════════════════════════════════════ */
.badm-errlog { max-width: 1100px; }
.badm-errlog__empty { color: #999; font-style: italic; padding: 24px 0; }

/* Analyzy – karty */
/* badm-errlog__analyses → badm-card-stack, badm-errlog__card → badm-card + badm-card--warn/danger/ok */
/* badm-errlog__card-header → badm-card__header */
.badm-errlog__date { font-size: .8rem; color: #6b7280; }
.badm-errlog__period { font-size: .8rem; color: #9ca3af; }
.badm-errlog__meta { display: flex; gap: 6px; margin-left: auto; }
.badm-errlog__summary { margin: 0 0 6px; font-size: .9rem; color: #374151; }

/* Severity badges */
.badm-severity {
    display: inline-block; padding: 2px 8px; border-radius: 4px;
    font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
}
.badm-severity--ok { background: #dcfce7; color: #15803d; }
.badm-severity--warning { background: #fef3c7; color: #b45309; }
.badm-severity--critical { background: #fee2e2; color: #b91c1c; }

/* Details – rozbalovaci */
.badm-errlog__details { margin-top: 8px; }
.badm-errlog__details summary { cursor: pointer; font-size: .82rem; color: #6b7280; }
.badm-errlog__analysis {
    font-size: .82rem; line-height: 1.7; color: #374151;
    padding: 12px 16px; margin: 6px 0 0;
    background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 6px;
    max-height: 500px; overflow-y: auto;
}
.badm-errlog__pre {
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 4px;
    padding: 10px 12px; font-size: .78rem; white-space: pre-wrap; word-break: break-word;
    margin: 6px 0 0; max-height: 400px; overflow-y: auto;
}
.badm-errlog__pre--sm { max-height: 200px; font-size: .72rem; }

/* Raw data – tlacitka v karte analyzy */
.badm-errlog__raw {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #e5e7eb;
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}
.badm-errlog__raw-label {
    font-size: .75rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 600;
}

/* Raw data – obsah modalu */
.badm-errlog__raw-header {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: .82rem;
    line-height: 1.6;
    color: #374151;
}
.badm-errlog__raw-totals {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.badm-errlog__raw-table-wrap {
    max-height: 60vh;
    overflow-y: auto;
    margin-top: 8px;
}
.badm-errlog__raw-code {
    display: block;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: .72rem;
    color: #374151;
    white-space: pre-wrap;
    word-break: break-word;
    max-width: 600px;
}

/* Globalni banner bezicich cronu (fixni dole) */
.badm-cron-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 900;
    padding: 8px 20px;
    background: #1e40af;
    color: #fff;
    font-size: .82rem;
    text-align: center;
    box-shadow: 0 -2px 8px rgba(0,0,0,.15);
}
.badm-cron-banner.is-hidden { display: none; }
/* Kdyz je banner viditelny, pridat padding dole na sidebar a content */
body:has(.badm-cron-banner:not(.is-hidden)) .badm-sidebar { padding-bottom: 40px; }
body:has(.badm-cron-banner:not(.is-hidden)) main { padding-bottom: 40px; }
.badm-cron-banner__time { opacity: .7; font-size: .75rem; }

/* Bezici crony – alert v Error Log */
.badm-errlog__running-crons {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    padding: 8px 14px;
    margin-bottom: 12px;
    background: var(--badm-info-light, #eff6ff);
    border: 1px solid #bfdbfe;
    border-radius: var(--badm-radius);
    font-size: .82rem;
    color: var(--badm-info, #2563eb);
}

/* Timeline – hodinove sbery */
.badm-errlog__timeline {
    background: var(--badm-surface);
    border: 1px solid var(--badm-border);
    border-radius: var(--badm-radius);
    padding: 10px 14px;
    margin-bottom: 16px;
}
.badm-errlog__timeline-label {
    font-size: .72rem;
    color: var(--badm-text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
}
.badm-errlog__timeline-row {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
    align-items: center;
}
.badm-errlog__timeline-dot {
    width: 14px;
    height: 14px;
    border-radius: 2px;
    cursor: pointer;
    transition: transform .1s;
    border: 1px solid transparent;
}
.badm-errlog__timeline-dot:hover {
    transform: scale(1.4);
    border-color: var(--badm-text);
}
/* Collect popup – prepinace zdroju */
.badm-errlog__collect-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--badm-border);
}

/* Hodinovy sber – 6 kategorii (4 frontend mutace + admin + mozek).
   Kazda kategorie ma vlastni 48h timeline na strance Error Log.
   Layout: 3 sloupce na desktopu (2 radky × 3), 2 pod 1100px, 1 pod 700px. */
.badm-errlog__cats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--badm-gap);
    margin-bottom: var(--badm-gap);
}
@media (max-width: 1100px) {
    .badm-errlog__cats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
    .badm-errlog__cats { grid-template-columns: 1fr; }
}
.badm-errlog__cat {
    border: 1px solid var(--badm-border);
    border-left-width: 4px;
    border-radius: var(--badm-radius);
    padding: 8px 10px;
    background: var(--badm-bg);
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.badm-errlog__cat-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
/* Auto-fill: 14px dotu se vejde tolik kolik je sirka karty (nezavisi na
   poctu sloupcu nadrazeneho gridu). LIMIT=96 zustava. */
.badm-errlog__cat-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, 14px);
    gap: 3px;
    overflow: hidden;
}

/* Barvy per kategorie – akcent vlevo + barva titulku.
   Frontend mutace (cz/eu/sk/de) = info (modra), admin = primary (purple),
   mozek = success (zelena). Konkretni mutace se pozna podle titulku. */
.badm-errlog__cat--cz .badm-errlog__cat-title,
.badm-errlog__cat--eu .badm-errlog__cat-title,
.badm-errlog__cat--sk .badm-errlog__cat-title,
.badm-errlog__cat--de .badm-errlog__cat-title { color: var(--badm-info); }
.badm-errlog__cat--cz,
.badm-errlog__cat--eu,
.badm-errlog__cat--sk,
.badm-errlog__cat--de { border-left-color: var(--badm-info); }
.badm-errlog__cat--admin .badm-errlog__cat-title { color: var(--badm-primary); }
.badm-errlog__cat--admin { border-left-color: var(--badm-primary); }
.badm-errlog__cat--mozek .badm-errlog__cat-title { color: var(--badm-success); }
.badm-errlog__cat--mozek { border-left-color: var(--badm-success); }

.badm-errlog__timeline-dot--ok       { background: var(--badm-success); }
.badm-errlog__timeline-dot--warning   { background: var(--badm-warning); }
.badm-errlog__timeline-dot--critical  { background: var(--badm-danger); }

/* Cron logy – status pills */
.badm-cron-status {
    display: inline-block; padding: 1px 7px; border-radius: 3px;
    font-size: .72rem; font-weight: 600; letter-spacing: .03em;
}
.badm-cron-status--ok { background: #dcfce7; color: #15803d; }
.badm-cron-status--warning { background: #fef3c7; color: #b45309; }
.badm-cron-status--error { background: #fee2e2; color: #b91c1c; }
.badm-cron-status--running { background: #e0e7ff; color: #3730a3; }

.badm-errlog__cron-time { font-size: .78rem; white-space: nowrap; color: #6b7280; }
.badm-errlog__cron-name { font-family: monospace; font-size: .82rem; }
.badm-errlog__cron-row--error td { background: #fff5f5; }
.badm-errlog__cron-row--warning td { background: #fffbeb; }
.badm-errlog__running { color: #9ca3af; font-style: italic; }
.badm-errlog__error-msg {
    background: #fff5f5; border: 1px solid #fecaca; border-radius: 3px;
    padding: 6px 10px; font-size: .8rem; color: #b91c1c; margin-bottom: 6px;
}
.badm-errlog__inline-details summary { cursor: pointer; font-size: .78rem; color: #9ca3af; }
.badm-errlog__progress { margin-left: 8px; display: inline-block; min-width: 220px; }
.badm-errlog__progress-info { font-size: .85rem; color: #374151; margin-bottom: 4px; }
.badm-errlog__progress-bar { height: 6px; background: #e5e7eb; border-radius: 3px; overflow: hidden; }
.badm-errlog__progress-fill { height: 100%; width: 0; background: #f97316; border-radius: 3px; transition: width .3s ease; }

/* ═══════════════════════════════════════════════════════════
   CREATIVE BANK – Banka kreativ
   ═══════════════════════════════════════════════════════════ */

/* Toolbar */
.badm-bank__toolbar { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.badm-bank__tag-filters { display: flex; gap: .4rem; flex-wrap: wrap; }
.badm-bank__tag-chip { padding: .25rem .65rem; border-radius: 999px; font-size: .78rem; cursor: pointer; border: 1.5px solid #d1d5db; background: #f9fafb; color: #374151; transition: background .15s, border-color .15s; }
.badm-bank__tag-chip:hover { border-color: #6366f1; color: #4f46e5; }
.badm-bank__tag-chip.is-active { background: #6366f1; border-color: #6366f1; color: #fff; }

/* Grid */
/* badm-bank__grid migrovano na badm-card-grid badm-card-grid--cols-4 */
.badm-bank__loading { grid-column: 1/-1; text-align: center; color: #9ca3af; padding: 2rem; }
.badm-bank__empty { grid-column: 1/-1; text-align: center; color: #9ca3af; padding: 3rem 1rem; font-size: .95rem; }

/* Karta */
.badm-bank__card { background: var(--badm-surface); border: 1px solid var(--badm-border); border-radius: var(--badm-radius); overflow: hidden; cursor: pointer; transition: box-shadow .2s, transform .15s; }
.badm-bank__card:hover { box-shadow: 0 6px 24px rgba(0,0,0,.13); transform: translateY(-2px); }
.badm-bank__thumb { aspect-ratio: 1/1; overflow: hidden; background: #f3f4f6; position: relative; }
.badm-bank__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.badm-bank__thumb-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #d1d5db; font-size: 2.5rem; }
.badm-bank__card-body { padding: .75rem; }
.badm-bank__card-name { font-size: .8rem; font-weight: 600; color: #111; margin-bottom: .15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badm-bank__card-ad { font-size: .72rem; color: #7c3aed; margin-bottom: .1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badm-bank__card-campaign { font-size: .72rem; color: #6b7280; margin-bottom: .5rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badm-bank__card-metrics { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .5rem; }
.badm-bank__metric { font-size: .72rem; padding: .15rem .4rem; border-radius: 4px; font-weight: 600; }
.badm-bank__metric--roas { background: #dcfce7; color: #15803d; }
.badm-bank__metric--pno  { background: #fef9c3; color: #a16207; }
.badm-bank__metric--spend { background: #f3f4f6; color: #374151; }
.badm-bank__card-tags { display: flex; gap: .3rem; flex-wrap: wrap; }
.badm-bank__card-tag { font-size: .68rem; padding: .1rem .4rem; border-radius: 999px; background: #ede9fe; color: #5b21b6; }

/* Modal */
.badm-bank__modal-dialog { max-width: 780px; max-height: 90vh; overflow: hidden; }
.badm-bank__modal-dialog .badm-modal__body { flex: 1; overflow-y: auto; }
.badm-bank__modal-content { display: grid; grid-template-columns: 160px 1fr; gap: 1.5rem; align-items: start; }
@media (max-width: 680px) { .badm-bank__modal-content { grid-template-columns: 1fr; } }
.badm-bank__modal-thumb { width: 160px; height: 160px; border-radius: var(--badm-radius); overflow: hidden; background: #f3f4f6; flex-shrink: 0; }
.badm-bank__modal-thumb img { width: 100%; height: 100%; object-fit: contain; }
.badm-bank__modal-info { display: flex; flex-direction: column; gap: .75rem; }
.badm-bank__modal-name { font-size: 1rem; font-weight: 700; color: #111; }
.badm-bank__modal-sub { font-size: .82rem; color: #6b7280; }
.badm-bank__modal-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.badm-bank__modal-metric { background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 6px; padding: .4rem .6rem; }
.badm-bank__modal-metric__label { font-size: .7rem; color: #9ca3af; }
.badm-bank__modal-metric__val { font-size: .92rem; font-weight: 700; color: #111; }
.badm-bank__modal-body { font-size: .82rem; color: #374151; line-height: 1.5; max-height: 80px; overflow-y: auto; }
.badm-bank__modal-section-label { font-size: .75rem; font-weight: 600; color: #374151; text-transform: uppercase; letter-spacing: .04em; }

/* Tag editor v modalu */
.badm-bank__tag-input-row { display: flex; gap: .4rem; }
.badm-bank__tag-input-row input { flex: 1; }
.badm-bank__tag-list { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .4rem; min-height: 1.5rem; }
.badm-bank__modal-tag { font-size: .78rem; padding: .2rem .55rem; border-radius: 999px; background: #ede9fe; color: #5b21b6; cursor: pointer; transition: background .15s; }
.badm-bank__modal-tag:hover { background: #c4b5fd; }
.badm-bank__ai-tags { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .35rem; }
.badm-bank__ai-tag { font-size: .75rem; padding: .18rem .5rem; border-radius: 999px; background: #e0f2fe; color: #0369a1; cursor: pointer; border: 1px dashed #7dd3fc; }
.badm-bank__ai-tag:hover { background: #bae6fd; }

/* Tlacitko Pridat do banky v AI analyze */
.badm-bank__save-btn { font-size: .72rem; padding: .1rem .4rem; border-radius: 4px; border: 1px solid #d1d5db; background: #f9fafb; cursor: pointer; color: #374151; margin-left: .4rem; vertical-align: middle; transition: background .15s; }
.badm-bank__save-btn:hover { background: #ede9fe; border-color: #a78bfa; color: #5b21b6; }
.badm-bank__save-btn.is-saved { background: #dcfce7; border-color: #86efac; color: #15803d; cursor: default; }

/* ── Newsletter ─────────────────────────────────────── */
.badm-nl__th-campaign { min-width: 20rem; }
.badm-nl__campaign-name { }
.badm-nl__subject { font-size: .82rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badm-nl__title { font-size: .7rem; color: var(--badm-text-muted); margin-top: .15rem; }
.badm-nl__gloss-toggle {
    font-size: .72rem; color: var(--badm-text-muted); margin-top: .15rem;
    cursor: pointer; display: inline-flex; align-items: center; gap: .3rem;
}
.badm-nl__gloss-toggle:hover { color: var(--badm-primary); }
.badm-nl__gloss-icon { font-size: .65rem; }
.badm-nl__gloss-preview {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    font-style: italic; max-width: 25rem;
}
.badm-nl__gloss-toggle.is-open .badm-nl__gloss-preview { display: none; }
.badm-nl__gloss-toggle.is-open ~ .badm-nl__gloss-full { display: block; }
.badm-nl__gloss-full {
    display: none; font-size: .78rem; color: var(--badm-text-muted);
    font-style: italic; margin-top: .3rem; line-height: 1.5;
    padding: .4rem .6rem; background: var(--badm-surface-hover); border-radius: 4px;
}
.badm-nl__date { white-space: nowrap; color: var(--badm-text-muted); }
.badm-nl__rate { font-weight: 500; white-space: nowrap; min-width: 4rem; }
.badm-nl__or { position: relative; min-width: 5.5rem; }
.badm-nl__or-bar {
    position: absolute; inset: 2px auto 2px 2px; border-radius: 3px; opacity: .18;
    width: calc(var(--or-pct, 0) * 1%);
    background: hsl(calc(clamp(0, var(--or-pct, 0), 30) * 4), 70%, 50%);
}
.badm-nl__or-val { position: relative; font-weight: 600; }

/* ── Newsletter Plan ──────────────────────────────── */
.badm-nl__plan-section { margin-bottom: 1.5rem; }
.badm-nl__plan-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; }
.badm-nl__plan-table { table-layout: fixed; width: 100%; }
.badm-nl__plan-row { background: rgba(255, 193, 7, 0.06); border-left: 3px solid #ffc107; }
.badm-nl__plan-row:hover { background: rgba(255, 193, 7, 0.12); }
.badm-nl__plan-date { white-space: nowrap; line-height: 1.1; min-width: 82px; }
.badm-nl__plan-week { font-size: 15px; font-weight: 700; color: var(--badm-text); }
.badm-nl__plan-day { font-size: 12px; color: var(--badm-text-muted); }
.badm-nl__plan-potisk-cell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badm-nl__plan-potisk-cell img { width: 24px; height: 24px; object-fit: contain; vertical-align: middle; margin-right: .25rem; border-radius: 2px; }
.badm-nl__plan-edit, .badm-nl__plan-edit-row td { background: var(--badm-surface); border: 1px solid var(--badm-border); border-radius: var(--badm-radius); }
.badm-nl__plan-edit { padding: 1rem; margin-bottom: .75rem; }
.badm-nl__plan-edit-row td { padding: 1rem !important; }
.badm-nl__plan-form { display: flex; flex-direction: column; gap: .6rem; }
.badm-nl__plan-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.badm-nl__plan-form-row--3col { grid-template-columns: 1fr 1fr 1fr; }
.badm-nl__plan-field label { display: block; font-size: .7rem; font-weight: 600; color: var(--badm-text-muted); text-transform: uppercase; letter-spacing: .3px; margin-bottom: .2rem; }
.badm-nl__plan-form-actions { display: flex; gap: .5rem; margin-top: .25rem; }
/* Digi potisky – multi-select */
.badm-nl__plan-multi-wrap { position: relative; }
.badm-nl__plan-multi-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .35rem; }
.badm-nl__plan-digi-cell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badm-nl__plan-digi-cell img { width: 24px; height: 24px; object-fit: contain; vertical-align: middle; margin-right: .15rem; border-radius: 2px; }
/* Potisk autocomplete */
.badm-nl__plan-potisk-wrap { position: relative; }
.badm-nl__plan-potisk-results { position: absolute; top: 100%; left: 0; right: 0; z-index: 50; background: var(--badm-surface); border: 1px solid var(--badm-border); border-radius: var(--badm-radius); max-height: 200px; overflow-y: auto; box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.badm-nl__plan-potisk-item { display: flex; align-items: center; gap: .4rem; padding: .4rem .6rem; cursor: pointer; font-size: .8rem; }
.badm-nl__plan-potisk-item:hover { background: var(--badm-bg); }
.badm-nl__plan-potisk-thumb { width: 28px; height: 28px; object-fit: contain; border-radius: 2px; flex-shrink: 0; }
.badm-nl__plan-potisk-chip { display: flex; align-items: center; gap: .35rem; background: var(--badm-bg); border: 1px solid var(--badm-border); border-radius: var(--badm-radius); padding: .25rem .5rem; font-size: .8rem; }
.badm-nl__plan-potisk-clear { background: none; border: none; cursor: pointer; font-size: 1rem; color: var(--badm-text-muted); padding: 0 .15rem; line-height: 1; }
.badm-nl__plan-potisk-clear:hover { color: var(--badm-danger, #e53e3e); }
/* Potisk hover preview – presunuto do sdileneho .badm-img-preview (viz vyse) */

/* ── Sdileny layout: obsah + sticky sidebar ─── */
/* Pouziva se pro: detail stranky s akcema (save/delete), Nastaveni modulu, atd. */
.badm-page-layout { display: grid; grid-template-columns: 1fr 240px; gap: 1.5rem; align-items: start; }
@media (max-width: 768px) { .badm-page-layout { grid-template-columns: 1fr; } }
.badm-page-layout__main { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.badm-page-layout__sidebar { position: sticky; top: 70px; display: flex; flex-direction: column; gap: .75rem; }
.badm-page-layout__header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
/* Akcni box v sidebaru (sticky save + status + odkazy) */
.badm-page-layout__actions { display: flex; flex-direction: column; gap: .35rem; padding: .85rem; background: var(--badm-surface); border: 1px solid var(--badm-border); border-radius: var(--badm-radius); }
.badm-page-layout__actions-row { display: flex; gap: .35rem; }
.badm-page-layout__actions-row > .badm-btn:first-child { flex: 1; }
.badm-page-layout__save-status { font-size: .75rem; color: var(--badm-text-muted); min-height: 1rem; text-align: center; }
.badm-page-layout__delete-link { display: block; text-align: center; font-size: .75rem; color: var(--badm-text-muted); text-decoration: none; margin-top: .35rem; }
.badm-page-layout__delete-link:hover { color: var(--badm-danger, #dc3545); text-decoration: underline; }
.badm-btn--block { width: 100%; justify-content: center; }

/* ── Newsletter Detail Workflow – modul-specificke prvky ── */
.badm-nl__detail-section .badm-section__header { display: flex; align-items: center; gap: .5rem; }
.badm-nl__check--done { color: var(--badm-success, #28a745); font-size: .8rem; }
.badm-nl__detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.badm-nl__detail-grid--3col { grid-template-columns: 1fr 1fr 1fr; }
.badm-nl__detail-field label { display: block; font-size: .7rem; font-weight: 600; color: var(--badm-text-muted); text-transform: uppercase; letter-spacing: .3px; margin-bottom: .2rem; }
.badm-nl__detail-gloss-linked { padding: .75rem; background: var(--badm-bg); border-radius: var(--badm-radius); border: 1px solid var(--badm-border); }
.badm-nl__detail-gloss-text { font-size: .85rem; line-height: 1.5; white-space: pre-wrap; }
.badm-nl__detail-gloss-actions { display: flex; gap: .5rem; }

/* ── Newsletter Basty picker (faze 3) ─────────────────────── */
.badm-nl__basty-picker { display: flex; gap: .75rem; align-items: center; }
.badm-nl__basty-preview { width: 80px; height: 91px; flex-shrink: 0; border: 1px solid var(--badm-border); border-radius: var(--badm-radius); background: repeating-conic-gradient(#f2f2f2 0% 25%, #fafafa 0% 50%) 50% / 12px 12px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.badm-nl__basty-thumb { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.badm-nl__basty-placeholder { color: var(--badm-text-muted); opacity: .4; font-size: 1.5rem; }
.badm-nl__basty-actions { display: flex; flex-direction: column; gap: .35rem; align-items: flex-start; }
.badm-nl__basty-name { font-size: .8rem; color: var(--badm-text-muted); font-family: monospace; }

/* Modal grid pro picker */
.badm-nl__basty-modal-search { margin-bottom: .75rem; }
.badm-nl__basty-modal-count { margin-left: .5rem; font-size: .75rem; color: var(--badm-text-muted); }
.badm-nl__basty-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .6rem; max-height: 60vh; overflow-y: auto; padding: .25rem; }
.badm-nl__basty-item { display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: .4rem; border: 1px solid var(--badm-border); border-radius: var(--badm-radius); background: var(--badm-surface); cursor: pointer; transition: border-color .15s; }
.badm-nl__basty-item:hover { border-color: var(--badm-primary); }
.badm-nl__basty-item.is-selected { border-color: var(--badm-primary); background: var(--badm-primary-light, #fff4ed); }
.badm-nl__basty-item-thumb { width: 90px; height: 102px; object-fit: contain; background: repeating-conic-gradient(#f2f2f2 0% 25%, #fafafa 0% 50%) 50% / 10px 10px; border-radius: 3px; }
.badm-nl__basty-item-name { font-size: .65rem; color: var(--badm-text-muted); font-family: monospace; word-break: break-all; text-align: center; line-height: 1.2; }

/* ── Newsletter Obrazky kampane (faze 4) ──────────────────── */
.badm-nl__images-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; }
.badm-nl__image-slot { display: flex; flex-direction: column; gap: .4rem; }
.badm-nl__image-preview { background: repeating-conic-gradient(#f2f2f2 0% 25%, #fafafa 0% 50%) 50% / 16px 16px; border: 1px solid var(--badm-border); border-radius: var(--badm-radius); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.badm-nl__image-thumb { max-width: 100%; max-height: 100%; display: block; object-fit: contain; }
.badm-nl__image-placeholder { color: var(--badm-text-muted); font-size: 2rem; opacity: .4; }
.badm-nl__image-meta { display: flex; flex-direction: column; font-size: .75rem; line-height: 1.3; }
.badm-nl__image-meta .badm-text-muted { font-size: .7rem; }
.badm-nl__image-actions { display: flex; gap: .3rem; flex-wrap: wrap; }
.badm-nl__image-actions .badm-btn { flex: 1 1 auto; min-width: 0; }
.nlDetImgUploadLabel { cursor: pointer; }

/* Readiness sidebar */
.badm-nl__readiness-bar { height: 6px; background: var(--badm-border); border-radius: 3px; overflow: hidden; margin-bottom: .35rem; }
.badm-nl__readiness-fill { height: 100%; background: var(--badm-success, #28a745); border-radius: 3px; transition: width .3s; }
.badm-nl__readiness-list { list-style: none; padding: 0; margin: .75rem 0 0; font-size: .8rem; }
.badm-nl__readiness-list li { padding: .25rem 0; color: var(--badm-text-muted); display: flex; align-items: center; gap: .4rem; }
.badm-nl__readiness-list li::before { content: '\f111'; font-family: 'Font Awesome 6 Free'; font-weight: 400; font-size: .5rem; color: var(--badm-border); }
.badm-nl__readiness-list li.is-done { color: var(--badm-text); }
.badm-nl__readiness-list li.is-done::before { content: '\f058'; font-weight: 900; color: var(--badm-success, #28a745); font-size: .7rem; }
.badm-nl__readiness-list a { color: inherit; text-decoration: none; }
.badm-nl__readiness-list a:hover { color: var(--badm-primary); }

/* ── Sdileny nav list pro sidebar ────────────── */
.badm-nav-list { list-style: none; padding: 0; margin: 0; font-size: .8rem; }
.badm-nav-list li { padding: 0; }
.badm-nav-list a { color: var(--badm-text); text-decoration: none; display: block; padding: .3rem .5rem; border-radius: 3px; }
.badm-nav-list a:hover { background: var(--badm-bg); color: var(--badm-primary); }

/* ── Newsletter Settings – specificke ────────── */
.badm-nl__settings-tuner-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .6rem; }
@media (max-width: 900px) { .badm-nl__settings-tuner-grid { grid-template-columns: 1fr; } }

/* ── Newsletter Plan Quick form ───────────────── */
.badm-nl__plan-quick { background: var(--badm-surface); border: 1px solid var(--badm-border); border-radius: var(--badm-radius); padding: .75rem 1rem; margin-bottom: .75rem; }
.badm-nl__plan-quick-row { display: flex; align-items: flex-end; gap: .75rem; flex-wrap: wrap; }
.badm-nl__plan-quick-actions { display: flex; gap: .5rem; margin-left: auto; }

/* ── Newsletter Subject AI ────────────────────── */
.badm-nl__subject-ai { display: flex; align-items: center; gap: .75rem; }
.badm-nl__subject-suggestions { display: flex; flex-direction: column; gap: .4rem; margin-top: .75rem; }
/* Override globalniho .badm label { display: block } */
label.badm-nl__subject-item { display: flex; flex-direction: row; align-items: center; gap: .75rem; padding: .6rem .75rem; border: 1px solid var(--badm-border); border-radius: var(--badm-radius); cursor: pointer; background: var(--badm-surface); font-size: inherit; font-weight: normal; color: inherit; margin-bottom: 0; }
.badm-nl__subject-item:hover { background: var(--badm-bg); border-color: var(--badm-primary); }
.badm-nl__subject-item input[type="radio"] { flex-shrink: 0; }
.badm-nl__subject-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .2rem; }
.badm-nl__subject-item-text { font-size: .85rem; font-weight: 500; line-height: 1.3; }
.badm-nl__subject-item-rationale { font-size: .75rem; color: var(--badm-text-muted); font-style: italic; font-weight: 400; }
.badm-nl__subject-item-preheader { font-size: .78rem; color: var(--badm-text); }
.badm-nl__subject-item-pre-icon { font-size: .65rem; opacity: .55; transform: scaleX(-1); }
.badm-nl__subject-item-meta { font-size: .7rem; margin-left: .35rem; flex-shrink: 0; font-weight: 400; }
.badm-nl__subject-len--ok { color: var(--badm-success, #28a745); }
.badm-nl__subject-len--warn { color: var(--badm-warning, #ffc107); }

/* ── Newsletter Glosa generator – krokove odsazeni ─ */
.badm-nl__glosa-step { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--badm-border); }
.badm-nl__glosa-step:first-child { margin-top: .75rem; padding-top: 0; border-top: none; }
.badm-nl__glosa-step-label { font-weight: 600; font-size: .75rem; color: var(--badm-text-muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: .6rem; }
.badm-nl__glosa-tuner { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; padding-top: .75rem; border-top: 1px solid var(--badm-border); align-items: center; }

/* ── Newsletter Campaign Plan Enrichment ─────────── */
.badm-nl__camp-plan-row td { padding: .25rem .75rem !important; background: rgba(255,193,7,0.06); border-top: none !important; }
.badm-nl__camp-plan { display: flex; align-items: center; gap: .5rem; font-size: .8rem; color: var(--badm-text-muted); flex-wrap: wrap; }
.badm-nl__camp-plan-icon { font-size: .7rem; color: var(--badm-warning); }
.badm-nl__camp-plan-label { white-space: nowrap; }
.badm-nl__camp-plan-sep { color: var(--badm-border); }

/* ── Newsletter Glosa ──────────────────────────────── */
.badm-glosa__actions-bar { display: flex; gap: .5rem; margin-bottom: 1rem; }
.badm-glosa__step { margin-bottom: 1.25rem; }
.badm-glosa__step-label { font-weight: 600; font-size: .85rem; color: var(--badm-text-muted); margin-bottom: .5rem; display: block; }
.badm-glosa__field { margin-top: .75rem; }
.badm-glosa__field label { font-size: .8rem; font-weight: 500; display: block; margin-bottom: .25rem; }
.badm-glosa__field--inline { display: inline-flex; align-items: center; gap: .5rem; margin-right: 1.5rem; }
.badm-glosa__field--inline label { display: inline; margin-bottom: 0; }
.badm-glosa__topics { display: flex; flex-direction: column; gap: .35rem; margin-top: .75rem; }
.badm-glosa__topic { display: flex; align-items: center; gap: .4rem; font-size: .85rem; padding: .35rem .5rem; border-radius: var(--badm-radius); cursor: pointer; }
.badm-glosa__topic:hover { background: var(--badm-hover); }
.badm-glosa__topic input[type="checkbox"] { margin: 0; }
.badm-glosa__source-link { color: var(--badm-text-muted); font-size: .7rem; margin-left: .25rem; }
.badm-glosa__source-link:hover { color: var(--badm-primary); }
.badm-glosa__textarea { width: 100%; font-family: inherit; font-size: .9rem; padding: .6rem; border: 1px solid var(--badm-border); border-radius: var(--badm-radius); resize: vertical; min-height: 80px; }

.badm-glosa__meta-row { display: flex; flex-wrap: wrap; align-items: center; margin: .75rem 0; }
.badm-glosa__tuner { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .75rem; align-items: center; }
.badm-glosa__save-row { display: flex; gap: .5rem; align-items: center; margin-top: .75rem; }
.badm-glosa__status-msg { font-size: .75rem; color: var(--badm-text-muted); margin-top: .4rem; min-height: 1rem; }
.badm-glosa__row { cursor: pointer; }
.badm-glosa__row:hover { background: var(--badm-hover); }
.badm-glosa__preview { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; font-size: .85rem; white-space: normal; }
.badm-glosa__row td { vertical-align: top; padding-top: .6rem; padding-bottom: .6rem; }
.badm-glosa__actions { display: flex; gap: .25rem; margin-top: .25rem; }
.badm-glosa__full-text { white-space: pre-wrap; font-size: .85rem; line-height: 1.5; padding: .5rem 0; }
.badm-glosa__potisk-wrap { position: relative; }
.badm-glosa__potisk-results { position: absolute; z-index: 10; background: #fff; border: 1px solid var(--badm-border); border-radius: var(--badm-radius); width: 100%; max-height: 250px; overflow-y: auto; box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.badm-glosa__potisk-item { display: flex; align-items: center; gap: .5rem; padding: .5rem .75rem; cursor: pointer; font-size: .85rem; }
.badm-glosa__potisk-item:hover { background: var(--badm-hover); }
.badm-glosa__potisk-thumb { width: 32px; height: 32px; object-fit: contain; border-radius: 4px; background: #f5f5f5; }
.badm-glosa__potisk-chip { display: inline-flex; align-items: center; gap: .5rem; background: var(--badm-hover, #f3f4f6); border: 1px solid var(--badm-border); border-radius: var(--badm-radius); padding: .3rem .6rem; font-size: .85rem; margin-top: .5rem; }
.badm-glosa__potisk-chip img { width: 24px; height: 24px; object-fit: contain; border-radius: 3px; }
.badm-glosa__potisk-chip button { background: none; border: none; cursor: pointer; font-size: 1.1rem; color: var(--badm-text-muted); padding: 0 0 0 .25rem; line-height: 1; }
.badm-glosa__potisk-chip button:hover { color: var(--badm-danger, #dc3545); }

/* ── Settings panel – sdilene prvky pro nastaveni modulu ── */
.badm-set { max-width: 700px; }
.badm-set__field { margin-bottom: .75rem; }
.badm-set__label { font-size: .8rem; font-weight: 500; display: block; margin-bottom: .25rem; }
.badm-set__hint { font-size: .8rem; color: var(--badm-text-muted); margin: 0 0 .5rem; }
.badm-set__radio-group { display: flex; gap: 1.25rem; }
.badm-set__radio-group label { font-size: .85rem; cursor: pointer; display: flex; align-items: center; gap: .3rem; }
.badm-set__save { margin-top: 1rem; display: flex; gap: .75rem; align-items: center; }
.badm-set__row { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.badm-set__subtitle { font-size: 13px; font-weight: 600; margin: 4px 0 8px; color: var(--badm-text-muted); }
.badm-textarea--mono + .badm-btn { margin-top: .5rem; }
.badm-crvset__preset-row { padding: .75rem; margin-bottom: .5rem; border: 1px solid var(--badm-border); border-radius: var(--badm-radius); background: var(--badm-bg, #fafafa); cursor: grab; }
.badm-crvset__preset-row:active { cursor: grabbing; }
.badm-crvset__preset-handle { color: var(--badm-text-muted); cursor: grab; padding: 0 .25rem; }

/* Preset tlacitka ve video tabu */
.badm-crv__presets { display: flex; flex-wrap: wrap; gap: .4rem; }
.badm-crv__preset-btn {
    padding: .4rem .75rem; font-size: .82rem; border: 1px solid var(--badm-border, #ddd);
    border-radius: var(--badm-radius, 6px); background: var(--badm-surface, #fff);
    cursor: pointer; transition: border-color .15s, background .15s; display: inline-flex; align-items: center; gap: .3rem;
}
.badm-crv__preset-btn:hover { border-color: var(--badm-primary, #2563eb); background: var(--badm-bg-hover, #f5f5f5); }
.badm-crv__preset-btn.is-active { border-color: var(--badm-primary, #2563eb); background: var(--badm-primary, #2563eb); color: #fff; }

/* ── Integrace ──────────────────────────────────────── */
/* badm-integrace__section → badm-page-section, badm-integrace__section-title → badm-section-label */
/* badm-integrace__grid/card migrovano na badm-half-grid / badm-card (viz hlavni blok) */

/* ── Sdileny sync progress bar ────────────────────────────── */
.badm-sync__group    { display: flex; flex-direction: row; align-items: center; gap: .5rem; }
.badm-sync__last     { font-size: .72rem; color: var(--badm-text-muted); }
.badm-sync__progress { display: flex; flex-direction: column; gap: .2rem; min-width: 260px; }
.badm-sync__row1     { display: flex; align-items: center; gap: .5rem; }
.badm-sync__row2     { display: flex; align-items: center; gap: .4rem; }
.badm-sync__info     { font-size: .85rem; color: #374151; flex-shrink: 0; }
.badm-sync__warn     { font-size: .72rem; color: #92400e; background: #fef3c7; padding: .1rem .35rem; border-radius: 3px; }
.badm-sync__bar-wrap { flex: 1; height: 6px; background: #e5e7eb; border-radius: 3px; overflow: hidden; }
.badm-sync__bar-fill { height: 100%; width: 0; background: #f97316; border-radius: 3px; transition: width .3s ease; }
.badm-sync__timer    { font-size: .72rem; color: var(--badm-text-muted); flex-shrink: 0; }

/* ── Competitors ─────────────────────────────────────────── */
/* badm-comp__grid migrovano na badm-card-grid badm-card-grid--cols-3 */
.badm-comp__card          { background: var(--badm-surface); border: 1px solid var(--badm-border); border-radius: var(--badm-radius); overflow: hidden; display: flex; flex-direction: column; cursor: pointer; transition: box-shadow .15s, transform .15s; }
.badm-comp__card[data-ad-id]:hover { box-shadow: 0 4px 14px rgba(0,0,0,.1); transform: translateY(-1px); }
/* 4:5 ramecek (vetsi nez puvodnich 16:9), object-fit:contain - nikdy nekrop */
.badm-comp__card-img      { position: relative; aspect-ratio: 4/5; background: #f3f4f6; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--badm-border); overflow: hidden; }
.badm-comp__card-thumb    { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block; }
.badm-comp__card-reach    { position: absolute; top: .5rem; right: .5rem; background: rgba(0,0,0,.75); color: #fff; font-size: .72rem; padding: .15rem .4rem; border-radius: 4px; pointer-events: none; z-index: 2; }
.badm-comp__card-reach i  { margin-right: .2rem; }
.badm-comp__card-reach-rpd { margin-left: .35rem; padding-left: .35rem; border-left: 1px solid rgba(255,255,255,.35); font-size: .68rem; opacity: .85; }
.badm-comp__card-mtype    { position: absolute; top: .5rem; left: .5rem; background: rgba(0,0,0,.75); color: #fff; font-size: .68rem; padding: .15rem .4rem; border-radius: 4px; pointer-events: none; z-index: 2; }
.badm-comp__card-mtype--catalog { background: rgba(168,85,247,.85); }
.badm-comp__card-mtype i  { margin-right: .2rem; }
.badm-comp__card-days     { color: var(--badm-text-muted); }
.badm-comp__card-target   { margin-top: .4rem; font-size: .72rem; color: var(--badm-text-muted); }
.badm-comp__card-target i { margin-right: .25rem; opacity: .7; }
.badm-comp__card-img a    { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; text-decoration: none; color: var(--badm-text-muted); }
.badm-comp__card-img--landscape { aspect-ratio: 4/3; }

/* Demograficky breakdown na karte (skutecny reach z DSA breakdown) */
.badm-comp__card-demo     { margin-top: .5rem; display: flex; flex-direction: column; gap: .25rem; }
.badm-comp__card-demo-item { font-size: .7rem; color: var(--badm-text-muted); display: flex; align-items: center; gap: .4rem; }
.badm-comp__card-demo-item i { opacity: .7; }
.badm-comp__gender-bar    { display: inline-flex; width: 50px; height: 6px; border-radius: 3px; overflow: hidden; background: var(--badm-border); flex-shrink: 0; }
.badm-comp__gender-bar > span { display: block; height: 100%; }
.badm-comp__gender-bar--f { background: #ec4899; }
.badm-comp__gender-bar--m { background: #3b82f6; }
.badm-comp__gender-bar--lg { width: 100%; height: 16px; border-radius: 4px; }

/* ── Detail modal ────────────────────────────────────────── */
.badm-comp__detail        { display: grid; grid-template-columns: 380px 1fr; gap: 1.5rem; }
.badm-comp__detail-loading { text-align: center; padding: 3rem; color: var(--badm-text-muted); }
.badm-comp__detail-left   { display: flex; flex-direction: column; gap: .75rem; }
.badm-comp__detail-imgwrap { background: #f3f4f6; border-radius: var(--badm-radius); display: flex; align-items: center; justify-content: center; min-height: 380px; max-height: 500px; overflow: hidden; }
.badm-comp__detail-img    { max-width: 100%; max-height: 500px; width: auto; height: auto; object-fit: contain; display: block; }
.badm-comp__detail-noimg  { color: #666; font-size: .9rem; text-align: center; padding: 2rem; }
.badm-comp__detail-noimg i { font-size: 2rem; display: block; margin-bottom: .5rem; }
.badm-comp__detail-badges { display: flex; gap: .4rem; flex-wrap: wrap; }
.badm-comp__detail-duration { font-size: .8rem; color: var(--badm-text-muted); }
.badm-comp__detail-platforms { display: flex; gap: .3rem; flex-wrap: wrap; }
.badm-comp__detail-actions { margin-top: .5rem; }

.badm-comp__detail-right  { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.badm-comp__detail-section { padding-bottom: .85rem; border-bottom: 1px solid var(--badm-border); }
.badm-comp__detail-section:last-child { border-bottom: none; padding-bottom: 0; }
.badm-comp__detail-label  { font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: var(--badm-text-muted); font-weight: 600; margin-bottom: .5rem; }
.badm-comp__detail-reach  { font-size: .82rem; color: var(--badm-text-muted); padding: .25rem 0 .5rem; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.badm-comp__detail-reach strong { color: var(--badm-text); font-weight: 600; }
.badm-comp__detail-reach i { color: var(--badm-text-muted); margin-right: .15rem; }
.badm-comp__detail-reach-sep { opacity: .4; }
.badm-comp__detail-textnote { font-size: .7rem; color: var(--badm-text-muted); font-style: italic; margin-top: .35rem; }
.badm-comp__detail-adtitle { font-size: 1rem; font-weight: 600; margin-bottom: .35rem; }
.badm-comp__detail-adtext { font-size: .85rem; line-height: 1.5; color: var(--badm-text); white-space: pre-wrap; max-height: 280px; overflow-y: auto; padding-right: .5rem; }
.badm-comp__detail-addesc { font-size: .78rem; color: var(--badm-text-muted); margin-top: .4rem; font-style: italic; }
.badm-comp__detail-cta    { display: inline-flex; align-items: center; gap: .4rem; font-size: .82rem; color: var(--badm-primary); word-break: break-all; text-decoration: none; }
.badm-comp__detail-cta:hover { text-decoration: underline; }
.badm-comp__detail-target { font-size: .85rem; line-height: 1.7; color: var(--badm-text); }

/* Gender section uvnitr modal */
.badm-comp__detail-gender { display: flex; flex-direction: column; gap: .4rem; }
.badm-comp__detail-gender-labels { display: flex; justify-content: space-between; font-size: .8rem; color: var(--badm-text-muted); }

/* Age histogram */
.badm-comp__detail-agelist { display: flex; flex-direction: column; gap: .35rem; }
.badm-comp__detail-agerow  { display: grid; grid-template-columns: 60px 1fr 120px; gap: .5rem; align-items: center; font-size: .8rem; }
.badm-comp__detail-agelabel { font-weight: 600; color: var(--badm-text); }
.badm-comp__detail-agebar  { background: var(--badm-border); height: 10px; border-radius: 5px; overflow: hidden; }
.badm-comp__detail-agebar > span { display: block; height: 100%; background: var(--badm-primary); border-radius: 5px; }
.badm-comp__detail-ageval  { text-align: right; color: var(--badm-text-muted); font-size: .75rem; }

/* Catalog items (DPA) seznam */
.badm-comp__detail-catalog { list-style: decimal inside; padding: 0; margin: 0; max-height: 320px; overflow-y: auto; }
.badm-comp__detail-catalog li { padding: .4rem 0; border-bottom: 1px solid var(--badm-border); font-size: .82rem; }
.badm-comp__detail-catalog li:last-child { border-bottom: none; }
.badm-comp__detail-catalog-title { display: inline; font-weight: 500; color: var(--badm-text); }
.badm-comp__detail-catalog-caption { display: block; margin-left: 1.1rem; font-size: .72rem; color: var(--badm-text-muted); }

/* Card catalog count suffix v header */
.badm-comp__card-cat-count { font-weight: 400; text-transform: none; letter-spacing: 0; color: #a855f7; margin-left: .25rem; }

/* Responzivni: na mobile stacknout */
@media (max-width: 900px) {
    .badm-comp__detail { grid-template-columns: 1fr; }
    .badm-comp__detail-imgwrap { min-height: 280px; }
}
.badm-comp__card-img a:hover { background: #e5e7eb; }
.badm-comp__card-placeholder { display: flex; flex-direction: column; align-items: center; gap: .4rem; color: var(--badm-text-muted); font-size: .8rem; }
.badm-comp__card-placeholder i { font-size: 1.5rem; }
.badm-comp__card-body     { padding: .75rem; flex: 1; }
.badm-comp__card-competitor { font-size: .72rem; color: var(--badm-text-muted); margin-bottom: .25rem; text-transform: uppercase; letter-spacing: .03em; }
.badm-comp__card-title    { font-size: .88rem; font-weight: 600; line-height: 1.3; color: var(--badm-text); margin-bottom: .35rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.badm-comp__card-text     { font-size: .72rem; line-height: 1.35; color: var(--badm-text-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.badm-comp__card-domain   { margin-top: .4rem; font-size: .72rem; color: var(--badm-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badm-comp__card-domain i { margin-right: .25rem; opacity: .7; }
.badm-comp__card-meta     { padding: .5rem .75rem; border-top: 1px solid var(--badm-border); font-size: .72rem; color: var(--badm-text-muted); display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.badm-comp__filters       { margin-bottom: 1rem; }
.badm-comp__filter-form   { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.badm-comp__filter-form .badm-input--compact { min-width: 160px; }
.badm-comp__filter-count  { font-size: .82rem; color: var(--badm-text-muted); }
.badm-comp__filter-action { margin-left: auto; }

/* ── Multi-select dropdown s checkboxy ── */
.badm-multiselect          { position: relative; display: inline-block; }
.badm-multiselect__btn     {
    display: inline-flex; align-items: center; gap: .5rem;
    min-width: 180px; padding: 5px 8px;
    border: 1px solid var(--badm-border); border-radius: var(--badm-radius);
    background: var(--badm-surface); color: var(--badm-text);
    font-size: 12px; font-family: var(--badm-font); line-height: 1.4;
    cursor: pointer; text-align: left;
}
.badm-multiselect__btn:hover { border-color: var(--badm-primary); }
.badm-multiselect__label   { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badm-multiselect__btn i   { font-size: .65rem; opacity: .6; }
.badm-multiselect.is-open .badm-multiselect__btn i { transform: rotate(180deg); }
.badm-multiselect__menu    {
    position: absolute; top: calc(100% + 4px); left: 0; z-index: 50;
    min-width: 100%; max-height: 320px; overflow-y: auto;
    background: var(--badm-surface); border: 1px solid var(--badm-border);
    border-radius: var(--badm-radius); box-shadow: 0 4px 12px rgba(0,0,0,.1);
    padding: .25rem 0;
}
.badm-multiselect__menu[hidden] { display: none; }
.badm-multiselect__opt     {
    display: flex !important; align-items: center; gap: .5rem;
    padding: .35rem .75rem; font-size: 12px; font-weight: normal !important;
    color: var(--badm-text); cursor: pointer; margin: 0 !important;
    white-space: nowrap;
}
.badm-multiselect__opt:hover { background: var(--badm-bg); }
.badm-multiselect__opt input[type="checkbox"] { margin: 0; flex-shrink: 0; }
.badm-multiselect__opt span { flex: 1; }

/* Platform split bar v Prehledu (FB/IG/Messenger/AN) */
.badm-comp__platform-split { display: flex; width: 120px; height: 8px; background: var(--badm-border); border-radius: 4px; overflow: hidden; }
.badm-comp__platform-bar    { display: block; height: 100%; }
.badm-comp__platform-bar--fb  { background: #1877f2; }
.badm-comp__platform-bar--ig  { background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af); }
.badm-comp__platform-bar--msg { background: #00b2ff; }
.badm-comp__platform-bar--an  { background: #6b7280; }

/* Competitors modal */
.badm-comp__modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1000; display: none; align-items: center; justify-content: center; }
.badm-comp__modal-overlay.is-visible { display: flex; }
.badm-comp__modal         { background: var(--badm-surface); border-radius: 8px; padding: 1.5rem; width: 100%; max-width: 480px; box-shadow: 0 8px 30px rgba(0,0,0,.15); }
.badm-comp__modal-header  { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.badm-comp__modal-header h3 { margin: 0; font-size: 1.1rem; }
.badm-comp__modal-close   { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--badm-text-muted); line-height: 1; }

/* Finance tab */
.badm-comp__fin-table th[colspan]  { text-align: center; border-bottom: none; padding-bottom: .2rem; }
.badm-comp__fin-subheader th       { font-size: .7rem; font-weight: 500; color: var(--badm-text-muted); padding-top: .2rem; }
.badm-comp__fin-negative           { color: #dc2626; }
.badm-comp__fin-positive           { color: #16a34a; }
.badm-comp__fin-note               { font-size: .75rem; color: var(--badm-text-muted); margin-top: .75rem; }
.badm-comp__fin-sticky             { position: sticky; left: 0; z-index: 1; background: var(--badm-surface, #fff); min-width: 140px; box-shadow: 2px 0 4px rgba(0,0,0,.06); }
.badm-comp__fin-table thead .badm-comp__fin-sticky { z-index: 3; }
.badm-comp__fin-empty td           { color: var(--badm-text-muted, #999); }
.badm-comp__fin-empty td:first-child strong { font-weight: 400; }

/* Logo konkurenta */
.badm-comp__logo { width: 20px; height: 20px; object-fit: contain; vertical-align: middle; margin-right: 6px; border-radius: 3px; }
.badm-comp__card-logo { width: 14px; height: 14px; object-fit: contain; vertical-align: middle; margin-right: 4px; border-radius: 2px; }
.badm-comp__detail-logo { width: 20px; height: 20px; object-fit: contain; vertical-align: middle; margin-right: 8px; border-radius: 3px; }

/* Recenze – progress bar: migrovano na sdileny badm-pct-bar (viz sekce Percent bar) */
.badm-comp__overview-actions { white-space: nowrap; }
.badm-comp__row-own > td    { background: var(--badm-primary-soft, rgba(255,127,0,.06)); font-weight: 500; }
.badm-comp__name-link       { color: inherit; text-decoration: none; }
.badm-comp__name-link:hover { color: var(--badm-primary); }

/* Bestsellery – produktove karty */
/* badm-comp__grid--4 migrovano na badm-card-grid badm-card-grid--cols-4 */
.badm-comp__best-section   { margin-bottom: 2rem; }
.badm-comp__best-header    { font-size: 1rem; font-weight: 600; margin: 0 0 .75rem; display: flex; align-items: center; gap: .5rem; }
.badm-comp__best-count     { font-size: .8rem; font-weight: 400; color: var(--badm-text-muted); }
.badm-comp__best-card      { background: var(--badm-surface); border: 1px solid var(--badm-border); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; }
.badm-comp__best-img       { aspect-ratio: 1/1; background: #fff; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--badm-border); padding: .5rem; }
.badm-comp__best-img img   { max-width: 100%; max-height: 100%; object-fit: contain; }
.badm-comp__best-body      { padding: .65rem; flex: 1; display: flex; flex-direction: column; gap: .35rem; position: relative; }
.badm-comp__best-name      { font-size: .82rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.badm-comp__best-name a    { color: var(--badm-text); text-decoration: none; }
.badm-comp__best-name a:hover { color: var(--badm-primary); text-decoration: underline; }
.badm-comp__best-meta      { display: flex; align-items: center; gap: .65rem; font-size: .78rem; color: var(--badm-text-muted); margin-top: auto; }
.badm-comp__best-price     { font-weight: 600; color: var(--badm-text); }
.badm-comp__best-badge     { display: inline-block; font-size: .65rem; font-weight: 700; padding: .15rem .4rem; border-radius: 4px; background: #e5e7eb; color: #374151; margin-right: .3rem; margin-bottom: .2rem; }
.badm-comp__best-badge--top { background: #fbbf24; color: #92400e; }
.badm-comp__best-badge--new { background: #34d399; color: #064e3b; }
.badm-comp__best-badge--gone { background: #f87171; color: #7f1d1d; }
.badm-comp__best-card--inactive { opacity: .5; }
.badm-comp__best-brand { font-size: .7rem; background: #e5e7eb; padding: .1rem .35rem; border-radius: 3px; color: #6b7280; }

/* SimilarWeb top 3 highlight – per-column ranking v prehledove tabulce (jen Navstevy) */
.badm-sw__rank-1 { background: #fef3c7; color: #92400e; font-weight: 600; }
.badm-sw__rank-2 { background: #f3f4f6; color: #374151; font-weight: 600; }
.badm-sw__rank-3 { background: #fef6ec; color: #92400e; font-weight: 600; }

/* responzivni breakpointy pro comp gridy presunuto do badm-card-grid */

/* ═══════════════════════════════════════
   KPI Prehled – porovnavaci grid (badm-kpi-grid)
   ═══════════════════════════════════════ */
.badm-kpi-grid { overflow-x: auto; margin-bottom: var(--badm-gap); background: var(--badm-surface); border: 1px solid var(--badm-border); border-radius: var(--badm-radius); }
.badm-kpi-grid table { width: 100%; border-collapse: collapse; }
.badm-kpi-grid__corner { width: 100px; border: none; }
.badm-kpi-grid__period { text-align: center; padding: 14px 8px 6px; border-left: 1px solid var(--badm-border, #e5e7eb); }
.badm-kpi-grid__period-name { font-size: 1rem; font-weight: 700; color: #111827; }
.badm-kpi-grid__period-range { font-size: .72rem; color: #9ca3af; margin-top: 2px; }
.badm-kpi-grid__legend td { text-align: center; padding: 0 8px 8px; border-left: 1px solid var(--badm-border, #e5e7eb); border-bottom: 2px solid var(--badm-border, #e5e7eb); }
.badm-kpi-grid__legend-cols { display: flex; justify-content: space-around; font-size: .68rem; color: #9ca3af; text-transform: uppercase; letter-spacing: .3px; }
.badm-kpi-grid__label { font-size: .82rem; font-weight: 600; color: #374151; padding: 12px 14px; white-space: nowrap; vertical-align: middle; border-bottom: 1px solid #f3f4f6; }
.badm-kpi-grid__cell { text-align: center; padding: 10px 12px; border-left: 1px solid var(--badm-border, #e5e7eb); border-bottom: 1px solid #f3f4f6; vertical-align: top; min-width: 200px; }
.badm-kpi-grid__value { font-size: 18px; font-weight: 700; color: #111827; }
.badm-kpi-grid__value-pct { display: block; font-size: .85rem; font-weight: 600; color: #6b7280; margin-bottom: 2px; }
.badm-kpi-grid__pct { font-size: .85rem; font-weight: 600; color: #6b7280; margin-left: 4px; }
.badm-kpi-grid__comp { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; }
.badm-kpi-grid__side { flex: 1; text-align: center; }
.badm-kpi-grid__side .badm-table__delta { display: block; font-size: .78rem; margin-bottom: 2px; }
.badm-kpi-grid__abs { display: block; font-size: .72rem; color: #374151; white-space: nowrap; }
.badm-kpi-grid__abs-pct { color: #6b7280; }
.badm-kpi-grid__abs-sep { color: #9ca3af; margin: 0 2px; }
.badm-kpi-grid__empty { color: #d1d5db; font-size: .85rem; padding: 16px 0; }
.badm-kpi-grid__expandable { cursor: pointer; }
.badm-kpi-grid__arrow { font-size: .65rem; color: #9ca3af; transition: transform .15s; margin-right: 2px; }
.badm-kpi-grid__expandable.is-open .badm-kpi-grid__arrow { transform: rotate(90deg); }
.badm-kpi-grid__sub .badm-kpi-grid__label { padding-left: 28px; }
.badm-kpi-grid__sub .badm-kpi-grid__value { font-size: .95rem; font-weight: 600; }
.badm-kpi-grid__sub td { background: #fafbfc; }
.badm-kpi-grid__country-indent { font-weight: 500; color: #6b7280; }

/* ═══════════════════════════════════════
   KPI Objednavky (badm-orders)
   ═══════════════════════════════════════ */
/* badm-card, badm-orders-duo, badm-orders-stat* migrovano na badm-card / badm-half-grid / badm-stat-row (viz hlavni blok) */
.badm-orders-deltas { margin-top: 10px; display: flex; gap: 6px; }
.badm-orders-reasons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.badm-orders-icon { width: 24px; height: 24px; vertical-align: middle; margin-right: 4px; object-fit: contain; }

/* badm-cust-seg*, badm-comm-duo – migrovano na badm-half-grid / badm-card / badm-badge */

/* ═══════════════════════════════════════
   P&L Dashboard (badm-pnl)
   ═══════════════════════════════════════ */

.badm-pnl { position: relative; }
.badm-pnl__table { width: max-content; min-width: 100%; border-collapse: collapse; font-size: .82rem; white-space: nowrap; table-layout: fixed; }
.badm-pnl__table th,
.badm-pnl__table td { padding: 5px 10px; border-bottom: 1px solid var(--badm-border, #e5e7eb); }
.badm-pnl__table thead th { background: var(--badm-surface, #fff); font-weight: 600; font-size: .75rem; color: #6b7280; text-transform: uppercase; letter-spacing: .3px; position: sticky; top: 0; z-index: 2; }

/* Sirky sloupcu */
.badm-pnl__sticky { position: sticky; left: 0; z-index: 1; background: var(--badm-surface, #fff); width: 190px; min-width: 190px; }
.badm-pnl__month { width: 95px; min-width: 95px; }
.badm-pnl__year { width: 105px; min-width: 105px; }
.badm-pnl__total { width: 105px; min-width: 105px; }
.badm-pnl__table thead .badm-pnl__sticky { z-index: 3; }

/* Labely */
.badm-pnl__label { font-weight: 500; }
.badm-pnl__label--child { padding-left: 28px; font-weight: 400; color: #6b7280; font-size: .78rem; }
.badm-pnl__label--subchild { padding-left: 48px; font-weight: 400; color: #9ca3af; font-size: .75rem; }

/* Sipka pro expand */
.badm-pnl__arrow { display: inline-block; width: 14px; margin-right: 2px; cursor: pointer; color: #9ca3af; transition: transform .15s; }
[data-pnl-toggle] { cursor: pointer; }
[data-pnl-toggle]:hover .badm-pnl__sticky { background: #f9fafb; }
.badm-pnl__table tbody tr:not(.badm-pnl__row--subtotal):not(.badm-pnl__row--total):hover { background: #fafbfc; }
.badm-pnl__table tbody tr:not(.badm-pnl__row--subtotal):not(.badm-pnl__row--total):hover .badm-pnl__sticky { background-color: #fafbfc; }

/* Typy radku */
.badm-pnl__row--income td { color: #059669; }
.badm-pnl__row--income .badm-pnl__label { color: #111827; }
.badm-pnl__row--expense td { color: #dc2626; }
.badm-pnl__row--expense .badm-pnl__label { color: #111827; }
.badm-pnl__row--adjustment td { color: #d97706; }
.badm-pnl__row--adjustment .badm-pnl__label { color: #111827; }
.badm-pnl__row--info td { color: #6b7280; font-style: italic; }
.badm-pnl__row--income-minor td { color: #059669; }
.badm-pnl__row--income-minor .badm-pnl__label { color: #111827; }
.badm-pnl__row--computed td { color: #6b7280; }

.badm-pnl__row--subtotal { background: #f3f4f6; }
.badm-pnl__row--subtotal td { font-weight: 600; color: #374151; border-top: 2px solid #d1d5db; }
.badm-pnl__row--subtotal .badm-pnl__sticky { background: #f3f4f6; }

.badm-pnl__row--total { background: #111827; }
.badm-pnl__row--total td { font-weight: 700; color: #fff; border-top: 2px solid #374151; }
.badm-pnl__row--total .badm-pnl__sticky { background: #111827; color: #fff; }

.badm-pnl__row--pct td { font-size: .75rem; color: #6b7280; font-style: italic; }

.badm-pnl__row--kpi { border-top: 2px solid #e5e7eb; }
.badm-pnl__row--kpi td { color: #6b7280; font-size: .78rem; }

/* Rocni a celkove sloupce */
.badm-pnl__year { background: #fafafa; font-weight: 600; }
.badm-pnl__table thead .badm-pnl__year { background: #f3f4f6; }
.badm-pnl__total { background: #f0f9ff; font-weight: 700; }
.badm-pnl__table thead .badm-pnl__total { background: #e0f2fe; }

/* Subtotal/total override pro year/total sloupce */
.badm-pnl__row--subtotal .badm-pnl__year { background: #e5e7eb; }
.badm-pnl__row--subtotal .badm-pnl__total { background: #dbeafe; }
.badm-pnl__row--total .badm-pnl__year { background: #1f2937; }
.badm-pnl__row--total .badm-pnl__total { background: #1e3a5f; }

/* Editovatelne bunky v P&L tabulce */
.badm-pnl__cell--editable { cursor: pointer; position: relative; }
.badm-pnl__cell--editable:hover { background: #fef3c7; }
.badm-pnl__child--editable td:first-child { font-style: normal; }
.badm-pnl__input {
    width: 100%; padding: 2px 4px; border: 1px solid #3b82f6;
    border-radius: 3px; font-size: .78rem; text-align: right;
    outline: none; background: #fff; box-sizing: border-box;
    -moz-appearance: textfield;
}
.badm-pnl__input::-webkit-outer-spin-button,
.badm-pnl__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.badm-pnl__input:focus { box-shadow: 0 0 0 2px rgba(59,130,246,.3); }

/* Forecast bunky */
.badm-pnl__cell--forecast { color: #2563eb !important; }
.badm-pnl__cell--has-forecast { color: #2563eb !important; }

/* Edit wrapper (input + checkbox odhad) */
.badm-pnl__edit-wrap { display: flex; flex-direction: column; gap: 2px; }
.badm-pnl__forecast-label { display: flex; align-items: center; gap: 3px; font-size: .68rem; color: #9ca3af; cursor: pointer; white-space: nowrap; user-select: none; }
.badm-pnl__forecast-check { width: 12px; height: 12px; margin: 0; cursor: pointer; }

/* ── Video Feed ─────────────────────────────────────────── */
.badm-crv-feed__actions { display: flex; justify-content: space-between; align-items: center; margin: 1rem 0; flex-wrap: wrap; gap: .5rem; }
.badm-crv-feed__stats { color: var(--badm-text-muted); font-size: .9rem; }
.badm-crv-feed__btns { display: flex; gap: .5rem; }
.badm-crv-feed__table { table-layout: fixed; }
.badm-crv-feed__thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; }
.badm-crv-feed__pill {
    display: inline-block; padding: 2px 8px; border-radius: 10px;
    font-size: .75rem; font-weight: 600; text-align: center; min-width: 36px;
}
.badm-crv-feed__pill--done { background: #d1fae5; color: #065f46; }
.badm-crv-feed__pill--pending { background: #f3f4f6; color: #6b7280; }
.badm-crv-feed__pill--submitted,
.badm-crv-feed__pill--processing { background: #fef3c7; color: #92400e; animation: badm-pulse 1.5s ease-in-out infinite; }
.badm-crv-feed__pill--failed { background: #fee2e2; color: #991b1b; cursor: help; }
@keyframes badm-pulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }

/* ── Tvoric ────────────────────────────────────────────── */

/* Formular novy brainstorming */
.badm-tvoric__new-batch { background: var(--badm-surface, #fff); border: 1px solid var(--badm-border, #e5e7eb); border-radius: var(--badm-radius); padding: var(--badm-gap); }
.badm-tvoric__new-batch h3 { margin: 0 0 12px; font-size: 13px; font-weight: 600; }
.badm-tvoric__form-row { display: flex; gap: 1rem; margin-bottom: .75rem; }
.badm-tvoric__field { flex: 1; }
.badm-tvoric__field--main { flex: 2; }
.badm-tvoric__batch-link { color: var(--badm-text); text-decoration: none; }
.badm-tvoric__batch-link:hover { color: var(--badm-primary); }
.badm-tvoric__batch-actions { display: flex; gap: .25rem; justify-content: flex-end; }

/* Batch info bar */
.badm-tvoric__batch-info { display: flex; justify-content: space-between; align-items: center; margin-bottom: .75rem; padding: .5rem .75rem; background: var(--badm-surface, #fff); border: 1px solid var(--badm-border, #e5e7eb); border-radius: 6px; }

/* Kreativni brief */
.badm-tvoric__brief { margin-bottom: 1rem; border: 1px solid var(--badm-border, #e5e7eb); border-radius: 6px; background: var(--badm-surface, #fff); }
.badm-tvoric__brief-toggle { padding: .5rem .75rem; cursor: pointer; font-size: .85rem; font-weight: 500; color: var(--badm-text-secondary, #4b5563); list-style: none; }
.badm-tvoric__brief-toggle::-webkit-details-marker { display: none; }
.badm-tvoric__brief-toggle::before { content: '\f0da'; font-family: 'Font Awesome 6 Free'; font-weight: 900; margin-right: .5rem; transition: transform .2s; display: inline-block; }
.badm-tvoric__brief[open] > .badm-tvoric__brief-toggle::before { transform: rotate(90deg); }
.badm-tvoric__brief-toggle i { margin-right: .35rem; }
.badm-tvoric__brief-body { padding: 0 .75rem .75rem; font-size: .85rem; }
.badm-tvoric__brief-section { margin-bottom: .5rem; }
.badm-tvoric__brief-section:last-child { margin-bottom: 0; }
.badm-tvoric__brief-tags { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .25rem; }
.badm-tvoric__brief-tag { display: inline-block; padding: .1rem .4rem; border-radius: 3px; font-size: .75rem; background: #e0f2fe; color: #0369a1; }
.badm-tvoric__brief-tag--wp { background: #fef3c7; color: #92400e; }
.badm-tvoric__brief-tag--ref { background: #ede9fe; color: #6d28d9; }
.badm-tvoric__brief-tag--prop { background: #dcfce7; color: #166534; }
.badm-tvoric__brief-wp-group { margin: .25rem 0; }
.badm-tvoric__brief-log-wrap { margin-top: .5rem; }
.badm-tvoric__brief-log { background: var(--badm-bg, #f9fafb); padding: .5rem; border-radius: 4px; font-size: .75rem; max-height: 300px; overflow-y: auto; white-space: pre-wrap; word-break: break-word; margin-top: .25rem; }

/* Grid karet konceptu */
/* badm-tvoric__grid migrovano na badm-card-grid */

/* Karta konceptu */
.badm-tvoric__card { background: var(--badm-surface, #fff); border: 1px solid var(--badm-border, #e5e7eb); border-radius: var(--badm-radius); padding: var(--badm-gap); display: flex; flex-direction: column; gap: .5rem; transition: border-color .2s; }
.badm-tvoric__card--approved { border-color: #22c55e; border-width: 2px; }
.badm-tvoric__card--rejected { opacity: .5; border-color: #ef4444; }
.badm-tvoric__card--generating { border-color: #f59e0b; animation: badm-pulse 1.5s ease-in-out infinite; }

.badm-tvoric__card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.badm-tvoric__card-name { font-weight: 600; font-size: .95rem; line-height: 1.3; }

/* Score badge */
.badm-tvoric__score { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 24px; border-radius: 12px; font-size: .75rem; font-weight: 700; flex-shrink: 0; }
.badm-tvoric__score--high { background: #d1fae5; color: #065f46; }
.badm-tvoric__score--mid { background: #fef3c7; color: #92400e; }
.badm-tvoric__score--low { background: #f3f4f6; color: #6b7280; }

/* Styl dropdown */
.badm-tvoric__card-style { }
.badm-tvoric__style-select { width: 100%; }

/* Text na triku */
.badm-tvoric__card-text { font-style: italic; color: var(--badm-text, #1f2937); font-size: .9rem; }

/* Vizualni popis */
.badm-tvoric__card-desc { font-size: .85rem; color: var(--badm-text-muted, #6b7280); line-height: 1.4; }
.badm-tvoric__card-more { background: none; border: none; color: var(--badm-primary, #2563eb); cursor: pointer; font-size: .8rem; padding: 0; text-decoration: underline; }

/* Obrazek */
.badm-tvoric__card-img {
    background: repeating-conic-gradient(#e5e7eb 0% 25%, #fff 0% 50%) 50% / 16px 16px;
    border-radius: 6px; overflow: hidden; min-height: 180px; display: flex; align-items: center; justify-content: center;
}
.badm-tvoric__card-img img { max-width: 100%; max-height: 300px; object-fit: contain; }

/* Akce */
.badm-tvoric__card-actions { display: flex; gap: .5rem; align-items: center; margin-top: auto; padding-top: .25rem; }
.badm-tvoric__card-edit-row { margin-top: .25rem; }
.badm-tvoric__card-desc-edit { width: 100%; font-size: .85rem; resize: vertical; }
.badm-tvoric__card--editing .badm-tvoric__card-text-edit { width: 100%; }

/* Nastaveni: modely grid */
.badm-tvoric__models-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .75rem; }

/* Nastaveni: styl karty */
.badm-tvoric__style-card { background: var(--badm-bg, #f9fafb); border: 1px solid var(--badm-border, #e5e7eb); border-radius: 6px; padding: .75rem; margin-bottom: .75rem; }
.badm-tvoric__style-card-row { display: flex; gap: .75rem; align-items: flex-start; margin-bottom: .5rem; }
.badm-tvoric__style-remove-wrap { flex: 0 0 auto; margin-bottom: 0; }

/* ══════════════════════════════════════════════════════════
   Google Campaigns breakdown tab
   ══════════════════════════════════════════════════════════ */
.badm-gc__th-period { white-space: nowrap; }
.badm-gc__th-seg { white-space: nowrap; font-size: .82rem; min-width: 80px; cursor: pointer; }
.badm-gc__th-seg:hover { color: #333; }
.badm-gc__td-period { white-space: nowrap; font-size: .82rem; }
.badm-gc__td-metric { white-space: nowrap; font-size: .82rem; color: var(--badm-text-muted, #6b7280); }
.badm-gc__td-num { font-variant-numeric: tabular-nums; font-size: .82rem; white-space: nowrap; }
.badm-gc__td--warn { color: #dc2626; font-weight: 600; }

/* Detail segmenty (non-Celkem) – muted jako porovnavaci sloupce v rek. systemech */
#gcCampaignTable .badm-gc__th-seg:not(.badm-table__divider) { color: var(--badm-text-muted); font-weight: 400; font-size: 11px; }
#gcCampaignTable .badm-gc__td-num:not(.badm-table__divider) { color: var(--badm-text-muted); font-size: 11px; }
#gcCampaignTable .badm-gc__td-num:not(.badm-table__divider) strong { color: var(--badm-text-muted); font-size: 11px; }
#gcCampaignTable .badm-gc__td-num.badm-gc__td--warn { color: #dc2626; }
/* Zakladni (Celkem) segmenty – tucne pro zvyrazneni */
#gcCampaignTable .badm-gc__td-num.badm-table__divider { font-weight: 600; }

/* Skupinove barvy v zahlavi */
.badm-gc__group--neutral { border-color: #6b7280; background-color: rgba(107, 114, 128, 0.04); }
.badm-gc__group--brand   { border-color: #d97706; background-color: rgba(217, 119, 6, 0.04); }
.badm-gc__group--vp      { border-color: #16a34a; background-color: rgba(22, 163, 74, 0.04); }
.badm-gc__group--ost     { border-color: #2563eb; background-color: rgba(37, 99, 235, 0.04); }
.badm-gc__group--extra   { border-color: #6366f1; background-color: rgba(99, 102, 241, 0.04); }

/* Oddeleni periody – silnejsi cara nad prvnim radkem obdobi (td kvuli border-collapse precedenci) */
.badm-gc__period-first td { border-top: 2px solid #9ca3af; }
#gcCampaignTable tfoot .badm-gc__period-first td { border-top: 3px solid #6b7280; }

/* Info panel (segment definitions) */
.badm-gc__info { margin-top: 1.5rem; border: 1px solid var(--badm-border, #e5e7eb); border-radius: var(--badm-radius); }
.badm-gc__info-title { padding: .75rem 1rem; cursor: pointer; font-weight: 500; font-size: .9rem; color: var(--badm-text-muted, #6b7280); }
.badm-gc__info-title i { margin-right: .4rem; }
.badm-gc__info-body { padding: 0 1rem 1rem; }
.badm-gc__info-body p { margin-bottom: .75rem; font-size: .85rem; color: var(--badm-text-muted, #6b7280); }
.badm-gc__info-table td:first-child { width: 180px; white-space: nowrap; }

/* Override mkt table right-align – GC tab pouziva left-align jako analytics */
#gcCampaignTable td,
#gcCampaignTable th { text-align: left; }
#gcCampaignTable .badm-gc__td-num { font-variant-numeric: tabular-nums; }

/* ── Sdileny collapse pattern ──────────────────────────── */
.badm-collapse__header {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: .4rem;
}
.badm-collapse__header:hover { color: var(--badm-primary); }
.badm-collapse__chevron {
    font-size: .7rem;
    transition: transform .2s;
    width: 14px;
    text-align: center;
}
.badm-collapse__chevron.is-collapsed { transform: rotate(-90deg); }
.badm-collapse__body.is-collapsed { display: none; }

/* ── Tabulka – fixed layout modifikator ───────────────── */
.badm-table--fixed { table-layout: fixed; }

/* ── Checkbox grid (filtry s hodne checkboxu) ─────────── */
.badm-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 4px 12px;
    padding: 4px 0;
}

/* ── Replenishment – vyber druhu dle profilu ───────────── */
.badm-repl__druhy-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 10px;
    align-items: center;
    font-size: 12px;
    padding: 4px 0;
}
.badm-repl__kat-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    align-items: center;
    font-size: 12px;
    padding: 4px 0;
}
.badm-repl__druhy-wrap .badm-analytics__druh-icon {
    width: 16px;
    height: 16px;
    top: 0;
}
.badm-repl__profil-tag {
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--badm-text-muted);
    background: var(--badm-bg);
    padding: 1px 6px;
    border-radius: var(--badm-radius);
}

/* ── Replenishment – modul-specificke ─────────────────── */
.badm-repl__table td:first-child { white-space: nowrap; }
.badm-repl__vel-cell {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    padding-left: 4px !important;
    padding-right: 4px !important;
}
.badm-repl__vel-obj { color: var(--badm-success); font-weight: 600; display: block; font-size: .75rem; }
.badm-repl__vel-obj--zero { color: var(--badm-text-muted); font-weight: 400; }
.badm-repl__mape { font-size: .7rem; margin-left: .3rem; padding: 1px 5px; border-radius: var(--badm-radius); cursor: help; }
.badm-repl__mape--good { color: var(--badm-success); background: rgba(34,197,94,.08); }
.badm-repl__mape--ok { color: var(--badm-warning); background: rgba(234,179,8,.08); }
.badm-repl__mape--bad { color: var(--badm-danger); background: rgba(239,68,68,.08); }

/* ── SimilarWeb tabulka ────────────────────────────── */
.badm-sw__comp-first td { border-top: 2px solid #9ca3af; }

/* ── Product cell – produkt v tabulce (obrazek + info) ── */
.badm-product-cell {
    display: flex;
    gap: 10px;
    align-items: center;
}
.badm-product-cell__img {
    width: 52px;
    height: 52px;
    border-radius: 4px;
    object-fit: contain;
    flex-shrink: 0;
}

/* ── Img preview – sdilena lupa (hover popup) ────────────── */
/* Pouziti: <img class="badm-img-preview" data-preview-src="URL" data-preview-name="nazev"> */
/* JS v main.js vytvori popup a zobrazi ho pod obrazkem pri hoveru. */
/* Pokud data-preview-src chybi, pouzije se img.src. */
.badm-img-preview { cursor: zoom-in; }
.badm-img-preview-popup {
    position: absolute;
    z-index: 800;
    background: var(--badm-surface);
    border: 1px solid var(--badm-border);
    border-radius: var(--badm-radius);
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
    padding: .5rem;
    max-width: 320px;
    text-align: center;
}
.badm-img-preview-popup img {
    width: 300px;
    height: 300px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}
.badm-img-preview-popup__name {
    font-size: .75rem;
    color: var(--badm-text-muted);
    margin-top: .35rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.badm-product-cell__icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: .6;
}
.badm-product-cell__info {
    min-width: 0;
}
.badm-product-cell__name {
    font-weight: 600;
    font-size: .85rem;
    line-height: 1.3;
    color: var(--badm-text);
    text-decoration: none;
}
.badm-product-cell__name:hover { text-decoration: underline; }
a.badm-product-cell__name { color: var(--badm-primary); }
.badm-product-cell__meta {
    font-size: .72rem;
    color: var(--badm-text-muted);
    line-height: 1.3;
    margin-top: 1px;
}
.badm-product-cell__return { color: var(--badm-danger); font-weight: 600; }

/* Dual obrazek – rotace hrud/zada (fade in/out) */
.badm-product-cell__dual {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    cursor: zoom-in;
}
.badm-product-cell__dual .badm-product-cell__img {
    position: absolute;
    top: 0; left: 0;
}
.badm-product-cell__rotate-a {
    animation: badmRotateImg 4s ease-in-out infinite;
}
.badm-product-cell__rotate-b {
    animation: badmRotateImg 4s ease-in-out infinite;
    animation-delay: 2s;
    opacity: 0;
}
@keyframes badmRotateImg {
    0%, 40% { opacity: 1; }
    50%, 90% { opacity: 0; }
    100% { opacity: 1; }
}
.badm-product-cell__meta-link { color: var(--badm-text-muted); text-decoration: none; }
.badm-product-cell__meta-link:hover { color: var(--badm-text); }

/* ═══════════════════════════════════════════════════════════════
   PLANOVAC KAMPANI – gantt a mockup styly (Faze 0)
   ═══════════════════════════════════════════════════════════════ */

/* ── Toolbar s prepinacem roku + legendou ── */
.badm-plan__toolbar {
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.badm-plan__year-switch { display: flex; align-items: center; gap: 6px; }
.badm-plan__legend {
    display: flex; align-items: center; gap: 12px;
    font-size: 11px; color: var(--badm-text-muted);
    flex-wrap: wrap;
}
.badm-plan__legend-item { display: inline-flex; align-items: center; gap: 6px; }

/* ── Tabulka: ikony kanalu ── */
/* Ikony kanalu – wrapper s flex layoutem zaruci, ze jsou vzdy zleva */
td.badm-plan__channel-icons,
th.badm-plan__channel-icons {
    padding-left: 0;
}
td.badm-plan__channel-icons {
    font-size: 13px;
    color: var(--badm-text-muted);
    line-height: 1;
    vertical-align: middle;
}
.badm-plan__channel-icons__wrap {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
}
.badm-plan__channel-icons__wrap > i {
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

/* Tag small varianta */
.badm-tag--sm {
    padding: 1px 6px;
    font-size: 10px;
    margin-right: 2px;
}

/* ── Tab udalosti: 2-sloupcovy grid ── */
.badm-plan__events-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 1100px) {
    .badm-plan__events-grid { grid-template-columns: 1fr; }
}

/* ── Vertikalni kalendar (per-tyden radky) ── */
.badm-plan-v {
    background: var(--badm-surface);
    border: 1px solid var(--badm-border);
    border-radius: var(--badm-radius);
    overflow: hidden;
    font-size: 13px;
}
.badm-plan-v__header,
.badm-plan-v__row {
    display: grid;
    grid-template-columns: 160px 200px 1fr;
    border-bottom: 1px solid var(--badm-border);
}
.badm-plan-v__row:last-child { border-bottom: none; }
.badm-plan-v__header {
    background: var(--badm-bg);
    font-weight: 600;
    font-size: 12px;
    color: var(--badm-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 2;
}
.badm-plan-v__header > div {
    padding: 10px 12px;
    border-right: 1px solid var(--badm-border);
}
.badm-plan-v__header > div:last-child { border-right: none; }

.badm-plan-v__col-week,
.badm-plan-v__col-ctx,
.badm-plan-v__col-camp {
    padding: 10px 12px;
    border-right: 1px solid var(--badm-border);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.badm-plan-v__col-camp { border-right: none; }

/* Dnesni tyden – jen levy oranzovy pruh (background by koldidoval s barvou kampane "V pripave") */
.badm-plan-v__row--today { box-shadow: inset 3px 0 0 var(--badm-primary); }

/* Timeline sloupec Kampane = 7-denni grid (po-ne) */
.badm-plan-v__timeline {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(var(--tracks, 1), minmax(28px, auto));
    gap: 3px;
    padding: 6px 8px;
}

/* Den-of-week header nad sloupcem Kampane */
.badm-plan-v__dow {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
    font-size: 10px;
    font-weight: 600;
    color: var(--badm-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badm-plan-v__dow > span {
    text-align: center;
    padding: 0 2px;
}

.badm-plan-v__week-num { font-weight: 700; font-size: 14px; }
.badm-plan-v__week-range { color: var(--badm-text-muted); font-size: 11px; }
/* Meziroci historie – linky na kampane z minulych let ve stejnem ISO tydnu */
.badm-plan-v__history {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed var(--badm-border);
}
.badm-plan-v__history-link {
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-size: 11px;
    line-height: 1.25;
    color: var(--badm-text-muted);
    text-decoration: none;
    padding: 1px 0;
}
.badm-plan-v__history-link:hover {
    color: var(--badm-primary);
}
.badm-plan-v__history-year {
    font-weight: 600;
    font-size: 10px;
    padding: 1px 4px;
    background: var(--badm-bg);
    border-radius: 3px;
    color: var(--badm-text-muted);
    flex-shrink: 0;
}
.badm-plan-v__history-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.badm-plan-v__today-label {
    margin-top: 2px;
    display: inline-block;
    align-self: flex-start;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    background: var(--badm-primary);
    color: #fff;
    border-radius: 10px;
}

/* Event chip uvnitr kontextu */
.badm-plan-v__event {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    padding: 3px 8px;
    border-radius: var(--badm-radius);
    font-size: 11px;
    line-height: 1.3;
    max-width: 100%;
    align-self: flex-start;
    box-sizing: border-box;
}
.badm-plan-v__event-name {
    white-space: normal;
    overflow-wrap: anywhere;
    flex: 1 1 auto;
    min-width: 0;
}
.badm-plan-v__event-icon {
    flex: 0 0 auto;
}
.badm-plan-v__event-date {
    flex: 0 0 auto;
}
.badm-plan-v__event--svatek { background: #fef3c7; color: #92400e; }
.badm-plan-v__event--skippy { background: #e0e7ff; color: #3730a3; }
.badm-plan-v__event-icon { font-size: 13px; }
.badm-plan-v__event-date {
    font-size: 10px;
    opacity: 0.7;
    margin-left: 2px;
}

/* Timeline chip (siroky podle poctu dnu, pozice podle dne v tydnu) */
.badm-plan-v__chip {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 5px 8px;
    border-radius: var(--badm-radius);
    background: var(--badm-primary-light);
    border-left: 3px solid var(--badm-primary);
    text-decoration: none;
    color: var(--badm-text);
    font-size: 12px;
    line-height: 1.25;
    min-height: 40px;
    overflow: hidden;
    transition: transform 0.08s, box-shadow 0.08s;
    position: relative;
    z-index: 1;
}
.badm-plan-v__chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    z-index: 2;
}

.badm-plan-v__chip-row1 {
    display: flex;
    align-items: baseline;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    min-width: 0;
}
.badm-plan-v__chip-row2 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--badm-text-muted);
    white-space: nowrap;
    overflow: hidden;
    min-width: 0;
}

.badm-plan-v__chip-name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.badm-plan-v__chip-status {
    font-size: 11px;
    font-weight: 500;
    color: var(--badm-text-muted);
    flex-shrink: 0;
}
.badm-plan-v__chip-status::before {
    content: '· ';
    opacity: 0.6;
}

.badm-plan-v__chip-dates {
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}
.badm-plan-v__flag { font-size: 12px; line-height: 1; }
.badm-plan-v__chip-markets { display: inline-flex; gap: 2px; flex-shrink: 0; }
.badm-plan-v__chip-channels {
    display: inline-flex;
    gap: 4px;
    opacity: 0.6;
    flex-shrink: 0;
}
.badm-plan-v__chip-disk {
    color: var(--badm-text-muted);
    font-size: 13px;
    margin-left: auto;
    padding: 1px 3px;
    border-radius: 3px;
    flex-shrink: 0;
    transition: color 0.1s, background 0.1s;
}
.badm-plan-v__chip-disk:hover {
    color: var(--badm-primary);
    background: rgba(255, 128, 20, 0.1);
}

/* "Pokracuje" konektory: bez zaobleni na hranach navazujicich radku */
.badm-plan-v__chip--continues {
    border-left: none;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    padding-left: 10px;
}
.badm-plan-v__chip-prefix {
    font-size: 12px;
    color: var(--badm-text-muted);
    opacity: 0.5;
    flex-shrink: 0;
}
.badm-plan-v__chip--ongoing {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.badm-plan-v__chip-continues {
    font-size: 12px;
    color: var(--badm-text-muted);
    opacity: 0.6;
    margin-left: auto;
    flex-shrink: 0;
}

/* Status varianty – pozadi + left border */
.badm-plan-v__chip--uzavreno    { background: #dcfce7; border-left-color: var(--badm-success); }
.badm-plan-v__chip--vyhodnoceni { background: #f3f4f6; border-left-color: #6b7280; }
.badm-plan-v__chip--nasazeni    { background: #dbeafe; border-left-color: var(--badm-info); }
.badm-plan-v__chip--priprava    { background: var(--badm-primary-light); border-left-color: var(--badm-primary); }
.badm-plan-v__chip--zadani      { background: #fef3c7; border-left-color: var(--badm-warning); }

.badm-plan-v__empty {
    color: var(--badm-text-muted);
    font-size: 12px;
    opacity: 0.5;
    padding: 4px 0;
}

/* Range event chip – rozlisitelny od single (jemna barevnost) */
.badm-plan-v__event--range {
    opacity: 0.9;
}
.badm-plan-v__event--range.badm-plan-v__event--svatek {
    background: #fef9e7;  /* svetlejsi varianta svatku */
}
.badm-plan-v__event--range.badm-plan-v__event--skippy {
    background: #eef0ff;  /* svetlejsi varianta skippy */
}

/* Legenda swatch */
.badm-plan-v__legend-swatch {
    display: inline-block;
    width: 16px;
    height: 10px;
    border-radius: 2px;
    vertical-align: middle;
    margin-right: 2px;
}
.badm-plan-v__legend-swatch--uzavreno    { background: #dcfce7; border-left: 3px solid var(--badm-success); }
.badm-plan-v__legend-swatch--vyhodnoceni { background: #f3f4f6; border-left: 3px solid #6b7280; }
.badm-plan-v__legend-swatch--nasazeni    { background: #dbeafe; border-left: 3px solid var(--badm-info); }
.badm-plan-v__legend-swatch--priprava    { background: var(--badm-primary-light); border-left: 3px solid var(--badm-primary); }
.badm-plan-v__legend-swatch--zadani      { background: #fef3c7; border-left: 3px solid var(--badm-warning); }

/* Primary button napravo v toolbar radku */
.badm-plan__toolbar-action {
    margin-left: auto;
}

/* Dropzone pro nahravani obrazku (drag/paste/browse) */
.badm-plan__dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 12px;
    border: 2px dashed var(--badm-border);
    border-radius: var(--badm-radius);
    background: var(--badm-bg);
    color: var(--badm-text-muted);
    text-align: center;
    transition: border-color 0.15s, background 0.15s;
}
.badm-plan__dropzone.is-dragover {
    border-color: var(--badm-primary);
    border-style: solid;
    background: var(--badm-primary-light);
    color: var(--badm-primary);
}
.badm-plan__dropzone-icon {
    font-size: 28px;
    opacity: 0.5;
}
.badm-plan__dropzone-hint {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 12px;
    line-height: 1.4;
}
.badm-plan__dropzone-hint strong {
    color: var(--badm-text);
    font-weight: 600;
}
.badm-plan__dropzone-hint kbd {
    display: inline-block;
    padding: 1px 5px;
    background: var(--badm-surface);
    border: 1px solid var(--badm-border);
    border-radius: 3px;
    font-size: 10px;
    font-family: inherit;
    color: var(--badm-text);
}
.badm-plan__dropzone--hero { min-height: 180px; }
.badm-plan__dropzone--banner {
    aspect-ratio: 2.4 / 1;
    padding: 10px;
    gap: 4px;
}
.badm-plan__dropzone--banner .badm-plan__dropzone-icon { font-size: 20px; }
.badm-plan__dropzone--banner .badm-plan__dropzone-hint { font-size: 11px; }

/* Sdeleni a obsah – text vlevo, vizual vpravo nahore */
.badm-plan__sdeleni {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.badm-plan__sdeleni-text { flex: 1; min-width: 0; }
.badm-plan__sdeleni-text .badm-section__title { margin-top: 0; }
.badm-plan__sdeleni-visual {
    order: 2;
    width: 200px;
    flex-shrink: 0;
}
.badm-plan__sdeleni-visual .badm-plan__visual-thumb {
    width: 100%;
    height: 140px;
}
.badm-plan__sdeleni-visual-caption {
    margin-top: 8px;
    font-size: 12px;
    color: var(--badm-text-muted);
    line-height: 1.5;
}
.badm-plan__sdeleni-visual-caption strong {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--badm-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 3px;
}
@media (max-width: 900px) {
    .badm-plan__sdeleni { flex-direction: column; }
    .badm-plan__sdeleni-visual { width: 100%; order: 0; }
}

/* Klicovy vizual thumbnail (sdileny) */
.badm-plan__visual-thumb {
    border: 1px dashed var(--badm-border);
    border-radius: var(--badm-radius);
    background: var(--badm-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--badm-text-muted);
    font-size: 28px;
    opacity: 0.5;
}
.badm-plan__edit-visual {
    display: flex;
    gap: 10px;
}
.badm-plan__edit-visual-preview {
    width: 140px;
    height: 100px;
    flex-shrink: 0;
    border: 1px dashed var(--badm-border);
    border-radius: var(--badm-radius);
    background: var(--badm-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--badm-text-muted);
    font-size: 11px;
}
.badm-plan__edit-visual-preview i { font-size: 24px; opacity: 0.5; }
.badm-plan__edit-visual-actions {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Edit form detailu kampane */
.badm-plan__edit-form { display: flex; flex-direction: column; gap: 14px; }
.badm-plan__edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.badm-plan__edit-grid--3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 900px) { .badm-plan__edit-grid { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .badm-plan__edit-grid--3 { grid-template-columns: 1fr 1fr; } }
.badm-plan__edit-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    padding: 6px 0;
}
.badm-plan__edit-checkboxes label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    cursor: pointer;
}
.badm-plan__edit-chip-input {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    padding: 4px 6px;
    border: 1px solid var(--badm-border);
    border-radius: var(--badm-radius);
    min-height: 32px;
    background: #fff;
}
.badm-plan__edit-chip-input .badm-tag i {
    cursor: pointer;
    opacity: 0.5;
    margin-left: 4px;
}
.badm-plan__edit-chip-input input {
    flex: 1;
    min-width: 100px;
    border: none;
    padding: 2px 4px;
    background: transparent;
    outline: none;
}

/* Sekce Zobrazeni na webu – 4 typy x N trhu, rozbalovaci details */
.badm-plan__web-row {
    border-top: 1px solid var(--badm-border);
    padding: 10px 0;
}
.badm-plan__web-row:first-of-type { border-top: none; padding-top: 4px; }
.badm-plan__web-row > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    padding: 4px 0;
}
.badm-plan__web-row > summary::-webkit-details-marker { display: none; }
.badm-plan__web-row > summary::marker { content: ''; }
.badm-plan__web-row-chevron {
    font-size: 11px;
    color: var(--badm-text-muted);
    transition: transform 0.15s;
    width: 12px;
}
.badm-plan__web-row[open] > summary .badm-plan__web-row-chevron {
    transform: rotate(90deg);
}
.badm-plan__web-row-stav {
    margin-left: auto;
    display: inline-flex;
    gap: 4px;
}
.badm-plan__web-row[open] > summary .badm-plan__web-row-stav { display: none; }
.badm-plan__web-row > .badm-plan__web-trhy {
    margin-top: 8px;
}
.badm-plan__web-trhy {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px;
}

.badm-plan__web-slot {
    border: 1px solid var(--badm-border);
    border-radius: var(--badm-radius);
    padding: 8px;
    background: var(--badm-bg);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.badm-plan__web-slot--unset {
    border-style: dashed;
    background: transparent;
}
.badm-plan__web-slot-add {
    flex: 1;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: transparent;
    border: none;
    color: var(--badm-text-muted);
    cursor: pointer;
    border-radius: var(--badm-radius);
    transition: background 0.1s, color 0.1s;
}
.badm-plan__web-slot-add:hover:not(:disabled) {
    background: var(--badm-primary-light);
    color: var(--badm-primary);
}
.badm-plan__web-slot-add i { font-size: 20px; opacity: 0.5; }
.badm-plan__web-slot-head {
    display: flex;
    align-items: center;
    gap: 6px;
}
/* Nahled promo listy (barevny pruh s textem) */
.badm-plan__web-slot-lista {
    border-radius: var(--badm-radius);
    padding: 10px 12px;
    color: #fff;
    font-size: 12px;
    line-height: 1.4;
    text-align: center;
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.badm-plan__web-slot-lista-text u { text-decoration: underline; }
.badm-plan__web-slot-lista-text strong { font-weight: 700; }

/* Color swatch pro barvu pozadi listy */
.badm-plan__web-color-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    vertical-align: middle;
    border: 1px solid rgba(0,0,0,0.1);
    margin-right: 2px;
}
.badm-plan__web-slot-meta {
    font-size: 11px;
    line-height: 1.4;
    color: var(--badm-text);
}
.badm-plan__web-slot-meta strong { color: var(--badm-text); }

/* Sidebar: propagacni kanaly chipy */
.badm-plan__sidebar-channels { display: flex; flex-wrap: wrap; gap: 3px; }
.badm-plan__sidebar-channels .badm-tag { display: inline-flex; align-items: center; gap: 4px; }

/* Kompaktni sidebar sekce v detailu kampane */
.badm-plan__sidebar-section { padding: 12px; }
.badm-plan__sidebar-section .badm-section__title { margin-bottom: 8px; }
.badm-plan__sidebar-field { margin-bottom: 10px; }
.badm-plan__sidebar-field:last-child { margin-bottom: 0; }
.badm-plan__sidebar-field > label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--badm-text-muted);
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.badm-plan__sidebar-value {
    font-size: 12px;
    color: var(--badm-text);
    line-height: 1.3;
}
.badm-plan__sidebar-utm {
    display: block;
    font-size: 11px;
    background: var(--badm-bg);
    padding: 6px 8px;
    border-radius: var(--badm-radius);
    word-break: break-all;
}

/* Navigace rozsahem */
.badm-plan__range-switch,
.badm-plan__nav {
    display: flex;
    align-items: center;
    gap: 6px;
}
.badm-plan__anchor-label {
    font-size: 12px;
    color: var(--badm-text-muted);
    padding: 0 8px;
    min-width: 180px;
    text-align: center;
}

/* ── Detail: komentare ── */
.badm-plan__comments {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.badm-plan__comment {
    background: var(--badm-bg);
    border: 1px solid var(--badm-border);
    border-radius: var(--badm-radius);
    padding: 10px 12px;
}
.badm-plan__comment-head {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 12px;
}
.badm-plan__comment-body {
    font-size: 13px;
    line-height: 1.4;
    color: var(--badm-text);
}
.badm-plan__comment-new {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
    align-items: flex-end;
}
.badm-plan__comment-new textarea {
    width: 100%;
    min-height: 60px;
    resize: vertical;
}

/* ══════════════════════════════════════════════════════════
   Nastenka (dashboard) – sdilene boxy na metriky
   ══════════════════════════════════════════════════════════ */
.badm-dash__metrics-stack {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0;
    min-width: 0; /* grid item nesmi rust nad 1fr track kvuli flex obsahu */
}
.badm-dash__metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    align-items: start;
    padding: 12px 0;
}
.badm-dash__metrics-stack .badm-dash__metrics { padding: 0; }
.badm-dash__metrics .badm-box--toggle { min-width: 0; }
.badm-dash__metrics .badm-box--toggle .badm-box__value { white-space: nowrap; }
.badm-dash__metrics .badm-box--toggle .badm-box__label { white-space: nowrap; }
/* Mobil: horizontalni scroll – boxy zustanou stejne siroke jako na desktopu,
   swipe vodorovne odkryje dalsi. Scroll-snap drzi boxy v zakrytu. */
@media (max-width: 640px) {
    .badm-dash__metrics {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px; /* prostor pro native scrollbar */
        /* Fade edge na pravem okraji – napoveda "jde scrollovat dal" */
        mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 24px), transparent 100%);
    }
    .badm-dash__metrics .badm-box--toggle {
        flex: 0 0 45%;
        scroll-snap-align: start;
    }
    .badm-dash__metrics-stack > .badm-dash__metrics + .badm-dash__metrics { margin-top: 8px; }
    /* Grafy na mobilu: skryt Y osu (vertikalni hodnoty berou misto) */
    .badm-half-grid > .badm-chart-wrap { height: 180px; }
}
/* Nastenka – nizsi chart wrap vedle KPI stacku (prekryva default 360px + margin) */
.badm-half-grid > .badm-chart-wrap { height: 240px; margin-bottom: 0; }

/* Rank list (top N potisky / produkty) s horizontalnim bar grafem na pozadi */
.badm-dash__rank-list { display: flex; flex-direction: column; gap: 2px; }
.badm-dash__rank-row {
    display: grid;
    grid-template-columns: 24px 1fr auto auto;
    gap: 8px;
    padding: 4px 8px;
    font-size: 12px;
    background-image: linear-gradient(to right, rgba(245, 158, 11, 0.18) var(--bar, 0%), transparent var(--bar, 0%));
    border-radius: 4px;
    align-items: center;
}
.badm-dash__rank-pos { color: var(--badm-text-muted); font-variant-numeric: tabular-nums; }
.badm-dash__rank-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badm-dash__rank-val { font-weight: 600; font-variant-numeric: tabular-nums; }
.badm-dash__rank-pct { color: var(--badm-text-muted); font-variant-numeric: tabular-nums; min-width: 48px; text-align: right; }
.badm-dash__pie-wrap { height: 260px; position: relative; }

/* ── QC widget – vlastni potisky kontrola ───────────────────────── */
.badm-dash__qc-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.badm-dash__qc-search { padding: 6px 10px; border: 1px solid var(--badm-border); border-radius: var(--badm-radius); font-size: 13px; width: 200px; }
.badm-dash__qc-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; }
@media (max-width: 1400px) { .badm-dash__qc-grid { grid-template-columns: repeat(6, 1fr); } }
@media (max-width: 1100px) { .badm-dash__qc-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 700px)  { .badm-dash__qc-grid { grid-template-columns: repeat(3, 1fr); } }
.badm-dash__qc-card { position: relative; background: var(--badm-surface); border: 1px solid var(--badm-border); border-radius: var(--badm-radius); overflow: hidden; cursor: pointer; transition: box-shadow .15s, background .15s; aspect-ratio: 440 / 590; display: flex; flex-direction: column; }
.badm-dash__qc-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.badm-dash__qc-card.badm-skeleton { cursor: default; background-color: var(--badm-surface); }
/* Jemne obarveni karty podle stavu kontroly (+ barevne spodni cislo objednavky) */
.badm-dash__qc-card[data-result="ok"]      { background: var(--badm-success-light); border-color: #bbf7d0; }
.badm-dash__qc-card[data-result="problem"] { background: var(--badm-danger-light);  border-color: #fecaca; }
.badm-dash__qc-card[data-result="ok"]      .badm-dash__qc-cislo { background: var(--badm-success-light); }
.badm-dash__qc-card[data-result="problem"] .badm-dash__qc-cislo { background: var(--badm-danger-light); }
.badm-dash__qc-card[data-result="ok"]      .badm-dash__qc-thumb,
.badm-dash__qc-card[data-result="problem"] .badm-dash__qc-thumb { background: transparent; }
.badm-dash__qc-thumb { width: 100%; flex: 1; object-fit: contain; display: block; background: #f5f5f5; }
.badm-dash__qc-thumb--empty { display: flex; align-items: center; justify-content: center; color: var(--badm-text-muted); font-size: 24px; }
.badm-dash__qc-count { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,0.65); color: #fff; padding: 2px 6px; border-radius: 10px; font-size: 10px; font-weight: 600; }
.badm-dash__qc-badge { position: absolute; top: 6px; left: 6px; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #fff; }
.badm-dash__qc-badge--ok { background: #16a34a; }
.badm-dash__qc-badge--problem { background: #dc2626; }
.badm-dash__qc-cislo { padding: 4px 6px; font-size: 11px; text-align: center; color: var(--badm-text-muted); border-top: 1px solid var(--badm-border); background: var(--badm-surface); }
.badm-dash__qc-loadmore { text-align: center; margin-top: 12px; }

/* QC Modal – landscape 3-column layout (grafika | mockup | info panel) */
#badmModal .badm-modal__dialog.badm-dash__qc-dialog { max-width: 1200px; }
.badm-dash__qc-modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr 320px;
    gap: 16px;
    align-items: stretch;
}
@media (max-width: 900px) { .badm-dash__qc-modal-body { grid-template-columns: 1fr; } }
.badm-dash__qc-modal-preview {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--qc-bg, #f5f5f5);
    border-radius: var(--badm-radius);
    padding: 12px;
    height: 460px;
    transition: background .15s;
}
.badm-dash__qc-modal-preview-imgwrap {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    border-radius: var(--badm-radius);
}
.badm-dash__qc-modal-preview-imgwrap > a { display: contents; } /* anchor neprerusi flex layout, img ziska max-width z imgwrap */
.badm-dash__qc-modal-preview img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.badm-dash__qc-bg-toggle {
    position: absolute;
    bottom: 10px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0,0,0,.2), 0 1px 3px rgba(0,0,0,.15);
    cursor: pointer;
    padding: 0;
    transition: transform .15s;
}
.badm-dash__qc-bg-toggle:hover { transform: scale(1.15); }
.badm-dash__qc-bg-toggle--black { left: 10px; background: #000; }
.badm-dash__qc-bg-toggle--pink  { right: 10px; background: #f4b6d2; }
.badm-dash__qc-modal-preview-label { font-size: 11px; color: var(--badm-text-muted); margin-top: 6px; text-transform: uppercase; letter-spacing: .06em; }
.badm-dash__qc-modal-info { display: flex; flex-direction: column; gap: 10px; font-size: 12px; }
.badm-dash__qc-modal-info h4 { margin: 0; font-size: 11px; text-transform: uppercase; color: var(--badm-text-muted); letter-spacing: .06em; }
.badm-dash__qc-modal-info a { display: block; padding: 4px 0; }
.badm-dash__qc-modal-status { padding: 8px 12px; border-radius: var(--badm-radius); font-size: 12px; }
.badm-dash__qc-modal-status--ok { background: #dcfce7; color: #166534; }
.badm-dash__qc-modal-status--problem { background: #fee2e2; color: #991b1b; }
.badm-dash__qc-modal-actions { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; border-top: 1px solid var(--badm-border); }
.badm-dash__qc-modal-actions-row { display: flex; gap: 8px; }
.badm-dash__qc-modal-actions-row .badm-btn { flex: 1; }
.badm-dash__qc-modal-note { width: 100%; min-height: 60px; padding: 6px 10px; border: 1px solid var(--badm-border); border-radius: var(--badm-radius); font-size: 13px; resize: vertical; box-sizing: border-box; }
.badm-dash__qc-modal-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--badm-border); gap: 12px; flex-wrap: wrap; }
.badm-dash__qc-modal-nav-group { display: flex; gap: 6px; align-items: center; }

/* ========== Markdown rendering (sdilene .badm-md) ========== */
.badm-md p { margin: 0 0 6px; }
.badm-md p:first-child { margin-top: 0; }
.badm-md p:last-child { margin-bottom: 0; }
.badm-md ul, .badm-md ol { margin: 6px 0; padding-left: 20px; }
.badm-md li { margin-bottom: 2px; }
.badm-md h1, .badm-md h2, .badm-md h3 { font-size: 0.95rem; margin: 10px 0 4px; font-weight: 600; }
.badm-md code {
    background: rgba(0,0,0,0.06);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.88em;
    font-family: "SFMono-Regular", "Consolas", "Liberation Mono", monospace;
}
.badm-md pre {
    background: rgba(0,0,0,0.05);
    padding: 8px 10px;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 0.88em;
    margin: 6px 0;
}
.badm-md pre code { background: transparent; padding: 0; }
.badm-md a { color: var(--badm-primary); }
.badm-md strong { font-weight: 600; }
.badm-md blockquote {
    border-left: 3px solid var(--badm-border);
    padding-left: 10px;
    margin: 6px 0;
    color: var(--badm-text-muted);
}

/* Hint pod labelem (napoveda formatu, MD apod.) */
.badm-set__hint {
    font-size: 11px;
    color: var(--badm-text-muted);
    margin-top: 4px;
    line-height: 1.4;
}
.badm-set__hint code {
    background: rgba(0,0,0,0.05);
    padding: 0 4px;
    border-radius: 3px;
    font-size: 10px;
}

/* Hero vizual nahrany – obrazek na cele plose */
.badm-plan__sdeleni-visual-img {
    max-width: 100%;
    max-height: 240px;
    border-radius: var(--badm-radius);
    display: block;
    object-fit: contain;
    background: var(--badm-bg);
}

/* Dropzone – disabled/placeholder stav */
.badm-plan__dropzone--disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Upload progress overlay */
.badm-plan__dropzone.is-uploading {
    border-style: solid;
    border-color: var(--badm-primary);
    background: var(--badm-primary-light);
}
.badm-plan__dropzone.is-drag-over {
    border-style: solid;
    border-color: var(--badm-primary);
    background: rgba(255, 128, 20, 0.08);
}

/* Dropzone – hotovy preview obrazek */
.badm-plan__dropzone {
    position: relative;
}
.badm-plan__dropzone-preview {
    max-width: 100%;
    max-height: 180px;
    border-radius: 4px;
    display: block;
    object-fit: contain;
    margin: 0 auto;
}
.badm-plan__dropzone-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    z-index: 2;
}
.badm-plan__dropzone-remove:hover { background: var(--badm-danger); }
.badm-plan__dropzone-input {
    position: absolute;
    opacity: 0;
    width: 1px; height: 1px;
    pointer-events: none;
}
.badm-plan__dropzone-browse { position: relative; margin-top: 6px; cursor: pointer; }

/* Edit form: hero layout (dropzone + popis vedle sebe) */
.badm-plan__edit-visual-row {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 16px;
    align-items: start;
}
.badm-plan__edit-visual-zone { min-width: 0; }
.badm-plan__edit-visual-text { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 720px) {
    .badm-plan__edit-visual-row { grid-template-columns: 1fr; }
}

/* Promo tabulka (tab Bannery / Listy) */
.badm-plan__promo-table td { vertical-align: middle; }
.badm-plan__promo-thumb {
    max-width: 140px;
    max-height: 80px;
    border-radius: 3px;
    object-fit: contain;
    display: block;
    background: var(--badm-bg);
}
.badm-plan__promo-table tbody tr { cursor: pointer; }
.badm-plan__promo-table tbody tr:hover td { background: var(--badm-surface-hover, #f5f5f5); }
.badm-plan__promo-lista-swatch {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    color: #fff;
    font-size: 11px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}
/* Lista preview (modal i radek tabulky) – renderovany HTML obsah na barvenem pozadi */
.badm-plan__lista-preview {
    display: block;
    padding: 10px 14px;
    border-radius: 4px;
    color: #fff;
    font-size: 13px;
    line-height: 1.4;
    min-height: 36px;
    word-break: break-word;
}
.badm-plan__lista-preview--inline {
    padding: 4px 10px;
    font-size: 11px;
    min-height: 0;
    margin-top: 4px;
}
/* Tabulka List – sloupec "Interní název" chceme co nejsirsi */
.badm-plan__promo-table col[data-col="title"], .badm-plan__promo-table th[data-col="title"] { width: 45%; }
/* Color picker + hex input vedle sebe */
.badm-plan__color-row {
    display: flex;
    gap: 6px;
    align-items: center;
}
.badm-plan__color-picker {
    width: 40px;
    height: 32px;
    padding: 2px;
    border: 1px solid var(--badm-border);
    border-radius: 4px;
    cursor: pointer;
    background: none;
}
.badm-plan__color-row .badm-input { flex: 1; min-width: 100px; max-width: 120px; }

/* Potisk tydne – tab */
.badm-plan__potisk-table td { vertical-align: middle; padding: 8px 10px; }
.badm-plan__potisk-cell { cursor: pointer; }
.badm-plan__potisk-cell:hover { background: var(--badm-surface-hover, #f5f5f5); }
.badm-plan__potisk-week strong { font-size: 14px; }
.badm-plan__potisk-row--today { box-shadow: inset 3px 0 0 var(--badm-primary); }
/* Minule tydny – jen ztlumit label tydne, chip zustava plnou barvou */
.badm-plan__potisk-row--past .badm-plan__potisk-week { opacity: 0.5; }
.badm-plan__potisk-row--past .badm-plan__potisk-empty { opacity: 0.35; border-style: dotted; }
.badm-plan__potisk-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}
.badm-plan__potisk-thumb {
    width: 36px; height: 36px;
    object-fit: contain;
    background: rgba(255,255,255,0.3);
    border-radius: 4px;
    flex: 0 0 auto;
}
.badm-plan__potisk-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badm-plan__potisk-empty {
    background: none;
    border: 1px dashed var(--badm-border);
    border-radius: 4px;
    padding: 8px 12px;
    color: var(--badm-text-muted);
    cursor: pointer;
    width: 100%;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.badm-plan__potisk-empty:hover { border-color: var(--badm-primary); color: var(--badm-primary); }

/* Modal search */
.badm-plan__potisk-results {
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid var(--badm-border);
    border-radius: 4px;
    margin-top: 4px;
    background: var(--badm-surface);
}
.badm-plan__potisk-result {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--badm-border);
}
.badm-plan__potisk-result:last-child { border-bottom: none; }
.badm-plan__potisk-result:hover { background: var(--badm-bg); }
.badm-plan__potisk-result img {
    width: 40px; height: 40px; object-fit: contain;
    background: var(--badm-bg); border-radius: 3px;
}

/* Selected in modal */
.badm-plan__potisk-selected {
    display: flex; align-items: center; gap: 12px;
    padding: 10px;
    border: 1px solid var(--badm-border);
    border-radius: 4px;
    background: var(--badm-bg);
    margin-bottom: 10px;
}
.badm-plan__potisk-selected-img {
    width: 60px; height: 60px; object-fit: contain;
    background: #fff; border-radius: 4px;
}

/* Preview in modal */
.badm-plan__potisk-preview {
    padding: 20px;
    border-radius: 4px;
    border: 1px solid var(--badm-border);
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 80px;
    background: #f0c34c; /* default fallback, prepise se inline stylem */
}
.badm-plan__potisk-preview-img {
    width: 60px; height: 60px; object-fit: contain;
    background: rgba(255,255,255,0.3); border-radius: 4px;
}
.badm-plan__potisk-preview span { font-size: 18px; font-weight: 600; }
.badm-plan__color-palette {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.badm-plan__color-swatch {
    width: 28px;
    height: 28px;
    border: 1px solid var(--badm-border);
    border-radius: 4px;
    cursor: pointer;
    padding: 0;
    transition: transform 0.1s;
}
.badm-plan__color-swatch:hover { transform: scale(1.1); border-color: var(--badm-primary); }
/* Multiselect filtr v zahlavi tabulky – pouzij .badm-msel (viz nahore v style.css) */
.badm-plan__promo-camp-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
}
.badm-plan__promo-camp-link i { font-size: 10px; color: var(--badm-text-muted); }

/* Web sloty – editacni form uvnitr slot */
.badm-plan__web-slot--editable .badm-plan__web-slot-edit {
    display: grid;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--badm-border);
}
.badm-plan__web-slot-edit-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}
.badm-plan__web-slot-edit textarea,
.badm-plan__web-slot-edit input[type="text"],
.badm-plan__web-slot-edit input[type="url"],
.badm-plan__web-slot-edit input[type="color"],
.badm-plan__web-slot-edit input[type="datetime-local"] {
    font-size: 12px;
}
.badm-plan__web-slot-edit-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    margin-top: 4px;
}
.badm-plan__web-slot-lista-preview {
    padding: 10px 14px;
    border-radius: 4px;
    color: #fff;
    font-weight: 500;
    font-size: 13px;
    min-height: 32px;
    display: flex;
    align-items: center;
}
.badm-plan__web-slot-banner-preview {
    max-width: 100%;
    max-height: 120px;
    border-radius: 4px;
    display: block;
    margin: 4px auto;
}

/* ══════════════════════════════════════════════════════════
   Knowledge base (UI: "Bible") – knowledge.tpl + knowledge_folders.tpl

   Pouziva sdilene prvky: .badm-page-header, .badm-section, .badm-nav-list,
   .badm-toolbar, .badm-modal, .badm-btn, .badm-badge, .badm-set, .badm-table.
   Module-specific zustavaji jen: 2-sloupcovy layout, sticky sidebar,
   ProseMirror styly editoru, history rows, diff coloring.
   ══════════════════════════════════════════════════════════ */

.badm-knowledge__layout {
    display: grid;
    grid-template-columns: 52px 1fr;
    gap: var(--badm-gap);
    align-items: start;
    transition: grid-template-columns 200ms ease;
}
.badm-knowledge[data-sidebar="expanded"] .badm-knowledge__layout {
    grid-template-columns: 280px 1fr;
}

/* ── NAV wrapper (rail + sidebar) ──────────────────────── */
.badm-knowledge__nav {
    position: sticky;
    top: 70px;
    align-self: start;
}

/* ── RAIL (uzka lista s ikonami, viditelna v collapsed stavu) ── */
.badm-knowledge__rail {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 6px;
    background: var(--badm-surface);
    border: 1px solid var(--badm-border);
    border-radius: var(--badm-radius);
    width: 52px;
    position: relative;
    z-index: 60; /* nad sidebar overlay (z-index: 50), aby hamburger byl vzdy klikatelny */
}
.badm-knowledge[data-sidebar="expanded"] .badm-knowledge__rail {
    display: none;
}
.badm-knowledge__rail-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: var(--badm-radius);
    color: var(--badm-text);
    font-size: 16px;
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease;
}
.badm-knowledge__rail-btn:hover {
    background: var(--badm-bg);
    color: var(--badm-primary);
}
.badm-knowledge__rail-btn--toggle {
    margin-top: auto;
    border-top: 1px solid var(--badm-border);
    border-radius: 0;
    padding-top: 8px;
}
.badm-knowledge__rail-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 14px;
    height: 14px;
    padding: 0 3px;
    background: var(--badm-bg);
    color: var(--badm-text-muted);
    border: 1px solid var(--badm-border);
    font-size: 9px;
    line-height: 12px;
    border-radius: 7px;
    text-align: center;
    font-weight: 600;
}

/* ── SIDEBAR (plna lista) ─────────────────────────────── */
.badm-knowledge__sidebar {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Collapsed: sidebar je skryta defaultne, ale pri hover na rail se vysune VEDLE rail jako overlay.
   Sidebar je primo nalepena na rail (left: 52px, zadny gap), navic ma neviditelnou bridge
   `::before` doleva pres rail – aby pri prejezdu z rail na sidebar nedoslo k zaniku hoveru. */
.badm-knowledge[data-sidebar="collapsed"] .badm-knowledge__sidebar {
    position: absolute;
    top: 0;
    left: 52px;
    width: 280px;
    z-index: 50;
    background: var(--badm-surface);
    border: 1px solid var(--badm-border);
    border-radius: var(--badm-radius);
    padding: 8px;
    box-shadow: var(--badm-shadow-md, 0 8px 24px rgba(0, 0, 0, 0.12));
    opacity: 0;
    pointer-events: none;
    transform: translateX(-8px);
    transition: opacity 120ms ease, transform 120ms ease;
}
/* Bridge zone: kryje gap mezi rail a sidebar; predehrava jako prodlouzeni hover oblasti */
.badm-knowledge[data-sidebar="collapsed"] .badm-knowledge__sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: -12px;
    width: 12px;
    z-index: -1;
}
.badm-knowledge[data-sidebar="collapsed"] .badm-knowledge__nav:hover .badm-knowledge__sidebar,
.badm-knowledge[data-sidebar="collapsed"] .badm-knowledge__nav:focus-within .badm-knowledge__sidebar,
.badm-knowledge[data-sidebar="collapsed"] .badm-knowledge__sidebar:hover,
.badm-knowledge[data-sidebar="collapsed"] .badm-knowledge__sidebar:focus-within {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

.badm-knowledge__sidebar-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 4px;
}
.badm-knowledge[data-sidebar="collapsed"] .badm-knowledge__sidebar-header {
    display: none;
}
.badm-knowledge__sidebar-collapse {
    border: none;
    background: transparent;
    color: var(--badm-text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--badm-radius);
    font-size: 12px;
}
.badm-knowledge__sidebar-collapse:hover {
    background: var(--badm-bg);
    color: var(--badm-primary);
}

.badm-knowledge__sidebar > .badm-section {
    margin-bottom: 0;
}
.badm-knowledge__sidebar > .badm-section + .badm-section {
    margin-top: var(--badm-gap);
}
.badm-knowledge__sidebar .badm-section__header {
    cursor: pointer;
}
.badm-knowledge__sidebar .badm-section__title .badm-badge {
    margin-left: 6px;
    vertical-align: middle;
}

.badm-knowledge__search-input {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid var(--badm-border);
    border-radius: var(--badm-radius);
    font-size: 12px;
    background: var(--badm-surface);
}
.badm-knowledge__search-input:focus {
    outline: none;
    border-color: var(--badm-primary);
}
.badm-knowledge__search-results {
    margin-top: 8px;
    max-height: 240px;
    overflow-y: auto;
    border-top: 1px solid var(--badm-border);
}
.badm-knowledge__search-result {
    padding: 6px 4px;
    border-bottom: 1px solid var(--badm-border);
    cursor: pointer;
}
.badm-knowledge__search-result:last-child { border-bottom: none; }
.badm-knowledge__search-result:hover { background: var(--badm-bg); }
.badm-knowledge__search-result-title {
    font-weight: 600;
    font-size: 12px;
}
.badm-knowledge__search-result-meta {
    color: var(--badm-text-muted);
    font-size: 10px;
    margin-top: 2px;
}

.badm-knowledge__new-doc {
    padding: 2px 6px;
}

/* Aktivni dokument v badm-nav-list */
.badm-nav-list a.is-active {
    background: var(--badm-primary-light);
    color: var(--badm-primary);
    font-weight: 600;
}

/* ── Main – empty state + doc viewer/editor ──────────── */

.badm-knowledge__empty {
    display: flex;
    flex-direction: column;
    gap: var(--badm-gap);
}
.badm-knowledge__empty[hidden] {
    display: none !important;
}

/* ── Textovy outline (soupis vsech dokumentu po slozkach) ── */

.badm-knowledge__outline {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.badm-knowledge__outline-folder {
    /* nic – jen prirozeny rozestup */
}
.badm-knowledge__outline-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 6px;
    color: var(--badm-text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.badm-knowledge__outline-title i {
    color: var(--badm-primary);
    font-size: 13px;
}
.badm-knowledge__outline-list {
    list-style: none;
    margin: 0;
    padding: 0 0 0 22px;
}
.badm-knowledge__outline-list li {
    padding: 3px 0;
    font-size: 13px;
}
.badm-knowledge__outline-list a {
    color: var(--badm-text);
    text-decoration: none;
}
.badm-knowledge__outline-list a:hover {
    color: var(--badm-primary);
    text-decoration: underline;
}
.badm-knowledge__outline-empty {
    margin: 0 0 0 22px;
    font-size: 12px;
    font-style: italic;
}

/* ── Naposledy upraveno (sekundarni sekce dole) ────────── */

.badm-knowledge__recent {
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--badm-border);
}
.badm-knowledge__recent-title-h {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--badm-text-muted);
    margin: 0 0 8px;
}
.badm-knowledge__recent-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.badm-knowledge__recent-list li + li {
    margin-top: 2px;
}
.badm-knowledge__recent-list a {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 4px 0;
    color: var(--badm-text);
    text-decoration: none;
    font-size: 12px;
}
.badm-knowledge__recent-list a:hover {
    color: var(--badm-primary);
}
.badm-knowledge__recent-doc-title {
    font-weight: 500;
}
.badm-knowledge__recent-meta {
    font-size: 10px;
    color: var(--badm-text-muted);
}
.badm-knowledge__recent-meta code {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10px;
    background: none;
    padding: 0;
}

/* ── Folder settings: icon input + nahled ──────────────── */

.badm-knowledge-folders__icon-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.badm-knowledge-folders__icon-row input {
    flex: 1;
    max-width: 280px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 12px;
}
.badm-knowledge-folders__icon-preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--badm-bg);
    border: 1px solid var(--badm-border);
    border-radius: var(--badm-radius);
    color: var(--badm-primary);
    font-size: 16px;
}

.badm-knowledge__doc-actions {
    display: flex;
    gap: 6px;
}
.badm-knowledge__doc-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    font-size: 10px;
    color: var(--badm-text-muted);
    margin-bottom: 12px;
}
.badm-knowledge__doc-path {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
}

/* ── TipTap toolbar (rozsireni .badm-toolbar) ──────────── */

.badm-knowledge__toolbar {
    gap: 2px;
    padding: 6px;
    background: var(--badm-bg);
    border: 1px solid var(--badm-border);
    border-radius: var(--badm-radius);
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.badm-knowledge__toolbar .badm-btn.is-active {
    background: var(--badm-primary-light);
    color: var(--badm-primary);
}
.badm-toolbar__sep {
    width: 1px;
    background: var(--badm-border);
    margin: 0 4px;
    align-self: stretch;
}
.badm-knowledge__toolbar-wysiwyg {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-wrap: wrap;
}

/* ── Mode switch (WYSIWYG / MD) ────────────────────────── */

.badm-knowledge__mode-switch {
    display: inline-flex;
    background: var(--badm-surface);
    border: 1px solid var(--badm-border);
    border-radius: var(--badm-radius);
    padding: 2px;
    gap: 0;
}
.badm-knowledge__mode-btn {
    background: transparent;
    border: none;
    padding: 4px 10px;
    font-size: 11px;
    color: var(--badm-text-muted);
    cursor: pointer;
    border-radius: var(--badm-radius-sm);
    transition: background 120ms ease, color 120ms ease;
}
.badm-knowledge__mode-btn:hover {
    color: var(--badm-text);
}
.badm-knowledge__mode-btn.is-active {
    background: var(--badm-primary);
    color: #fff;
    font-weight: 600;
}

/* ── Read mode viewer (Parsedown HTML output) ─────────── */

.badm-knowledge__viewer {
    font-size: 13px;
    line-height: 1.6;
    color: var(--badm-text);
    min-height: 200px;
}
.badm-knowledge__viewer h1 { font-size: 18px; font-weight: 700; margin: 16px 0 10px; }
.badm-knowledge__viewer h2 { font-size: 15px; font-weight: 700; margin: 14px 0 8px; }
.badm-knowledge__viewer h3 { font-size: 13px; font-weight: 600; margin: 12px 0 6px; }
.badm-knowledge__viewer p { margin: 8px 0; }
.badm-knowledge__viewer ul,
.badm-knowledge__viewer ol { padding-left: 24px; margin: 8px 0; }
.badm-knowledge__viewer blockquote {
    border-left: 3px solid var(--badm-border);
    padding-left: 12px;
    color: var(--badm-text-muted);
    margin: 8px 0;
}
.badm-knowledge__viewer code {
    background: var(--badm-secondary);
    padding: 1px 6px;
    border-radius: var(--badm-radius-sm);
    font-size: 11px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.badm-knowledge__viewer pre {
    background: var(--badm-secondary);
    padding: 10px 14px;
    border-radius: var(--badm-radius);
    overflow-x: auto;
}
.badm-knowledge__viewer pre code {
    background: none;
    padding: 0;
}
.badm-knowledge__viewer img {
    max-width: 100%;
    height: auto;
    border-radius: var(--badm-radius);
}
.badm-knowledge__viewer table {
    border-collapse: collapse;
    margin: 8px 0;
    width: 100%;
}
.badm-knowledge__viewer th,
.badm-knowledge__viewer td {
    border: 1px solid var(--badm-border);
    padding: 5px 8px;
    font-size: 12px;
}
.badm-knowledge__viewer th {
    background: var(--badm-bg);
    font-weight: 600;
    text-align: left;
}
.badm-knowledge__viewer a {
    color: var(--badm-primary);
    text-decoration: underline;
}

/* ── MD source textarea ───────────────────────────────── */

.badm-knowledge__md-source {
    width: 100%;
    min-height: 500px;
    padding: 12px 14px;
    border: 1px solid var(--badm-border);
    border-radius: var(--badm-radius);
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 12px;
    line-height: 1.6;
    background: var(--badm-surface);
    color: var(--badm-text);
    resize: vertical;
}
.badm-knowledge__md-source:focus {
    outline: none;
    border-color: var(--badm-primary);
}

/* Save button highlight pri neulozenych zmenach */
#knSaveBtn.is-dirty {
    box-shadow: 0 0 0 2px var(--badm-primary-light);
}

/* Mode-based viditelnost tlacitek – CSS je source-of-truth */
.badm-knowledge__doc[data-mode="read"] #knSaveBtn,
.badm-knowledge__doc[data-mode="read"] #knCancelBtn,
.badm-knowledge__doc[data-mode="read"] #knEditWrap {
    display: none !important;
}
.badm-knowledge__doc[data-mode="edit"] #knEditBtn,
.badm-knowledge__doc[data-mode="edit"] #knViewer {
    display: none !important;
}

/* ── ProseMirror (TipTap editor obsah) ─────────────────── */

.badm-knowledge__editor .ProseMirror {
    min-height: 400px;
    outline: none;
    font-size: 13px;
    line-height: 1.55;
    color: var(--badm-text);
}
.badm-knowledge__editor .ProseMirror h1 { font-size: 18px; font-weight: 700; margin: 16px 0 10px; }
.badm-knowledge__editor .ProseMirror h2 { font-size: 15px; font-weight: 700; margin: 14px 0 8px; }
.badm-knowledge__editor .ProseMirror h3 { font-size: 13px; font-weight: 600; margin: 12px 0 6px; }
.badm-knowledge__editor .ProseMirror p { margin: 8px 0; }
.badm-knowledge__editor .ProseMirror ul,
.badm-knowledge__editor .ProseMirror ol { padding-left: 24px; }
.badm-knowledge__editor .ProseMirror blockquote {
    border-left: 3px solid var(--badm-border);
    padding-left: 12px;
    color: var(--badm-text-muted);
    margin: 8px 0;
}
.badm-knowledge__editor .ProseMirror code {
    background: var(--badm-secondary);
    padding: 1px 6px;
    border-radius: var(--badm-radius-sm);
    font-size: 11px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.badm-knowledge__editor .ProseMirror pre {
    background: var(--badm-secondary);
    padding: 10px 14px;
    border-radius: var(--badm-radius);
    overflow-x: auto;
}
.badm-knowledge__editor .ProseMirror pre code {
    background: none;
    padding: 0;
}
.badm-knowledge__editor .ProseMirror img {
    max-width: 100%;
    height: auto;
    border-radius: var(--badm-radius);
}
.badm-knowledge__editor .ProseMirror table {
    border-collapse: collapse;
    margin: 8px 0;
    width: 100%;
}
.badm-knowledge__editor .ProseMirror th,
.badm-knowledge__editor .ProseMirror td {
    border: 1px solid var(--badm-border);
    padding: 5px 8px;
    font-size: 12px;
}
.badm-knowledge__editor .ProseMirror th {
    background: var(--badm-bg);
    font-weight: 600;
    text-align: left;
}
.badm-knowledge__editor .ProseMirror a {
    color: var(--badm-primary);
    text-decoration: underline;
}

/* ── Modal historie a diff ────────────────────────────── */

.badm-knowledge__history-row {
    display: grid;
    grid-template-columns: 80px 1fr 130px;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--badm-border);
    cursor: pointer;
    align-items: center;
    font-size: 12px;
}
.badm-knowledge__history-row:last-child { border-bottom: none; }
.badm-knowledge__history-row:hover { background: var(--badm-bg); }
.badm-knowledge__history-sha {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10px;
    color: var(--badm-text-muted);
}
.badm-knowledge__history-meta {
    font-size: 10px;
    color: var(--badm-text-muted);
    text-align: right;
}

.badm-knowledge__diff pre {
    background: var(--badm-bg);
    padding: 10px 14px;
    border-radius: var(--badm-radius);
    font-size: 11px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    overflow-x: auto;
    line-height: 1.5;
}
.badm-knowledge__diff .diff-add {
    background: var(--badm-success-light);
    color: var(--badm-success);
    display: block;
}
.badm-knowledge__diff .diff-del {
    background: var(--badm-danger-light);
    color: var(--badm-danger);
    display: block;
}

/* ── Responsive: pod 768px sidebar nad obsah ─────────── */

@media (max-width: 768px) {
    .badm-knowledge__layout,
    .badm-knowledge[data-sidebar="expanded"] .badm-knowledge__layout {
        grid-template-columns: 1fr;
    }
    .badm-knowledge__nav {
        position: static;
    }
    .badm-knowledge__rail {
        flex-direction: row;
        width: auto;
        flex-wrap: wrap;
    }
    .badm-knowledge__rail-btn--toggle {
        margin-top: 0;
        margin-left: auto;
        border-top: none;
        border-left: 1px solid var(--badm-border);
        padding-top: 0;
        padding-left: 8px;
    }
    .badm-knowledge[data-sidebar="collapsed"] .badm-knowledge__sidebar {
        position: static;
        width: auto;
        opacity: 1;
        pointer-events: auto;
        transform: none;
        box-shadow: none;
        margin-top: 8px;
    }
}

/* ═══════════════════════════════════════════════════════════
   Error Log
   ═══════════════════════════════════════════════════════════ */
.badm-errlog { max-width: 1100px; }
.badm-errlog__empty { color: #999; font-style: italic; padding: 24px 0; }

/* Analyzy – karty */
/* badm-errlog__analyses → badm-card-stack, badm-errlog__card → badm-card + badm-card--warn/danger/ok */
/* badm-errlog__card-header → badm-card__header */
.badm-errlog__date { font-size: .8rem; color: #6b7280; }
.badm-errlog__period { font-size: .8rem; color: #9ca3af; }
.badm-errlog__meta { display: flex; gap: 6px; margin-left: auto; }
.badm-errlog__summary { margin: 0 0 6px; font-size: .9rem; color: #374151; }

/* Severity badges */
.badm-severity {
    display: inline-block; padding: 2px 8px; border-radius: 4px;
    font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
}
.badm-severity--ok { background: #dcfce7; color: #15803d; }
.badm-severity--warning { background: #fef3c7; color: #b45309; }
.badm-severity--critical { background: #fee2e2; color: #b91c1c; }

/* Details – rozbalovaci */
.badm-errlog__details { margin-top: 8px; }
.badm-errlog__details summary { cursor: pointer; font-size: .82rem; color: #6b7280; }
.badm-errlog__analysis {
    font-size: .82rem; line-height: 1.7; color: #374151;
    padding: 12px 16px; margin: 6px 0 0;
    background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 6px;
    max-height: 500px; overflow-y: auto;
}
.badm-errlog__pre {
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 4px;
    padding: 10px 12px; font-size: .78rem; white-space: pre-wrap; word-break: break-word;
    margin: 6px 0 0; max-height: 400px; overflow-y: auto;
}
.badm-errlog__pre--sm { max-height: 200px; font-size: .72rem; }

/* Raw data – tlacitka v karte analyzy */
.badm-errlog__raw {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #e5e7eb;
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}
.badm-errlog__raw-label {
    font-size: .75rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 600;
}

/* Raw data – obsah modalu */
.badm-errlog__raw-header {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: .82rem;
    line-height: 1.6;
    color: #374151;
}
.badm-errlog__raw-totals {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.badm-errlog__raw-table-wrap {
    max-height: 60vh;
    overflow-y: auto;
    margin-top: 8px;
}
.badm-errlog__raw-code {
    display: block;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: .72rem;
    color: #374151;
    white-space: pre-wrap;
    word-break: break-word;
    max-width: 600px;
}

/* Globalni banner bezicich cronu (fixni dole) */
.badm-cron-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 900;
    padding: 8px 20px;
    background: #1e40af;
    color: #fff;
    font-size: .82rem;
    text-align: center;
    box-shadow: 0 -2px 8px rgba(0,0,0,.15);
}
.badm-cron-banner.is-hidden { display: none; }
/* Kdyz je banner viditelny, pridat padding dole na sidebar a content */
body:has(.badm-cron-banner:not(.is-hidden)) .badm-sidebar { padding-bottom: 40px; }
body:has(.badm-cron-banner:not(.is-hidden)) main { padding-bottom: 40px; }

/* ══════════════════════════════════════════════════════════
   Modul Prodeje (?page=analytics)
   ══════════════════════════════════════════════════════════ */

.badm-analytics { display: flex; flex-direction: column; gap: var(--badm-gap); }

/* Filtr: checkbox label se ramečkem (nahrazuje bastard `.badm-mkt__checkbox`) */
.badm-analytics__checkbox {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border: 1px solid var(--badm-border);
    border-radius: var(--badm-radius);
    cursor: pointer;
    font-size: .85rem;
    user-select: none;
    transition: background .15s;
}
.badm-analytics__checkbox:hover { background: var(--badm-bg-hover); }
.badm-analytics__checkbox input { margin: 0; }

/* Souhrn karty (4 KPI nahore: ks / trzby / naklady / marze) */
.badm-analytics__summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--badm-gap);
}
@media (max-width: 900px) { .badm-analytics__summary { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .badm-analytics__summary { grid-template-columns: 1fr; } }

.badm-analytics__summary-card {
    background: var(--badm-bg);
    border: 1px solid var(--badm-border);
    border-radius: var(--badm-radius);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.badm-analytics__summary-label {
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--badm-text-muted);
}
.badm-analytics__summary-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--badm-fg);
}

/* Chart.js wrapper – fixni vyska aby chart neselhal pri responsive resize */
.badm-analytics__chart-wrap {
    position: relative;
    height: 320px;
    margin-bottom: var(--badm-gap);
}

/* Detaily pod chartem (collapsed tabulka) */
.badm-analytics__ts-details summary {
    cursor: pointer;
    padding: 6px 0;
    font-weight: 600;
    color: var(--badm-text-muted);
}
.badm-analytics__ts-details[open] summary { color: var(--badm-fg); margin-bottom: 8px; }

/* Inline link uvnitr tabulky (ZID -> detail) */
.badm-link { color: var(--badm-primary); text-decoration: none; }
.badm-link:hover { text-decoration: underline; }

/* ══════════════════════════════════════════════════════════
   Modul Marketing – portovany 1:1 z bastardu (rady 3092-3499)
   ══════════════════════════════════════════════════════════ */
/* ---------- Marketing Dashboard (badm-mkt) ---------- */

.badm-mkt__checkbox {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 13px;
    cursor: pointer;
}
.badm-mkt__checkbox input { margin: 0; }


/* Sync */
.badm-mkt__sync-status { font-size: 13px; color: #666; }
.badm-mkt__sync-status--ok { color: #16a34a; }
.badm-mkt__sync-status--error { color: #dc2626; }


/* Graf (chart section) */
.badm-mkt__chart-section { padding: 0; }

/* Layout: metric boxy nad grafem – plynuly tok, label nad prvnim boxem skupiny */
.badm-mkt__metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-end;
    padding: 12px 0;
    margin-bottom: 12px;
}
.badm-mkt__metric-first {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.badm-mkt__metric-group-label {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--badm-text-muted);
}
/* Metric selector boxy – pouzivaji standard badm-box padding, text nesmí zalamovat */
.badm-mkt__metrics .badm-box--toggle { min-width: 0; }
.badm-mkt__metrics .badm-box--toggle .badm-box__value { white-space: nowrap; }
.badm-mkt__metrics .badm-box--toggle .badm-box__label { white-space: nowrap; }
/* Liska pod metriky: granularita vpravo */
.badm-mkt__chart-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 8px 16px;
    border-bottom: 1px solid var(--badm-border);
}


/* Marketing – tabulkove specificke tridy (zbytek presunuto do sdilenych badm-table modifikatoru) */
.badm-mkt__weather-dev { font-weight: 600; white-space: nowrap; }
.badm-mkt__td-period { font-weight: 600; white-space: nowrap; }
.badm-mkt__th-period { cursor: pointer; user-select: none; }
/* Druhy sloupec (Den) – sticky vedle sticky prvniho sloupce */
.badm-mkt__td-day { text-align: left; }
/* Sticky sloupce v summary radku – nepruhledne pozadi */
.badm-table__summary td:first-child { background: #f9f9f9; }

/* Podbarveni radku podle platformy */
.badm-mkt__row--facebook    { background: rgba(66, 103, 178, 0.06); }
.badm-mkt__row--google      { background: rgba(52, 168, 83, 0.06); }
.badm-mkt__row--sklik       { background: rgba(204, 0, 0, 0.06); }
.badm-mkt__row--tiktok      { background: rgba(128, 128, 128, 0.06); }
/* Sticky sloupce – nepruhledne barvy (rgba by prosvitalo pri scrollu) */
.badm-mkt__row--facebook td:first-child { background: #f4f6fa; }
.badm-mkt__row--google td:first-child   { background: #f3faf5; }
.badm-mkt__row--sklik td:first-child    { background: #fcf0f0; }
.badm-mkt__row--tiktok td:first-child   { background: #f7f7f7; }



/* Disabled taby */
.badm-tabs__btn--disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* Poznamky k tydnum – ikona v period bunce */
.badm-mkt__note-icon {
    opacity: 0.15;
    font-size: 13px;
    cursor: pointer;
    margin-left: 4px;
    transition: opacity 0.15s;
}
.badm-mkt__note-icon:hover {
    opacity: 0.5;
}
.badm-mkt__note-icon--active {
    opacity: 1;
    color: var(--badm-primary, #ff8014);
}
.badm-mkt__note-icon--active:hover {
    opacity: 0.8;
}

/* Modal pro poznamky */
.badm-mkt__note-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}
.badm-mkt__note-modal {
    background: var(--badm-surface, #fff);
    border-radius: var(--badm-radius, 6px);
    padding: 20px;
    width: 420px;
    max-width: 90vw;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}
.badm-mkt__note-modal h3 {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 600;
}
.badm-mkt__note-field {
    margin-bottom: 12px;
}
.badm-mkt__note-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #555;
}
.badm-mkt__note-field textarea {
    width: 100%;
    height: 60px;
    resize: vertical;
    font-size: 13px;
    padding: 6px 8px;
    border: 1px solid var(--badm-border, #e5e5e5);
    border-radius: 4px;
    font-family: inherit;
}
.badm-mkt__note-field textarea:focus {
    outline: none;
    border-color: var(--badm-primary, #ff8014);
}
.badm-mkt__note-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ── Segment toggle (gear ikona + dropdown) ─────── */
.badm-mkt__section-header {
    display: flex;
    justify-content: flex-end;
    padding: 4px 8px 0;
}
.badm-mkt__segment-toggle {
    position: relative;
}
.badm-mkt__gear-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #999;
    padding: 4px;
}
.badm-mkt__gear-btn:hover {
    color: #333;
}
.badm-mkt__segment-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: #fff;
    border: 1px solid var(--badm-border, #e5e5e5);
    border-radius: 6px;
    padding: 8px 12px;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .1);
    min-width: 160px;
}
.badm-mkt__segment-dropdown.is-open {
    display: block;
}
.badm-mkt__segment-dropdown label {
    display: block;
    padding: 4px 0;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
}


/* ══════════════════════════════════════════════════ */
/* AI Analyza kampani                                */
/* ══════════════════════════════════════════════════ */

.badm-mkt__analysis-intro {
    color: var(--badm-text-muted);
    font-size: 12px;
    line-height: 1.5;
    margin: 0 0 1rem;
}

.badm-mkt__analysis-buttons {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.badm-mkt__analysis-run {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.5rem;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: var(--badm-radius);
    color: #fff;
    cursor: pointer;
    transition: opacity 0.15s;
}

.badm-mkt__analysis-run:hover { opacity: 0.85; }
.badm-mkt__analysis-run:disabled { opacity: 0.5; cursor: not-allowed; }

.badm-mkt__analysis-run[data-platform="facebook"] { background: #1877f2; }
.badm-mkt__analysis-run[data-platform="google"] { background: #34a853; }

/* Blok jedne platformy */
.badm-mkt__analysis-block {
    border: 1px solid var(--badm-border);
    border-radius: var(--badm-radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

.badm-mkt__analysis-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.badm-mkt__analysis-block-title {
    font-size: 13px;
    font-weight: 600;
    margin: 0;
    color: var(--badm-text);
}

.badm-mkt__analysis-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.badm-mkt__analysis-refresh {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.badm-mkt__analysis-status {
    font-size: 11px;
    color: var(--badm-text-muted);
}

/* Loading spinner */
.badm-mkt__analysis-loading {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--badm-text-muted);
}

.badm-mkt__analysis-loading p {
    margin: 0.5rem 0;
    font-size: 12px;
}

.badm-spinner {
    width: 1.5rem;
    height: 1.5rem;
    border: 3px solid var(--badm-border);
    border-top-color: var(--badm-primary);
    border-radius: 50%;
    animation: badm-spin 0.8s linear infinite;
    margin: 0 auto 0.75rem;
}

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

/* Error stav */
.badm-mkt__analysis-error {
    padding: 0.75rem 1rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--badm-radius);
    color: #991b1b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 12px;
}

.badm-mkt__analysis-error i {
    color: #dc2626;
    font-size: 1rem;
}

/* Obsah analyzy (vygenerovany HTML z Claude) */
.badm-mkt__analysis-content {
    font-size: 12px;
    line-height: 1.5;
    color: var(--badm-text);
    max-width: 900px;
}

.badm-mkt__analysis-content h3 {
    font-size: 13px;
    font-weight: 600;
    margin: 1.25rem 0 0.4rem;
    color: var(--badm-text);
}

.badm-mkt__analysis-content h3:first-child {
    margin-top: 0;
}

/* AI-generovany obsah – tabulky dostavaji .badm-table pres JS, jen margin navic */
.badm-mkt__analysis-content table {
    margin: 0.5rem 0 1rem;
}

.badm-mkt__analysis-content ul {
    margin: 0.5rem 0;
    padding-left: 1.25rem;
}

.badm-mkt__analysis-content li {
    margin-bottom: 0.3rem;
}

.badm-mkt__analysis-content p {
    margin: 0.5rem 0;
    line-height: 1.5;
}

/* Semanticke CSS tridy pro zvyrazneni */
.badm-mkt__good { color: #16a34a; font-weight: 600; }
.badm-mkt__bad { color: #dc2626; font-weight: 600; }
.badm-mkt__warn { color: #ea580c; font-weight: 600; }

/* ---------- Marketing Targets (Plneni cilu) ---------- */
.badm-mkt__target-cell { cursor: pointer; min-width: 70px; }
.badm-mkt__target-cell:hover { background: rgba(37,99,235,0.06); outline: 1px dashed rgba(37,99,235,0.3); }
.badm-mkt__target-cell:empty::after { content: '–'; color: #ccc; }
.badm-mkt__target-cell--default { color: #9ca3af; font-style: italic; }
.badm-mkt__target-cell--override { font-weight: 600; }
.badm-mkt__target-cell--saving { opacity: 0.5; }
.badm-mkt__target-cell--saved { animation: badm-target-flash 1.5s ease-out; }
@keyframes badm-target-flash { 0% { background: rgba(22,163,74,0.15); } 100% { background: transparent; } }

.badm-mkt__target-input {
    width: 80px; padding: 2px 4px; border: 1px solid var(--badm-primary, #ff8014);
    border-radius: 3px; font-size: 13px; text-align: right;
    outline: none; background: #fff;
}
.badm-mkt__target-input:focus { box-shadow: 0 0 0 2px rgba(255,128,20,0.25); }

.badm-mkt__achievement--good { color: #16a34a; font-weight: 600; }
.badm-mkt__achievement--close { color: #ea580c; font-weight: 600; }
.badm-mkt__achievement--bad { color: #dc2626; font-weight: 600; }

.badm-mkt__defaults-bar {
    display: flex; flex-direction: column; gap: 0.5rem;
    padding: 0.75rem 1rem; background: #f8fafc; border: 1px solid #e2e8f0;
    border-radius: 6px; margin-bottom: 1rem; font-size: 0.82rem;
}
.badm-mkt__defaults-row { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; align-items: center; }
.badm-mkt__defaults-row--eshop { font-size: 0.88rem; }
.badm-mkt__defaults-row--platforms {
    padding-left: 1rem; border-left: 2px solid #e2e8f0;
    display: flex; flex-wrap: wrap; gap: 0.3rem 1.5rem; align-items: center;
}
.badm-mkt__defaults-platform { display: inline-flex; gap: 0.4rem; align-items: center; white-space: nowrap; }
.badm-mkt__defaults-platform-name { color: #64748b; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; }
.badm-mkt__target-cell--default-bar {
    display: inline-block; cursor: pointer; min-width: 50px;
    padding: 1px 6px; border-radius: 3px; color: #475569;
    border-bottom: 1px dashed #94a3b8;
}
.badm-mkt__target-cell--default-bar:hover { background: rgba(37,99,235,0.06); }
.badm-mkt__target-cell--default-bar:empty::after { content: '–'; color: #ccc; }

/* ============================================================
