/* ═══════════════════════════════════════════════════════════════
   STUDIO — Wassermann · Nástěnka úprav
   Varianta „číslované řádky" v jazyce wassermann.cz
   ═══════════════════════════════════════════════════════════════ */

:root {
    --bg: #fafaf9;
    --paper: #ffffff;
    --surface: #f5f5f4;
    --ink: #0a0a0a;
    --ink-2: #262626;
    --muted: #737373;
    --muted-2: #a3a3a3;
    --line: #e7e5e4;
    --line-strong: #d6d3d1;

    --accent: #ff5a1f;
    --accent-soft: #fff4ee;
    --accent-ink: #c2410c;
    --focus: #ff5a1f;
    --danger: #b91c1c;

    --ok: #15803d;
    --ok-soft: #f0fdf4;
    --ok-line: #bbf7d0;
    --warn: #d97706;
    --info: #0891b2;

    --sans: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --mono: 'Geist Mono', 'SF Mono', Menlo, Consolas, monospace;

    --container: 1120px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --radius: 14px;
    --radius-lg: 20px;
}

/* ─── Reset / base ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--ink);
    line-height: 1.55;
    font-weight: 400;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    font-feature-settings: "kern", "liga", "ss01", "cv11";
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
body > main,
body > .board,
body > .detail { flex: 1 0 auto; }
::selection { background: var(--accent); color: #fff; }
svg { display: block; max-width: 100%; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; background: none; border: 0; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }

.wrap {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 40px;
    position: relative;
}
.accent { color: var(--accent); }
.muted { color: var(--muted); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }

/* ─── Brand mark ─── */
.brand {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--ink);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: opacity .2s;
}
.brand:hover { opacity: 0.82; }
.brand-mark {
    width: 20px;
    height: 20px;
    border: 1.5px solid var(--ink);
    border-radius: 5px;
    display: inline-block;
    position: relative;
    flex-shrink: 0;
}
.brand-mark::after {
    content: '';
    position: absolute;
    inset: 3px;
    background: var(--accent);
    border-radius: 1.5px;
}
.brand-sub {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 400;
    color: var(--muted);
    margin-left: 2px;
}

/* ─── Eyebrow / num / meta — mono editorial meta ─── */
.eyebrow {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}
.num, .item-num {
    font-family: var(--mono);
    font-size: clamp(24px, 2.6vw, 30px);
    font-weight: 400;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--muted-2);
    font-variant-numeric: tabular-nums;
}
.meta, .item-meta, .detail-meta {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
    letter-spacing: 0.01em;
}
.meta .who, .item-meta .who, .detail-meta .who { color: var(--ink-2); }

/* ═══════════════════════════════════════════════════════════════
   BUTTONS — pill
   .btn (filled/primary) · .btn.ghost (outline) · .btn.sm · .btn.danger
   ═══════════════════════════════════════════════════════════════ */
.btn,
.btn-primary,
.btn-send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 100px;
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: -0.005em;
    line-height: 1.2;
    white-space: nowrap;
    background: var(--accent);
    color: #fff;
    border: 1px solid var(--accent);
    transition: background .2s var(--ease), color .2s var(--ease),
                border-color .2s var(--ease), transform .2s var(--ease),
                box-shadow .25s var(--ease);
}
.btn:hover,
.btn-primary:hover,
.btn-send:hover {
    background: var(--accent-ink);
    border-color: var(--accent-ink);
    transform: translateY(-1px);
    box-shadow: 0 12px 28px -14px rgba(255, 90, 31, 0.7);
}
.btn:active,
.btn-primary:active,
.btn-send:active { transform: translateY(0); }
.btn svg,
.btn-primary svg,
.btn-send svg { transition: transform .25s var(--ease); }
.btn:hover svg,
.btn-send:hover svg { transform: translateX(2px); }

.btn-primary { width: 100%; padding: 14px 22px; }

/* outline / secondary */
.btn.ghost,
.nav-cta {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    box-shadow: none;
}
.btn.ghost:hover,
.nav-cta:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: none;
}
.nav-cta {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1;
    padding: 9px 16px;
    font-size: 13px;
}
.nav-cta svg { flex-shrink: 0; transition: transform .25s var(--ease); }
.nav-cta:hover svg { transform: translateX(2px); }

/* neutral / quiet */
.btn.quiet {
    background: var(--paper);
    color: var(--ink-2);
    border-color: var(--line);
    box-shadow: none;
}
.btn.quiet:hover {
    background: var(--surface);
    color: var(--ink);
    border-color: var(--line-strong);
    box-shadow: none;
    transform: translateY(-1px);
}

/* small */
.btn.sm { padding: 8px 14px; font-size: 13px; }
.btn.xs { padding: 6px 11px; font-size: 12px; }

/* destructive */
.btn.danger {
    background: transparent;
    color: var(--danger);
    border-color: #fecaca;
    box-shadow: none;
}
.btn.danger:hover {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
    box-shadow: 0 12px 28px -14px rgba(185, 28, 28, 0.6);
}
.btn.danger:hover svg { transform: none; }

/* quiet delete (textová varianta — Smazat položku) */
.btn-delete {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 15px;
    border-radius: 100px;
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.02em;
    color: var(--muted);
    border: 1px solid transparent;
    transition: color .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease);
}
.btn-delete:hover {
    color: var(--danger);
    background: #fef2f2;
    border-color: #fecaca;
}

.btn:disabled,
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

/* back link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    padding: 8px 0;
    transition: color .2s var(--ease);
}
.back-link:hover { color: var(--accent); }
.back-link svg { transition: transform .2s var(--ease); }
.back-link:hover svg { transform: translateX(-3px); }

/* ═══════════════════════════════════════════════════════════════
   TOP BAR — .topbar (= .app-bar) — sdílená všemi stránkami
   ═══════════════════════════════════════════════════════════════ */
.topbar,
.app-bar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(250, 250, 249, 0.85);
    backdrop-filter: saturate(1.4) blur(14px);
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
    border-bottom: 1px solid var(--line);
}
.topbar > .wrap,
.app-bar > .wrap,
.topbar-inner,
.app-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    padding-top: 16px;
    padding-bottom: 16px;
}
.app-nav { display: flex; align-items: center; gap: 16px; }
.user-chip { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    display: grid;
    place-items: center;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--ink-2);
    flex-shrink: 0;
    overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-name {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--ink-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}
