/* Roční plán Skvělá destinace 2026 - styles - Kreia branding */
:root {
    --color-primary: #1E5C30;          /* destinace – tmavě zelená */
    --color-primary-dark: #184D27;
    --color-accent-green: #0f8040;     /* Kreia green */
    --color-accent-yellow: #f5ba00;    /* Kreia yellow */
    --color-accent-red: #b41a34;       /* Kreia red */
    --color-bg: #ffffff;
    --color-bg-alt: #f7f9fc;
    --color-bg-section: #d4e8d9;       /* světlá zelená */
    --color-border: #dbe2ec;
    --color-text: #1f2937;
    --color-muted: #6b7280;
    --color-success: #0f8040;
    --color-warning: #f5ba00;
    --color-danger: #b41a34;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --radius: 6px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    color: var(--color-text);
    background: var(--color-bg-alt);
    font-size: 15px;
    line-height: 1.5;
}

h1, h2, h3 { margin: 0 0 8px; color: var(--color-text); }
h1 { font-size: 22px; }
h2 { font-size: 17px; }

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.muted { color: var(--color-muted); }
.small { font-size: 13px; }

/* Topbar */
.topbar {
    background: white;
    border-bottom: 2px solid var(--color-primary);
    box-shadow: var(--shadow-sm);
}
.topbar-inner {
    max-width: 1600px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.kreia-logo-link { display: inline-block; }
.kreia-logo { height: 42px; width: auto; display: block; }
.brand-text .brand-title { font-size: 18px; font-weight: 700; color: var(--color-primary-dark); line-height: 1.1; }
.brand-text .brand-sub { font-size: 12.5px; color: var(--color-muted); }
.org-logo { height: 48px; width: auto; max-width: 200px; object-fit: contain; display: block; }
.org-logo-slot {
    display: flex; align-items: center; justify-content: center;
    min-height: 56px; padding: 4px 12px;
}
.org-logo-slot.scrollable {
    cursor: pointer; transition: opacity 0.15s;
}
.org-logo-slot.scrollable:hover { opacity: 0.7; }
.org-logo-placeholder {
    font-size: 13px; color: var(--color-primary-dark); text-align: center;
    line-height: 1.2; font-weight: 600;
}
.topbar-right { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; justify-content: flex-end; }
.user-info { font-size: 13px; }
.role-badge {
    display: inline-block; padding: 2px 8px; border-radius: 12px;
    font-size: 11px; font-weight: 600; text-transform: uppercase; margin-left: 6px;
}
.role-superadmin { background: #fce7f3; color: #9d174d; }
.role-admin { background: #fef3c7; color: #92400e; }
.role-editor, .role-odpovedna_osoba { background: #d4e8d9; color: #184D27; }
.role-realizator { background: #e0f2fe; color: #075985; }
.role-readonly { background: #e5e7eb; color: #374151; }

.btn-help {
    width: 30px; height: 30px; padding: 0; line-height: 1;
    border: 2px solid var(--color-primary); border-radius: 50%;
    color: var(--color-primary); font-weight: 700; font-size: 16px;
    background: white; cursor: pointer;
}
.btn-help:hover { background: var(--color-primary); color: white; text-decoration: none; }

/* Container */
.container { max-width: 1600px; margin: 0 auto; padding: 10px 24px 80px; }

/* === Dash hero – kompaktní řádek === */
.dash-hero { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 10px; padding: 4px 0; flex-wrap: wrap; }
.dash-hero-left { flex: 1; min-width: 220px; }
.dash-title { font-size: 22px; font-weight: 800; margin: 0 0 2px; color: var(--color-primary-dark); letter-spacing: -0.3px; }
.dash-sub { font-size: 12px; color: var(--color-muted); margin: 0 0 8px; }
.dash-stats { display: flex; gap: 20px; flex-wrap: wrap; }
.dash-stats .stat { display: flex; flex-direction: column; }
.dash-stats .stat-num { font-size: 22px; font-weight: 700; color: var(--color-primary-dark); line-height: 1; }
.dash-stats .stat-lbl { font-size: 11px; color: var(--color-muted); text-transform: uppercase; letter-spacing: 0.4px; margin-top: 2px; }

.dash-hero-right {
    display: flex; flex-direction: row; align-items: center; justify-content: center;
    flex: 0 0 calc(60% - 12px);
    gap: 20px; background: white; position: relative;
    border-radius: var(--radius); padding: 10px 24px;
    border: 1px solid var(--color-border); box-shadow: var(--shadow-sm);
}
.gauge-title {
    position: absolute; left: 24px;
    font-size: 22px; color: var(--color-primary-dark); font-weight: 800;
    letter-spacing: -0.3px; line-height: 1.3; text-align: left;
    max-width: 30%;
}
.gauge-big-holder { width: 275px; }

/* Tachometr */
.gauge { display: block; width: 100%; height: auto; }
.gauge-large { max-width: 275px; }
.gauge-medium { max-width: 260px; }

/* SC Gauges grid */
.sc-gauges { background: white; border: 1px solid var(--color-border); border-radius: var(--radius); padding: 10px 16px; margin-bottom: 10px; box-shadow: var(--shadow-sm); }
.sc-gauges h2 { font-size: 15px; margin: 0 0 2px; color: var(--color-primary-dark); }
.sc-gauges-grid { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.sc-gauge-card { border: 1px solid var(--color-border); border-radius: 8px; padding: 10px 14px; background: var(--color-bg-alt); }
.sc-gauge-head { margin-bottom: 4px; }
.sc-gauge-title { display: flex; flex-direction: row; align-items: baseline; gap: 8px; flex-wrap: nowrap; overflow: hidden; }
.sc-gauge-title .sc-code { font-size: 14px; color: var(--color-primary-dark); font-weight: 800; white-space: nowrap; flex-shrink: 0; }
.sc-gauge-title .sc-short { font-size: 14px; color: var(--color-muted); line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.sc-gauge-row { display: flex; align-items: flex-start; gap: 14px; }
.sc-gauge-body { flex: 0 0 40%; display: flex; justify-content: center; align-items: center; padding: 6px 12px; }
.sc-priorities { flex: 0 0 60%; min-width: 0; }
.sc-priorities h4 { font-size: 11px; color: #4b5563; text-transform: uppercase; letter-spacing: 0.4px; margin: 0 0 4px; }

/* Priority bar (style obrázku 2) */
.prio-row-link { cursor: pointer; border-radius: 4px; padding: 1px 3px; margin: -1px -3px; transition: background 0.15s; }
.prio-row-link:hover { background: rgba(1, 174, 172, 0.08); }
.prio-row-link:hover .prio-label { color: var(--color-primary); text-decoration: underline; }
.prio-row { margin-bottom: 5px; }
.prio-row:last-child { margin-bottom: 0; }
.prio-info { display: flex; align-items: baseline; gap: 6px; margin-bottom: 1px; flex-wrap: nowrap; overflow: hidden; }
.prio-info strong { color: var(--color-primary-dark); font-size: 12px; min-width: 24px; flex-shrink: 0; }
.prio-info .prio-label { font-size: 12px; color: var(--color-text); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prio-info .prio-count { font-size: 11px; white-space: nowrap; flex-shrink: 0; }
.prio-bar-wrap { position: relative; height: 22px; padding-top: 6px; }
.prio-bar-track { height: 9px; border-radius: 5px; background: linear-gradient(to right, #dc2626 0%, #ea580c 17%, #f59e0b 33%, #eab308 50%, #84cc16 75%, #16a34a 100%); }
.prio-bar-pointer { position: absolute; top: 0; display: flex; flex-direction: column; align-items: center; }
.prio-bar-pointer span { background: #1f2937; color: white; padding: 1px 5px; border-radius: 3px; font-size: 10px; font-weight: 700; margin-bottom: 1px; white-space: nowrap; }
.prio-bar-pointer::after { content: ''; display: block; width: 0; height: 5px; }

/* Hero (původní – pro fallback, už nepoužíváme) */
.hero {
    background: linear-gradient(120deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    padding: 14px 24px;
    border-radius: 8px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-md);
}
.hero-title { font-size: 24px; font-weight: 800; margin: 0 0 2px; color: white; letter-spacing: -0.3px; }
.hero-sub { font-size: 13px; margin: 0; color: rgba(255,255,255,0.9); }

/* Dashboard cards */
.dashboard {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}
.dash-card {
    background: white; border: 1px solid var(--color-border);
    border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow-sm);
}
.dash-main { background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark)); color: white; border: none; }
.dash-main .dash-label { color: rgba(255,255,255,0.85); }
.dash-main .progress { background: rgba(255,255,255,0.2); }
.dash-main .progress-bar { background: white; }
.dash-label { font-size: 12px; color: var(--color-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.dash-value { font-size: 30px; font-weight: 700; margin-top: 4px; }

.dashboard-sections {
    background: white; border: 1px solid var(--color-border);
    border-radius: var(--radius); padding: 14px 18px;
    margin-bottom: 16px; box-shadow: var(--shadow-sm);
}
.ds-head {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 12px; margin-bottom: 12px; flex-wrap: wrap;
}
.chart-toggle { display: flex; gap: 4px; }
.chart-mode.active {
    background: var(--color-primary); color: white; border-color: var(--color-primary);
}

/* Sloupcový graf */
.chart-holder { width: 100%; overflow-x: auto; overflow-y: hidden; height: 380px; }
.bar-chart { display: block; height: 360px; }
.bar-chart .axis-line { stroke: var(--color-border); stroke-width: 1; }
.bar-chart .grid-line { stroke: var(--color-border); stroke-dasharray: 2,3; stroke-width: 0.5; }
.bar-chart .axis-text { font-size: 10px; fill: var(--color-muted); }
.bar-chart .bar-label { font-size: 11px; fill: var(--color-text); font-weight: 600; }
.bar-chart .bar-frame { fill: rgba(0,0,0,0.025); stroke: var(--color-border); stroke-width: 1; rx: 3; }
.bar-chart .bar-fill { stroke: none; rx: 3; transition: opacity 0.2s; }
.bar-chart .bar-fill.fill-good { fill: var(--color-accent-green); }
.bar-chart .bar-fill.fill-warn { fill: var(--color-accent-yellow); }
.bar-chart .bar-fill.fill-bad  { fill: var(--color-accent-red); }
.bar-chart .bar-cat-label {
    font-size: 10px; fill: var(--color-text);
}
.bar-chart .bar-group { cursor: default; }
.bar-chart .bar-group:hover .bar-fill { opacity: 0.85; }

.chart-tooltip {
    position: absolute;
    background: rgba(31, 41, 55, 0.95); color: white;
    padding: 6px 10px; border-radius: 4px;
    font-size: 12px; pointer-events: none;
    z-index: 50; white-space: nowrap;
}

/* Progress bars (legacy) */
.progress { height: 8px; background: #e5e7eb; border-radius: 4px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--color-success); transition: width 0.3s ease; }
.progress-bar.warn { background: var(--color-warning); }
.progress-bar.danger { background: var(--color-danger); }
.progress-mini { height: 6px; }

/* Filters */
.filters {
    background: white; border: 1px solid var(--color-border);
    border-radius: var(--radius); padding: 14px;
    margin-bottom: 16px; box-shadow: var(--shadow-sm);
}
.filter-help, .table-help { margin: 0 0 8px; }
.table-help { margin-top: 8px; }
.filter-row {
    display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px;
    align-items: center;
}
.filter-row:last-child { margin-bottom: 0; }
.filter-row input, .filter-row select {
    padding: 8px 11px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius); background: white;
    font-size: 14px; font-family: inherit;
    min-width: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    padding-right: 28px; /* prostor pro šipku, aby se text neořezával pod ní */
}
.filter-row select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%236b7280' d='M0 0l5 6 5-6z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
}
.filter-row input { flex: 1 1 180px; min-width: 160px; }
.filter-row select { flex: 0 1 auto; }
.filter-row #filterSC       { min-width: 145px; max-width: 155px; }
.filter-row #filterScPrio   { min-width: 145px; max-width: 185px; flex-grow: 1; }
.filter-row #filterOdpovedna{ min-width: 125px; max-width: 165px; }
.filter-row #filterRealizator{ min-width: 115px; max-width: 150px; }
.filter-row #filterStav     { min-width: 100px; max-width: 120px; }
.filter-row #filterPriorita { min-width: 105px; max-width: 125px; }
.filter-row #filterQuarter  { min-width: 110px; max-width: 140px; }
.filter-row #filterSort     { min-width: 105px; max-width: 130px; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: white; color: var(--color-text);
    font-size: 14px; font-family: inherit; cursor: pointer;
    text-decoration: none; transition: background 0.15s;
}
.btn:hover { background: var(--color-bg-alt); text-decoration: none; }
.btn-sm { padding: 5px 11px; font-size: 13px; }
.btn-primary { background: var(--color-primary); color: white; border-color: var(--color-primary); }
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-secondary { background: white; }
.btn-danger { background: var(--color-danger); color: white; border-color: var(--color-danger); }
.btn-danger:hover { background: #8a1428; }
/* Nevratné akce v liště nástrojů – méně nápadné, odsunuté doprava */
.btn-danger-outline { background: white; color: var(--color-danger); border-color: #e7b3bd; }
.btn-danger-outline:hover { background: #fdf2f4; }
.filter-row .btn-push-right { margin-left: auto; }
.btn-link { border: none; background: transparent; color: var(--color-primary); padding: 4px 8px; }
.btn-icon {
    width: 36px; height: 36px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 18px; line-height: 1; flex-shrink: 0;
}

/* Group toggle (Dle strategie / Dle oddílu) */
.group-toggle {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 2px 4px;
    background: var(--color-bg-alt); border: 1px solid var(--color-border);
    border-radius: var(--radius);
}
.group-toggle-label {
    font-size: 12px; color: var(--color-muted);
    margin: 0 4px 0 6px; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 600;
}
.group-mode {
    background: transparent; border-color: transparent;
    color: var(--color-muted);
}
.group-mode:hover { background: white; color: var(--color-text); }
.group-mode.active {
    background: var(--color-primary); color: white; border-color: var(--color-primary);
}

/* Table */
.table-wrap { background: white; border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
table.plan { width: 100%; border-collapse: collapse; font-size: 14px; }
table.plan th, table.plan td {
    text-align: left; padding: 9px 11px;
    border-bottom: 1px solid var(--color-border); vertical-align: top;
}
table.plan th {
    background: var(--color-bg-alt); font-weight: 600;
    font-size: 12px; text-transform: uppercase; letter-spacing: 0.3px;
    color: var(--color-muted); position: sticky; top: 0;
}
table.plan tr.row-odd { background: var(--color-bg-alt); }
table.plan tr.row:hover { background: #d4e8d9; cursor: pointer; }

tr.section-header td {
    background: var(--color-bg-section); font-weight: 700;
    color: var(--color-primary-dark); font-size: 14px; cursor: pointer; padding: 11px;
}
tr.section-header .section-toggle { display: inline-block; width: 16px; }
tr.section-header .section-pct { float: right; font-weight: 600; }

/* SC hlavička – nadřazená priority */
tr.sc-header td {
    background: var(--color-primary); color: white;
    padding: 10px 12px; font-size: 14px; font-weight: 700;
}
tr.sc-header .sc-code { display: inline-block; min-width: 36px; font-size: 16px; }
tr.sc-header .sc-name { font-weight: 600; }
tr.sc-header .sc-pct { float: right; font-weight: 700; background: rgba(255,255,255,0.2); padding: 2px 10px; border-radius: 12px; }
.sc-header-card {
    background: var(--color-primary); color: white;
    padding: 10px 14px; font-weight: 700; font-size: 14px;
    border-bottom: 1px solid var(--color-primary-dark);
    display: flex; align-items: center; gap: 10px;
}
.sc-header-card .sc-code { font-size: 16px; min-width: 36px; }
.sc-header-card .sc-name { flex: 1; font-weight: 600; }
.sc-header-card .sc-pct { font-weight: 700; background: rgba(255,255,255,0.2); padding: 2px 10px; border-radius: 12px; }

/* Duplicate badge */
.dup-badge {
    display: inline-block;
    background: #fef3c7; color: #92400e;
    font-size: 11px; font-weight: 600;
    padding: 1px 7px; border-radius: 10px;
    margin-left: 6px; vertical-align: middle;
    cursor: help;
}

.priorita-badge {
    display: inline-block; width: 22px; height: 22px; line-height: 22px;
    text-align: center; border-radius: 50%;
    font-weight: 700; color: white; font-size: 12px;
}
.priorita-1 { background: var(--color-danger); }
.priorita-2 { background: var(--color-warning); }
.priorita-3 { background: #6b7280; }

.done-badge {
    display: inline-block; background: var(--color-success); color: white;
    padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600;
}

.scale-text { font-size: 13px; color: var(--color-muted); }
.empty-val { color: #d1d5db; }

/* Návaznost – odlišení SC / Priority / Opatření */
.nav-sc { color: var(--color-primary-dark); font-weight: 700; }
.nav-prio { color: #b88600; font-weight: 600; }
.nav-op { color: var(--color-text); font-weight: 500; }
.nav-extra { font-size: 11px; }
.nav-line { line-height: 1.4; }
.nav-derived { padding: 6px 10px; background: var(--color-bg-section); border-radius: 4px; font-size: 12px; color: var(--color-text); }
.nav-derived em { color: var(--color-muted); }

/* Strukturovaný editor návaznosti */
.nav-chips {
    min-height: 28px;
    padding: 6px 8px;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border); border-radius: var(--radius);
    display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.nav-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 8px;
    background: white; border: 1px solid var(--color-primary);
    border-radius: 12px; font-size: 12px;
    color: var(--color-text);
}
.nav-chip strong { color: var(--color-primary-dark); }
.nav-chip-x {
    background: transparent; border: none; cursor: pointer;
    font-size: 16px; line-height: 1; padding: 0 2px;
    color: var(--color-danger); font-weight: 700;
}
.nav-chip-x:hover { color: #8a1428; }
.nav-chip-empty { padding: 2px 4px; }
.nav-chip-static { background: var(--color-bg-alt); border-color: var(--color-border); }

/* Realizátoři chip editor */
.realizatori-editor { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.realizatori-chips {
    min-height: 28px; padding: 6px 8px;
    background: var(--color-bg-alt); border: 1px solid var(--color-border);
    border-radius: var(--radius); display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.real-chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 8px; background: white; border: 1px solid var(--color-primary);
    border-radius: 12px; font-size: 12px; color: var(--color-text);
}
.real-chip-x {
    background: transparent; border: none; cursor: pointer;
    font-size: 14px; line-height: 1; padding: 0 2px;
    color: var(--color-danger); font-weight: 700;
}
.real-chip-x:hover { color: #8a1428; }
.realizatori-add-sel { margin-top: 2px; font-size: 13px; padding: 4px 6px; border: 1px solid var(--color-border); border-radius: var(--radius); width: 100%; max-width: 300px; }

.nav-summary {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border); border-radius: var(--radius);
    margin-top: 4px;
}
.nav-summary-content {
    flex: 1; min-width: 0;
    display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.nav-summary .nav-edit-btn { flex-shrink: 0; }

.nav-add-row {
    display: flex; gap: 6px; align-items: center; margin: 8px 0;
    flex-wrap: wrap;
}
.nav-add-row select, .nav-add-row input {
    padding: 6px 10px; border: 1px solid var(--color-border);
    border-radius: var(--radius); font-size: 13px; font-family: inherit;
}
.nav-add-row .nav-sc-sel { min-width: 90px; }
.nav-add-row .nav-prio-sel { min-width: 250px; flex: 1; }
.nav-add-row .nav-op-input { min-width: 180px; }

.nav-ap-row { margin-top: 4px; }
.nav-ap-label {
    display: flex; align-items: center; gap: 8px;
    font-size: 12px; color: var(--color-muted);
}
.nav-ap-label input {
    flex: 1; padding: 6px 10px;
    border: 1px solid var(--color-border); border-radius: var(--radius);
    font-size: 13px; font-family: inherit;
}
.nav-ap-row .nav-done-btn { margin-top: 10px; }

td.col-pct { white-space: nowrap; }
td.col-pct .pct-num { display: inline-block; min-width: 42px; font-weight: 600; }

/* Detail (podrobné) zobrazení */
.detail-list { padding: 0; }
.detail-section-header {
    background: var(--color-bg-section); color: var(--color-primary-dark);
    font-weight: 700; font-size: 14px; padding: 12px 16px;
    cursor: pointer; border-bottom: 1px solid var(--color-border);
}
.detail-section-header .section-pct { float: right; font-weight: 600; }
.detail-section-header .section-toggle { display: inline-block; width: 18px; }

.detail-card {
    border-bottom: 1px solid var(--color-border);
    padding: 14px 18px; cursor: pointer;
    page-break-inside: avoid; break-inside: avoid;
}
.detail-card:hover { background: #d4e8d9; }
.detail-card .dc-head {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 16px; margin-bottom: 10px;
}
.detail-card .dc-title { display: flex; align-items: center; gap: 10px; flex: 1; }
.detail-card .dc-title strong { font-size: 14px; }
.detail-card .dc-status { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.detail-card .dc-status .pct-num { font-weight: 600; }

.detail-card .dc-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 8px 18px; font-size: 13px; margin-top: 8px;
}
.detail-card .dc-grid > div { min-width: 0; }
.detail-card .dc-grid-eval {
    grid-template-columns: repeat(10, 1fr);
    background: var(--color-bg-alt); padding: 10px 12px;
    border-radius: var(--radius); border: 1px solid var(--color-border);
}
.detail-card .dc-grid-eval > div { grid-column: span 2; }
.detail-card .dc-wide { grid-column: span 2; }
.detail-card .dc-half { grid-column: span 5 !important; }
.detail-card .dc-fullrow { grid-column: 1 / -1 !important; }
.detail-card .dc-clip {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.detail-card .dc-label {
    font-size: 11px; color: var(--color-muted);
    text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 1px;
}

/* Modal */
[hidden] { display: none !important; }
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.5);
    display: flex; align-items: flex-start; justify-content: center;
    z-index: 100; padding: 40px 16px; overflow-y: auto;
}
.modal {
    background: white; border-radius: 8px;
    max-width: 720px; width: 100%; box-shadow: var(--shadow-md); overflow: hidden;
}
.modal.modal-wide { max-width: 1000px; }
.modal-head {
    padding: 14px 18px; border-bottom: 1px solid var(--color-border);
    display: flex; justify-content: space-between; align-items: center;
    background: var(--color-bg-alt);
}
.modal-head h2 { margin: 0; }
.modal-close { background: transparent; border: none; font-size: 22px; cursor: pointer; color: var(--color-muted); }
.modal-body { padding: 18px; }
.modal-foot {
    padding: 12px 18px; border-top: 1px solid var(--color-border);
    display: flex; justify-content: flex-end; gap: 8px; background: var(--color-bg-alt);
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid label { display: block; font-size: 12px; color: var(--color-muted); }
.form-grid label.required { color: #000; font-weight: 700; font-size: 13px; }
.form-grid label.required .req-mark { color: var(--color-danger); margin-left: 2px; }
.form-grid label.full { grid-column: 1 / -1; }
.form-grid input, .form-grid select, .form-grid textarea {
    width: 100%; padding: 8px 11px;
    border: 1px solid var(--color-border); border-radius: var(--radius);
    font-family: inherit; font-size: 14px; margin-top: 3px;
    background: white; color: var(--color-text);
}
.form-grid textarea { min-height: 60px; resize: vertical; }
.form-grid input:disabled, .form-grid select:disabled, .form-grid textarea:disabled {
    background: var(--color-bg-alt); color: var(--color-muted); cursor: not-allowed;
}
.form-grid label.field-locked { opacity: 0.55; }
.form-grid label.check-row {
    display: flex; align-items: center; gap: 10px;
    font-size: 14px; color: var(--color-text); font-weight: 600;
    margin-top: 4px;
}
.form-grid label.check-row input.big-check {
    width: 22px; height: 22px;
    margin: 0; padding: 0;
    accent-color: var(--color-primary);
    cursor: pointer; flex-shrink: 0;
}
.form-grid label.check-row span { user-select: none; }
.form-section {
    margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--color-border);
}
.form-section h3 {
    font-size: 13px; text-transform: uppercase; color: var(--color-muted);
    letter-spacing: 0.3px; margin-bottom: 10px;
}

/* Read-only box pro editora a readonly v detailu opatření – decentní */
.readonly-box {
    padding: 0; margin-bottom: 18px;
}
.readonly-h3 {
    margin: 0 0 8px; font-size: 13px;
    color: var(--color-muted); letter-spacing: 0.3px;
    text-transform: uppercase; font-weight: 600;
}
.readonly-title {
    font-size: 16px; font-weight: 700; color: var(--color-text);
    margin-bottom: 12px; line-height: 1.3;
}
.readonly-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 10px 16px; font-size: 13px;
}
.readonly-grid > div { min-width: 0; }
.readonly-grid .ro-fullrow { grid-column: 1 / -1; }
.readonly-grid .ro-label {
    font-size: 11px; color: var(--color-muted);
    text-transform: uppercase; letter-spacing: 0.4px;
    margin-bottom: 2px;
}

/* Auth */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--color-bg-alt); }
.auth-card {
    background: white; padding: 28px 32px; border-radius: 10px;
    box-shadow: var(--shadow-md); width: 100%; max-width: 400px;
}
.auth-card label { display: block; margin-bottom: 12px; font-size: 13px; color: var(--color-muted); }
.auth-card input {
    width: 100%; padding: 10px 12px;
    border: 1px solid var(--color-border); border-radius: var(--radius);
    font-size: 15px; margin-top: 4px; font-family: inherit;
}
.auth-card .btn { width: 100%; padding: 11px; margin-top: 8px; }
.alert { padding: 10px 12px; border-radius: var(--radius); margin-bottom: 14px; font-size: 14px; }
.alert-error { background: #fef2f2; color: var(--color-danger); border: 1px solid #fecaca; }
.alert-ok { background: #f0fdf4; color: var(--color-success); border: 1px solid #bbf7d0; }

/* Changelog */
.cl-filter-bar {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 12px; padding-bottom: 10px;
    border-bottom: 1px solid var(--color-border); gap: 12px; flex-wrap: wrap;
}
.cl-filter-buttons { display: flex; gap: 4px; }
.cl-filter.active {
    background: var(--color-primary); color: white; border-color: var(--color-primary);
}
.changelog-list { max-height: 60vh; overflow-y: auto; }
.changelog-item { padding: 10px 0; border-bottom: 1px solid var(--color-border); font-size: 13px; }
.changelog-item .cl-meta { color: var(--color-muted); font-size: 11px; margin-bottom: 2px; }
.changelog-item .cl-field { font-weight: 600; }
.changelog-item .cl-old { color: var(--color-danger); text-decoration: line-through; }
.changelog-item .cl-new { color: var(--color-success); }

/* User table */
.user-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.user-table th, .user-table td { padding: 8px; border-bottom: 1px solid var(--color-border); text-align: left; }

/* Footer */
.footer {
    margin-top: 50px; padding: 24px 0; text-align: center;
    color: var(--color-muted); font-size: 13px;
    border-top: 1px solid var(--color-border);
    display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.footer a { color: var(--color-primary); font-weight: 600; }
.footer-kreia { display: inline-block; }
.footer-kreia-logo { height: 56px; width: auto; display: block; }
.footer-text { font-size: 13px; }

/* Help modal content */
.help-content h3 { color: var(--color-primary-dark); margin-top: 16px; }
.help-content h3:first-child { margin-top: 0; }
.help-content ul { margin: 6px 0 12px; padding-left: 22px; }
.help-content li { margin-bottom: 4px; }

/* Print header */
.print-header { display: none; }

/* Print menu dropdown */
.print-menu-wrap { position: relative; display: inline-block; }
.print-menu {
    position: absolute; top: 100%; left: 0; margin-top: 4px;
    background: white; border: 1px solid var(--color-border);
    border-radius: var(--radius); box-shadow: var(--shadow-md);
    z-index: 30; min-width: 200px; padding: 4px;
}
.print-menu .print-opt {
    display: block; width: 100%; text-align: left;
    padding: 8px 12px; border: none; background: white;
    cursor: pointer; font-size: 14px; font-family: inherit;
    border-radius: 4px;
}
.print-menu .print-opt:hover { background: var(--color-bg-section); }

/* Scroll-to-top button */
.scroll-top-btn {
    position: fixed; bottom: 32px; right: 32px; z-index: 999;
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--color-primary-dark); color: white;
    border: none; font-size: 20px; font-weight: 700; line-height: 1;
    cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    opacity: 0; pointer-events: none;
    transition: opacity 0.25s, transform 0.25s, background 0.15s;
    transform: translateY(10px);
}
.scroll-top-btn.visible {
    opacity: 1; pointer-events: auto; transform: translateY(0);
}
.scroll-top-btn:hover { background: var(--color-primary); }

/* === Navigace mezi listy (Roční plán / Indikátory) === */
.hlavni-nav { display: flex; gap: 4px; }
.nav-list {
    display: inline-block; padding: 7px 14px; border-radius: var(--radius);
    font-size: 14px; font-weight: 600; color: var(--color-text); text-decoration: none;
    border: 1px solid transparent;
}
.nav-list:hover { background: var(--color-bg-alt); text-decoration: none; }
.nav-list.active { background: var(--color-primary); border-color: var(--color-primary); color: white; }


/* === Indikátory === */
.ind-section { background: white; border: 1px solid var(--color-border); border-radius: var(--radius); padding: 10px 16px; margin-bottom: 10px; box-shadow: var(--shadow-sm); }
.ind-section[hidden] { display: none; }
.ind-section .ind-block { border-top: none; margin-top: 0; padding-top: 0; }
.ind-section .ind-block-head h4 { font-size: 15px; text-transform: none; letter-spacing: 0; color: var(--color-primary-dark); }
.ind-section-note { margin: 0 0 8px; font-size: 12px; color: #4b5563; }

.ind-block { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--color-border); }
.ind-block-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; flex-wrap: wrap; }
.ind-block-head h4 { font-size: 11px; color: #4b5563; text-transform: uppercase; letter-spacing: 0.4px; margin: 0; }
.ind-block-head .ind-add { margin-left: auto; }
.ind-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

.ind-card { background: white; border: 1px solid var(--color-border); border-radius: 8px; padding: 8px 12px 6px; min-width: 0; }
.ind-card-link { cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; }
.ind-card-link:hover, .ind-card-link:focus-visible { border-color: var(--color-primary); box-shadow: var(--shadow-md); outline: none; }
.ind-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.ind-name { font-size: 14px; font-weight: 700; line-height: 1.3; }
.ind-status {
    flex-shrink: 0; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px;
    white-space: nowrap; text-transform: uppercase; letter-spacing: 0.3px;
}
.ind-status-ok { background: #dcfce7; color: #166534; }
.ind-status-bad { background: #fee2e2; color: #991b1b; }
.ind-status-wait { background: #f1f5f9; color: #475569; }
.ind-foot { font-size: 12px; color: #4b5563; margin-top: 2px; }
.ind-empty { padding: 10px 0; }

/* Posuvník: vlevo názvy pásů; nahoře cíle (▼), uprostřed osa, dole skutečnost (▲) */
.ind-slider {
    display: grid; grid-template-columns: 96px minmax(0, 1fr); grid-template-rows: 40px 10px 40px;
    align-items: center; column-gap: 4px; margin: 6px 0 4px;
}
.ind-lane-name { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.3px; white-space: nowrap; }
.ind-lane-name-top { color: #b45309; align-self: end; }
.ind-lane-name-bottom { color: var(--color-primary); align-self: start; }
.ind-lane { position: relative; height: 100%; margin: 0 30px; }
.ind-track { position: relative; height: 10px; margin: 0 30px; border-radius: 5px; background: #e5e7eb; }
.ind-lane-empty { position: absolute; left: 0; font-size: 10px; font-style: italic; }
.ind-lane-top .ind-lane-empty { bottom: 4px; }
.ind-lane-bottom .ind-lane-empty { top: 4px; }

.ind-mark {
    position: absolute; transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; white-space: nowrap; line-height: 1.1;
}
.ind-mark:hover { z-index: 2; }
.ind-mark-top { bottom: 0; }
.ind-mark-bottom { top: 0; flex-direction: column-reverse; }
.ind-mark::after { content: ''; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; order: 2; }
.ind-mark-top::after { border-top: 6px solid #f59e0b; }
.ind-mark-bottom::after { border-bottom: 6px solid var(--color-primary); }
.ind-mark-bottom.is-down::after { border-bottom-color: var(--color-danger); }
.ind-mark-lbl { order: 0; display: flex; flex-direction: column; align-items: center; padding: 1px 5px; border-radius: 4px; }
.ind-mark-lbl b { font-size: 12px; font-weight: 700; }
.ind-mark-lbl i { font-size: 10px; font-style: normal; opacity: 0.9; }
/* Cíl = obrys (plánováno), skutečnost = plná barva (naměřeno) */
.ind-mark-top .ind-mark-lbl { background: #fffbeb; border: 1px dashed #f59e0b; color: #92400e; }
.ind-mark-bottom .ind-mark-lbl { background: var(--color-primary); color: white; }
.ind-mark-bottom.is-down .ind-mark-lbl { background: var(--color-danger); }
.ind-mark::before { content: ''; order: 1; width: 1px; height: 0; }

/* Druhá úroveň popisků (když by se překrývaly) – popisek dál od osy, spojený čárkou */
.ind-slider.has-l2-top { grid-template-rows: 70px 10px 40px; }
.ind-slider.has-l2-bottom { grid-template-rows: 40px 10px 70px; }
.ind-slider.has-l2-top.has-l2-bottom { grid-template-rows: 70px 10px 70px; }
.ind-mark-l2::before { height: 30px; }
.ind-mark-top.ind-mark-l2::before { background: #f59e0b; }
.ind-mark-bottom.ind-mark-l2::before { background: var(--color-primary); }
.ind-mark-bottom.is-down.ind-mark-l2::before { background: var(--color-danger); }
.ind-mark-compact .ind-mark-lbl { display: none; }

/* Starší skutečnosti jsou tlumené, výrazná zůstává jen aktuální (poslední) hodnota */
.ind-mark-bottom:not(.is-past) { z-index: 1; }
.ind-mark-bottom.is-past .ind-mark-lbl { background: #e3efe6; color: var(--color-primary-dark); }
.ind-mark-bottom.is-past::after { border-bottom-color: #8fbf9b; }
.ind-mark-bottom.is-past.ind-mark-l2::before { background: #8fbf9b; }
.ind-mark-bottom.is-past.is-down .ind-mark-lbl { background: #fde8e8; color: #991b1b; }
.ind-mark-bottom.is-past.is-down::after { border-bottom-color: #eea5a5; }
.ind-mark-bottom.is-past.is-down.ind-mark-l2::before { background: #eea5a5; }

.ind-fill { position: absolute; top: 0; bottom: 0; border-radius: 5px; background: linear-gradient(90deg, #84cc16, #16a34a); }
.ind-fill-bad { background: linear-gradient(90deg, #f59e0b, #dc2626); }
.ind-tick { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; border-radius: 1px; background: #f59e0b; }
.ind-zone {
    position: absolute; top: 0; bottom: 0; right: 0; border-radius: 0 5px 5px 0;
    background: repeating-linear-gradient(45deg, rgba(245, 158, 11, 0.45) 0 4px, rgba(245, 158, 11, 0.12) 4px 8px);
}

/* Posuvník ANO / NE */
.ind-yn { margin: 8px 0 4px; }
.ind-yn-track {
    position: relative; display: grid; grid-template-columns: 1fr 1fr; height: 26px;
    border-radius: 13px; overflow: hidden; border: 1px solid var(--color-border);
}
.ind-yn-half {
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 800; letter-spacing: 0.5px; color: #9ca3af; background: #f3f4f6;
}
.ind-yn-no { border-right: 1px solid var(--color-border); }
.ind-yn.is-no .ind-yn-no { background: #fee2e2; color: #991b1b; }
.ind-yn.is-yes .ind-yn-yes { background: #dcfce7; color: #166534; }
.ind-yn-knob {
    position: absolute; top: 2px; width: 20px; height: 20px; border-radius: 50%;
    background: #1f2937; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transform: translateX(-50%); transition: left 0.25s;
}
.ind-yn.is-no .ind-yn-knob { left: 10%; }
.ind-yn.is-yes .ind-yn-knob { left: 90%; }
.ind-yn-meta { font-size: 12px; margin-top: 4px; }

/* Editor indikátoru */
.ind-preview { margin-bottom: 14px; }
.ind-preview .ind-card { background: var(--color-bg-alt); }
.ind-values { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 8px; }
.ind-values th, .ind-values td { padding: 5px 8px; border-bottom: 1px solid var(--color-border); text-align: left; }
.ind-values th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.3px; color: var(--color-muted); }
.ind-values th.th-target { color: #b45309; }
.ind-values th.th-actual { color: var(--color-primary); }
.ind-values input {
    width: 100%; max-width: 180px; padding: 5px 8px;
    border: 1px solid var(--color-border); border-radius: var(--radius); font: inherit;
}
.ind-base-row td { background: var(--color-bg-alt); }
.ind-rm-year { color: var(--color-danger); font-size: 18px; line-height: 1; }
.ind-yn-edit { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.ind-yn-edit label { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--color-muted); }
.ind-yn-edit select, .ind-yn-edit input {
    padding: 6px 8px; border: 1px solid var(--color-border); border-radius: var(--radius); font: inherit; min-width: 90px;
}
.ind-yn-switch { display: inline-flex; border: 1px solid var(--color-border); border-radius: 18px; overflow: hidden; }
.ind-yn-btn {
    border: none; background: #f3f4f6; color: #6b7280; padding: 7px 22px;
    font-family: inherit; font-weight: 800; cursor: pointer;
}
.ind-yn-btn[data-yn="0"].active { background: #fee2e2; color: #991b1b; }
.ind-yn-btn[data-yn="1"].active { background: #dcfce7; color: #166534; }
.ind-yn-btn:disabled { cursor: default; }

/* === Vize a globální cíl === */
.strategy-intro {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px;
    background: white; border: 1px solid var(--color-border); border-radius: var(--radius);
    padding: 12px 16px; margin-bottom: 10px; box-shadow: var(--shadow-sm);
}
.si-label {
    display: block; font-size: 11px; font-weight: 800; text-transform: uppercase;
    letter-spacing: 0.4px; color: var(--color-primary); margin-bottom: 2px;
}
.si-item p { margin: 0; font-size: 13.5px; line-height: 1.45; }
.ind-section-note { margin: 0 0 8px; font-size: 12px; color: #4b5563; }

/* === Panel s ročními úkoly (hlavička + filtry + tabulka drží pohromadě) === */
.plan-panel {
    background: white; border: 1px solid var(--color-border); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); margin-bottom: 10px; overflow: hidden;
}
.plan-panel-head {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
    flex-wrap: wrap; padding: 12px 16px 10px;
}
.plan-panel-title { font-size: 16px; margin: 0 0 2px; color: var(--color-primary-dark); }
.plan-panel-sub { margin: 0; max-width: 620px; }
.plan-panel-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* Tlačítka výstupů mají stejnou šířku i výšku, ať lišta drží rastr
   (odkaz <a> by jinak byl o pár pixelů vyšší než <button>) */
.plan-panel-actions .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 4px;
    min-width: 170px; min-height: 32px; line-height: 1.2;
    white-space: nowrap; text-align: center;
}
.tb-vystupy > .btn, .tb-vystupy > .print-menu-wrap { flex: 1 1 170px; }
.tb-vystupy .print-menu-wrap { display: flex; }
.tb-vystupy .print-menu-wrap > .btn { width: 100%; }

.toolbar {
    display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch;
    padding: 10px 16px; background: var(--color-bg-alt);
    border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border);
}
.tb-group {
    display: flex; gap: 6px; align-items: center; flex-wrap: wrap; min-width: 0;
    border: 1px solid transparent; border-radius: var(--radius); padding: 4px 8px 4px 6px; position: relative;
}
.tb-filters, .tb-sort { background: white; border-color: var(--color-border); }
.tb-filters { flex: 1 1 640px; }
.tb-sort { flex: 0 1 320px; }

/* Filtrační pole v mřížce se stejně širokými sloupci – řádky pak končí zarovnaně */
.tb-fields {
    flex: 1; min-width: 0; display: grid; gap: 6px;
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
}
/* .toolbar v selektoru kvůli přebití obecného max-width níže */
.toolbar .tb-fields > * { width: 100%; max-width: none; min-width: 0; }
.toolbar .tb-sort select { flex: 1; width: 100%; max-width: none; min-width: 0; }
.tb-label {
    font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--color-muted); align-self: center; padding-right: 4px;
}
.tb-filters.has-active, .tb-sort.has-active { border-color: var(--color-primary); background: #f3f8f4; }
.tb-filters.has-active .tb-label, .tb-sort.has-active .tb-label { color: var(--color-primary); }
.toolbar input, .toolbar select {
    padding: 6px 10px; border: 1px solid var(--color-border); border-radius: var(--radius);
    font-size: 13px; font-family: inherit; background: white; max-width: 200px;
}
.toolbar #filterText { min-width: 150px; }
.toolbar .btn-icon { align-self: center; flex: 0 0 auto; }
.btn-attention { border-color: var(--color-primary); color: var(--color-primary); font-weight: 700; }
.plan-panel .table-help { padding: 8px 16px 0; margin: 0; }
.plan-panel .table-wrap { border: none; box-shadow: none; border-radius: 0; }

/* Zvýraznění cíle skoku (z priority na úkoly a zpět na kartu cíle) */
.jump-flash { animation: jumpFlash 1.2s ease-out; }
@keyframes jumpFlash {
    0%, 40% { background-color: #fde68a; }
    100% { background-color: transparent; }
}
tr.sc-header-link { cursor: pointer; }
tr.sc-header-link:hover .sc-jump { text-decoration: underline; }
.sc-headbar {
    display: inline-block; vertical-align: middle; width: 120px; height: 7px;
    background: rgba(255,255,255,0.35); border-radius: 4px; overflow: hidden; margin: 0 8px;
}
.sc-headbar-fill { display: block; height: 100%; background: white; border-radius: 4px; }
.sc-headbar-fill.warn { background: var(--color-warning); }
.sc-headbar-fill.danger { background: #ffb3c0; }
.sc-jump { font-size: 11px; font-weight: 600; opacity: 0.9; margin-left: 10px; white-space: nowrap; }

/* Jednorázově zobrazené heslo */
.pass-reveal { display: flex; align-items: center; gap: 10px; margin: 10px 0; flex-wrap: wrap; }
.pass-reveal code {
    font-size: 20px; font-weight: 700; letter-spacing: 1px;
    background: var(--color-bg-alt); border: 1px dashed var(--color-primary);
    padding: 8px 14px; border-radius: var(--radius);
}
.u-flag {
    display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 8px;
    background: #fef3c7; color: #92400e; font-size: 10px; font-weight: 700; white-space: nowrap;
}
.u-actions { white-space: nowrap; }
.danger-zone {
    margin-top: 20px; padding: 12px 14px;
    border: 1px solid #e7b3bd; border-radius: var(--radius); background: #fdf7f8;
}
.danger-zone h3 { margin-top: 0; color: var(--color-danger); }

/* Plovoucí tlačítko „nahoru" nesmí překážet v otevřeném okně */
body.modal-open .scroll-top-btn { display: none; }

@media (max-width: 600px) {
    .topbar-inner { padding: 8px 16px; gap: 6px; }
    .topbar-right { justify-content: flex-start; gap: 6px 10px; }
    .dash-hero-right { flex-direction: column; gap: 4px; padding: 10px 16px; }
    .gauge-title { font-size: 18px; text-align: center; }
    .gauge-big-holder { width: 100%; max-width: 260px; }
    /* Posuvník: místo popisků pásů jen šipky, ať zbude šířka pro osu */
    .ind-slider { grid-template-columns: 14px minmax(0, 1fr); }
    .ind-lane-txt { display: none; }
    .ind-lane, .ind-track { margin: 0 24px; }
    .ind-card { padding: 8px 10px 6px; }
    .ind-block-head .ind-add { margin-left: 0; }

    /* Tabulka úkolů se na mobilu skládá do karet – žádné vodorovné posouvání */
    .plan-panel-head { padding: 10px 12px 8px; }
    .toolbar { padding: 8px 12px; }
    .tb-group { flex: 1 1 100%; min-width: 0; }
    .toolbar input, .toolbar select { max-width: none; width: 100%; flex: 0 0 auto; min-width: 0; }
    .tb-filters, .tb-sort { flex: 1 1 100%; }
    .tb-fields { grid-template-columns: 1fr; }
    .toolbar .btn-icon { flex: 0 0 auto; width: auto; }
    table.plan, table.plan tbody, table.plan tr, table.plan td { display: block; width: auto; }
    table.plan thead { display: none; }
    table.plan tr.row {
        border: 1px solid var(--color-border); border-radius: 8px;
        margin: 8px 12px; padding: 8px 10px; background: white;
    }
    table.plan tr.row.row-odd { background: var(--color-bg-alt); }
    table.plan tr.row td { border: none; padding: 2px 0; }
    table.plan tr.row td[data-label] { display: flex; justify-content: space-between; gap: 12px; }
    table.plan tr.row td[data-label]::before {
        content: attr(data-label); flex: 0 0 auto;
        font-size: 11px; text-transform: uppercase; letter-spacing: 0.3px; color: var(--color-muted);
    }
    table.plan tr.row td.col-pct { align-items: center; flex-wrap: wrap; }
    table.plan tr.row td.col-pct .cell-sub { flex: 1 0 100%; text-align: right; margin-top: 0; }
    table.plan tr.sc-header td, table.plan tr.section-header td { display: block; }
    .sc-headbar { width: 70px; }
    .sc-jump { display: none; }
}

/* PRINT */
@media print {
    @page { size: A4 landscape; margin: 10mm 10mm 12mm 10mm; }
    html, body { background: white !important; font-size: 10pt; color: #000; }
    .no-print { display: none !important; }
    .chart-tooltip, .modal-overlay { display: none !important; }

    /* Vynutit barvy ve všech dotčených prvcích */
    *, *::before, *::after {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    /* Container bez okrajů */
    .container { padding: 0; max-width: none; }
    .table-wrap { box-shadow: none; border: none; }

    /* === REŽIMY TISKU === */
    body.print-mode-dashboard .table-wrap,
    body.print-mode-dashboard .print-header,
    body.print-mode-dashboard .footer { display: none !important; }
    body.print-mode-opatreni .dash-hero,
    body.print-mode-opatreni .ind-section,
    body.print-mode-opatreni .sc-gauges { display: none !important; }

    /* Indikátory – karta se nedělí mezi stránky; sekce s cíli smí přetéct na další list */
    .ind-section { padding: 3mm 5mm; box-shadow: none !important; border: 1px solid #ccc; }
    .ind-card { page-break-inside: avoid; break-inside: avoid; }
    body .sc-gauges, body.print-mode-dashboard .sc-gauges { page-break-inside: auto !important; }
    .sc-gauge-card { page-break-inside: avoid; break-inside: avoid; }

    /* V „all" módu: po dashboardu nová stránka, karty pak začnou čistě 4 na list */
    body.print-mode-all .sc-gauges {
        page-break-after: always !important;
        break-after: page !important;
    }

    /* === DASHBOARD V TISKU === */
    .dash-hero { gap: 18px; margin-bottom: 6mm; padding: 0; page-break-inside: avoid; }
    .dash-title { font-size: 18pt; }
    .dash-sub { font-size: 10pt; margin-bottom: 4mm; }
    .dash-stats { gap: 24px; }
    .dash-stats .stat-num { font-size: 18pt; }
    .dash-stats .stat-lbl { font-size: 8pt; }
    .dash-hero-right { flex-direction: row; box-shadow: none !important; }
    .gauge-title { font-size: 12pt; position: static; max-width: none; }
    .gauge-big-holder { width: 60mm; }

    .sc-gauges { padding: 4mm 5mm; box-shadow: none !important; border: 1px solid #ccc; page-break-inside: avoid; }
    .sc-gauges h2 { font-size: 12pt; }
    .sc-gauges-grid { gap: 4mm; }
    .sc-gauge-card { padding: 3mm; cursor: default; background: white !important; }
    .sc-gauge-card.open { background: white !important; }
    .sc-gauge-card .sc-expand-btn { display: none; }
    .sc-gauge-card .sc-priorities { display: none !important; }
    .sc-gauge-title .sc-code { font-size: 11pt; }
    .sc-gauge-title .sc-short { font-size: 7pt; }

    /* Solo dashboard – větší tachometry */
    body.print-mode-dashboard .dash-title { font-size: 22pt; }
    body.print-mode-dashboard .gauge-big-holder { width: 80mm; }
    body.print-mode-dashboard .sc-gauge-card { padding: 4mm; }

    /* === HLAVIČKA STRÁNKY (kompaktní, ať zbude místo) === */
    .print-header {
        display: flex; justify-content: space-between; align-items: baseline;
        margin-bottom: 2mm; padding-bottom: 1mm; border-bottom: 1.5px solid var(--color-primary);
    }
    .print-header h1 { font-size: 10pt; margin: 0; color: var(--color-primary-dark); font-weight: 700; }
    .print-header > div { font-size: 7.5pt; color: #555; }

    /* === DASHBOARD (kompaktní pro „all") === */
    .dashboard {
        display: grid !important;
        grid-template-columns: 2fr 1fr 1fr 1fr;
        gap: 3mm; margin-bottom: 3mm;
        page-break-inside: avoid;
    }
    .dash-card {
        padding: 2.5mm 4mm; box-shadow: none !important;
        border: 1px solid #ccc; border-radius: 3px; background: white;
    }
    .dash-main { background: var(--color-primary) !important; color: white !important; border: none; }
    .dash-main .dash-label { color: rgba(255,255,255,0.9) !important; }
    .dash-main .dash-value { color: white !important; }
    .dash-label {
        font-size: 6.5pt; text-transform: uppercase; letter-spacing: 0.3px;
        color: #666; margin: 0;
    }
    .dash-value { font-size: 14pt; margin-top: 1mm; line-height: 1.1; font-weight: 700; }
    .progress { height: 5px !important; background: #e5e7eb; border-radius: 3px; overflow: hidden; }
    .progress-bar { background: var(--color-success); }
    .progress-bar.warn { background: var(--color-warning); }
    .progress-bar.danger { background: var(--color-danger); }

    /* === SOUHRN PLNĚNÍ – GRAF === */
    .dashboard-sections {
        margin-bottom: 3mm; padding: 3mm 5mm; box-shadow: none !important;
        border: 1px solid #ccc; border-radius: 3px; background: white;
        page-break-inside: avoid;
    }
    .dashboard-sections h2 { font-size: 10pt; margin: 0 0 2mm; color: var(--color-primary-dark); }
    .ds-head { display: block !important; margin-bottom: 2mm !important; }
    .chart-mode-print { font-weight: 400; font-size: 8pt; color: #555; }
    .chart-holder {
        height: 55mm !important; overflow: visible !important;
        page-break-inside: avoid; padding: 0;
    }
    .bar-chart {
        height: 55mm !important; width: 100% !important;
        max-width: 100% !important;
    }
    .bar-chart .axis-text { font-size: 8px; fill: #555; }
    .bar-chart .bar-label { font-size: 9px; font-weight: 600; fill: #000; }
    .bar-chart .bar-cat-label { font-size: 9px; fill: #000; }
    .bar-chart .grid-line { stroke: #ddd; }
    .bar-chart .axis-line { stroke: #999; }
    .bar-chart .bar-frame { fill: #f5f5f5; stroke: #ccc; }

    /* === SOLO DASHBOARD – přesně 1× A4 landscape === */
    body.print-mode-dashboard {
        /* zabránit jakémukoli zalomení uvnitř dashboardu */
    }
    body.print-mode-dashboard .container > * { page-break-inside: avoid !important; }
    body.print-mode-dashboard .dashboard {
        margin-bottom: 4mm; gap: 4mm;
        page-break-after: avoid !important;
    }
    body.print-mode-dashboard .dash-card { padding: 4mm 6mm; }
    body.print-mode-dashboard .dash-label { font-size: 9pt; }
    body.print-mode-dashboard .dash-value { font-size: 22pt; margin-top: 1mm; }
    body.print-mode-dashboard .progress { height: 8px !important; }

    body.print-mode-dashboard .dashboard-sections {
        padding: 3mm 5mm; margin-bottom: 0;
        page-break-after: avoid !important; break-after: avoid !important;
    }
    body.print-mode-dashboard .dashboard-sections h2 { font-size: 13pt; margin-bottom: 2mm; }
    body.print-mode-dashboard .chart-mode-print { font-size: 11pt; }
    body.print-mode-dashboard .chart-holder { height: 110mm !important; }
    body.print-mode-dashboard .bar-chart { height: 110mm !important; }
    body.print-mode-dashboard .bar-chart .axis-text { font-size: 10px; }
    body.print-mode-dashboard .bar-chart .bar-label { font-size: 12px; font-weight: 700; }
    body.print-mode-dashboard .bar-chart .bar-cat-label { font-size: 11px; }

    /* === KOMPAKTNÍ TABULKA === */
    table.plan { font-size: 9pt; border-collapse: collapse; }
    table.plan thead { display: table-header-group; }
    table.plan tbody { display: table-row-group; }
    table.plan th {
        background: var(--color-primary) !important; color: white !important;
        padding: 4px 6px; font-size: 8pt;
        position: static !important; border-bottom: 1px solid #999;
    }
    table.plan td {
        padding: 3px 6px; vertical-align: top;
        border-bottom: 1px solid #e5e7eb;
    }
    tr.section-header td {
        background: var(--color-bg-section) !important;
        color: var(--color-primary-dark) !important;
        font-weight: 700; font-size: 9pt; padding: 5px 6px;
    }
    tr.row-odd td { background: #f7f9fc !important; }
    tr.row:hover td { background: inherit !important; }
    tr { page-break-inside: avoid; }

    /* === BADGE A INDIKÁTORY === */
    .priorita-badge {
        width: 14px; height: 14px; line-height: 14px;
        font-size: 8pt; display: inline-block;
    }
    .priorita-1 { background: var(--color-danger) !important; color: white !important; }
    .priorita-2 { background: var(--color-warning) !important; color: white !important; }
    .priorita-3 { background: #6b7280 !important; color: white !important; }
    .done-badge {
        background: var(--color-success) !important; color: white !important;
        padding: 1px 6px; font-size: 7.5pt;
    }
    .empty-val { color: #ccc !important; }

    /* === PODROBNÉ ZOBRAZENÍ – KARTY (40mm × 4 = 160mm + sekce + hlavička stránky) === */
    .detail-section-header {
        font-size: 8.5pt; padding: 1.5mm 3mm;
        background: var(--color-bg-section) !important;
        color: var(--color-primary-dark) !important;
        page-break-after: avoid !important; break-after: avoid !important;
        border-bottom: 1px solid var(--color-primary);
    }
    .detail-section-header .section-pct { float: right; }
    .detail-list { display: block; }
    .detail-card {
        page-break-inside: avoid !important; break-inside: avoid !important;
        height: 40mm; max-height: 40mm; overflow: hidden;
        padding: 1.5mm 3mm; font-size: 7pt; box-sizing: border-box;
        border-bottom: 1px solid #ddd; background: white;
    }
    .detail-card:hover { background: white !important; }
    .detail-card .dc-head { margin-bottom: 1mm; gap: 4mm; align-items: center; display: flex; }
    .detail-card .dc-title { gap: 5px; flex: 1; min-width: 0; }
    .detail-card .dc-title strong {
        font-size: 8.5pt; line-height: 1.15;
        display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
        overflow: hidden; text-overflow: ellipsis;
    }
    .detail-card .dc-status { gap: 5px; flex-shrink: 0; }
    .detail-card .dc-status .pct-num { font-size: 9pt; font-weight: 700; }
    .detail-card .dc-status .progress-mini { width: 40px !important; height: 4px; }

    /* 4 sloupce v gridu = méně řádků na výšku */
    .detail-card .dc-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 0.5mm 3mm; font-size: 6.5pt; margin-top: 0.5mm;
    }
    .detail-card .dc-label {
        font-size: 5.5pt; margin-bottom: 0; line-height: 1.1;
        text-transform: uppercase; letter-spacing: 0.2px; color: #777;
    }
    .detail-card .dc-grid > div { grid-column: span 1 !important; }
    .detail-card .dc-wide { grid-column: span 2 !important; }
    .detail-card .dc-half { grid-column: span 2 !important; }
    .detail-card .dc-fullrow { grid-column: 1 / -1 !important; }
    .detail-card .dc-grid-eval {
        padding: 1mm 1.5mm; margin-top: 1mm;
        background: #fafbfc !important;
        border: 1px solid #e5e7eb; border-radius: 2px;
    }
    /* Ořez dlouhých textů na 1-2 řádky s tečkami */
    .detail-card .dc-grid > div > div:last-child:not(.dc-clip) {
        overflow: hidden; line-height: 1.15;
        display: -webkit-box;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        text-overflow: ellipsis;
    }
    .detail-card .dc-clip {
        overflow: hidden; line-height: 1.15;
        display: -webkit-box;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        text-overflow: ellipsis;
    }
    /* Spolupráce a poznámka k obsahu (dc-wide / dc-fullrow) – povolit 2 řádky */
    .detail-card .dc-wide > div:last-child,
    .detail-card .dc-fullrow > div:last-child {
        -webkit-line-clamp: 2 !important;
    }

    /* === PAGE-BREAK PRO KARTY (jednotná logika 4 na list) === */
    .detail-card.print-break,
    .detail-section-header.print-break-header {
        page-break-before: always !important; break-before: page !important;
    }

    /* === PATIČKA === */
    .footer {
        display: flex !important; flex-direction: column; align-items: center; gap: 2mm;
        padding: 2mm 0 0; margin-top: 4mm;
        font-size: 8pt;
        border-top: 1px solid #ccc; color: #555;
    }
    .footer-kreia-logo { height: 12mm !important; width: auto !important; }
    .footer a { color: var(--color-primary-dark) !important; font-weight: 600; text-decoration: none; }
}

@media (max-width: 1100px) {
    .sc-gauges-grid { grid-template-columns: repeat(2, 1fr); }
    .sc-gauge-card.open { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
    .form-grid { grid-template-columns: 1fr; }
    .topbar-inner { flex-direction: column; align-items: flex-start; }
    .dash-hero { flex-direction: column; }
    /* Na úzké obrazovce by absolutně umístěný nadpis překryl tachometr */
    .dash-hero-right { align-self: stretch; }
    .gauge-title { position: static; max-width: none; }
    .dash-title { font-size: 24px; }
    .sc-gauges-grid { grid-template-columns: 1fr; }
    .ind-grid { grid-template-columns: 1fr; }
}

/* === Stavy aktivit === */
.stav-badge {
    display: inline-block; padding: 2px 8px; border-radius: 10px;
    font-size: 11px; font-weight: 700; white-space: nowrap;
}
.stav-aktivni { background: #dbeafe; color: #1e40af; }
.stav-nezahajena { background: #f1f5f9; color: #475569; }
.stav-zrusena { background: #e5e7eb; color: #4b5563; text-decoration: line-through; }
tr.row-zrusena td, .detail-card.row-zrusena { opacity: 0.55; }
.stav-bar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 8px 10px; margin-bottom: 12px;
    background: var(--color-bg-alt); border: 1px solid var(--color-border); border-radius: var(--radius);
}
.stav-bar-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--color-muted); }

/* Sekundární priority u aktivity */
.sek-prio {
    display: inline-block; padding: 0 6px; margin-left: 2px; border-radius: 8px;
    background: #eef2f7; color: #475569; font-weight: 700; font-size: 10.5px;
}

/* Výběr sekundárních priorit v detailu aktivity */
.sek-editor {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px;
    max-height: 190px; overflow-y: auto; padding: 8px;
    border: 1px solid var(--color-border); border-radius: var(--radius); background: white;
}
.sek-group-title {
    display: block; font-size: 10px; font-weight: 800; text-transform: uppercase;
    letter-spacing: 0.4px; color: var(--color-primary); margin-bottom: 2px;
}
.sek-item { display: flex; align-items: flex-start; gap: 6px; font-size: 12.5px; color: var(--color-text); }
.sek-item input { margin-top: 3px; }

/* Číselník strategie a oprávnění v Administraci */
.st-add { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.st-add input, .st-add select {
    padding: 6px 8px; border: 1px solid var(--color-border); border-radius: var(--radius); font: inherit;
}
.st-add input:not([style]) { flex: 1 1 220px; }
tr.st-sc-row td {
    background: var(--color-bg-section); color: var(--color-primary-dark);
    font-weight: 700; font-size: 12px;
}
.pravo-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13.5px; }

/* Priority a indikátory na listu Indikátory */
.sc-ind-section h2 { font-size: 16px; color: var(--color-primary-dark); margin-bottom: 6px; }
.sc-prio-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 4px 14px; margin-bottom: 10px; }
.sc-prio-item { font-size: 13px; padding: 3px 0; border-bottom: 1px dashed var(--color-border); }
.sc-prio-item strong { color: var(--color-primary-dark); margin-right: 4px; }

/* ======================================================================
   Životní cyklus aktivit, kvantifikované cíle a čerpání rozpočtu
   ====================================================================== */

/* Doplňkový řádek v buňce – „10,5 z 25 km" pod ukazatelem plnění */
.cell-sub { font-size: 11px; color: var(--color-muted); margin-top: 3px; }

/* Zbývající dny do termínu */
.dny { display: inline-block; font-weight: 600; font-size: 13px; white-space: nowrap; }
.dny-ok { color: var(--color-success); }
.dny-po { color: var(--color-danger); }

/* Vyčerpání finančního plánu */
.fin { display: inline-block; font-weight: 700; font-size: 13px; white-space: nowrap; }
.fin-ok { color: var(--color-success); }
.fin-nad { color: var(--color-danger); }

/* Fajfka u ukončené aktivity – barva podle dosaženého plnění */
.fajfka { font-size: 20px; font-weight: 700; line-height: 1; }
.fajfka-ok { color: var(--color-success); }
.fajfka-warn { color: #d99100; }
.fajfka-bad { color: var(--color-danger); }

/* Vykřičník u aktivity po termínu */
.po-terminu-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; margin-left: 4px; vertical-align: 1px;
    background: var(--color-danger); color: white;
    border-radius: 50%; font-size: 12px; font-weight: 700; cursor: help;
}
.po-terminu-text { color: var(--color-danger); font-weight: 600; font-size: 13px; }
table.plan tr.row-po-terminu td:first-child { box-shadow: inset 3px 0 0 var(--color-danger); }

/* Malá tlačítka START / Ukončit přímo v řádku tabulky */
.btn-mini {
    border: 1px solid var(--color-border); background: white; color: var(--color-text);
    border-radius: var(--radius); padding: 4px 8px;
    font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn-mini:hover { background: var(--color-bg-alt); }
.btn-mini:disabled { opacity: 0.5; cursor: default; }
.btn-mini-start { border-color: var(--color-primary); color: var(--color-primary); }
.btn-mini-start:hover { background: var(--color-primary); color: white; }
.btn-mini-done { border-color: var(--color-success); color: var(--color-success); }
.btn-mini-done:hover { background: var(--color-success); color: white; }

/* Souhrn nad historií zápisů (postup / čerpání) */
.kv-souhrn { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.kv-souhrn .kv-cisla { font-size: 14px; white-space: nowrap; }
.kv-souhrn .progress { flex: 1 1 140px; min-width: 120px; }
.kv-souhrn .pct-num { font-weight: 700; white-space: nowrap; }

/* Tabulka jednotlivých zápisů */
table.zapisy { width: 100%; border-collapse: collapse; font-size: 13px; }
table.zapisy td { padding: 5px 8px; border-bottom: 1px solid var(--color-border); vertical-align: top; }
table.zapisy tr:last-child td { border-bottom: none; }
table.zapisy td.num { text-align: right; font-weight: 600; white-space: nowrap; }
table.zapisy td.zap-x { width: 28px; text-align: right; }
.btn-x {
    border: none; background: none; color: var(--color-muted);
    font-size: 16px; line-height: 1; cursor: pointer; padding: 0 2px;
}
.btn-x:hover { color: var(--color-danger); }

/* Řádek pro přidání zápisu */
.zap-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.zap-add input { padding: 6px 8px; border: 1px solid var(--color-border); border-radius: var(--radius); font: inherit; font-size: 13px; }
.zap-add input[type=date] { flex: 0 0 150px; }
.zap-add input[type=number] { flex: 0 0 130px; }
.zap-add input[type=text] { flex: 1 1 160px; min-width: 120px; }

/* Obsah jen pro tisk (na obrazovce skrytý) */
.print-only { display: none; }

/* Informace místo ručního hodnocení u kvantifikované aktivity */
.kvant-info {
    background: var(--color-bg-alt); border: 1px solid var(--color-border);
    border-radius: var(--radius); padding: 8px 10px; font-size: 14px;
}

/* „Vyhodnoceno za rok" na kartě strategického cíle */
.sc-rok {
    display: block; margin-top: 1px;
    font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px;
    color: var(--color-muted);
}

@media (max-width: 600px) {
    /* V kartovém zobrazení tabulky patří i nové sloupce na jeden řádek */
    table.plan tr.row td.col-dny, table.plan tr.row td.col-fin,
    table.plan tr.row td.col-stav { align-items: center; }
    /* Ve flexu karty by ukazatel plnění měl nulovou šířku – dát mu pevný pruh */
    table.plan tr.row td.col-pct .progress-mini { flex: 0 0 72px; align-self: center; }
    .zap-add input[type=date], .zap-add input[type=number] { flex: 1 1 100px; }
}

@media print {
    .btn-mini, .btn-x, .zap-add { display: none !important; }
    .print-only { display: inline !important; }
    .dny-po, .fin-nad, .po-terminu-mark, .po-terminu-text { color: #000 !important; }
    .po-terminu-mark { background: #000 !important; color: #fff !important; }
}
