/* style.css — univerzální tmavý minimalistický motiv
   Created :: 2026-05-25
   Updated :: 2026-05-25

   TIMELINE
   2026-05-25 :: Vytvoření – globální font-size, layout LIŠTA1/2/3, breadcrumb,
                 patička, formuláře, flash hlášky, tabulky, login obrazovka, nástěnka.

   Pravidlo: font-size je definován globálně (--fs-base). Mění se jen tam,
   kde je to nutné (H1, drobné popisky), přes proměnné níže.
*/

:root {
    /* Barvy */
    --bg:           #0f1115;
    --bg-2:         #12151c;
    --panel:        #171a21;
    --panel-2:      #1c2029;
    --border:       #262b36;
    --border-soft:  #20242e;
    --text:         #e7e9ee;
    --muted:        #8b93a7;
    --accent:       #7aa2ff;
    --accent-2:     #5d86e8;
    --accent-ink:   #0f1115;
    --ok:           #4ade80;
    --ok-bg:        #11271a;
    --err:          #f87171;
    --err-bg:       #2a1416;
    --warn:         #fbbf24;
    --warn-bg:      #2a2310;
    --info:         #60a5fa;
    --info-bg:      #14202e;

    /* Category accent colors — pro paralelní kategorie (např. POBO/Style/YT/Links/ExtImg).
       Nepoužívat pro stavy (úspěch/varování/chyba) — na to jsou --ok/--warn/--err. */
    --cat-orange:   #d97706;
    --cat-blue:     #2563eb;
    --cat-red:      #b91c1c;
    --cat-green:    #2e7d4a;
    --cat-purple:   #6b21a8;

    /* Typografie – globální velikost písma */
    --fs-base:      15px;
    --fs-small:     13px;
    --fs-tiny:      12px;
    --fs-h1:        22px;
    --fs-h2:        17px;
    --lh:           1.55;

    /* Rozměry */
    --radius:       10px;
    --radius-sm:    8px;
    --gap:          16px;
    --maxw:         95%;
    --font:         -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { font-size: var(--fs-base); }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 1rem;
    line-height: var(--lh);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: var(--fs-h1); font-weight: 600; margin: 0 0 16px; color: #fff; }
h2 { font-size: var(--fs-h2); font-weight: 600; margin: 0 0 12px; color: #fff; }
p  { margin: 0 0 12px; }

hr.breaker { border: 0; border-top: 1px solid var(--border-soft); margin: 24px 0; }

/* ============================================================
   LIŠTA1 :: horní lišta
   ============================================================ */
.lista1 {
    background: var(--panel);
    border-bottom: 1px solid var(--border);
}
.lista1__in {
    max-width: var(--maxw); margin: 0 auto;
    display: flex; align-items: stretch; justify-content: space-between;
    gap: var(--gap); padding: 0 20px; height: 40px;
}
.lista1__brand { display: inline-flex; align-items: center; font-weight: 600; color: #fff; font-size: 1rem; }
.lista1__brand:hover { text-decoration: none; }
.lista1__right { display: flex; align-items: stretch; gap: 2px; }
.lista1__right a {
    display: inline-flex; align-items: center;
    color: var(--muted); padding: 0 10px;
    border-bottom: 2px solid transparent;
    font-size: var(--fs-small);
}
.lista1__right a:hover { color: var(--text); text-decoration: none; }
.lista1__right a.is-active { color: #fff; border-bottom-color: var(--accent); }
.lista1__email { color: var(--text); font-weight: 500; }
.lista1__sep { align-self: center; width: 1px; height: 20px; background: var(--border); margin: 0 6px; }
.lista1__logout { color: var(--err); }

/* ============================================================
   LIŠTA2 :: hlavní menu (moduly)
   ============================================================ */
.lista2 { background: var(--bg-2); border-bottom: 1px solid var(--border); }
.lista2__in {
    max-width: var(--maxw); margin: 0 auto; padding: 0 20px;
    display: flex; gap: 4px; min-height: 38px; align-items: stretch;
}
.lista2 a {
    display: inline-flex; align-items: center; padding: 0 14px;
    color: var(--muted); font-size: var(--fs-small);
    border-bottom: 2px solid transparent;
}
.lista2 a:hover { color: var(--text); text-decoration: none; }
.lista2 a.is-active { color: #fff; border-bottom-color: var(--accent); }
.lista2__empty { display: inline-flex; align-items: center; color: var(--muted); font-size: var(--fs-small); opacity: .6; }

/* ============================================================
   LIŠTA3 :: submenu
   ============================================================ */
.lista3 { background: var(--panel-2); border-bottom: 1px solid var(--border); }
.lista3__in {
    max-width: var(--maxw); margin: 0 auto; padding: 0 20px;
    display: flex; gap: 2px; min-height: 34px; align-items: stretch; flex-wrap: wrap;
}
.lista3 a {
    display: inline-flex; align-items: center; padding: 0 12px;
    color: var(--muted); font-size: var(--fs-small);
    border-bottom: 2px solid transparent;
}
.lista3 a:hover { color: var(--text); text-decoration: none; }
.lista3 a.is-active { color: #fff; border-bottom-color: var(--accent); }
/* Oranžová varianta — pro akce typu „Synchronizovat" / „Spustit job". */
.lista3 a.warn { color: var(--warn); }
.lista3 a.warn:hover { color: #fde68a; }
.lista3 a.warn.is-active { color: var(--warn); border-bottom-color: var(--warn); }
/* Drobné nenápadné značení admin-only položek (např. „(a)" za labelem) */
.lista3__admin { font-size: 11px; color: var(--muted); margin-left: 1px; opacity: .7; }

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb {
    max-width: var(--maxw); margin: 0 auto; padding: 9px 20px 0;
    font-size: var(--fs-small); color: var(--muted);
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb .sep { margin: 0 8px; opacity: .5; }
.breadcrumb .current { color: var(--text); }

/* ============================================================
   OBSAH
   ============================================================ */
.content { max-width: var(--maxw); margin: 0 auto; padding: 20px; }

.panel {
    background: var(--panel); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 22px;
    margin-bottom: var(--gap);   /* spacing pod panelem k jakémukoli následujícímu prvku */
}
.panel__title { margin: 0 0 16px; }
/* Pozn.: panel + panel sequence — margin collapsing zajistí jediný gap, ne dvojitý. */

.muted { color: var(--muted); }
.small { font-size: var(--fs-small); }
.tiny  { font-size: var(--fs-tiny); }

/* ============================================================
   FLASH HLÁŠKY
   ============================================================ */
.flash { border-radius: var(--radius-sm); padding: 12px 16px; margin: 0 0 16px; border: 1px solid transparent; font-size: var(--fs-small); }
.flash ul { margin: 0; padding-left: 18px; }
.flash li { margin: 2px 0; }
.flash--error   { background: var(--err-bg);  border-color: #5b2126; color: #fecaca; }
.flash--success { background: var(--ok-bg);   border-color: #1e4d31; color: #bbf7d0; }
.flash--info    { background: var(--info-bg); border-color: #1e3a5b; color: #bfdbfe; }
.flash--warning { background: var(--warn-bg); border-color: #5b4a17; color: #fde68a; }

/* ============================================================
   FORMULÁŘE
   ============================================================ */
.form { max-width: 460px; }
.form--wide { max-width: 640px; }
.field { margin-bottom: 16px; }
/* Vyloučit .checkbox z generického label stylu — má svůj vlastní layout (inline-flex). */
.field label:not(.checkbox) { display: block; margin-bottom: 6px; font-size: var(--fs-small); color: var(--muted); }
.field .hint { display: block; margin-top: 6px; font-size: var(--fs-tiny); color: var(--muted); }
.label-hint { font-size: var(--fs-tiny); color: var(--muted); font-weight: 400; margin-left: 6px; }
.req { color: var(--err); margin-left: 2px; }

/* Globální stavový badge (Aktivní / Vypnuto / Chyba …).
   Použití:  <span class="status status--on">Aktivní</span>  */
.status {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: var(--fs-small); font-weight: 500;
    line-height: 1;
}
.status::before {
    content: ''; width: 9px; height: 9px; border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 3px rgba(255,255,255,.04);
}
.status--on   { color: var(--ok); }     /* zelená — aktivní */
.status--off  { color: var(--warn); }   /* oranžová — vypnuto */
.status--err  { color: var(--err); }    /* červená — chyba (rezerva) */

/* Reusable rozložení: 2 pole vedle sebe (na mobilu pod sebou).
   minmax(0,1fr) zabraňuje tomu, aby grid sloupec rostl podle intrinsic
   šířky inputu (zejména datetime-local s vnitřními kontrolkami).
   margin-bottom: 16px na řádku samém — držíme jednotný vertikální rytmus
   shodný s běžným .field (jinak by inner .field's margin-bottom uvnitř gridu
   přidával viditelný gap navíc a vznikaly by nekonzistence). */
.field-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}
.field-row > .field { margin-bottom: 0; min-width: 0; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; gap: 0; } }

input[type=text], input[type=email], input[type=password],
input[type=search], input[type=url], input[type=date],
input[type=time], input[type=datetime-local], select, textarea {
    width: 100%; padding: 11px 13px;
    background: var(--bg-2); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 1rem; font-family: inherit; outline: none;
    box-sizing: border-box;          /* aby border/padding neměnil rozměr */
    min-height: 44px;                /* sjednocená výška napříč typy */
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(122,162,255,.15); }
input::placeholder { color: #5b6273; }

/* WebKit (Chrome/Safari): calendar ikonka sjednotit s tématem. */
input[type=date]::-webkit-calendar-picker-indicator,
input[type=time]::-webkit-calendar-picker-indicator,
input[type=datetime-local]::-webkit-calendar-picker-indicator {
    filter: invert(0.7); cursor: pointer;
}

/* Select – vlastní šipka + tmavá nabídka (sjednocení s inputy) */
select {
    appearance: none; -webkit-appearance: none; -moz-appearance: none;
    padding-right: 36px; cursor: pointer; line-height: 1.2;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M1 3l4 4 4-4' stroke='%238b93a7' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 13px center; background-size: 10px;
}
select option { background: var(--panel); color: var(--text); }
select:disabled { opacity: .55; cursor: not-allowed; }

/* Globální stylovaný checkbox.
   Použití:
     <label class="checkbox" for="x">
        <input id="x" name="x" type="checkbox" value="1" checked>
        <span>Popisek <span class="label-hint">… nepovinný hint</span></span>
     </label>
*/
.checkbox {
    display: inline-flex; align-items: center; gap: 20px;
    font-size: var(--fs-small); color: var(--text); cursor: pointer;
    user-select: none; line-height: 1.35;
}
.checkbox input[type=checkbox] {
    appearance: none; -webkit-appearance: none;
    width: 22px; height: 22px; min-height: 22px;
    margin: 0; padding: 0; flex: 0 0 22px;
    display: inline-block; vertical-align: middle;
    background-color: var(--panel-2);
    border: 1px solid #3a4154; border-radius: 6px;
    cursor: pointer; position: relative;
    transition: background-color .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.checkbox input[type=checkbox]:hover { border-color: var(--accent); }
.checkbox input[type=checkbox]:focus-visible {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(122,162,255,.18);
}
.checkbox input[type=checkbox]:checked {
    background-color: var(--accent);
    border-color: var(--accent);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M3.5 8.5l3 3 6-7' stroke='%230f1115' stroke-width='2.4' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 16px 16px;
}
.checkbox input[type=checkbox]:disabled { opacity: .55; cursor: not-allowed; }
.checkbox input[type=checkbox]:disabled + span { opacity: .65; cursor: not-allowed; }
.checkbox > span { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 6px; }

.form-actions {
    display: flex; align-items: center; gap: 12px;
    flex-wrap: wrap;
    margin-top: 4px;       /* aby nekolaboval s margin-bottom posledního pole */
    padding-top: 20px;     /* viditelná mezera nad tlačítky */
    border-top: 1px solid var(--border-soft);  /* jemný oddělovač */
}

/* Tlačítka */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 18px; min-height: 44px;          /* sjednoceno s inputy (input/select min-height: 44px) */
    box-sizing: border-box;
    border-radius: var(--radius-sm);
    background: var(--panel-2); color: var(--text);
    border: 1px solid var(--border); font-size: var(--fs-small);
    font-family: inherit; cursor: pointer; line-height: 1;
}
.btn:hover { background: #232834; text-decoration: none; }
.btn--primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn--primary:hover { background: var(--accent-2); }
.btn--danger { background: transparent; color: var(--err); border-color: #5b2126; }
.btn--danger:hover { background: var(--err-bg); }
.btn--ghost { background: transparent; }
.btn--sm { padding: 6px 12px; font-size: var(--fs-tiny); min-height: 0; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Skupina tlačítek vedle sebe — gap + wrap */
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }

/* ============================================================
   UTILITY TŘÍDY (margin / padding / text / layout)
   Použivej tyto místo inline style="..." atributů.
   ============================================================ */

/* Margin top/bottom (px granularita) */
.mt-0  { margin-top:  0; }
.mb-0  { margin-bottom: 0; }
.mt-4  { margin-top:  4px; }
.mt-6  { margin-top:  6px; }
.mt-8  { margin-top:  8px; }
.mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; }
.mt-16 { margin-top: 16px; }
.mt-18 { margin-top: 18px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }

.mb-4  { margin-bottom:  4px; }
.mb-8  { margin-bottom:  8px; }
.mb-10 { margin-bottom: 10px; }
.mb-12 { margin-bottom: 12px; }
.mb-14 { margin-bottom: 14px; }
.mb-18 { margin-bottom: 18px; }

.ml-6  { margin-left:  6px; }
.ml-8  { margin-left:  8px; }
.mr-10 { margin-right: 10px; }

.my-12 { margin: 12px 0; }
.my-24 { margin: 24px 0; }

.maxw-300 { max-width: 300px; }
.maxw-400 { max-width: 400px; }

.text-center { text-align: center; }
.fw-normal   { font-weight: normal; }
.justify-center { justify-content: center; }

/* Pomocný text pod label / titulkem — drobný šedý */
.hint { font-size: var(--fs-tiny); color: var(--muted); margin-top: 4px; }

/* Zarovnání + spacing pro prázdné <td colspan="N"> v tabulkách */
.empty-cell { text-align: center; padding: 20px; color: var(--muted); }

/* Layout — flex helpers */
.ml-auto { margin-left: auto; }
.row-end { display: flex; justify-content: flex-end; }

/* Max-width omezení pro úzké formuláře / popis textů */
.maxw-560 { max-width: 560px; }
.maxw-640 { max-width: 640px; }

/* Text helpers (sjednocené, žádné inline color/font-size) */
.text-err     { color: var(--err); }
.text-ok      { color: var(--ok); }
.text-warn    { color: var(--warn); }

/* ============================================================
   STAT GRID — souhrn metrik (kolik / OK / WARN / ERR)
   Použití: <div class="stat-grid">
              <div class="stat stat--ok"><div class="stat__lbl">…</div><div class="stat__val">…</div></div>
              ...
            </div>
   ============================================================ */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin: 14px 0 20px;
}
.stat {
    background: var(--panel-2);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--border);
}
/* Sémantické modifiery — stav (úspěch/varování/chyba/info) */
.stat--ok     { border-left-color: var(--ok); }
.stat--warn   { border-left-color: var(--warn); }
.stat--err    { border-left-color: var(--err); }
.stat--info   { border-left-color: var(--accent); }

/* Kategorové modifiery — barva pro rozlišení paralelních kategorií
   (POBO vs Style vs YouTube vs Links vs ExtImg — sémantika je per-view) */
.stat--orange { border-left-color: var(--cat-orange); }
.stat--blue   { border-left-color: var(--cat-blue); }
.stat--red    { border-left-color: var(--cat-red); }
.stat--green  { border-left-color: var(--cat-green); }
.stat--purple { border-left-color: var(--cat-purple); }
.stat__label   { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.stat__value   { font-size: 24px; font-weight: 600; margin-top: 4px; }
.stat__sub     { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ============================================================
   TABS — sub-navigace uvnitř stránky (filter na pohledy)
   Pozn.: pro horní lišty modulu se používá .lista2/.lista3 (jiný kontext).
   ============================================================ */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs a {
    padding: 7px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--panel-2);
    color: var(--text);
    text-decoration: none;
    font-size: var(--fs-small);
    line-height: 1;
}
.tabs a:hover { border-color: var(--accent); text-decoration: none; }
.tabs a.is-active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }

/* ============================================================
   PAGINATION — stránkování (pod tabulkou nebo listem)
   ============================================================ */
.pagination { display: flex; gap: 4px; margin-top: 14px; flex-wrap: wrap; align-items: center; }
.pagination a, .pagination span {
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--panel-2);
    text-decoration: none;
    color: var(--text);
    font-size: var(--fs-tiny);
}
.pagination a:hover { background: #232834; text-decoration: none; }
.pagination .current { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.pagination__info { color: var(--muted); margin-left: 8px; }

.text-accent  { color: var(--accent); }
.text-muted-sm{ font-size: var(--fs-small); color: var(--muted); }
.text-break   { word-break: break-all; }

/* Sub-heading: malý nadpis uvnitř panelu (mini-section title) */
.subhead { margin: 0 0 8px; font-size: 14px; }
.subhead--up { color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }  /* uppercase muted varianta — sekce uvnitř panelu */
.subhead--sm { font-size: 12px; }                                                       /* menší varianta */

/* Display utility */
.d-inline-flex  { display: inline-flex; }
.d-inline-block { display: inline-block; }
.overflow-auto  { overflow: auto; }

/* Reset button-like elementu (border + bg none) */
.btn-reset { border: 0; background: none; padding: 0; }

/* PRE/CODE blok pro JSON / log output */
.pre-block {
    background: var(--bg-2); border: 1px solid var(--border-soft);
    border-radius: 8px; padding: 12px;
    white-space: pre-wrap; word-break: break-word;
    font-size: var(--fs-small); margin: 0;
}
/* Scrollable varianta pro streamované logy (orchestrátory, sync, AI volání…) */
.pre-block--scroll { max-height: 320px; overflow: auto; }

/* Width utility — column hint pro <th> nebo úzké inputy */
.w-auto{ width:  auto; }
.w-60  { width:  60px; }
.w-80  { width:  80px; }
.w-90  { width:  90px; }
.w-110 { width: 110px; }
.w-180 { width: 180px; }
.w-240 { width: 240px; }
.w-260 { width: 260px; }

/* Letter spacing / font-size hint pro nadpisové texty v panelech */
.lead-sm { font-size: 15px; letter-spacing: .2px; }

/* ============================================================
   TABULKY
   ============================================================ */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-small); }
table.tbl th, table.tbl td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
table.tbl th { background: var(--panel-2); color: var(--muted); font-weight: 600; font-size: var(--fs-tiny); text-transform: uppercase; letter-spacing: .03em; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tbody tr:hover { background: var(--bg-2); }
table.tbl td.actions,
table.tbl th.actions { white-space: nowrap; text-align: right; }

/* Kompaktní varianta tabulky (např. pro logy – hustší a přehlednější) */
table.tbl.tbl--sm { font-size: var(--fs-tiny); }
table.tbl.tbl--sm th, table.tbl.tbl--sm td { padding: 5px 9px; }
table.tbl.tbl--sm th { font-size: 10px; }
table.tbl.tbl--sm td .tiny { font-size: 11px; }
table.tbl.tbl--sm td .btn { padding: 1px 8px; font-size: 11px; border-radius: 6px; }

/* ============================================================
   DATA TABLE — variantní listing tabulka (produkty, sync log, webhooks).
   Větší padding než .tbl--sm, bez borderu okolo. Podporuje:
     .data-table--vmid   = vertical-align: middle (pro thumbnaily)
     td.cell-sub / td.mono / td.wrap utility uvnitř
   ============================================================ */
.data-table { width: 100%; border-collapse: collapse; font-size: var(--fs-small); }
.data-table th, .data-table td {
    text-align: left; padding: 8px 10px;
    border-bottom: 1px solid var(--border-soft);
    vertical-align: top;
}
.data-table--vmid th, .data-table--vmid td { vertical-align: middle; }
.data-table th { color: var(--muted); font-weight: 600; font-size: var(--fs-tiny); text-transform: uppercase; letter-spacing: .4px; }
.data-table .mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.data-table .small { font-size: var(--fs-tiny); }
.data-table .wrap { word-break: break-word; }

/* ============================================================
   SPINNER OVERLAY — modální overlay s točícím se kruhem.
   Použití: <div class="spinner-overlay is-active"><div class="spinner-overlay__ring"></div></div>
   ============================================================ */
.spinner-overlay {
    display: none;
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(2px);
    align-items: center; justify-content: center;
    flex-direction: column; gap: 18px;
    color: #fff; font-family: inherit;
}
.spinner-overlay.is-active { display: flex; }
.spinner-overlay__ring {
    width: 56px; height: 56px;
    border: 5px solid rgba(255,255,255,.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spinner-rotate 0.9s linear infinite;
}
.spinner-overlay__text { font-size: 16px; font-weight: 600; text-align: center; max-width: 540px; padding: 0 24px; }
.spinner-overlay__sub  { font-size: 13px; text-align: center; max-width: 540px; padding: 0 24px; color: rgba(255,255,255,.7) !important; }
@keyframes spinner-rotate { to { transform: rotate(360deg); } }

/* ============================================================
   PROGRESS BAR — lineární progres pro long-running operace
   Použití:
     <div class="progress"><div class="progress__bar"></div></div>
   JS pak setuje šířku přes el.style.width = pct + '%'.
   ============================================================ */
.progress {
    width: 100%; height: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 999px;
    overflow: hidden;
}
.progress__bar {
    width: 0;                    /* default 0%, JS přepisuje dynamicky */
    height: 100%;
    background: var(--accent);
    transition: width .25s ease;
}

/* Monospace textarea (MD editor, JSON editor, code-like input) */
.textarea--mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: var(--fs-small); line-height: 1.55;
    white-space: pre; tab-size: 2;
}

/* Štítky */
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: var(--fs-tiny); border: 1px solid var(--border); color: var(--muted); }
.badge--admin  { color: var(--accent); border-color: #2c3a5e; background: #141a2b; }
.badge--user   { color: var(--muted); }
.badge--active { color: var(--ok); border-color: #1e4d31; background: var(--ok-bg); }
.badge--banned { color: var(--err); border-color: #5b2126; background: var(--err-bg); }
.badge--nopass { color: var(--warn); border-color: #5b4a17; background: var(--warn-bg); }

/* Badge uvnitř tabulkové buňky — kompaktnější padding + font, aby neroztáhl výšku řádku.
   Platí pro .tbl i .data-table bez nutnosti přidávat HTML třídu. */
.tbl td .badge,
.data-table td .badge {
    padding: 1px 7px;
    font-size: 10px;
    line-height: 1.4;
    vertical-align: middle;
}

.level { font-weight: 600; }

/* Sjednocené ikony v logu — jen 3 (info / warning / error) */
.log-ico {
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; border-radius: 50%;
    font-size: 11px; font-weight: 700; line-height: 1;
    vertical-align: -3px; margin-right: 2px;
}
.log-ico--info { background: rgba(122,162,255,.18); color: var(--accent); font-family: Georgia, serif; font-style: italic; }
.log-ico--warn { background: rgba(251,191,36,.18); color: var(--warn); border-radius: 4px; }
.log-ico--err  { background: rgba(248,113,113,.18); color: var(--err); }
.level--INFO, .level--info { color: var(--info); }
.level--error, .level--ERROR { color: var(--err); }
.level--warning, .level--WARNING { color: var(--warn); }

/* ============================================================
   TABULKOVÉ KOMPONENTY — semantic třídy pro buňky/sloupce
   ============================================================ */

/* Sekundární text v buňce (URL hint, kódy variant, EAN, drobné info) */
.cell-sub {
    font-size: var(--fs-tiny);          /* 12px */
    font-weight: 400;
    color: var(--muted);
    line-height: 1.4;
}
a.cell-sub { text-decoration: none; }
a.cell-sub:hover { color: var(--text); }

/* Sloupec s thumbnail (úzký, malý padding) */
.col-thumb { width: 56px; padding: 6px 8px; }

/* Thumbnail v tabulce (48×48 rounded square) */
.thumb {
    display: block; width: 48px; height: 48px;
    border-radius: 6px; object-fit: cover;
    background: var(--bg-2); border: 1px solid var(--border-soft);
}
.thumb--empty {
    width: 48px; height: 48px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--muted); font-size: 14px;
}

/* Kompaktní seznam — žádný vnější margin, indent na 18px (návody, sub-listy) */
.list-compact { margin: 0; padding-left: 18px; }

/* ============================================================
   PATIČKA
   ============================================================ */
.paticka { margin-top: 36px; border-top: 1px solid var(--border); }   /* čára přes celou šířku */
.paticka__in {
    max-width: var(--maxw); margin: 0 auto; padding: 14px 20px;
    color: var(--muted); font-size: var(--fs-tiny);
    display: flex; justify-content: space-between; gap: 6px 14px; flex-wrap: wrap; align-items: center;
}
.paticka a { color: var(--muted); }
.paticka a:hover { color: var(--text); }
.paticka__contact { display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: center; }
.paticka__contact .dot { opacity: .4; }

/* ============================================================
   NÁSTĚNKA :: karty modulů
   ============================================================ */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--gap); }
.card {
    display: block; background: var(--panel); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px;
}
.card:hover { border-color: var(--accent); text-decoration: none; }
.card__title { color: #fff; font-weight: 600; margin-bottom: 4px; }
.card__desc { color: var(--muted); font-size: var(--fs-small); }

/* ============================================================
   PŘIHLAŠOVACÍ OBRAZOVKA
   ============================================================ */
.auth {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 24px; background:
        radial-gradient(1200px 600px at 50% -10%, #1a2030 0%, var(--bg) 60%);
}
.auth__card {
    width: 100%; max-width: 400px; background: var(--panel);
    border: 1px solid var(--border); border-radius: 14px; padding: 32px;
    box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.auth__logo { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.auth__logo img { width: 30px; height: 30px; }
.auth__logo span { font-weight: 600; color: #fff; }
.auth__title { font-size: var(--fs-h1); color: #fff; margin: 14px 0 4px; }
.auth__sub { color: var(--muted); font-size: var(--fs-small); margin-bottom: 22px; }
.auth__foot { margin-top: 18px; text-align: center; font-size: var(--fs-small); color: var(--muted); }
.auth__row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
/* Sjednocený font: „Zapamatovat si mě" (checkbox label) a „Zapomenuté heslo?" stejně. */
.auth__row a,
.auth__row .checkbox { font-size: var(--fs-small); color: var(--muted); }
.auth__row a { text-decoration: none; }
.auth__row a:hover { color: var(--text); }
/* Užší checkbox na login: text blíž k boxu (globální .checkbox má gap: 20px pro formuláře). */
.auth__row .checkbox { gap: 10px; }
/* Sjednocený font: ".auth .btn--primary" se chová stejně jako .btn --- ne 100% width override needed. */
.auth .btn--primary { width: 100%; padding: 12px; }

/* Utility */
.stack > * + * { margin-top: var(--gap); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* ----------------------------------------------------------------
   INFOBOX :: drobný metadata box uvnitř .panel
   Použití (Údaj: hodnota · Údaj: hodnota / nebo X výsledků · strana n/m):

     <div class="panel">
       <div class="infobox">
         <span><strong>V DB:</strong> 9 265 produktů</span>
         <span><strong>Poslední sync:</strong> 03.06.2026 02:19</span>
       </div>
       <!-- ... obsah ... -->
     </div>
   ---------------------------------------------------------------- */
.infobox {
    display: flex; flex-wrap: wrap; align-items: center;
    gap: 6px 10px;                /* mezi řádky 6 px, mezi položkami 10 px (matchne margin u tečky) */
    margin-bottom: 12px;          /* jen dolní – nechává mt-* utility fungovat */
    padding: 10px 14px;
    background: var(--panel-2); border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    color: var(--muted); font-size: var(--fs-small);
}
.infobox strong { color: var(--text); font-weight: 600; }
.infobox a { color: var(--accent); text-decoration: none; }
.infobox a:hover { text-decoration: underline; }
.infobox .spacer { flex: 1; }     /* rozhodí položky vlevo / vpravo */

/* Varianta pro chyby / varování — červená výrazná */
.infobox--err {
    background: var(--err-bg); border-color: #5b2126; color: var(--err);
}
.infobox--err strong { color: var(--err); }
.infobox--err a { color: var(--err); text-decoration: underline; }

/* Tečka mezi sourozenci (kromě první položky a kromě .spacer i prvku za ním —
   tam dělá oddělení samotná flex mezera). */
.infobox > *:not(:first-child):not(.spacer)::before {
    content: '•';                  /* U+2022 bullet — větší a viditelnější než středová tečka */
    margin-right: 10px;
    color: var(--muted);
    font-size: .85em;
    user-select: none;
}
.infobox > .spacer + *::before { content: none; }

/* Utility — šířka sloupce v tabulce (procenta). Použij na <th> nebo <td>.
   Browser respektuje jen jako hint, pokud má dost obsahu. Pro tvrdé vynucení
   nastav v tabulce table-layout: fixed. */
.col-w-15 { width: 15%; }
.col-w-20 { width: 20%; }
.col-w-25 { width: 25%; }
.col-w-30 { width: 30%; }
.col-w-40 { width: 40%; }
.col-w-50 { width: 50%; }
.col-w-60 { width: 60%; }
.spacer { flex: 1; }
.nowrap { white-space: nowrap; }
.dl { display: grid; grid-template-columns: 180px 1fr; gap: 10px 16px; font-size: var(--fs-small); }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; color: var(--text); }

/* ============================================================
   MODÁLNÍ OKNO
   ============================================================ */
.modal-overlay {
    position: fixed; inset: 0; z-index: 100; padding: 24px;
    background: rgba(0,0,0,.6); backdrop-filter: blur(2px);
    display: none; align-items: center; justify-content: center;
}
.modal-overlay.is-open { display: flex; }
.modal {
    background: var(--panel); border: 1px solid var(--border);
    border-radius: var(--radius); width: 100%; max-width: 760px; max-height: 85vh;
    display: flex; flex-direction: column; box-shadow: 0 24px 70px rgba(0,0,0,.5);
}
.modal--wide { max-width: 900px; }    /* pro tabulkové modaly (master karty …) */
.modal__head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 13px 18px; border-bottom: 1px solid var(--border);
}
.modal__title { color: #fff; font-weight: 600; font-size: var(--fs-h2); }
.modal__close { background: none; border: 0; color: var(--muted); font-size: 24px; line-height: 1; cursor: pointer; padding: 0 4px; }
.modal__close:hover { color: var(--text); }
.modal__body { padding: 16px 18px; overflow: auto; }
.modal__body pre {
    margin: 0; white-space: pre-wrap; word-break: break-word;
    font-size: var(--fs-small); color: var(--text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    background: var(--bg-2); border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm); padding: 12px;
}
.modal__label {
    color: var(--muted); font-size: var(--fs-tiny); text-transform: uppercase;
    letter-spacing: .04em; margin: 14px 0 5px;
}
.modal__label:first-child { margin-top: 0; }

/* Stavové prvky uvnitř .modal__body — sdílí fetch-modal s loading/summary box. */
.modal__loading { padding: 24px; text-align: center; color: var(--muted); }
.modal__summary { padding: 6px 0 12px; color: var(--muted); font-size: var(--fs-small); display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.modal__summary > * { margin: 0; }

/* ============================================================
   PRODUKT EDITOR — přesunuto do inc/editor/css/editor.css
   (CSS nástroje editoru). Načítá se v layoutu zahlavi.php.
   ============================================================ */

/* ============================================================
   MODAL :: rozšíření existujícího .modal-overlay > .modal patternu
   (základní styly jsou výše v sekci LOG/MODAL).
   Přidává footer + spinner + log box pro multi-step operace.
   ============================================================ */
.modal__foot {
    display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap;
    padding: 14px 18px; border-top: 1px solid var(--border);
}
.modal__spinner {
    width: 22px; height: 22px; border-radius: 50%;
    border: 3px solid rgba(122, 162, 255, .25); border-top-color: var(--accent);
    animation: cfgspin .9s linear infinite; display: inline-block; vertical-align: middle;
}
.modal__log {
    background: #0d1014; border: 1px solid var(--border-soft); border-radius: 8px;
    padding: 12px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px;
    color: #cdd5e0; max-height: 320px; overflow: auto; margin: 12px 0; line-height: 1.7;
}
.modal__log p { margin: 0; }
.modal__log .ok    { color: var(--ok); }
.modal__log .warn  { color: var(--warn); }
.modal__log .err   { color: var(--err); }
.modal__log .busy  { color: var(--muted); }

/* ============================================================
   EDITOR – VC — přesunuto do inc/editor/editor-output.css
   (CSS výstupu editoru, beze změn — také se kopíruje do Shoptet šablony).
   ============================================================ */

@media (max-width: 640px) {
    .lista1__email-text { display: none; }
    .dl { grid-template-columns: 1fr; gap: 2px 0; }
    .dl dd { margin-bottom: 8px; }
}

/* Drobné dodatkové max-width utility */
.maxw-160 { max-width: 160px; }
.maxw-180 { max-width: 180px; }
.maxw-240 { max-width: 240px; }
.maxw-260 { max-width: 260px; }
.maxw-320 { max-width: 320px; }
.maxw-520 { max-width: 520px; }

/* Mini layout helpers */
.pt-4 { padding-top: 4px; }
.cursor-pointer { cursor: pointer; }

/* Testing modul: hello stránka */
.hello-greeting { font-size: 20px; color: #fff; }

/* Lead paragraph — větší úvodní popisek pod nadpisem */
.lead { color: var(--muted); margin: 0 0 18px; font-size: var(--fs-small); }

/* ============================================================
   DEBUG mode — vizualizace odkud styl pochází
   Aktivace: <body class="debug-css">  (nebo přes ?debug-css=1 v URL)

   Color codes:
     CYAN dashed   = z css/_tmp/style.css   (sandbox nástroje)
     MAGENTA dashed = z css/_vyvoj/style.css (admin diagnostika)
     YELLOW dashed = z moduly/{modul}/css/  (per-modul)
     (bez outline) = z css/style.css        (globální layout/komponenty/utility)

   Legenda se zobrazí nahoře na stránce.
   ============================================================ */
body.debug-css [class*="pdetail-"],
body.debug-css [class*="an-"] {
    /* Per-modul classes pro Produkty modul (analyza, detail) — žluté dashed.
       Promotované do globálu jako .cell-sub/.col-thumb/.thumb/.webhooks-* už zde nejsou. */
    outline: 2px dashed #facc15 !important;
    outline-offset: 1px;
}

body.debug-css::before {
    content: "🔍 DEBUG-CSS aktivní — CYAN = css/_tmp · MAGENTA = css/_vyvoj · YELLOW = moduly/{m}/css · (bez) = globální";
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 99999;
    background: #1a1a1a;
    color: #fff;
    padding: 6px 14px;
    font-size: 12px;
    font-family: ui-monospace, Menlo, monospace;
    border-bottom: 2px solid var(--accent);
    box-shadow: 0 4px 12px rgba(0,0,0,.4);
}
body.debug-css { padding-top: 30px; }

/* ============================================================
   HELP :: čištění dat — utility + porovnání před/po
   ============================================================ */
.ok       { color: var(--ok); }
.grow     { flex: 1 1 auto; min-width: 0; }
.break    { word-break: break-all; }
.tbl-wrap { overflow-x: auto; }

.cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cmp__col { min-width: 0; border: 1px solid var(--border-soft); border-radius: var(--radius); overflow: hidden; }
.cmp__lbl {
    background: var(--panel-2); color: var(--muted);
    font-size: var(--fs-tiny); font-weight: 600; text-transform: uppercase; letter-spacing: .03em;
    padding: 5px 10px; border-bottom: 1px solid var(--border-soft);
}
.cmp__pre {
    margin: 0; padding: 10px; max-height: 420px; overflow: auto;
    font-family: ui-monospace, Menlo, monospace; font-size: 12px; line-height: 1.5;
    white-space: pre-wrap; word-break: break-word; color: var(--text);
}
@media (max-width: 720px) { .cmp { grid-template-columns: 1fr; } }