.app-sep { width: 1px; height: 18px; background: var(--line); flex-shrink: 0; }
.app-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--ink-2);
    padding: 8px 12px;
    border-radius: 8px;
    white-space: nowrap;
    transition: color .2s var(--ease), background .2s var(--ease);
}
.app-link:hover { color: var(--accent); background: var(--accent-soft); }
.app-link.is-current { color: var(--accent); }

/* ═══════════════════════════════════════════════════════════════
   CARD — generická karta (login, změna hesla, formuláře)
   ═══════════════════════════════════════════════════════════════ */
.card {
    position: relative;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02), 0 18px 40px -28px rgba(0,0,0,0.08);
}
.card.flush { box-shadow: none; }
.card-head { margin-bottom: 22px; }
.card-title {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--ink);
}
.card-sub { margin-top: 8px; font-size: 14px; color: var(--muted); line-height: 1.5; }

/* ─── Login ─── */
.auth { padding: 88px 0 72px; }
.auth-inner { max-width: 452px; margin: 0 auto; text-align: center; }
.auth-eyebrow { margin-bottom: 26px; }
.auth-card,
.auth .card {
    border-radius: var(--radius-lg);
    padding: 44px 40px 40px;
    text-align: left;
}
.auth-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--ink);
}
.auth-brand .brand-mark { width: 24px; height: 24px; }
.auth-brand .brand-sub { font-size: 13px; }
.auth-sub { margin-top: 14px; font-size: 15px; color: var(--muted); line-height: 1.5; }
.auth-form { margin-top: 30px; display: flex; flex-direction: column; gap: 18px; }
.auth-foot {
    margin-top: 22px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.04em;
    color: var(--muted-2);
    text-align: center;
}

/* ═══════════════════════════════════════════════════════════════
   FORM FIELDS
   ═══════════════════════════════════════════════════════════════ */
.field { display: flex; flex-direction: column; gap: 8px; }
.field + .field { margin-top: 0; }
.field-label,
.field > label,
.field > .label {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
}
.field-hint { font-size: 12px; color: var(--muted-2); }
.field-error { font-size: 12px; color: var(--danger); }

.input,
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="url"],
.field input[type="search"],
.field input[type="number"],
.field input[type="tel"],
.field textarea,
.field select,
.searchbar input {
    font-family: var(--sans);
    font-size: 15px;
    color: var(--ink);
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 13px 14px;
    width: 100%;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.field textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
.field select { cursor: pointer; appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23737373' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px;
}
.input::placeholder,
.field input::placeholder,
.field textarea::placeholder,
.searchbar input::placeholder { color: var(--muted-2); }
.input:focus,
.field input:focus,
.field textarea:focus,
.field select:focus,
.searchbar input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--paper);
    box-shadow: 0 0 0 3px rgba(255, 90, 31, 0.12);
}

/* checkbox řádek (např. „spěchá") */
.check {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    color: var(--ink-2);
}
.check input[type="checkbox"] {
    appearance: none; -webkit-appearance: none;
    width: 18px; height: 18px;
    border: 1.5px solid var(--line-strong);
    border-radius: 5px;
    background: var(--paper);
    display: grid; place-items: center;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    flex-shrink: 0;
}
.check input[type="checkbox"]:checked {
    background: var(--accent);
    border-color: var(--accent);
}
.check input[type="checkbox"]:checked::after {
    content: '';
    width: 9px; height: 5px;
    border: 2px solid #fff; border-top: 0; border-right: 0;
    transform: rotate(-45deg) translateY(-1px);
}
.check .rush-hint { font-family: var(--mono); font-size: 11px; color: var(--accent-ink); }

/* přepínač typu — chyba / změna */
.type-switch {
    display: inline-flex;
    gap: 3px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 100px;
    background: var(--surface);
}
.type-switch label,
.type-switch .type-opt {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: 100px;
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--muted);
    cursor: pointer;
    transition: color .2s var(--ease), background .2s var(--ease);
}
.type-switch input { position: absolute; opacity: 0; pointer-events: none; }
.type-switch label:hover { color: var(--ink); }
.type-switch input:checked + span,
.type-switch label.is-active,
.type-switch input:checked ~ .type-label {
    color: var(--accent-ink);
}
.type-switch label:has(input:checked) {
    background: var(--accent-soft);
    color: var(--accent-ink);
    box-shadow: inset 0 0 0 1px rgba(255,90,31,.28);
}

/* ═══════════════════════════════════════════════════════════════
   BADGE / TAG — mono stavový štítek
   ═══════════════════════════════════════════════════════════════ */
.badge, .tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--ink-2);
    padding: 5px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--paper);
    white-space: nowrap;
    line-height: 1.2;
}
/* stav s tečkou */
.badge.status, .tag-status,
.badge.novy, .badge.pracuje, .badge.ceka, .badge.hotovo {
    background: var(--surface);
}
.badge.status::before, .tag-status::before,
.badge.novy::before, .badge.pracuje::before,
.badge.ceka::before, .badge.hotovo::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}
.badge.novy::before    { background: var(--accent); }
.badge.pracuje::before { background: var(--warn); }
.badge.ceka::before    { background: var(--info); }
.badge.hotovo::before  { background: var(--ok); }
.badge.pracuje { color: #92400e; }
.badge.ceka    { color: #155e75; }
.badge.hotovo  { color: var(--ok); }

/* číslo podnětu */
.badge.num, .tag-num { color: var(--muted); }

/* typ */
.badge.bug, .tag-bug {
    color: var(--accent-ink);
    background: var(--accent-soft);
    border-color: rgba(255, 90, 31, 0.28);
}
.badge.zmena { color: var(--ink-2); }

/* spěchá */
.badge.rush, .tag-rush {
    color: var(--accent-ink);
    background: var(--accent-soft);
    border-color: var(--accent);
}

/* error inline výřez */
.err {
    font-family: var(--mono);
    font-size: 0.9em;
    color: var(--accent-ink);
    background: var(--accent-soft);
    border: 1px solid rgba(255, 90, 31, 0.22);
    padding: 1px 7px;
    border-radius: 6px;
}

/* ═══════════════════════════════════════════════════════════════
   FLASH — uspech / chyba / info
   ═══════════════════════════════════════════════════════════════ */
.flash {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--paper);
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink-2);
    margin: 0 0 20px;
}
.flash::before {
    content: '';
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--muted);
    flex-shrink: 0;
    margin-top: 7px;
}
.flash b, .flash strong { font-weight: 600; }
.flash a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.flash .flash-close { margin-left: auto; color: var(--muted-2); padding: 0 2px; }
.flash .flash-close:hover { color: var(--ink); }

.flash.uspech, .flash.success, .flash.ok {
    background: var(--ok-soft);
    border-color: var(--ok-line);
    color: #166534;
}
.flash.uspech::before { background: var(--ok); }

.flash.chyba, .flash.error, .flash.danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}
.flash.chyba::before { background: var(--danger); }

.flash.info {
    background: var(--accent-soft);
    border-color: rgba(255, 90, 31, 0.25);
    color: var(--accent-ink);
}
.flash.info::before { background: var(--accent); }

.flashes { margin-bottom: 8px; }

/* ═══════════════════════════════════════════════════════════════
   PAGE HEAD — sdílené nadpisy (nástěnka i admin)
   ═══════════════════════════════════════════════════════════════ */
.board { padding: 64px 0 40px; }
.detail { padding: 40px 0 8px; }
.page { padding: 56px 0 40px; }

.board-head, .page-head { max-width: 760px; }
.board-title, .page-title {
    margin-top: 22px;
    font-size: clamp(32px, 5vw, 58px);
    font-weight: 600;
    line-height: 1.02;
    letter-spacing: -0.038em;
    color: var(--ink);
    text-wrap: balance;
}
.page-title { font-size: clamp(28px, 4vw, 46px); }
.board-lede, .page-lede {
    margin-top: 22px;
    max-width: 56ch;
    font-size: 17px;
    line-height: 1.6;
    color: var(--ink-2);
}
.board-actions, .page-actions { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 12px; }
.board-cta { padding: 13px 20px; font-size: 14px; }

/* section head (eyebrow + linka) */
.section-head {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 30px;
}
.section-head::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--line);
}
.section-head .eyebrow { letter-spacing: 0.07em; }

/* divider */
.divider { display: flex; align-items: center; gap: 18px; padding: 24px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.divider-label {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted-2);
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════
   SEARCHBAR — vyhledávací pole + tlačítko
   ═══════════════════════════════════════════════════════════════ */
.searchbar {
    display: flex;
    gap: 10px;
    margin-top: 34px;
    max-width: 580px;
}
.searchbar .search-field { position: relative; flex: 1; min-width: 0; }
.searchbar .search-field svg {
    position: absolute;
    left: 14px; top: 50%;
    transform: translateY(-50%);
    color: var(--muted-2);
    pointer-events: none;
}
.searchbar .search-field input { padding-left: 40px; }
.searchbar input { flex: 1; min-width: 0; }
.searchbar .btn { flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════════
   FILTRY — chip s počtem
   ═══════════════════════════════════════════════════════════════ */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 40px;
}
.chip, .filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 100px;
    background: var(--paper);
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-2);
    cursor: pointer;
    transition: border-color .2s var(--ease), color .2s, background .2s;
}
.chip:hover, .filter:hover { border-color: var(--line-strong); color: var(--ink); }
.chip-n, .filter-n {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
}
.chip.active, .filter.active,
.chip[aria-selected="true"], .filter[aria-selected="true"] {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-ink);
}
.chip.active .chip-n, .filter.active .filter-n,
.chip[aria-selected="true"] .chip-n { color: var(--accent-ink); }
.chip.zero, .filter.zero { color: var(--muted); }
.chip.zero .chip-n, .filter.zero .filter-n { color: var(--muted-2); }

/* ═══════════════════════════════════════════════════════════════
   PODNĚTY — číslované editorial řádky
   ═══════════════════════════════════════════════════════════════ */
.items { margin-top: 32px; display: flex; flex-direction: column; gap: 12px; }
.item {
    display: block;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px;
    color: inherit;
    transition: border-color .15s, box-shadow .15s;
}
a.item:hover, .item:hover { border-color: var(--line-strong); box-shadow: 0 6px 22px -16px rgba(10, 10, 10, .3); }
.item-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.item-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.item-title {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--ink);
    text-wrap: balance;
    transition: color .2s var(--ease);
}
a.item:hover .item-title { color: var(--accent-ink); }
.item-desc {
    font-size: 13.5px;
    color: var(--muted);
    margin-top: 5px;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.item-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-top: 1px solid var(--line);
    padding-top: 14px;
    flex-wrap: wrap;
}
.item-foot-end { display: inline-flex; align-items: center; gap: 12px; flex-shrink: 0; }
.item-meta { font-size: 12px; color: var(--muted-2); }
.item-comments {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
}
.item-comments svg { color: var(--muted-2); }

/* ═══════════════════════════════════════════════════════════════
   PRÁZDNÉ STAVY
   ═══════════════════════════════════════════════════════════════ */
.empty, .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 56px 24px;
    color: var(--muted);
}
.empty svg, .empty-state svg { color: var(--muted-2); margin-bottom: 14px; }
.empty p, .empty-state p { font-size: 14px; max-width: 38ch; }
.empty .empty-title {
    font-size: 16px; font-weight: 600; color: var(--ink); margin-bottom: 6px;
    font-family: var(--sans); letter-spacing: -0.01em;
}
.items .empty, .items .empty-state { border-bottom: 1px solid var(--line); }

/* ═══════════════════════════════════════════════════════════════
   NOVÝ PODNĚT — rozbalovací composer
   ═══════════════════════════════════════════════════════════════ */
.composer {
    margin-top: 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--paper);
    padding: 28px 30px 30px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02), 0 16px 40px -32px rgba(0,0,0,0.1);
}
.composer[hidden] { display: none; }
.composer-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}
.composer-title { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.composer-form { display: flex; flex-direction: column; gap: 18px; }
.composer-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
    justify-content: space-between;
}
.composer-actions {
    margin-top: 6px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ═══════════════════════════════════════════════════════════════
   DROPZONE — přílohy / drag & drop
   ═══════════════════════════════════════════════════════════════ */
.dropzone {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 16px 18px;
    border: 1.5px dashed var(--line-strong);
    border-radius: 12px;
    background: var(--surface);
    color: var(--muted);
    font-size: 13px;
    cursor: pointer;
    transition: border-color .2s var(--ease), background .2s var(--ease), color .2s var(--ease);
}
.dropzone:hover,
.dropzone.is-dragover {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-ink);
}
.dropzone svg { flex-shrink: 0; color: var(--muted-2); transition: color .2s var(--ease); }
.dropzone:hover svg, .dropzone.is-dragover svg { color: var(--accent); }
.dropzone input[type="file"] { display: none; }
.dropzone kbd {
    font-family: var(--mono);
    font-size: 11px;
    color: inherit;
    background: var(--paper);
    border: 1px solid var(--line-strong);
    border-radius: 5px;
    padding: 1px 5px;
}

/* ─── Přílohy (seznam) ─── */
.prilohy {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
    list-style: none;
}
.prilohy:empty { margin-top: 0; }
.prilohy li, .prilohy .priloha {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 7px 11px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--paper);
    font-family: var(--mono);
    font-size: 12px;
    color: var(--ink-2);
    max-width: 100%;
    transition: border-color .2s, background .2s;
}
.prilohy a:hover, .prilohy .priloha:hover { border-color: var(--line-strong); background: var(--surface); }
.prilohy .priloha-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.prilohy .priloha-thumb {
    width: 30px; height: 30px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid var(--line);
    flex-shrink: 0;
}
.prilohy .priloha-remove {
    color: var(--muted-2);
    padding: 0 2px;
    line-height: 1;
    transition: color .15s;
}
.prilohy .priloha-remove:hover { color: var(--danger); }

/* Obrázková příloha = vizuální náhled (dlaždice), ne souborová chipka */
.prilohy .priloha.priloha-obrazek {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 6px;
    max-width: 280px;
    cursor: zoom-in;
}
.prilohy .priloha-obrazek .priloha-thumb {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 240px;
    border-radius: 8px;
    object-fit: contain;
    border: 1px solid var(--line);
}
.prilohy .priloha-obrazek .priloha-name { padding: 0 2px 2px; color: var(--muted); max-width: 100%; }

/* Lightbox — klik na náhled otevře obrázek přes celou obrazovku (JS v app.js) */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(10, 10, 10, 0.86);
    cursor: zoom-out;
    animation: lb-in .18s ease;
}
.lightbox img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 10px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }

/* ═══════════════════════════════════════════════════════════════
   DETAIL — hlavička
   ═══════════════════════════════════════════════════════════════ */
.detail-head { margin-top: 24px; max-width: 900px; }
.detail-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.detail-title {
    margin-top: 18px;
    font-size: clamp(22px, 2.6vw, 27px);
    font-weight: 600;
    line-height: 1.22;
    letter-spacing: -0.02em;
    color: var(--ink);
    text-wrap: balance;
}
.detail-meta { margin-top: 11px; font-size: 13px; color: var(--muted); }
.detail-meta .who { color: var(--ink-2); }

/* „Co nefunguje" */
.problem {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--line);
    max-width: 840px;
}
.problem .eyebrow { margin-bottom: 16px; }
.problem p, .problem .problem-body {
    font-size: 17px;
    line-height: 1.66;
    color: var(--ink-2);
}
.problem p + p { margin-top: 14px; }

/* ═══════════════════════════════════════════════════════════════
   DETAIL — časová osa + panel komentářů
   ═══════════════════════════════════════════════════════════════ */
.thread { margin-top: 58px; }
.detail-grid, .thread-grid {
    display: grid;
    grid-template-columns: 288px 1fr;
    gap: 50px;
    align-items: start;
}

/* ─── Časová osa (.timeline / .steps / .tl-node) ─── */
.timeline .eyebrow { margin-bottom: 24px; }
.steps, .timeline ol, .timeline ul { list-style: none; }
.tl-node, .step {
    position: relative;
    padding-left: 34px;
    padding-bottom: 30px;
    cursor: pointer;
}
.tl-node:last-child, .step:last-child { padding-bottom: 4px; }
.tl-node::before, .step::before {
    content: '';
    position: absolute;
    left: 8px; top: 20px; bottom: -2px;
    width: 1.5px;
    background: var(--line);
}
.tl-node:last-child::before, .step:last-child::before { display: none; }
.tl-dot, .step-dot {
    position: absolute;
    left: 0; top: 1px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--paper);
    border: 1.5px solid var(--line-strong);
    transition: border-color .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease);
}
.tl-label, .step-label {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    transition: color .2s var(--ease);
}
.tl-sub, .step-sub {
    margin-top: 6px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted-2);
}
.tl-node.is-active .tl-dot, .step.is-active .step-dot {
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}
.tl-node.is-active .tl-label, .step.is-active .step-label { color: var(--accent-ink); }
.tl-node.is-active .tl-sub, .step.is-active .step-sub { color: var(--ink-2); }
.tl-node.is-done .tl-dot, .step.is-done .step-dot { border-color: var(--ok); background: var(--ok); }
.tl-node.is-upcoming .tl-dot, .step.is-upcoming .step-dot { border-style: dashed; }
.tl-node.is-upcoming .tl-label, .step.is-upcoming .step-label { color: var(--muted-2); }
.tl-node:hover .tl-dot, .step:hover .step-dot { border-color: var(--accent); }
.tl-node:hover .tl-label, .step:hover .step-label { color: var(--ink); }
.tl-node.is-active:hover .tl-label, .step.is-active:hover .step-label { color: var(--accent-ink); }

/* ─── Panel komentářů (.float-panel / .panel) ─── */
.float-panel, .panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    box-shadow: 0 1px 2px rgba(0,0,0,0.02), 0 16px 40px -30px rgba(0,0,0,0.12);
    overflow: hidden;
}
.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding: 16px 22px;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
}
.panel-head .eyebrow { color: var(--ink-2); letter-spacing: 0.07em; }
.panel-time { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.panel-body { padding: 22px; }

/* zprávy uvnitř panelu */
.bubbles, .panel-body .thread-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ═══════════════════════════════════════════════════════════════
   CHAT BUBLINY — tým vlevo / klient vpravo
   ═══════════════════════════════════════════════════════════════ */
.bubble {
    max-width: 80%;
    padding: 13px 16px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--surface);
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--ink-2);
    align-self: flex-start;
}
.bubble-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 6px;
}
.bubble-who {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--ink-2);
}
.bubble-time { font-family: var(--mono); font-size: 11px; color: var(--muted-2); }
.bubble-text { color: var(--ink-2); }
.bubble .prilohy { margin-top: 10px; }

.bubble.tym {
    align-self: flex-start;
    background: var(--surface);
    border-color: var(--line);
    border-bottom-left-radius: 5px;
}
.bubble.tym .bubble-who { color: var(--accent-ink); }

.bubble.klient {
    align-self: flex-end;
    margin-left: auto;
    background: var(--accent-soft);
    border-color: rgba(255, 90, 31, 0.22);
    border-bottom-right-radius: 5px;
}
.bubble.klient .bubble-who { color: var(--accent-ink); }

/* systémová / interní poznámka */
.bubble.system {
    align-self: center;
    max-width: 100%;
    background: transparent;
    border: 0;
    text-align: center;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
    padding: 4px 0;
}

/* ═══════════════════════════════════════════════════════════════
   REPLY BOX — pole odpovědi
   ═══════════════════════════════════════════════════════════════ */
.reply-box, .reply { margin-top: 18px; }
.reply-box textarea, .reply-input {
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.55;
    color: var(--ink);
    width: 100%;
    min-height: 96px;
    resize: vertical;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px 16px;
    transition: border-color .2s, box-shadow .2s;
}
.reply-box textarea::placeholder, .reply-input::placeholder { color: var(--muted-2); }
.reply-box textarea:focus, .reply-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 90, 31, 0.12);
}
.reply-box .dropzone, .reply .dropzone { margin-top: 12px; }
.reply-actions {
    margin-top: 14px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* smazat položku (pata detailu) */
.detail-foot {
    margin-top: 46px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: flex-end;
}

/* ═══════════════════════════════════════════════════════════════
   VÝBĚR PROJEKTU / ADMIN — seznam projektů (řádky)
   ═══════════════════════════════════════════════════════════════ */
.project-list {
    margin-top: 38px;
    border-top: 1px solid var(--line);
    list-style: none;
}
.project-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 28px;
    padding: 26px 0;
    border-bottom: 1px solid var(--line);
    align-items: center;
    position: relative;
    color: inherit;
    transition: padding .35s var(--ease);
}
.project-row::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 2px;
    background: var(--accent);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform .35s var(--ease);
}
a.project-row:hover { padding-left: 16px; }
a.project-row:hover::before { transform: scaleY(1); }
.project-main { min-width: 0; }
.project-name {
    font-size: clamp(18px, 2vw, 23px);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--ink);
    transition: color .2s var(--ease);
}
a.project-row:hover .project-name { color: var(--accent-ink); }
.project-sub {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
}
.project-counts { display: flex; flex-wrap: wrap; gap: 6px; }
.project-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
}

/* ═══════════════════════════════════════════════════════════════
   ADMIN — odkaz pro klienta / přihlašovací údaje
   ═══════════════════════════════════════════════════════════════ */
.link-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px 13px 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
}
.link-box .link-url, .link-box code {
    flex: 1;
    min-width: 0;
    font-family: var(--mono);
    font-size: 13px;
    color: var(--ink-2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.link-box .btn { flex-shrink: 0; }

.creds-box {
    border: 1px solid var(--accent);
    background: var(--accent-soft);
    border-radius: var(--radius);
    padding: 22px 24px;
}
.creds-box .eyebrow { color: var(--accent-ink); margin-bottom: 14px; }
.creds-box dl, .creds-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px 18px;
    align-items: baseline;
}
.creds-box dt, .cred-key {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent-ink);
}
.creds-box dd, .cred-val {
    font-family: var(--mono);
    font-size: 14px;
    color: var(--ink);
    word-break: break-all;
}
.creds-note {
    margin-top: 16px;
    font-size: 12px;
    color: var(--accent-ink);
    line-height: 1.5;
}

/* sloupcové rozložení karet v nastavení */
.stack { display: flex; flex-direction: column; gap: 28px; }
.stack-lg { display: flex; flex-direction: column; gap: 44px; }
.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    align-items: start;
}

/* ═══════════════════════════════════════════════════════════════
   TABULKA KLIENTŮ
   ═══════════════════════════════════════════════════════════════ */
.table-wrap {
    margin-top: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow-x: auto;
    background: var(--paper);
}
.table {
    width: 100%;
    min-width: 520px;
    border-collapse: collapse;
}
.table th {
    text-align: left;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
    white-space: nowrap;
}
.table td {
    padding: 15px 18px;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
    color: var(--ink-2);
    vertical-align: middle;
}
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover td { background: var(--surface); }
.table .cell-mono { font-family: var(--mono); font-size: 13px; color: var(--ink); }
.table .row-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════ */
footer.site-foot, .site-foot {
    flex-shrink: 0;
    padding: 40px 0 48px;
    margin-top: 56px;
    border-top: 1px solid var(--line);
}
.foot-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 32px;
    flex-wrap: wrap;
}
.foot-left {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
}
.foot-left b { color: var(--ink); font-weight: 500; }
.foot-links {
    display: flex;
    gap: 28px;
    font-size: 13px;
    color: var(--muted);
}
.foot-links a { transition: color .2s var(--ease); }
.foot-links a:hover { color: var(--accent); }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 980px) {
    .detail-grid, .thread-grid { grid-template-columns: 1fr; gap: 36px; }
    .timeline { padding-bottom: 4px; border-bottom: 1px solid var(--line); }
    .split { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
    .wrap { padding-left: 28px; padding-right: 28px; }

    .auth { padding: 56px 0; }
    .auth-card, .auth .card { padding: 36px 28px 32px; }

    .topbar > .wrap, .app-bar > .wrap, .app-bar-inner, .topbar-inner { gap: 16px; }
    .user-name { display: none; }
    .app-nav { gap: 12px; }

    .board { padding: 48px 0 32px; }
    .detail { padding: 28px 0 8px; }
    .page { padding: 40px 0 32px; }

    .item {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 28px 0;
    }
    .item:hover { padding-left: 12px; }
    .item .num, .item-num { padding-top: 0; }
    .item-meta, .item .meta { margin-top: 4px; }
    .item-tags {
        justify-content: flex-start;
        padding-top: 2px;
        max-width: 100%;
    }

    .project-row { grid-template-columns: 1fr; gap: 16px; }
    .project-actions { justify-content: flex-start; }

    .composer { padding: 24px 22px 26px; }
    .composer-row { flex-direction: column; align-items: flex-start; gap: 16px; }

    .foot-inner { flex-direction: column; align-items: flex-start; gap: 16px; }
}

@media (max-width: 560px) {
    .searchbar { flex-wrap: wrap; }
    .searchbar .search-field { flex: 1 1 100%; }
    .searchbar .btn { width: 100%; }
    .bubble { max-width: 92%; }
    .table th, .table td { padding: 12px 14px; }
    .reply-actions, .composer-actions, .detail-foot, .page-actions, .board-actions { flex-wrap: wrap; }
}

@media (max-width: 480px) {
    .wrap { padding-left: 20px; padding-right: 20px; }
    .app-link { padding: 8px 8px; }
    .filters { gap: 6px; }
    .dropzone { flex-direction: column; align-items: flex-start; }
    .type-switch { width: 100%; }
    .type-switch label, .type-switch .type-opt { flex: 1; justify-content: center; }
    .creds-box dl, .creds-list { grid-template-columns: 1fr; gap: 4px 0; }
    .creds-box dd, .cred-val { margin-bottom: 8px; }
}

@media print {
    .topbar, .app-bar, .site-foot, .reply-box, .reply, .composer, .board-actions, .filters, .searchbar { display: none !important; }
    body { background: #fff; }
    .float-panel, .panel, .card { box-shadow: none; }
}
/* ═══ E-maily: přepínače (E) ═══ */
.switch-list { display: flex; flex-direction: column; }
.switch-row { display: flex; align-items: flex-start; gap: 14px; padding: 16px 0; cursor: pointer; border-bottom: 1px solid var(--line); }
.switch-list .switch-row:last-child { border-bottom: none; }
.switch-master { padding: 4px 0; border: none; }
.switch-row input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-knob { flex-shrink: 0; width: 42px; height: 24px; border-radius: 100px; background: var(--line-strong); position: relative; transition: background .2s var(--ease); margin-top: 1px; }
.switch-knob::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s var(--ease); }
.switch-row input:checked + .switch-knob { background: var(--accent); }
.switch-row input:checked + .switch-knob::after { transform: translateX(18px); }
.switch-row input:focus-visible + .switch-knob { outline: 2px solid var(--focus); outline-offset: 2px; }
.switch-text { display: flex; flex-direction: column; gap: 3px; }
.switch-title { font-weight: 600; font-size: 15px; }
.switch-master .switch-title { font-size: 16px; }
.switch-desc { font-size: 13px; color: var(--muted); line-height: 1.5; }

/* ═══ E-maily: stromový log (F) ═══ */
.log-projekt { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); margin-bottom: 12px; overflow: hidden; }
.log-projekt > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; cursor: pointer; font-weight: 600; list-style: none; }
.log-projekt > summary::-webkit-details-marker { display: none; }
.log-projekt-nazev { font-size: 15px; }
.log-count { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.log-radky { border-top: 1px solid var(--line); }
.log-radek { display: grid; grid-template-columns: 108px 120px 1fr auto auto; gap: 14px; align-items: center; padding: 11px 20px; border-bottom: 1px solid var(--line); font-size: 13px; }
.log-radek:last-child { border-bottom: none; }
.log-typ { color: var(--ink-2); font-weight: 500; }
.log-predmet { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-prijemce { font-size: 12px; color: var(--muted); }
.log-cas { font-family: var(--mono); font-size: 12px; color: var(--muted-2); white-space: nowrap; }

@media (max-width: 680px) {
  .switch-row { gap: 11px; }
  .switch-title { font-size: 14px; }
  .log-radek { grid-template-columns: auto 1fr; row-gap: 4px; padding: 12px 16px; }
  .log-radek .log-predmet { grid-column: 1 / -1; white-space: normal; }
  .log-radek .log-prijemce { grid-column: 1 / -1; }
  .log-radek .log-cas { grid-column: 2; text-align: right; }
}

/* ===================================================================
   A: souhrn pro klienty  +  B: plánované termíny
   =================================================================== */

/* B — banner termínu na detailu (vidí klient i admin) */
.plan-banner {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-top: 22px;
    padding: 14px 18px;
    background: var(--accent-soft);
    border: 1px solid rgba(255, 90, 31, 0.22);
    border-radius: var(--radius);
    color: var(--accent-ink);
}
.plan-banner svg { flex-shrink: 0; margin-top: 1px; }
.plan-banner > div { display: flex; flex-direction: column; gap: 3px; }
.plan-label { font-size: 14px; color: var(--ink-2); }
.plan-label strong { color: var(--accent-ink); }
.plan-note { font-size: 13px; color: var(--muted); }

/* B — termín na kartě nástěnky */
.item-plan {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--accent-ink);
    white-space: nowrap;
}
.item-plan svg { flex-shrink: 0; }

/* A — lišta souhrnu v seznamu projektů (dashboard) */
.souhrn-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 9px 14px;
    background: var(--accent-soft);
    border: 1px solid rgba(255, 90, 31, 0.22);
    border-radius: 10px;
    font-size: 13px;
    color: var(--ink-2);
    text-decoration: none;
    transition: border-color .15s, background .15s;
}
.souhrn-strip:hover { border-color: var(--accent); background: #ffeee5; }
.souhrn-strip > svg { flex-shrink: 0; color: var(--accent-ink); }
.souhrn-strip .souhrn-cta { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--accent-ink); white-space: nowrap; }

/* A — výrazná karta souhrnu na stránce nastavení projektu */
.souhrn-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 22px;
    background: var(--accent-soft);
    border: 1px solid rgba(255, 90, 31, 0.28);
    border-radius: var(--radius);
    text-decoration: none;
    transition: border-color .15s, box-shadow .15s;
}
.souhrn-card:hover { border-color: var(--accent); box-shadow: 0 6px 22px -14px rgba(255, 90, 31, 0.6); }
.souhrn-ico {
    flex-shrink: 0;
    width: 44px; height: 44px;
    display: grid; place-items: center;
    background: var(--paper);
    border: 1px solid rgba(255, 90, 31, 0.28);
    border-radius: 11px;
    color: var(--accent-ink);
}
.souhrn-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.souhrn-h { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.souhrn-s { font-size: 13px; line-height: 1.5; color: var(--muted); }
.souhrn-card .souhrn-cta {
    margin-left: auto; flex-shrink: 0;
    font-family: var(--mono); font-size: 12px; color: var(--accent-ink); white-space: nowrap;
}

/* A — náhledová stránka souhrnu */
.prijemci { display: flex; flex-wrap: wrap; gap: 8px; }
.prijemce {
    font-family: var(--mono); font-size: 12.5px; color: var(--ink-2);
    background: var(--surface); border: 1px solid var(--line);
    border-radius: 7px; padding: 5px 10px;
}

.souhrn-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.souhrn-item {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 15px 0; border-top: 1px solid var(--line);
}
.souhrn-item:first-child { border-top: 0; padding-top: 0; }
.souhrn-item .tag-status { flex-shrink: 0; margin-top: 1px; }
.souhrn-item .tag-status::before { background: var(--c, var(--accent)); }
.souhrn-item-body { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.souhrn-item-title { font-size: 14.5px; font-weight: 600; color: var(--ink); text-decoration: none; }
.souhrn-item-title:hover { color: var(--accent-ink); }
.souhrn-item-plan {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 13px; color: var(--accent-ink);
}
.souhrn-item-plan svg { flex-shrink: 0; }
.souhrn-item-msg {
    font-size: 13px; line-height: 1.6; color: var(--ink-2);
    padding-left: 11px; border-left: 2px solid var(--line);
}

.mail-preview {
    width: 100%; height: 520px;
    border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--bg, #fafaf9);
}

.souhrn-send { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; pointer-events: none; }

@media (max-width: 560px) {
  .souhrn-card { flex-wrap: wrap; }
  .souhrn-card .souhrn-cta { margin-left: 0; width: 100%; }
  .souhrn-strip { flex-wrap: wrap; }
  .souhrn-strip .souhrn-cta { margin-left: 0; }
  .mail-preview { height: 460px; }
}

/* ===================================================================
   Vlastní kalendář (datepicker) — nahrazuje nativní <input type=date>
   =================================================================== */
.datepick { position: relative; }
.datepick-trigger {
    display: flex; align-items: center; gap: 9px; width: 100%;
    font-family: var(--sans); font-size: 15px; color: var(--muted); text-align: left;
    background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
    padding: 13px 14px; cursor: pointer;
    transition: border-color .2s, box-shadow .2s, background .2s, color .2s;
}
.datepick.has-value .datepick-trigger { color: var(--ink); }
.datepick-trigger > svg:first-child { color: var(--accent-ink); flex-shrink: 0; }
.datepick-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.datepick-caret { color: var(--muted-2); flex-shrink: 0; transition: transform .2s; }
.datepick.open .datepick-caret { transform: rotate(180deg); }
.datepick-trigger:hover { border-color: var(--line-strong); }
.datepick.open .datepick-trigger,
.datepick-trigger:focus-visible {
    outline: none; border-color: var(--accent); background: var(--paper);
    box-shadow: 0 0 0 3px rgba(255, 90, 31, .12);
}

.datepick-pop {
    position: absolute; z-index: 60; top: calc(100% + 8px); left: 0;
    width: 292px; max-width: calc(100vw - 32px);
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: 0 18px 44px -16px rgba(10, 10, 10, .32), 0 4px 12px -8px rgba(10, 10, 10, .18);
    padding: 14px; animation: dp-in .14s var(--ease);
}
@keyframes dp-in { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: none; } }

.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.dp-title { font-size: 14px; font-weight: 600; color: var(--ink); text-transform: capitalize; letter-spacing: -.01em; }
.dp-nav {
    width: 30px; height: 30px; flex-shrink: 0; display: grid; place-items: center;
    font-size: 18px; line-height: 1; color: var(--ink-2);
    background: transparent; border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}
.dp-nav:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }

.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-dow { margin-bottom: 4px; }
.dp-dow-cell { text-align: center; font-family: var(--mono); font-size: 11px; color: var(--muted-2); padding: 3px 0; }
.dp-empty { aspect-ratio: 1; }
.dp-day {
    aspect-ratio: 1; display: grid; place-items: center;
    font-family: var(--sans); font-size: 13.5px; color: var(--ink-2);
    background: transparent; border: 1px solid transparent; border-radius: 8px; cursor: pointer;
    transition: background .12s, color .12s, border-color .12s;
}
.dp-day:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent-ink); }
.dp-day.is-today { border-color: var(--line-strong); font-weight: 600; }
.dp-day.is-sel { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.dp-day.is-sel:hover { background: var(--accent-ink); color: #fff; }
.dp-day.is-past { color: var(--muted-2); opacity: .4; cursor: not-allowed; }

.dp-foot { display: flex; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.dp-quick {
    flex: 1; font-family: var(--mono); font-size: 11.5px; letter-spacing: .02em; color: var(--ink-2);
    background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px; cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.dp-quick:hover { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }
.dp-clear { color: var(--muted); }
.dp-clear:hover { color: var(--danger); border-color: var(--danger); background: #fef2f2; }

/* ===================================================================
   C: WYSIWYG editor + rich-text výstup     |     D: video přílohy
   =================================================================== */

/* ── Editor ── */
.editor {
    border: 1px solid var(--line); border-radius: 12px; background: var(--bg);
    overflow: hidden; transition: border-color .2s, box-shadow .2s, background .2s;
}
.editor:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 90, 31, .12); background: var(--paper); }
.editor-toolbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 3px;
    padding: 7px 8px; border-bottom: 1px solid var(--line); background: var(--surface);
}
.ed-btn {
    display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 7px;
    font-size: 14px; color: var(--ink-2); background: transparent;
    border: 1px solid transparent; border-radius: 7px; cursor: pointer;
    transition: background .12s, border-color .12s, color .12s;
}
.ed-btn:hover { background: var(--paper); border-color: var(--line); color: var(--ink); }
.ed-btn strong, .ed-btn em, .ed-btn u, .ed-btn s { font-size: 14px; line-height: 1; }
.ed-clear { color: var(--muted-2); font-size: 13px; }
.ed-sep { width: 1px; height: 18px; background: var(--line-strong); margin: 0 4px; flex-shrink: 0; }
.ed-colors { display: inline-flex; gap: 3px; align-items: center; }
.ed-color {
    width: 18px; height: 18px; padding: 0; border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, .15); background: var(--sw); cursor: pointer;
    transition: transform .1s;
}
.ed-color:hover { transform: scale(1.18); }
.editor-area {
    min-height: 92px; max-height: 360px; overflow-y: auto;
    padding: 12px 14px; font-family: var(--sans); font-size: 15px; line-height: 1.6;
    color: var(--ink); outline: none;
}
.editor-area:focus { outline: none; }
.editor.is-empty .editor-area::before {
    content: attr(data-placeholder); color: var(--muted-2); pointer-events: none;
}

/* ── Vyrenderovaný rich-text ── */
.richtext { font-size: 15px; line-height: 1.65; color: var(--ink-2); }
.richtext p { margin: 0 0 .6em; }
.richtext p:last-child, .richtext > :last-child { margin-bottom: 0; }
.richtext ul, .richtext ol { margin: .4em 0 .6em; padding-left: 1.5em; }
.richtext li { margin: .15em 0; }
.richtext a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; word-break: break-word; }
.richtext strong, .richtext b { font-weight: 600; color: var(--ink); }
.richtext u { text-underline-offset: 2px; }
.problem .richtext { font-size: clamp(15px, 1.6vw, 17px); color: var(--ink-2); }
.bubble-text.richtext { font-size: 14px; }

/* ── Dropzone: oprava drag třídy + náhledy ── */
.dropzone.drag { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.dropzone.drag svg { color: var(--accent); }
.dropzone.has-files { flex-wrap: wrap; }
.dz-previews { display: flex; flex-wrap: wrap; gap: 9px; width: 100%; }
.dz-previews:empty { display: none; }
.dz-item {
    position: relative; display: inline-flex; align-items: center; gap: 8px;
    padding: 6px; padding-right: 26px;
    background: var(--paper); border: 1px solid var(--line); border-radius: 9px;
}
.dz-item img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; display: block; }
.dz-item.is-video { padding-right: 26px; }
.dz-video { width: 72px; height: 50px; object-fit: cover; border-radius: 6px; background: #000; display: block; }
.dz-file { font-family: var(--mono); font-size: 12px; color: var(--ink-2); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dz-remove {
    position: absolute; top: 4px; right: 4px;
    width: 18px; height: 18px; display: grid; place-items: center;
    font-size: 11px; line-height: 1; color: var(--muted-2);
    background: var(--surface); border: 1px solid var(--line); border-radius: 50%; cursor: pointer;
    transition: color .15s, border-color .15s;
}
.dz-remove:hover { color: var(--danger); border-color: var(--danger); }

/* ── Video příloha (výstup) ── */
.prilohy .priloha-video {
    display: block; padding: 0; border: 0; background: transparent;
    max-width: 340px; font-family: var(--sans);
}
.prilohy .priloha-video:hover { background: transparent; border: 0; }
.video-thumb {
    width: 100%; max-width: 340px; max-height: 260px;
    border-radius: 11px; border: 1px solid var(--line); background: #000; display: block;
}
.priloha-video .priloha-name {
    display: block; margin-top: 6px; max-width: 340px;
    font-family: var(--mono); font-size: 12px; color: var(--muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

@media (max-width: 560px) {
    .editor-toolbar { gap: 2px; }
    .ed-btn { min-width: 28px; height: 28px; }
    .ed-color { width: 16px; height: 16px; }
}

/* ===================================================================
   Fáze podnětu — stepper (detail), track (seznam), statepill
   =================================================================== */

/* statepill — barevná pilulka stavu */
.statepill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 4px 11px; border-radius: 100px; white-space: nowrap; line-height: 1.3; }
.statepill .d { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.statepill.novy { color: #1d4ed8; background: #eff6ff; }            .statepill.novy .d { background: #2563eb; }
.statepill.work { color: var(--accent-ink); background: var(--accent-soft); } .statepill.work .d { background: var(--accent); }
.statepill.wait { color: #7c3aed; background: #f5f0ff; }            .statepill.wait .d { background: #7c3aed; }
.statepill.pause { color: var(--muted); background: var(--surface); } .statepill.pause .d { background: var(--muted-2); }
.statepill.done { color: var(--ok); background: var(--ok-soft); }    .statepill.done .d { background: var(--ok); }

/* track — kompaktní progress v kartě seznamu */
.track { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 180px; max-width: 360px; }
.track .seg { height: 5px; border-radius: 3px; flex: 1; background: var(--line); }
.track .now-lbl { font-size: 11px; font-family: var(--mono); white-space: nowrap; }

/* stepper — detail (vlastní třídy .d-steps/.d-step, ať nekolidují s timeline .steps/.step) */
.d-stepper { margin: 24px 0; padding: 22px 18px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); max-width: 560px; }
.d-steps { display: flex; align-items: flex-start; gap: 0; }
.d-step { display: flex; flex-direction: column; align-items: center; flex: 1; position: relative; text-align: center; }
.d-step::before { content: ''; position: absolute; top: 8px; left: -50%; width: 100%; height: 2px; background: var(--line); z-index: 0; }
.d-step:first-child::before { display: none; }
.d-step .dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--paper); z-index: 1; display: grid; place-items: center; }
.d-step .dot svg { width: 10px; height: 10px; color: #fff; }
.d-step .lbl { font-size: 12px; color: var(--muted-2); margin-top: 8px; font-weight: 500; line-height: 1.25; }
.d-step.done::before { background: var(--accent); }
.d-step.done .dot { background: var(--accent); border-color: var(--accent); }
.d-step.done .lbl { color: var(--accent-ink); }
.d-step.now::before { background: var(--accent); }
.d-step.now .dot { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.d-step.now .lbl { color: var(--ink); font-weight: 600; }
.d-step.wait::before { background: linear-gradient(90deg, var(--accent), #7c3aed); }
.d-step.wait .dot { border-color: #7c3aed; box-shadow: 0 0 0 4px #f3e8ff; }
.d-step.wait .lbl { color: #7c3aed; font-weight: 600; }
.d-step.paused::before { background: var(--accent); }
.d-step.paused .dot { border-color: var(--muted-2); box-shadow: 0 0 0 4px var(--surface); }
.d-step.paused .lbl { color: var(--muted); font-weight: 600; }
.d-step.fin::before { background: var(--ok); }
.d-step.fin .dot { background: var(--ok); border-color: var(--ok); }
.d-step.fin .lbl { color: var(--ok); }

@media (max-width: 560px) {
    .item-foot { gap: 10px; }
    .track { min-width: 140px; }
    .d-step .lbl { font-size: 11px; }
}
