:root {
    --kodys-blue: #002D62;
    --kodys-yellow: #FFC40C;
    --kodys-grey: #55565A;
    --bg-panel: #ffffff;
    --border-soft: #E3E5E8;
    --text-main: #002D62;
    --text-soft: #55565A;
    --primary: #002D62;
    --primary-dark: #001F47;
    --shadow-md: 0 2px 8px rgba(0, 45, 98, 0.08);
    --shadow-lg: 0 6px 20px rgba(0, 45, 98, 0.12);
}

html, body {
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
    color: var(--text-soft);
    background: #F4F5F7;
}

a, .btn-link {
    color: var(--primary);
}

h1, h2, h3, h4 {
    margin: 0;
    font-weight: 700;
}

label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
    color: var(--text-soft);
}

.required-label {
    font-weight: 800;
    color: var(--text-main);
}

.required-label::after {
    content: " *";
    color: #dc2626;
    font-weight: 800;
}

/* Zvýraznění polí předvyplněných importem leadu z e-mailu — světle zelené pastelové
   podbarvení. Mizí, jakmile uživatel pole sám upraví (třída se odebere v code-behind).
   Záměrně nižší priorita než invalid stav — chybové podbarvení má přednost (je v souboru níže). */
.form-control.imported-field,
.form-select.imported-field {
    background: rgba(236, 253, 245, 0.96);
    border-color: rgba(16, 185, 129, 0.5);
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.14), 0 0 0 3px rgba(16, 185, 129, 0.07);
}

.detail-side-card .form-grid > div:has(.imported-field) > label {
    color: #047857;
}

.form-control.invalid,
.form-select.invalid,
.form-control.input-validation-error,
.form-select.input-validation-error,
.form-control.modified.invalid,
.form-select.modified.invalid,
input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
    border-color: #dc2626;
    background: rgba(255, 245, 245, 0.96);
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.16), 0 0 0 3px rgba(220, 38, 38, 0.08);
}

.detail-side-card .form-grid > div:has(input[aria-invalid="true"]),
.detail-side-card .form-grid > div:has(select[aria-invalid="true"]),
.detail-side-card .form-grid > div:has(textarea[aria-invalid="true"]),
.detail-side-card .form-grid > div:has(.form-control.invalid),
.detail-side-card .form-grid > div:has(.form-select.invalid),
.detail-side-card .form-grid > div:has(.input-validation-error) {
    background: rgba(254, 242, 242, 0.92);
    border: 1px solid rgba(220, 38, 38, 0.18);
    border-radius: 6px;
    padding: 0.8rem 0.85rem;
    margin: -0.1rem;
}

.page-panel,
.hero-panel,
.metric-card,
.project-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-soft);
    box-shadow: none;
}

.page-panel,
.project-card {
    border-radius: 8px;
    padding: 1.15rem;
}

/* Spacing mezi panely stohovanými za sebou (mimo grid kontejner) */
.page-panel,
.page-panel + .project-card,
.project-card + .page-panel,
.project-card + .project-card,
.hero-panel + .page-panel,
.hero-panel + .project-card {
    margin-top: 1rem;
}

.hero-panel {
    border-radius: 8px;
    padding: 1.45rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.detail-hero {
    padding: 1.25rem 1.35rem;
    background: #002D62;
    color: white;
}

.detail-hero .muted,
.detail-hero .section-eyebrow {
    color: rgba(219, 234, 254, 0.86);
}

.detail-hero .status-pill {
    background: rgba(255, 255, 255, 0.16);
    color: white;
}

.detail-hero-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.detail-hero-head h1 {
    font-size: 1.7rem;
    margin-bottom: 0.35rem;
}

.detail-hero-copy {
    min-width: 220px;
}

.detail-metrics {
    min-width: 0;
    margin-bottom: 0;
}

.detail-metrics-wide {
    width: 100%;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.detail-hero .metric-card {
    background: #ffffff;
    border: 2px solid rgba(255, 196, 12, 0.55);
    border-radius: 5px;
    box-shadow: none;
    color: var(--text-main);
}

.detail-hero .metric-card span {
    color: var(--text-soft);
}

.detail-hero .metric-card strong {
    color: var(--text-main);
    font-size: 1.05rem;
}

.detail-stage-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 0.75rem;
    margin-top: 1.15rem;
}

.detail-stage-node {
    display: grid;
    gap: 0.45rem;
}

.detail-stage-bar {
    display: block;
    width: 100%;
    height: 0.4rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.6);
    box-shadow: none;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.detail-stage-node.active .detail-stage-bar {
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.95), rgba(34, 197, 94, 0.92));
}

.detail-stage-node.lost .detail-stage-bar {
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.98), rgba(0, 0, 0, 0.96));
}

.detail-stage-node.lost.active .detail-stage-bar,
.detail-stage-node.lost.current .detail-stage-bar {
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.98), rgba(0, 0, 0, 0.96));
}

.detail-stage-node.current .detail-stage-bar {
    box-shadow: 0 0 0 2px rgba(187, 247, 208, 0.14), 0 10px 22px rgba(22, 101, 52, 0.22);
    transform: translateY(-1px);
}

.detail-stage-label {
    color: rgba(219, 234, 254, 0.82);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.detail-stage-node.active .detail-stage-label,
.detail-stage-node.current .detail-stage-label {
    color: #f8fafc;
}

.hero-panel p,
.muted {
    color: var(--text-soft);
}

.hero-actions,
.button-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.inline-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.detail-command-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.hero-command-bar {
    align-items: stretch;
    gap: 0.65rem;
    margin-left: auto;
    justify-content: flex-end;
    flex-wrap: wrap;
    max-width: 100%;
}

.detail-hero .hero-action-button {
    min-height: 3rem;
    border: 1px solid rgba(191, 219, 254, 0.24);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.2), rgba(30, 41, 59, 0.14));
    color: white;
    box-shadow: none;
    backdrop-filter: blur(12px);
    white-space: nowrap;
}

.detail-hero .hero-action-button:hover {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.28), rgba(14, 116, 144, 0.18));
    border-color: rgba(219, 234, 254, 0.3);
}

.detail-hero .hero-action-danger {
    border-color: rgba(254, 202, 202, 0.22);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.24), rgba(220, 38, 38, 0.16));
}

.action-message {
    padding: 0.65rem 0.95rem;
    border-radius: 4px;
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.16);
    color: var(--primary-dark);
    font-weight: 700;
}

.primary-button,
.secondary-button,
button.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 4px;
    padding: 0.66rem 0.95rem;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.92rem;
    line-height: 1.15;
    white-space: nowrap;
}

.primary-button,
button.primary-button {
    background: #002D62;
    color: white;
    box-shadow: none;
}

.secondary-button {
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary);
}

.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0px solid rgba(37, 99, 235, 0.18);
    border-radius: 4px;
    padding: 0.66rem 0.95rem;
    background: rgba(255, 255, 255, 0.72);
    color: var(--primary-dark);
    font-weight: 700;
    line-height: 1.15;
    font-size: 0.92rem;
}

.ghost-button.danger-outline {
    border-color: rgba(220, 38, 38, 0.18);
    color: #b91c1c;
}

.mini-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(37, 99, 235, 0.16);
    border-radius: 4px;
    padding: 0.42rem 0.7rem;
    background: rgba(255, 255, 255, 0.78);
    color: var(--primary-dark);
    font-size: 0.78rem;
    font-weight: 700;
}

.mini-button.danger {
    border-color: rgba(220, 38, 38, 0.2);
    color: #b91c1c;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
    gap: 0.65rem;
    margin-bottom: 0.85rem;
}

.metric-grid.compact {
    grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
}

.metric-card {
    border-radius: 8px;
    padding: 0.75rem 0.85rem;
    min-height: 0;
}

.metric-card span {
    display: block;
    color: var(--text-soft);
    margin-bottom: 0.25rem;
    font-size: 0.72rem;
    line-height: 1.2;
}

.metric-card strong {
    font-size: 1.08rem;
    line-height: 1.1;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.content-grid.single-column-top {
    grid-template-columns: 1fr;
}

.detail-workspace {
    display: grid;
    gap: 1.2rem;
}

.detail-two-column {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.8fr);
    gap: 1rem;
    align-items: start;
}

.module-opportunities .detail-two-column {
    grid-template-columns: minmax(0, 1fr);
}

.module-opportunities .detail-hero-head {
    flex-wrap: wrap;
}

.module-opportunities .detail-command-bar {
    max-width: 100%;
}

.module-opportunities .detail-workspace {
    max-width: 100%;
}

.module-opportunities .detail-side-panel {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.detail-field-stack {
    display: grid;
    gap: 0.8rem;
}

.detail-side-panel {
    display: grid;
    gap: 0.9rem;
    align-content: start;
    min-width: 0;
}

.detail-side-card {
    display: grid;
    gap: 0.9rem;
    padding: 0.85rem;
    border-radius: 8px;
    background: rgba(244, 249, 255, 0.78);
    border: 1px solid rgba(126, 164, 213, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
    min-width: 0;
}

.detail-side-card .panel-header.small {
    align-items: flex-start;
}

.contract-summary-card {
    border-color: var(--border-soft);
    background: #ffffff;
}

.form-readonly {
    min-height: 2.9rem;
    display: flex;
    align-items: center;
    padding: 0.65rem 0.8rem;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(248, 250, 252, 0.96);
    color: var(--ink-900);
    font-weight: 600;
}

.multiline-readonly {
    min-height: 5.5rem;
    align-items: flex-start;
    white-space: pre-wrap;
}

.side-card-button {
    border: 1px solid var(--border-soft);
    background: #ffffff;
    color: var(--primary-dark);
    white-space: nowrap;
}

.detail-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.section-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: #6a8ab2;
    font-size: 0.68rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

/* Nadpis sekce s doplňkovým textem napravo (např. „Vzniklo z leadu …" u nadpisu Detail příležitosti). */
.detail-section-title-row {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.detail-section-origin {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-soft);
}

.detail-section-origin a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}

.panel-header.small {
    margin-bottom: 0.65rem;
}

/* Barevné proužky modulů — jen na přehledové kartě s modrým záhlavím (:has h1) */
    .page-panel.module-leads:has(> .panel-header h1) {
        border-top: 15px solid #4d7c0f;
        background: var(--kodys-blue);
        margin-top:0px;
    }

.page-panel.module-opportunities:has(> .panel-header h1) {
    border-top: 15px solid #c2410c;
    background: var(--kodys-blue);
    margin-top: 0px;
}

.page-panel.module-business-cases:has(> .panel-header h1) {
    border-top: 15px solid #be185d;
    background: var(--kodys-blue);
    margin-top: 0px;
}

.page-panel.module-contracts:has(> .panel-header h1) {
    border-top: 15px solid #0f766e;
    background: var(--kodys-blue);
    margin-top: 0px;
}

.page-panel.module-activities:has(> .panel-header h1) {
    border-top: 15px solid #0284c7;
    background: var(--kodys-blue);
    margin-top: 0px;
}

.page-panel.module-projects:has(> .panel-header h1) {
    border-top: 15px solid #0369a1;
    background: var(--kodys-blue);
    margin-top: 0px;
}

.page-panel.module-service:has(> .panel-header h1) {
    border-top: 15px solid #b45309;
    background: var(--kodys-blue);
    margin-top: 0px;
}

.page-panel.module-timesheets:has(> .panel-header h1) {
    border-top: 15px solid #4338ca;
    background: var(--kodys-blue);
    margin-top: 0px;
}

.page-panel.module-customers:has(> .panel-header h1) {
    border-top: 15px solid #0f5d6e;
    background: var(--kodys-blue);
    margin-top: 0px;
}

.page-panel.module-contacts:has(> .panel-header h1) {
    border-top: 15px solid #0d9488;
    background: var(--kodys-blue);
    margin-top: 0px;
}

.page-panel.module-tasks:has(> .panel-header h1) {
    border-top: 15px solid #dc2626;
    background: var(--kodys-blue);
    margin-top: 0px;
}

.page-panel.module-reporting:has(> .panel-header h1) {
    border-top: 15px solid #7c3aed;
    background: var(--kodys-blue);
    margin-top: 0px;
}

.page-panel.module-assistant:has(> .panel-header h1) {
    border-top: 15px solid #ca8a04;
    background: var(--kodys-blue);
    margin-top: 0px;
}

.page-panel.module-settings:has(> .panel-header h1) {
    border-top: 15px solid #475569;
    background: var(--kodys-blue);
    margin-top: 0px;
}

.page-panel.module-organization:has(> .panel-header h1) {
    border-top: 15px solid #6366f1;
    background: var(--kodys-blue);
    margin-top: 0px;
}

.page-panel.module-planner:has(> .panel-header h1) {
    border-top: 15px solid #0e7490;
    background: var(--kodys-blue);
    margin-top: 0px;
}

.page-panel.module-home:has(> .panel-header h1) {
    border-top: 15px solid #002D62;
    background: var(--kodys-blue);
    margin-top: 0px;
}
    /* Průhledný rámeček na přehledových i detail-hero panelech — pruh stačí jako vizuální ohraničení */
    .page-panel.module-home:has(> .panel-header h1),
    .page-panel.module-leads:has(> .panel-header h1), .page-panel.detail-hero.module-leads,
    .page-panel.module-opportunities:has(> .panel-header h1), .page-panel.detail-hero.module-opportunities,
    .page-panel.module-business-cases:has(> .panel-header h1), .page-panel.detail-hero.module-business-cases,
    .page-panel.module-contracts:has(> .panel-header h1), .page-panel.detail-hero.module-contracts,
    .page-panel.module-activities:has(> .panel-header h1), .page-panel.detail-hero.module-activities,
    .page-panel.module-projects:has(> .panel-header h1), .page-panel.detail-hero.module-projects,
    .page-panel.module-service:has(> .panel-header h1), .page-panel.detail-hero.module-service,
    .page-panel.module-timesheets:has(> .panel-header h1), .page-panel.detail-hero.module-timesheets,
    .page-panel.module-customers:has(> .panel-header h1), .page-panel.detail-hero.module-customers,
    .page-panel.module-contacts:has(> .panel-header h1), .page-panel.detail-hero.module-contacts,
    .page-panel.module-tasks:has(> .panel-header h1), .page-panel.detail-hero.module-tasks,
    .page-panel.module-reporting:has(> .panel-header h1), .page-panel.detail-hero.module-reporting,
    .page-panel.module-assistant:has(> .panel-header h1), .page-panel.detail-hero.module-assistant,
    .page-panel.module-settings:has(> .panel-header h1), .page-panel.detail-hero.module-settings,
    .page-panel.module-organization:has(> .panel-header h1), .page-panel.detail-hero.module-organization,
    .page-panel.module-planner:has(> .panel-header h1), .page-panel.detail-hero.module-planner {
        border-left-color: transparent;
        border-right-color: transparent;
        border-bottom-color: transparent;
    }
    /* Barevný pruh také na detail-hero panelech */
.page-panel.detail-hero.module-leads {
    border-top: 15px solid #4d7c0f;
    margin-top: 0px;
}

.page-panel.detail-hero.module-opportunities {
    border-top: 15px solid #c2410c;
    margin-top: 0px;
}

.page-panel.detail-hero.module-business-cases {
    border-top: 15px solid #be185d;
    margin-top: 0px;
}

.page-panel.detail-hero.module-contracts {
    border-top: 15px solid #0f766e;
    margin-top: 0px;
}

.page-panel.detail-hero.module-activities {
    border-top: 15px solid #0284c7;
    margin-top: 0px;
}

.page-panel.detail-hero.module-projects {
    border-top: 15px solid #0369a1;
    margin-top: 0px;
}

.page-panel.detail-hero.module-service {
    border-top: 15px solid #b45309;
    margin-top: 0px;
}

.page-panel.detail-hero.module-timesheets {
    border-top: 15px solid #4338ca;
    margin-top: 0px;
}

.page-panel.detail-hero.module-customers {
    border-top: 15px solid #0f5d6e;
    margin-top: 0px;
}

.page-panel.detail-hero.module-contacts {
    border-top: 15px solid #0d9488;
    margin-top: 0px;
}

.page-panel.detail-hero.module-tasks {
    border-top: 15px solid #dc2626;
    margin-top: 0px;
}

.page-panel.detail-hero.module-reporting {
    border-top: 15px solid #7c3aed;
    margin-top: 0px;
}

.page-panel.detail-hero.module-assistant {
    border-top: 15px solid #ca8a04;
    margin-top: 0px;
}

.page-panel.detail-hero.module-settings {
    border-top: 15px solid #475569;
    margin-top: 0px;
}

.page-panel.detail-hero.module-organization {
    border-top: 15px solid #6366f1;
    margin-top: 0px;
}

.page-panel.detail-hero.module-planner {
    border-top: 15px solid #0e7490;
    margin-top: 0px;
}
    /* Záhlaví přehledových stránek (panel-header s h1 = list view) */
    .page-panel > .panel-header:has(h1) {
        background: #002D62;
        color: #fff;
        margin: -1.15rem -1.15rem 0;
        padding: 1.15rem;
        border-radius: 0;
        border-bottom: none;
    }

        .page-panel > .panel-header:has(h1) h1 {
            color: #fff;
        }

        .page-panel > .panel-header:has(h1) .section-eyebrow {
            color: rgba(199, 220, 240, 0.85);
        }
        /* Tlačítka v modrém záhlaví — primární = žlutá, ostatní = průhledná bílá */
        .page-panel > .panel-header:has(h1) .primary-button,
        .page-panel > .panel-header:has(h1) button.primary-button {
            background: #FFC40C;
            color: #002D62;
            box-shadow: none;
        }

            .page-panel > .panel-header:has(h1) .primary-button:hover,
            .page-panel > .panel-header:has(h1) button.primary-button:hover {
                background: #e6af00;
            }

        /* Nekreativní akce (Filtry a řazení / Vymazat filtry / Nápověda) mají v modrém záhlaví
           jednotný průhledný outline vzhled s bílým textem — žlutá zůstává jen tvorbě. */
        .page-panel > .panel-header:has(h1) .secondary-button,
        .page-panel > .panel-header:has(h1) .ghost-button {
            background: rgba(255, 255, 255, 0.08);
            color: #fff;
            border: 1px solid rgba(255, 255, 255, 0.28);
        }

            .page-panel > .panel-header:has(h1) .secondary-button:hover,
            .page-panel > .panel-header:has(h1) .ghost-button:hover {
                background: rgba(255, 255, 255, 0.16);
                border-color: rgba(255, 255, 255, 0.5);
                color: #fff;
            }
    /* table-shell v list-page panelu — stejná šířka jako modrý header, oddělený linkou */
    .page-panel:has(> .panel-header h1) > .table-shell {
        margin: 1rem 0rem 0rem;
        padding-top: 0.85rem;
        border-top: 2px solid var(--border-soft);
    }
    /* metric-grid v modrém záhlaví — navazuje plynule pod panel-header */
    .page-panel:has(> .panel-header h1) > .metric-grid {
        background: #002D62;
        margin: 0 -1.15rem;
        padding: 0.85rem 1.15rem 1.15rem;
    }

        .page-panel:has(> .panel-header h1) > .metric-grid .metric-card {
            background: #ffffff;
            border: 2px solid rgba(255, 196, 12, 0.55);
            border-radius: 5px;
            box-shadow: none;
            color: var(--text-main);
        }

    .toolbar {
        display: flex;
        flex-wrap: wrap;
        gap: 0.75rem;
        align-items: center;
        margin-bottom: 1rem;
    }

    .toolbar-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

    .filter-grid {
        margin-bottom: 0.85rem;
    }

    .table-shell {
        overflow-x: auto;
    }

    .table-footer {
        margin-top: 0.9rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        flex-wrap: wrap;
    }

    .inline-summary {
        display: inline-flex;
        align-items: center;
        gap: 1rem;
        flex-wrap: wrap;
        font-size: 0.92rem;
        color: #334155;
    }

    .pagination-bar {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .pagination-button {
        min-width: 2.8rem;
        padding-inline: 0.8rem;
    }

    .data-table {
        width: 100%;
        border-collapse: collapse;
        table-layout: fixed;
    }

        .data-table th {
            text-align: left;
            font-size: 0.74rem;
            text-transform: uppercase;
            color: #6a8ab2;
            letter-spacing: 0.06em;
            padding: 0 0.35rem 0.55rem 0;
            white-space: nowrap;
        }

    .opportunity-model-header,
    .opportunity-model-cell {
        padding-right: 1rem !important;
    }

    .opportunity-customer-header,
    .opportunity-customer-cell {
        padding-left: 0.45rem !important;
    }

    .table-sort {
        border: 0;
        padding: 0;
        background: transparent;
        color: inherit;
        font: inherit;
        text-transform: inherit;
        letter-spacing: inherit;
        cursor: pointer;
    }

    .data-table td {
        padding: 0.72rem 0.35rem 0.72rem 0;
        border-top: 1px solid rgba(126, 164, 213, 0.18);
        vertical-align: top;
        font-size: 0.92rem;
        line-height: 1.25;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .data-table tbody tr {
        cursor: pointer;
    }

        .data-table tbody tr:hover {
            background: rgba(37, 99, 235, 0.03);
        }

    .opportunity-list-row {
        min-height: 5.4rem;
    }

    .opportunity-row-cell {
        min-height: 4.8rem;
        display: grid;
        grid-template-rows: minmax(1.7rem, auto) minmax(1.7rem, auto);
        gap: 0.4rem;
    }

    .opportunity-row-top,
    .opportunity-row-bottom {
        display: flex;
        align-items: flex-start;
    }

    .opportunity-row-bottom {
        align-items: center;
    }

    .opportunity-row-meta-stack {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.26rem;
    }

    .opportunity-business-case-link {
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        flex-wrap: wrap;
    }

    .opportunity-status-cell {
        overflow: visible !important;
    }

    .opportunity-row-cell-status {
        min-width: 0;
        overflow: hidden;
        min-height: 3rem;
    }

        .opportunity-row-cell-status .opportunity-row-top {
            justify-content: flex-start;
            width: 100%;
        }

        .opportunity-row-cell-status .opportunity-row-bottom {
            justify-content: flex-start;
            flex-direction: column;
            align-items: stretch;
            gap: 0.18rem;
            width: 100%;
        }

    .opportunity-row-cell .status-track {
        width: 100%;
        margin-bottom: 0;
    }

    .status-inline-label {
        font-size: 0.7rem;
        font-weight: 700;
        color: #5a789c;
        line-height: 1.15;
    }

    .opportunity-status-track-wide {
        width: 100%;
        max-width: 6.25rem;
        min-width: 0;
        margin-left: 0;
    }

    .clickable-row {
        cursor: pointer;
    }

        .clickable-row:hover {
            background: rgba(37, 99, 235, 0.04);
        }

    .status-track {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        gap: 0.25rem;
        margin-bottom: 0.35rem;
    }

    .data-table td strong,
    .data-table td .muted,
    .tag-row {
        word-break: break-word;
    }
    /*@media (min-width: 1600px) {
    .page-panel,
    .project-card {
        padding: 1rem;
    }

    .detail-hero {
        padding: 1.15rem 1.25rem;
    }

    .detail-hero-head h1 {
        font-size: 1.55rem;
    }

    .detail-hero .hero-action-button {
        min-height: 2.55rem;
    }

    .primary-button,
    .secondary-button,
    button.primary-button,
    .ghost-button {
        padding: 0.58rem 0.86rem;
        font-size: 0.88rem;
    }

    .metric-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }

    .metric-grid.compact {
        grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
    }

    .detail-field-stack {
        gap: 0.7rem;
    }
}*/

    .status-step {
        height: 0.24rem;
        border-radius: 4px;
        background: rgba(148, 163, 184, 0.35);
    }

        .status-step.active {
            background: linear-gradient(90deg, #22c55e, #10b981);
        }

            .status-step.active.lost {
                background: linear-gradient(90deg, #111827, #000000);
            }

    .status-pill,
    .tag-pill {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 4px;
        padding: 0.35rem 0.75rem;
        font-size: 0.82rem;
        font-weight: 700;
    }

    .status-pill {
        background: rgba(37, 99, 235, 0.1);
        color: var(--primary-dark);
    }

    .filter-chip {
        border: 1px solid rgba(37, 99, 235, 0.18);
        background: rgba(255, 255, 255, 0.8);
        color: var(--primary-dark);
        border-radius: 4px;
        padding: 0.55rem 0.9rem;
        font-weight: 700;
    }

        .filter-chip.active {
            background: linear-gradient(135deg, var(--primary), #3b82f6);
            color: white;
        }

    /* Řádek s viditelným chipem aktivního filtru nad tabulkou (např. filtr na technika) */
    .active-filter-row {
        display: flex;
        flex-wrap: wrap;
        gap: 0.4rem;
        margin-bottom: 0.75rem;
    }

        .active-filter-row .filter-chip {
            cursor: pointer;
        }

    .tag-row {
        display: flex;
        flex-wrap: wrap;
        gap: 0.35rem;
        margin-top: 0.45rem;
    }

    .tag-pill {
        background: rgba(96, 165, 250, 0.16);
        color: #1d4f91;
    }

    .compact-tag-row {
        gap: 0.25rem;
        margin-top: 0.3rem;
    }

    .tag-pill-secondary {
        padding: 0.18rem 0.48rem;
        font-size: 0.72rem;
        font-weight: 600;
        background: rgba(148, 163, 184, 0.14);
        color: #475569;
    }

    .tag-pill-business-case {
        padding: 0.18rem 0.5rem;
        font-size: 0.7rem;
        font-weight: 700;
        background: rgba(190, 24, 93, 0.1);
        color: #9d174d;
        border: 1px solid rgba(190, 24, 93, 0.16);
    }

    .opportunity-kind-pill {
        min-width: 7.5rem;
    }

    .opportunity-kind-onetime {
        background: rgba(148, 163, 184, 0.12);
        color: #64748b;
        font-weight: 600;
    }

    .opportunity-kind-sla {
        background: rgba(22, 163, 74, 0.14);
        color: #166534;
    }

    .opportunity-kind-consumables {
        background: rgba(217, 119, 6, 0.16);
        color: #b45309;
    }

    .opportunity-kind-change-request {
        background: rgba(124, 58, 237, 0.14);
        color: #6d28d9;
    }

    .opportunity-kind-section {
        border-width: 1px;
        border-style: solid;
    }

        .opportunity-kind-section.opportunity-kind-onetime {
            border-color: rgba(37, 99, 235, 0.2);
            background: #ffffff;
        }

        .opportunity-kind-section.opportunity-kind-sla {
            border-color: rgba(22, 163, 74, 0.22);
            background: #ffffff;
        }

        .opportunity-kind-section.opportunity-kind-consumables {
            border-color: rgba(217, 119, 6, 0.26);
            background: #ffffff;
        }

        .opportunity-kind-section.opportunity-kind-change-request {
            border-color: rgba(124, 58, 237, 0.24);
            background: #ffffff;
        }

    .margin-pill,
    .health-pill {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 4px;
        padding: 0.3rem 0.7rem;
        font-size: 0.78rem;
        font-weight: 700;
    }

        .margin-pill.positive,
        .health-pill-good {
            background: rgba(22, 163, 74, 0.14);
            color: #166534;
        }

        .margin-pill.negative,
        .health-pill-danger {
            background: rgba(220, 38, 38, 0.14);
            color: #b91c1c;
        }

    .health-pill-warn {
        background: rgba(245, 158, 11, 0.16);
        color: #b45309;
    }

    .form-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem;
    }

    .selector-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

    .selector-card {
        display: flex;
        align-items: center;
        gap: 0.6rem;
        border: 1px solid rgba(126, 164, 213, 0.22);
        background: rgba(255, 255, 255, 0.7);
        padding: 0.85rem 1rem;
        border-radius: 6px;
        font-weight: 600;
    }

    .buttonlike {
        width: 100%;
        text-align: left;
        cursor: pointer;
    }

    .full-span {
        grid-column: 1 / -1;
    }

    .timesheet-top-panel {
        display: grid;
        gap: 1rem;
    }

    .timesheet-header {
        align-items: flex-start;
        gap: 1rem;
    }

    .timesheet-title-block {
        display: grid;
        gap: 0.25rem;
    }

    .timesheet-actions {
        align-items: flex-end;
    }

    .timesheet-view-select {
        min-width: 18rem;
    }

        .timesheet-view-select .form-select {
            min-height: 3rem;
        }

    .timesheet-filter-grid {
        align-items: end;
    }

    .timesheet-row {
        transition: background 0.2s ease, box-shadow 0.2s ease;
    }

    .timesheet-row-opportunity {
        background: rgba(37, 99, 235, 0.025);
    }

    .timesheet-row-project {
        background: rgba(16, 185, 129, 0.03);
    }

    .timesheet-row-contract {
        background: rgba(20, 184, 166, 0.05);
    }

    .timesheet-row-task {
        background: rgba(245, 158, 11, 0.03);
    }

    .timesheet-row:hover {
        box-shadow: inset 0 0 0 9999px rgba(37, 99, 235, 0.025);
    }

    .timesheet-row-actions {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .timesheet-type-pill {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 4px;
        padding: 0.28rem 0.66rem;
        font-size: 0.76rem;
        font-weight: 800;
        letter-spacing: 0.02em;
    }

    .timesheet-type-pill-opportunity {
        background: rgba(37, 99, 235, 0.12);
        color: #1d4f91;
    }

    .timesheet-type-pill-project {
        background: rgba(16, 185, 129, 0.14);
        color: #0f766e;
    }

    .timesheet-type-pill-contract {
        background: rgba(20, 184, 166, 0.14);
        color: #0f766e;
    }

    .timesheet-type-pill-task {
        background: rgba(245, 158, 11, 0.16);
        color: #b45309;
    }

    .danger-button-outline {
        border: 1px solid rgba(220, 38, 38, 0.22);
        color: #b91c1c;
        background: rgba(255, 255, 255, 0.84);
    }

        .danger-button-outline:hover {
            background: rgba(254, 226, 226, 0.92);
        }

    .timesheet-help-text {
        margin-top: 0.45rem;
        line-height: 1.35;
        font-size: 0.84rem;
    }

    .timesheet-chart-panel {
        margin-top: 1rem;
    }

    .timesheet-chart-shell {
        display: grid;
        gap: 0.6rem;
    }

    .timesheet-chart-layout {
        display: grid;
        grid-template-columns: 3.3rem minmax(0, 1fr);
        gap: 0.75rem;
        align-items: start;
        overflow-x: auto;
        padding-bottom: 0.25rem;
    }

    .timesheet-chart-y-axis {
        position: relative;
        height: 280px;
    }

        .timesheet-chart-y-axis span {
            position: absolute;
            left: 0;
            transform: translateY(-50%);
            font-size: 0.75rem;
            font-weight: 700;
            color: var(--text-soft);
            white-space: nowrap;
        }

    .timesheet-chart-plot-wrap {
        min-width: 980px;
    }

    .timesheet-chart {
        width: 100%;
        height: 280px;
        display: block;
    }

    .timesheet-chart-grid {
        stroke: rgba(126, 164, 213, 0.14);
        stroke-width: 1;
    }

    .timesheet-chart-grid-horizontal {
        stroke-dasharray: 4 4;
    }

    .timesheet-chart-grid-vertical {
        stroke-dasharray: 2 6;
    }

    .timesheet-chart-axis {
        stroke: rgba(126, 164, 213, 0.46);
        stroke-width: 1.2;
    }

    .timesheet-chart-bar {
        fill: linear-gradient(180deg, #3b82f6, #2563eb);
        fill: #2563eb;
        opacity: 0.9;
        filter: drop-shadow(0 12px 18px rgba(37, 99, 235, 0.2));
    }

        .timesheet-chart-bar:hover {
            opacity: 1;
        }

    .timesheet-chart-x-axis {
        display: grid;
        gap: 0.25rem;
        min-width: 980px;
        margin-top: 0.2rem;
    }

        .timesheet-chart-x-axis span {
            text-align: center;
            font-size: 0.74rem;
            font-weight: 700;
            color: var(--text-soft);
        }

    .timesheet-chart-note {
        font-size: 0.84rem;
    }

    .timesheet-bars-chart {
        display: grid;
        grid-template-columns: 3.5rem minmax(0, 1fr);
        gap: 0.75rem;
        align-items: end;
        overflow-x: auto;
        padding-top: 0.5rem;
    }

    .timesheet-bars-chart-scale {
        position: relative;
        height: 260px;
    }

        .timesheet-bars-chart-scale span {
            position: absolute;
            left: 0;
            transform: translateY(50%);
            font-size: 0.74rem;
            font-weight: 700;
            color: var(--text-soft);
            white-space: nowrap;
        }

    .timesheet-bars-chart-plot {
        display: grid;
        align-items: end;
        min-height: 260px;
        gap: 0.65rem;
        min-width: 980px;
        padding-bottom: 0.2rem;
        background: linear-gradient(to top, rgba(126, 164, 213, 0.12) 1px, transparent 1px) 0 0 / 100% 25%, linear-gradient(to top, rgba(126, 164, 213, 0.08) 1px, transparent 1px) 0 0 / 100% 12.5%;
        border-bottom: 1px solid rgba(126, 164, 213, 0.34);
        border-left: 1px solid rgba(126, 164, 213, 0.34);
        padding-left: 0.35rem;
    }

    .timesheet-bars-chart-column {
        display: grid;
        align-items: end;
        gap: 0.35rem;
        min-height: 240px;
    }

    .timesheet-bars-chart-track {
        position: relative;
        height: 220px;
        border-radius: 6px 6px 3px 3px;
        background: linear-gradient(to top, rgba(126, 164, 213, 0.08) 1px, transparent 1px) 0 0 / 100% 25%, linear-gradient(to top, rgba(126, 164, 213, 0.05) 1px, transparent 1px) 0 0 / 100% 12.5%, rgba(37, 99, 235, 0.04);
        overflow: hidden;
    }

    .timesheet-bars-chart-fill {
        position: absolute;
        left: 0.2rem;
        right: 0.2rem;
        bottom: 0;
        border-radius: 6px 6px 3px 3px;
        background: linear-gradient(180deg, #60a5fa 0%, #2563eb 100%);
        box-shadow: 0 10px 20px rgba(37, 99, 235, 0.18);
        min-height: 14px;
        border: 1px solid rgba(30, 64, 175, 0.22);
    }

    .timesheet-bars-chart-label {
        text-align: center;
        font-size: 0.74rem;
        font-weight: 700;
        color: var(--text-soft);
    }

    .bar-row,
    .list-row {
        display: flex;
        align-items: center;
        gap: 0.85rem;
        padding: 0.2rem 0;
        border-top: 1px solid rgba(126, 164, 213, 0.16);
    }

        .bar-row:first-of-type,
        .list-row:first-of-type {
            border-top: 0;
        }
    /* Klikatelný řádek — reset button defaults, zachovává list-row layout */
    button.linked-record-button {
        width: 100%;
        text-align: left;
        cursor: pointer;
        font: inherit;
        color: inherit;
        background: none;
        border-left: none;
        border-right: none;
        border-bottom: none;
        border-radius: 0;
        margin: 0;
        transition: background 0.15s ease, border-radius 0.15s ease;
    }

        button.linked-record-button:hover {
            background: rgba(0, 45, 98, 0.05);
            border-radius: 6px;
        }

        button.linked-record-button strong {
            display: block;
            font-size: 0.88rem;
            color: var(--text-main);
        }

        button.linked-record-button .muted {
            font-size: 0.78rem;
            margin-top: 0.1rem;
        }

    .bar-label {
        width: 10rem;
        flex: 0 0 10rem;
        font-weight: 600;
    }

    .bar-track {
        height: 0.7rem;
        flex: 1;
        border-radius: 4px;
        background: rgba(148, 163, 184, 0.2);
        overflow: hidden;
    }

    .bar-segments {
        display: flex;
        height: 100%;
        width: 100%;
    }

    .bar-fill {
        height: 100%;
        background: #002D62;
        flex-shrink: 0;
        min-width: 0;
    }

        .bar-fill.alt {
            background: #1a6fa8;
            flex-shrink: 0;
            min-width: 0;
        }

        .bar-fill.recurring {
            background: #FFC40C;
            flex-shrink: 0;
            min-width: 0;
        }

        .bar-fill.alt.recurring {
            background: #e6a800;
        }

    .bar-value {
        width: 2rem;
        text-align: right;
        font-weight: 700;
    }

    .nested-group {
        border-top: 1px solid rgba(126, 164, 213, 0.16);
        padding-top: 0.8rem;
        margin-top: 0.8rem;
    }

    .dropzone {
        border-radius: 6px;
        padding: 0.8rem;
    }

    .drop-hint {
        margin-bottom: 0.5rem;
    }

    .section-block {
        border-radius: 6px;
        padding: 1rem;
        margin-bottom: 1rem;
        background: rgba(247, 250, 255, 0.56);
        border: 1px solid rgba(126, 164, 213, 0.16);
    }

    .panel-theme-estimate {
        background: #ffffff;
        border-color: var(--border-soft);
    }

    .panel-theme-sales {
        background: #ffffff;
        border-color: var(--border-soft);
    }

    .panel-theme-estimate .summary-box {
        background: rgba(219, 234, 254, 0.78);
    }

    .panel-theme-sales .summary-box {
        background: rgba(255, 237, 213, 0.82);
    }

    .panel-theme-estimate .nested-group {
        border-top-color: rgba(96, 165, 250, 0.2);
    }

    .panel-theme-sales .nested-group {
        border-top-color: rgba(251, 146, 60, 0.2);
    }

    .nested-group-header {
        display: flex;
        justify-content: space-between;
        margin-bottom: 0.4rem;
    }

    /* Název oblasti + tlačítko „+" pro rychlé přidání položky do dané oblasti. */
    .area-title {
        display: inline-flex;
        align-items: center;
        gap: 0.45rem;
    }

    .inline-add-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 1.4rem;
        height: 1.4rem;
        padding: 0;
        border-radius: 50%;
        border: 1px solid var(--border-soft);
        background: transparent;
        color: var(--text-soft);
        font-size: 1rem;
        line-height: 1;
        cursor: pointer;
    }

    .inline-add-btn:hover {
        background: rgba(126, 164, 213, 0.16);
        color: var(--text-main);
    }

    /* Inline editace položky odhadu přímo v tabulce (název / tým / hodiny). */
    .estimate-row-edit {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 0.2rem;
    }

    .estimate-row-edit .form-control {
        width: 100%;
    }

    .estimate-row-author {
        font-size: 0.8rem;
    }

    .estimate-hours-input {
        width: 5rem;
        text-align: right;
    }

    .estimate-price-input {
        width: 6.5rem;
        text-align: right;
    }

    /* Decentní hlavička sloupců inline tabulky (odhad / prodej). Zarovnaná stejnými šířkami jako řádky. */
    .estimate-col-header {
        padding: 0 0.35rem 0.2rem;
        margin-bottom: 0.15rem;
        border-bottom: 1px solid rgba(126, 164, 213, 0.22);
    }

    .estimate-col-header > span {
        font-size: 0.7rem;
        font-weight: 700;
        letter-spacing: 0.02em;
        text-transform: uppercase;
        color: var(--text-soft);
    }

    /* Inline tabulka (odhad/prodej) = CSS grid s pevnou šablonou sloupců → hlavička i řádky sedí na sebe
       deterministicky bez ohledu na obsah. Šablonu určuje modifikátor .est-cols / .sale-cols.
       (Hlavička má také třídu .estimate-item-row, takže grid platí pro obě.) */
    .panel-theme-estimate .estimate-item-row {
        grid-template-columns: 1.3rem minmax(6rem, 1fr) 5.5rem 5rem 1.9rem;
    }

    .panel-theme-sales .estimate-item-row {
        grid-template-columns: 1.3rem minmax(8rem, 1fr) 5.5rem 5.5rem 5rem 6.5rem 5rem 6.5rem 6rem 1.9rem;
    }

    .estimate-item-row > * {
        box-sizing: border-box;
        min-width: 0;
    }

    .estimate-item-row .estimate-select {
        justify-content: center;
        padding: 0;
    }

    .estimate-item-row .estimate-margin-col {
        text-align: right;
    }

    /* Neuložená změna / nový řádek odhadu — jantarové podbarvení, ať je vidět, co ještě není uloženo. */
    .estimate-row-dirty {
        background: rgba(251, 191, 36, 0.16);
        border-radius: 6px;
    }

    .estimate-drafts {
        margin-top: 0.4rem;
    }

    .estimate-draft-area {
        margin-top: 0.25rem;
    }

    /* Kompaktní jednořádková položka odhadu/prodeje (grid, sloupce dle .est-cols / .sale-cols). */
    .estimate-item-row {
        display: grid;
        align-items: center;
        gap: 0.4rem;
        padding: 0.12rem 0.35rem;
        border-radius: 5px;
    }

    .estimate-item-row .form-control,
    .estimate-item-row .form-select {
        width: 100%;
        height: 1.75rem;
        padding: 0.1rem 0.4rem;
        font-size: 0.85rem;
    }

    .estimate-name-input,
    .estimate-name-ro {
        flex: 1;
        min-width: 0;
    }

    .estimate-name-ro {
        font-weight: 600;
    }

    .estimate-item-row.selected {
        background: rgba(126, 164, 213, 0.22);
    }

    .estimate-select {
        display: inline-flex;
        align-items: center;
        cursor: pointer;
        padding: 0 0.15rem;
    }

    .estimate-grip {
        color: var(--text-soft);
        opacity: 0.6;
        font-size: 0.9rem;
        line-height: 1;
        user-select: none;
    }

    .estimate-select-placeholder {
        cursor: default;
    }

    .estimate-selection-hint {
        padding: 0.35rem 0.5rem;
        margin-bottom: 0.4rem;
    }

    .estimate-collapse-btn {
        border: none;
        background: transparent;
        cursor: pointer;
        font-size: 0.9rem;
        padding: 0 0.3rem;
        color: var(--text-soft);
    }

    .estimate-area-count {
        font-size: 0.8rem;
    }

    .estimate-del-btn {
        padding: 0 0.45rem;
    }

    .estimate-team-ro,
    .estimate-hours-ro {
        font-size: 0.85rem;
        white-space: nowrap;
    }

    /* Barevné odlišení týmů v tabulce odhadu (barvu dodává inline style TeamColorStyle). */
    .estimate-team-pill {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 0.72rem;
        font-weight: 600;
        padding: 0.1rem 0.45rem;
        border-radius: 999px;
        white-space: nowrap;
    }

    .estimate-team-select {
        font-weight: 600;
        border-color: rgba(15, 23, 42, 0.12);
    }

    /* Oblast „Nezařazené" — vizuálně odlišená šedivým, méně výrazným textem. */
    .estimate-area-unassigned strong,
    .estimate-area-unassigned .estimate-area-count {
        color: var(--text-soft);
        font-weight: 500;
    }

    /* Hlavička nové (neuložené) oblasti — vypadá jako běžná hlavička oblasti, jen s inline názvem a podbarvením. */
    .estimate-area-draft-header {
        align-items: center;
        padding: 0.35rem 0.5rem;
        border-radius: 6px;
    }

    .estimate-area-name-input {
        width: 18rem;
        max-width: 100%;
        height: 1.9rem;
        font-weight: 600;
    }

    /* Lišta hromadných akcí nad vybranými položkami. */
    .estimate-bulk-bar {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        flex-wrap: wrap;
        padding: 0.5rem 0.7rem;
        margin-bottom: 0.6rem;
        background: rgba(126, 164, 213, 0.12);
        border: 1px solid rgba(126, 164, 213, 0.28);
        border-radius: 6px;
    }

    .thread-item {
        border-radius: 6px;
        padding: 1rem;
        background: rgba(244, 249, 255, 0.72);
        border: 1px solid rgba(126, 164, 213, 0.14);
        margin-bottom: 0.85rem;
    }

        .thread-item.subtle {
            background: rgba(247, 250, 255, 0.46);
        }

    .upload-shell {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        flex-wrap: wrap;
        padding: 0.95rem 1rem;
        border-radius: 6px;
        background: rgba(255, 255, 255, 0.82);
        border: 1px dashed rgba(126, 164, 213, 0.32);
    }

    .file-input-hidden {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .attachment-row {
        align-items: flex-start;
        min-width: 0;
        width: 100%;
    }

    .attachment-row-content {
        min-width: 0;
        flex: 1 1 auto;
        width: 0;
        display: grid;
        gap: 0.2rem;
    }

    .attachment-row-name {
        display: block;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .attachment-row-meta {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .attachment-row-actions {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        flex: 0 0 auto;
        min-width: 0;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .attachment-delete-button {
        white-space: nowrap;
    }

    .danger-button,
    button.danger-button {
        background: #dc2626;
        color: white;
        box-shadow: none;
    }

    .member-list {
        display: grid;
        gap: 0.65rem;
    }

    .member-pill {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        padding: 0.7rem 0.85rem;
        border-radius: 6px;
        background: rgba(255, 255, 255, 0.82);
        border: 1px solid rgba(126, 164, 213, 0.2);
    }

    .top-gap {
        margin-top: 0.85rem;
    }

    .team-select {
        min-width: min(240px, 100%);
    }

    .task-card {
        transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }

    .task-card-selected {
        border-color: #002D62;
        box-shadow: none;
    }

    .thread-meta {
        color: #6a8ab2;
        font-size: 0.82rem;
        margin-bottom: 0.35rem;
    }

    .draggable-row {
        border-radius: 6px;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        cursor: grab;
    }

        .draggable-row:hover {
            background: rgba(37, 99, 235, 0.04);
        }

    .draggable-section-header {
        align-items: center;
        gap: 1rem;
        padding: 0.5rem 0.65rem;
        border-radius: 6px;
        cursor: grab;
        transition: background 0.2s ease, border-color 0.2s ease;
    }

        .draggable-section-header:hover {
            background: rgba(37, 99, 235, 0.05);
        }

    .drop-target-active {
        background: rgba(37, 99, 235, 0.09) !important;
        outline: 2px dashed rgba(37, 99, 235, 0.32);
        outline-offset: 2px;
    }

    .drag-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0.25rem 0.65rem;
        border-radius: 4px;
        background: rgba(37, 99, 235, 0.08);
        color: var(--primary-dark);
        font-size: 0.78rem;
        font-weight: 700;
        cursor: inherit;
    }

    .drag-active {
        opacity: 0.7;
        cursor: grabbing;
    }

    .project-card {
        margin-bottom: 1rem;
    }

    .project-card-head {
        display: flex;
        justify-content: space-between;
        gap: 1rem;
        margin-bottom: 1rem;
    }

    .comparison-bars {
        display: grid;
        gap: 0.75rem;
    }

    .report-table {
        margin-top: 1rem;
    }

    .reporting-shell {
        display: block;
        border-top: 15px solid #7c3aed;
        border-left-color: transparent;
        border-right-color: transparent;
        border-bottom-color: transparent;
    }

    .reporting-section {
        display: grid;
        gap: 1rem;
    }

    .reporting-table td,
    .reporting-table th {
        vertical-align: top;
    }

    .reporting-status {
        background: rgba(37, 99, 235, 0.12);
        color: var(--primary-dark);
    }

    .reporting-priority {
        background: rgba(37, 99, 235, 0.14);
        color: var(--primary-dark);
    }

    .reporting-module-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        gap: 1rem;
    }

    .reporting-module-card {
        display: grid;
        gap: 0.85rem;
        padding: 1.1rem;
        border-radius: 8px;
        background: #ffffff;
        border: 1px solid var(--border-soft);
    }

    .reporting-module-head {
        display: flex;
        justify-content: space-between;
        gap: 1rem;
        align-items: flex-start;
    }

    .reporting-module-copy {
        color: var(--text-soft);
        line-height: 1.5;
    }

    .report-area-card-active {
        border-color: #002D62;
        box-shadow: none;
        background: rgba(0, 45, 98, 0.04);
    }

    .report-area-strip {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.85rem;
    }

    .report-area-card {
        min-height: 5.6rem;
    }

    .report-area-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 2.1rem;
        height: 2.1rem;
        border-radius: 6px;
        background: rgba(0, 45, 98, 0.08);
        color: var(--primary-dark);
        font-size: 0.82rem;
        font-weight: 800;
        letter-spacing: 0.04em;
    }

    .report-area-copy {
        display: grid;
        gap: 0.18rem;
    }

        .report-area-copy span {
            color: var(--text-soft);
            font-size: 0.86rem;
            line-height: 1.35;
        }

    .report-selector-shell {
        background: #F4F5F7;
    }

    .report-selector-bubble {
        display: grid;
        gap: 1rem;
        padding: 1.1rem 1.15rem;
        border-radius: 8px;
        background: #ffffff;
        border: 1px solid var(--border-soft);
    }

    .report-selector-header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 1rem;
    }

    .report-selector-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 0.85rem;
    }

    .filter-toggle-stack {
        display: grid;
        gap: 0.35rem;
        align-content: start;
    }

    .filter-toggle-column {
        display: grid;
        gap: 0.7rem;
    }

    .form-check-inline {
        display: inline-flex;
        align-items: center;
        gap: 0.55rem;
        color: var(--text-soft);
        font-size: 0.84rem;
        line-height: 1.35;
    }

    .report-selector-tile {
        display: grid;
        grid-template-columns: auto 1fr;
        gap: 0.85rem;
        align-items: flex-start;
        padding: 0.95rem 1rem;
        border-radius: 8px;
        border: 1px solid rgba(126, 164, 213, 0.2);
        background: rgba(255, 255, 255, 0.82);
        color: var(--text-main);
        text-align: left;
        transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
    }

        .report-selector-tile:hover {
            border-color: #002D62;
            box-shadow: none;
            transform: none;
        }

    .report-selector-tile-active {
        border-color: #002D62;
        background: rgba(0, 45, 98, 0.04);
        box-shadow: none;
    }

    .report-selector-code {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 2.35rem;
        height: 2.35rem;
        border-radius: 6px;
        background: rgba(0, 45, 98, 0.08);
        color: var(--primary-dark);
        font-size: 0.78rem;
        font-weight: 800;
        letter-spacing: 0.05em;
    }

    .report-selector-text {
        display: grid;
        gap: 0.18rem;
    }

        .report-selector-text span {
            color: var(--text-soft);
            font-size: 0.84rem;
            line-height: 1.35;
        }

    .report-display-shell {
        gap: 1.15rem;
    }

    .report-horizontal-list {
        display: grid;
        gap: 0.15rem;
    }

    .reporting-card-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        gap: 1rem;
    }

        .reporting-card-grid.compact {
            grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        }

    .reporting-card {
        display: grid;
        gap: 1rem;
        padding: 1.1rem;
        border-radius: 8px;
        background: #ffffff;
        border: 1px solid var(--border-soft);
    }

        .reporting-card.compact {
            gap: 0.75rem;
        }

    .reporting-card-head {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 1rem;
    }

    .reporting-info-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.85rem;
    }

    .reporting-detail-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.85rem;
    }

    .reporting-chip-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 0.85rem;
    }

    .report-preview {
        border-radius: 6px;
        min-height: 10rem;
        padding: 1rem;
        display: grid;
        align-items: end;
        border: 1px solid rgba(126, 164, 213, 0.16);
        overflow: hidden;
    }

    .preview-blue {
        background: linear-gradient(180deg, rgba(219, 234, 254, 0.9), rgba(239, 246, 255, 0.9));
    }

    .preview-indigo {
        background: linear-gradient(180deg, rgba(224, 231, 255, 0.92), rgba(238, 242, 255, 0.9));
    }

    .preview-green {
        background: linear-gradient(180deg, rgba(220, 252, 231, 0.92), rgba(240, 253, 244, 0.9));
    }

    .preview-orange {
        background: linear-gradient(180deg, rgba(255, 237, 213, 0.92), rgba(255, 247, 237, 0.9));
    }

    .preview-teal {
        background: linear-gradient(180deg, rgba(204, 251, 241, 0.92), rgba(240, 253, 250, 0.9));
    }

    .preview-rose {
        background: linear-gradient(180deg, rgba(255, 228, 230, 0.92), rgba(255, 241, 242, 0.9));
    }

    .preview-bars {
        display: flex;
        align-items: end;
        gap: 0.6rem;
        height: 100%;
    }

        .preview-bars span {
            flex: 1;
            border-radius: 6px 6px 2px 2px;
            background: linear-gradient(180deg, rgba(37, 99, 235, 0.75), rgba(59, 130, 246, 0.95));
            min-height: 1.5rem;
        }

    .preview-line-grid {
        display: flex;
        align-items: end;
        gap: 0.55rem;
        height: 100%;
        position: relative;
    }

        .preview-line-grid::before {
            content: "";
            position: absolute;
            left: 0;
            right: 0;
            bottom: 2.1rem;
            border-top: 2px dashed rgba(37, 99, 235, 0.2);
        }

        .preview-line-grid span {
            flex: 1;
            border-radius: 4px 4px 0.35rem 0.35rem;
            background: linear-gradient(180deg, rgba(99, 102, 241, 0.65), rgba(79, 70, 229, 0.95));
            min-height: 1.4rem;
        }

    .preview-split {
        height: 100%;
        display: grid;
        place-items: center;
    }

    .preview-split-primary,
    .preview-split-secondary {
        display: block;
        border-radius: 4px;
    }

    .preview-split-primary {
        width: 9rem;
        height: 9rem;
        border: 1.2rem solid rgba(15, 118, 110, 0.9);
        border-right-color: rgba(45, 212, 191, 0.32);
        border-bottom-color: rgba(45, 212, 191, 0.32);
    }

    .preview-split-secondary {
        width: 5rem;
        height: 5rem;
        margin-top: -7rem;
        margin-left: 4.8rem;
        border: 0.85rem solid rgba(20, 184, 166, 0.82);
        border-top-color: rgba(153, 246, 228, 0.32);
    }

    .approval-card {
        background: #ffffff;
        border: 1px solid var(--border-soft);
    }

    .approval-tag {
        background: rgba(245, 158, 11, 0.14);
        color: #b45309;
    }

    .reporting-approval-list {
        display: grid;
        gap: 0.65rem;
        color: var(--text-soft);
        line-height: 1.45;
    }

    .report-row {
        display: grid;
        grid-template-columns: minmax(18rem, 1.2fr) minmax(20rem, 1fr) auto;
        gap: 1rem;
        align-items: center;
        padding: 0.85rem 0;
        border-top: 1px solid rgba(126, 164, 213, 0.16);
    }

    .report-title {
        min-width: 0;
    }

    .report-bars {
        display: grid;
        gap: 0.5rem;
        justify-self: stretch;
    }

    .report-value,
    .report-value-stack {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 0.5rem;
        font-weight: 700;
    }

    .report-value-stack {
        flex-direction: column;
        align-items: flex-end;
    }

    .pipeline-split-detail {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 0.1rem;
        font-size: 0.72rem;
        font-weight: 400;
        color: var(--text-muted, #94a3b8);
        margin-top: 0.15rem;
    }

    .recurring-accent {
        color: #f59e0b;
    }
    /* ── Funnel chart ─────────────────────────────────────── */

    .funnel-chart {
        display: flex;
        flex-direction: column;
        gap: 3px;
        padding: 1.25rem 0 0.5rem;
    }

    .funnel-stage,
    .funnel-lost-row {
        display: grid;
        grid-template-columns: 12rem 1fr 15rem;
        align-items: center;
        gap: 1rem;
    }

    .funnel-stage-label {
        display: flex;
        flex-direction: column;
        gap: 0.15rem;
        font-size: 0.875rem;
    }

    .funnel-track {
        display: flex;
        justify-content: center;
        align-items: center;
        height: 2.4rem;
    }

    .funnel-band {
        display: flex;
        height: 100%;
        border-radius: 4px;
        overflow: hidden;
        min-width: 4px;
    }

    .funnel-regular {
        height: 100%;
        background: linear-gradient(90deg, var(--primary), #38bdf8);
        flex-shrink: 0;
    }

    .funnel-recurring {
        height: 100%;
        background: linear-gradient(90deg, #f59e0b, #f97316);
        flex-shrink: 0;
    }

    .funnel-stage--won .funnel-track .funnel-band {
        box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.45);
    }

    .funnel-band--lost {
        background: linear-gradient(90deg, rgba(239, 68, 68, 0.45), rgba(239, 68, 68, 0.2));
        height: 100%;
    }

    .funnel-lost-row {
        margin-top: 0.85rem;
        padding-top: 0.85rem;
        border-top: 1px solid rgba(126, 164, 213, 0.16);
    }

    .funnel-stage-values {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 0.1rem;
        font-size: 0.875rem;
    }

    .funnel-legend {
        display: flex;
        gap: 1.25rem;
        justify-content: center;
        margin-top: 1rem;
        padding-top: 0.75rem;
        border-top: 1px solid rgba(126, 164, 213, 0.1);
    }

    .funnel-legend-item {
        display: flex;
        align-items: center;
        gap: 0.4rem;
        font-size: 0.78rem;
        color: var(--text-muted, #94a3b8);
    }

    .funnel-legend-swatch {
        display: inline-block;
        width: 1rem;
        height: 0.5rem;
        border-radius: 2px;
        flex-shrink: 0;
    }

    .funnel-legend-regular {
        background: linear-gradient(90deg, var(--primary), #38bdf8);
    }

    .funnel-legend-recurring {
        background: linear-gradient(90deg, #f59e0b, #f97316);
    }

    .delay-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 3.25rem;
        padding: 0.25rem 0.6rem;
        border-radius: 4px;
        background: rgba(37, 99, 235, 0.1);
        color: var(--primary-dark);
        font-size: 0.78rem;
        font-weight: 700;
    }

    .delay-badge-danger {
        background: rgba(220, 38, 38, 0.14);
        color: #b91c1c;
    }

    .summary-line {
        display: flex;
        justify-content: space-between;
        gap: 1rem;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(126, 164, 213, 0.16);
    }

    .summary-box {
        min-height: 3rem;
        display: flex;
        align-items: center;
        padding: 0.8rem 1rem;
        border-radius: 6px;
        background: rgba(247, 250, 255, 0.85);
        border: 1px solid rgba(126, 164, 213, 0.2);
        font-weight: 700;
        color: var(--primary-dark);
    }

    .timesheet-chart-panel {
        margin-top: 1rem;
    }

    .timesheet-chart-shell {
        padding-top: 0.4rem;
    }

    .timesheet-chart {
        width: 100%;
        height: 260px;
        display: block;
    }

    .timesheet-chart-grid {
        stroke: rgba(126, 164, 213, 0.18);
        stroke-width: 1;
    }

    .timesheet-chart-axis-label,
    .timesheet-chart-x-label {
        fill: var(--text-soft);
        font-size: 12px;
        font-weight: 700;
    }

    .timesheet-chart-line {
        fill: none;
        stroke: var(--primary);
        stroke-width: 4;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .timesheet-chart-area {
        fill: rgba(37, 99, 235, 0.12);
    }

    .timesheet-chart-point {
        fill: white;
        stroke: var(--primary);
        stroke-width: 3;
    }

    .compact-textarea {
        min-height: 96px;
    }

    .sale-filter-input {
        min-width: min(320px, 100%);
    }

    .guide-panel {
        margin-bottom: 1rem;
        padding: 1.1rem 1.2rem;
        border-radius: 8px;
        background: #ffffff;
        border: 1px solid var(--border-soft);
    }

        .guide-panel p {
            margin: 0.65rem 0 0;
            color: var(--text-soft);
        }

    .guide-panel-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
    }

    .guide-list {
        display: grid;
        gap: 0.6rem;
        margin-top: 0.9rem;
    }

    .guide-item {
        display: grid;
        grid-template-columns: auto 1fr;
        gap: 0.7rem;
        align-items: flex-start;
    }

        .guide-item > span {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 1.7rem;
            height: 1.7rem;
            border-radius: 4px;
            background: rgba(37, 99, 235, 0.12);
            color: var(--primary-dark);
            font-size: 0.82rem;
            font-weight: 800;
        }

    .label-row {
        display: inline-flex;
        align-items: center;
        gap: 0.45rem;
        margin-bottom: 0.35rem;
    }

        .label-row label {
            margin-bottom: 0;
        }

    .help-tip {
        position: relative;
        display: inline-flex;
        align-items: center;
    }

    .help-tip-trigger {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 1.2rem;
        height: 1.2rem;
        border-radius: 4px;
        background: rgba(37, 99, 235, 0.12);
        color: var(--primary-dark);
        font-size: 0.74rem;
        font-weight: 800;
        cursor: help;
    }

    .help-tip-bubble {
        position: absolute;
        left: 50%;
        bottom: calc(100% + 0.55rem);
        transform: translateX(-50%) translateY(0.3rem);
        width: min(300px, 70vw);
        padding: 0.8rem 0.9rem;
        border-radius: 6px;
        background: rgba(15, 23, 42, 0.96);
        color: white;
        box-shadow: 0 18px 38px rgba(15, 23, 42, 0.28);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.18s ease, transform 0.18s ease;
        z-index: 10;
    }

        .help-tip-bubble strong {
            display: block;
            margin-bottom: 0.3rem;
            font-size: 0.84rem;
        }

    .project-health-tip {
        position: relative;
    }

        .project-health-tip .help-tip-bubble {
            left: 0;
            bottom: calc(100% + 0.6rem);
            transform: translateX(0) translateY(0.3rem);
            width: min(320px, 45vw);
        }

        .project-health-tip:hover .help-tip-bubble,
        .project-health-tip:focus-within .help-tip-bubble {
            transform: translateX(0) translateY(0);
        }

    .help-tip:hover .help-tip-bubble,
    .help-tip:focus-within .help-tip-bubble {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    .route-switch {
        display: flex;
        flex-wrap: wrap;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

    .route-tab {
        display: inline-flex;
        align-items: center;
        gap: 0.55rem;
        padding: 0.7rem 1rem;
        border-radius: 6px;
        border: 1px solid rgba(126, 164, 213, 0.2);
        background: rgba(255, 255, 255, 0.76);
        color: var(--primary-dark);
        font-weight: 700;
        text-decoration: none;
    }

        .route-tab.active {
            background: #002D62;
            color: white;
            box-shadow: none;
        }

    .meta-grid {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0.85rem;
    }

    .meta-card {
        padding: 0.95rem 1rem;
        border-radius: 6px;
        background: rgba(247, 250, 255, 0.82);
        border: 1px solid rgba(126, 164, 213, 0.18);
    }

        .meta-card span {
            display: block;
            margin-bottom: 0.3rem;
            color: var(--text-soft);
            font-size: 0.82rem;
        }

        .meta-card strong {
            color: var(--primary-dark);
        }

    .empty-state {
        padding: 1.1rem 1.2rem;
        border-radius: 6px;
        background: rgba(247, 250, 255, 0.76);
        border: 1px dashed rgba(126, 164, 213, 0.28);
        color: var(--text-soft);
    }

    /* Indikátor načítání seznamu — místo bliknutí „žádný záznam" během asynchronního načtení. */
    .list-loading {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.6rem;
        padding: 1.6rem 1.2rem;
        color: var(--text-soft);
    }

    .list-loading .spinner {
        width: 1.05rem;
        height: 1.05rem;
        border: 2px solid rgba(126, 164, 213, 0.35);
        border-top-color: rgba(66, 118, 180, 0.9);
        border-radius: 50%;
        animation: list-loading-spin 0.7s linear infinite;
    }

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

    .assistant-layout {
        display: grid;
        grid-template-columns: 260px minmax(0, 1fr) 280px;
        gap: 1rem;
        align-items: start;
    }

    .assistant-thread-list {
        display: flex;
        flex-direction: column;
        gap: 0.55rem;
        border: 1px solid rgba(126, 164, 213, 0.24);
        border-radius: 6px;
        padding: 0.85rem;
        background: rgba(247, 250, 255, 0.72);
    }

    .assistant-thread-list-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
    }

    .assistant-thread-new {
        border: 1px solid rgba(37, 99, 235, 0.25);
        border-radius: 4px;
        background: rgba(219, 234, 254, 0.84);
        color: #1d4ed8;
        cursor: pointer;
        font-size: 0.78rem;
        font-weight: 800;
        padding: 0.28rem 0.65rem;
    }

    .assistant-thread-item {
        display: grid;
        gap: 0.22rem;
        border: 1px solid rgba(126, 164, 213, 0.22);
        border-radius: 6px;
        background: rgba(255, 255, 255, 0.74);
        color: var(--text-main);
        cursor: pointer;
        padding: 0.65rem 0.7rem;
        text-align: left;
    }

        .assistant-thread-item strong {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .assistant-thread-item span {
            color: var(--text-soft);
            font-size: 0.74rem;
        }

    .assistant-thread-active {
        border-color: rgba(37, 99, 235, 0.4);
        background: rgba(219, 234, 254, 0.72);
    }

    .assistant-chat {
        display: flex;
        flex-direction: column;
        gap: 0.85rem;
        min-height: 420px;
    }

    .assistant-message {
        border: 1px solid rgba(126, 164, 213, 0.24);
        border-radius: 6px;
        padding: 0.9rem;
        background: rgba(255, 255, 255, 0.78);
    }

    .assistant-message-user {
        margin-left: 12%;
        background: rgba(224, 242, 254, 0.82);
    }

    .assistant-message-assistant {
        margin-right: 7%;
    }

    .assistant-message-label,
    .assistant-side-title {
        color: var(--text-soft);
        font-size: 0.78rem;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    .assistant-message-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
    }

    .assistant-model-badge {
        border: 1px solid rgba(148, 163, 184, 0.28);
        border-radius: 4px;
        color: #64748b;
        font-size: 0.72rem;
        font-weight: 800;
        padding: 0.18rem 0.55rem;
    }

    .assistant-model-active {
        background: rgba(22, 163, 74, 0.12);
        border-color: rgba(22, 163, 74, 0.28);
        color: #166534;
    }

    .assistant-connection {
        display: inline-flex;
        align-items: center;
        gap: 0.65rem;
        width: min(420px, 100%);
        border: 1px solid rgba(148, 163, 184, 0.3);
        border-radius: 6px;
        background: rgba(255, 255, 255, 0.78);
        padding: 0.65rem 0.8rem;
    }

        .assistant-connection strong,
        .assistant-connection small {
            display: block;
        }

        .assistant-connection strong {
            color: var(--text-strong);
            font-size: 0.9rem;
            line-height: 1.15;
        }

        .assistant-connection small {
            color: var(--text-soft);
            font-size: 0.76rem;
            line-height: 1.25;
            margin-top: 0.1rem;
            overflow-wrap: anywhere;
        }

    .assistant-connection-dot {
        width: 0.72rem;
        height: 0.72rem;
        flex: 0 0 auto;
        border-radius: 4px;
        background: #94a3b8;
        box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.16);
    }

    .assistant-connection-online {
        border-color: rgba(22, 163, 74, 0.28);
        background: rgba(240, 253, 244, 0.88);
    }

        .assistant-connection-online .assistant-connection-dot {
            background: #16a34a;
            box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.16);
        }

    .assistant-connection-warning {
        border-color: rgba(217, 119, 6, 0.3);
        background: rgba(255, 251, 235, 0.9);
    }

        .assistant-connection-warning .assistant-connection-dot {
            background: #d97706;
            box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.16);
        }

    .assistant-connection-local .assistant-connection-dot,
    .assistant-connection-checking .assistant-connection-dot {
        background: #64748b;
    }

    .assistant-message-text {
        margin-top: 0.25rem;
        line-height: 1.45;
        white-space: pre-line;
    }

    .assistant-metrics {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
        gap: 0.55rem;
        margin-top: 0.85rem;
    }

    .assistant-metric {
        box-shadow: none;
    }

    .assistant-chart {
        display: flex;
        flex-direction: column;
        gap: 0.55rem;
        margin-top: 0.85rem;
        padding: 0.75rem;
        border: 1px solid rgba(126, 164, 213, 0.22);
        border-radius: 6px;
        background: rgba(248, 251, 255, 0.72);
    }

    .assistant-chart-row {
        display: grid;
        grid-template-columns: minmax(4.5rem, 7rem) minmax(8rem, 1fr) minmax(4.5rem, auto);
        align-items: center;
        gap: 0.75rem;
    }

    .assistant-chart-label {
        color: var(--text-soft);
        font-size: 0.86rem;
        font-weight: 700;
    }

    .assistant-chart-track {
        height: 0.85rem;
        overflow: hidden;
        border-radius: 4px;
        background: rgba(126, 164, 213, 0.18);
    }

    .assistant-chart-bar {
        height: 100%;
        min-width: 0.2rem;
        border-radius: inherit;
        background: linear-gradient(90deg, #2563eb, #16a34a);
    }

    .assistant-chart-row > strong {
        color: var(--text-strong);
        font-size: 0.88rem;
        text-align: right;
    }

    .assistant-result-list {
        display: flex;
        flex-direction: column;
        gap: 0.45rem;
        margin-top: 0.85rem;
    }

    .assistant-result-row {
        display: flex;
        justify-content: space-between;
        gap: 1rem;
        padding: 0.7rem 0;
        border-top: 1px solid rgba(126, 164, 213, 0.2);
    }

        .assistant-result-row > span {
            flex: 0 0 auto;
            font-weight: 800;
            text-align: right;
        }

    .assistant-side {
        border: 1px solid rgba(126, 164, 213, 0.24);
        border-radius: 6px;
        padding: 0.85rem;
        background: rgba(247, 250, 255, 0.72);
    }

    .assistant-suggestions {
        display: flex;
        flex-direction: column;
        gap: 0.45rem;
        margin-top: 0.7rem;
    }

    .assistant-suggestion {
        border: 1px solid rgba(126, 164, 213, 0.32);
        border-radius: 6px;
        background: rgba(255, 255, 255, 0.78);
        color: var(--text-strong);
        cursor: pointer;
        font-weight: 700;
        padding: 0.65rem 0.75rem;
        text-align: left;
    }

        .assistant-suggestion:hover:not(:disabled) {
            border-color: rgba(37, 99, 235, 0.45);
            color: rgb(29, 78, 216);
        }

    .assistant-input-panel {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.75rem;
        align-items: stretch;
        border-top: 1px solid rgba(126, 164, 213, 0.18);
        padding-top: 1rem;
    }

    .assistant-input {
        min-height: 76px;
        resize: vertical;
    }

    .assistant-send {
        align-self: stretch;
        min-width: 120px;
    }

    .release-toggle {
        width: 100%;
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 1rem;
        border: 0;
        background: transparent;
        padding: 0;
        text-align: left;
    }

    .release-summary {
        margin: 0.75rem 0 0;
        color: var(--text-soft);
    }

    .release-details {
        margin-top: 0.8rem;
    }

    .modal-backdrop {
        position: fixed;
        inset: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 1.5rem;
        background: rgba(15, 23, 42, 0.38);
        backdrop-filter: blur(6px);
        z-index: 1100;
    }

    .module-opportunities.page-panel,
    .module-opportunities.project-card,
    .module-opportunities.modal-panel,
    .module-leads.page-panel,
    .module-leads.project-card,
    .module-leads.modal-panel,
    .module-projects.page-panel,
    .module-projects.project-card,
    .module-projects.modal-panel,
    .module-contracts.page-panel,
    .module-contracts.project-card,
    .module-contracts.modal-panel,
    .module-activities.page-panel,
    .module-activities.project-card,
    .module-activities.modal-panel,
    .module-business-cases.page-panel,
    .module-business-cases.project-card,
    .module-business-cases.modal-panel,
    .module-timesheets.page-panel,
    .module-timesheets.project-card,
    .module-timesheets.modal-panel {
        background: #ffffff;
        border-color: var(--border-soft);
        box-shadow: none;
    }
    /* Všechny module detail-hero sdílí jednotný KODYS tmavě modrý header */
    .module-opportunities.detail-hero,
    .module-leads.detail-hero,
    .module-projects.detail-hero,
    .module-contracts.detail-hero,
    .module-activities.detail-hero,
    .module-business-cases.detail-hero {
        background: #002D62;
    }

    .module-timesheets .section-eyebrow {
        color: #4338ca;
    }

    .module-projects .section-eyebrow {
        color: #0369a1;
    }

    .module-contracts .section-eyebrow {
        color: #0f766e;
    }

    .module-activities .section-eyebrow {
        color: #0284c7;
    }

    .module-business-cases .section-eyebrow {
        color: #be185d;
    }

    .module-opportunities .section-eyebrow {
        color: #c2410c;
    }

    .module-leads .section-eyebrow {
        color: #4d7c0f;
    }

    .login-shell {
        min-height: 100vh;
        display: grid;
        place-items: center;
        padding: 2rem;
        background: #F4F5F7;
    }

    .login-card {
        width: min(560px, 100%);
        display: grid;
        gap: 1.25rem;
        padding: 1.8rem;
        border-radius: 10px;
        background: #ffffff;
        border: 1px solid var(--border-soft);
        box-shadow: 0 4px 24px rgba(0, 45, 98, 0.08);
    }

    .login-copy {
        display: grid;
        gap: 0.4rem;
        text-align: center;
    }

    .login-logo {
        max-width: 480px;
        height: auto;
        margin: 0 auto 0.25rem;
        display: block;
    }

    .login-copy h1 {
        font-size: 2rem;
        color: #123d69;
    }

    .login-copy p {
        margin: 0;
        color: #5a789c;
        line-height: 1.5;
    }

    .login-form {
        display: grid;
        gap: 1rem;
    }

    .login-remember-card {
        align-items: flex-start;
        background: rgba(241, 247, 255, 0.8);
    }

    .login-submit {
        min-height: 3rem;
        font-size: 1rem;
    }

    .login-links {
        display: grid;
        gap: 0.45rem;
        text-align: center;
    }

        .login-links a {
            color: #1d4f91;
            text-decoration: none;
            font-weight: 600;
        }

            .login-links a:hover {
                text-decoration: underline;
            }

    .login-divider {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        color: #8fa3bb;
        font-size: 0.85rem;
    }

        .login-divider::before,
        .login-divider::after {
            content: "";
            flex: 1;
            height: 1px;
            background: var(--border-soft);
        }

    .login-microsoft-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.6rem;
        min-height: 3rem;
        font-size: 0.95rem;
        width: 100%;
    }

    .modal-panel {
        width: min(980px, calc(100vw - 2rem));
        max-height: calc(100vh - 3rem);
        overflow: auto;
        padding: 1.35rem;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.96);
        border: 1px solid rgba(126, 164, 213, 0.22);
        box-shadow: 0 30px 60px rgba(15, 23, 42, 0.24);
    }

    .modal-panel-compact {
        width: min(620px, calc(100vw - 2rem));
    }

    .form-control,
    .form-select,
    textarea.form-control {
        border-radius: 6px;
        border: 1px solid rgba(126, 164, 213, 0.35);
        padding: 0.8rem 1rem;
        background: rgba(255, 255, 255, 0.78);
    }

    textarea.form-control {
        min-height: 120px;
    }

    .narrow-input {
        max-width: 7rem;
    }

    #blazor-error-ui {
        background: #fff3cd;
        bottom: 0;
        box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
        display: none;
        left: 0;
        padding: 0.6rem 1.25rem 0.7rem 1.25rem;
        position: fixed;
        width: 100%;
        z-index: 1000;
    }

        #blazor-error-ui .dismiss {
            cursor: pointer;
            position: absolute;
            right: 0.75rem;
            top: 0.5rem;
        }

    @media (max-width: 1100px) {
        .metric-grid,
        .metric-grid.compact,
        .content-grid,
        .form-grid,
        .selector-grid,
        .report-area-strip,
        .report-row,
        .meta-grid,
        .reporting-detail-grid,
        .reporting-info-grid,
        .assistant-layout,
        .assistant-input-panel {
            grid-template-columns: 1fr;
        }

        .hero-panel,
        .panel-header,
        .project-card-head,
        .detail-hero-head,
        .detail-command-bar,
        .report-selector-header {
            flex-direction: column;
            align-items: flex-start;
        }

        .assistant-message-user,
        .assistant-message-assistant {
            margin-left: 0;
            margin-right: 0;
        }

        .hero-command-bar {
            margin-left: 0;
            justify-content: flex-start;
        }

        .detail-two-column,
        .detail-meta-grid {
            grid-template-columns: 1fr;
        }

        .bar-label {
            width: 7rem;
            flex-basis: 7rem;
        }
    }
    /* ============================================================
   Customers module theme + CRM detail UI
   ============================================================ */

    .module-customers.page-panel,
    .module-customers.project-card,
    .module-customers.modal-panel {
        background: #ffffff;
        border-color: var(--border-soft);
        box-shadow: none;
    }

    .module-customers.detail-hero {
        background: #002D62;
    }

    .module-customers .section-eyebrow {
        color: #0f5d6e;
    }

    .module-contacts.page-panel,
    .module-contacts.project-card,
    .module-contacts.modal-panel {
        background: #ffffff;
        border-color: var(--border-soft);
        box-shadow: none;
    }

    .module-contacts.detail-hero {
        background: #002D62;
    }

    .module-contacts .section-eyebrow {
        color: #0d9488;
    }
    /* --- Quick filter pill bar (customers list) --- */
    .quick-filter-bar {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.75rem 0 0.25rem;
    }

    .pill-button {
        padding: 0.4rem 0.85rem;
        border-radius: 4px;
        border: 1px solid rgba(15, 93, 110, 0.25);
        background: rgba(255, 255, 255, 0.85);
        color: #0f5d6e;
        font-size: 0.85rem;
        font-weight: 600;
        cursor: pointer;
        transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    }

        .pill-button:hover {
            background: rgba(45, 212, 191, 0.18);
        }

    .pill-button-active {
        background: #0f5d6e;
        border-color: #0f5d6e;
        color: #ffffff;
    }
    /* --- Mimo scope (out-of-scope) marker pro projektové úkoly --- */
    .nested-group-out-of-scope {
        border-left: 3px solid #d97706;
        background: rgba(217, 119, 6, 0.05);
        padding-left: 0.75rem;
    }

    .out-of-scope-badge {
        display: inline-block;
        padding: 0.15rem 0.6rem;
        border-radius: 4px;
        background: #d97706;
        color: #ffffff;
        font-size: 0.7rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        margin-left: 0.5rem;
    }
    /* --- Task row s integrovaným přiřazením členů týmu --- */
    .task-row {
        padding: 0.55rem 0.7rem 0.6rem;
        border-radius: 8px;
        background: #ffffff;
        margin-bottom: 0.55rem;
        border: 1px solid #d8dee9;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    }

        .task-row:hover {
            border-color: #b9c4d4;
            box-shadow: 0 2px 6px rgba(15, 23, 42, 0.1);
        }

    /* Řešitel + předchůdci na jedné řádce nad progressem */
    .task-row-meta {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.5rem 1.25rem;
        margin-top: 0.5rem;
    }

    .task-row-field {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.35rem;
    }

        .task-row-field-label {
            font-size: 0.72rem;
            text-transform: uppercase;
            letter-spacing: 0.02em;
            color: #64748b;
            font-weight: 600;
        }

    /* Vodorovné rozložení úkolu: oblast · název · řešitel · předchůdci · progress */
    .task-cells {
        display: grid;
        grid-template-columns: 120px minmax(150px, 1.3fr) 200px minmax(170px, 1.5fr) 210px;
        align-items: center;
        gap: 0.4rem 0.9rem;
    }

    .task-cell {
        min-width: 0;
    }

    .task-cell-area {
        font-size: 0.76rem;
        font-weight: 600;
        color: #475569;
        background: #f1f5f9;
        border: 1px solid #e2e8f0;
        border-radius: 6px;
        padding: 0.18rem 0.45rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .task-cell-name {
        display: flex;
        flex-direction: column;
        gap: 0.05rem;
    }

        .task-cell-name .task-row-title-link {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

    .task-cell-sub {
        font-size: 0.72rem;
    }

    .task-cell-deps {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.3rem;
    }

    .task-cell-progress {
        display: flex;
        align-items: center;
        gap: 0.45rem;
    }

        .task-cell-progress .bar-track {
            flex: 1;
            height: 6px;
            border-radius: 3px;
            background: rgba(0, 45, 98, 0.08);
            overflow: hidden;
        }

        .task-cell-progress .bar-fill {
            height: 100%;
            border-radius: 3px;
            transition: width 0.3s ease;
        }

    .task-cell-hours {
        font-size: 0.72rem;
        white-space: nowrap;
    }

    @media (max-width: 1000px) {
        .task-cells {
            grid-template-columns: 1fr;
            gap: 0.3rem;
        }
    }

    .task-row-draggable {
        cursor: grab;
    }

        .task-row-draggable:active {
            cursor: grabbing;
        }

        .task-row-draggable.drag-active {
            opacity: 0.4;
        }

    .task-row-out-of-scope {
        background: rgba(217, 119, 6, 0.07);
        border-left: 3px solid #d97706;
    }

    .nested-group.drop-target-active {
        outline: 2px dashed #0f5d6e;
        outline-offset: 4px;
    }

    .task-row-head {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 1rem;
    }

    .task-row-title-link {
        font-weight: 600;
        color: inherit;
        text-decoration: none;
    }

        .task-row-title-link:hover {
            text-decoration: underline;
            color: var(--accent, #0f5d6e);
        }

    .task-row-progress {
        display: flex;
        align-items: center;
        gap: 0.6rem;
        margin-top: 0.5rem;
    }

        .task-row-progress .bar-track {
            flex: 1;
            height: 6px;
            border-radius: 3px;
            background: rgba(0, 45, 98, 0.08);
            overflow: hidden;
        }

        .task-row-progress .bar-fill {
            height: 100%;
            border-radius: 3px;
            transition: width 0.3s ease;
        }

        .task-row-progress > .muted {
            white-space: nowrap;
            font-size: 0.8rem;
            min-width: 7rem;
            text-align: right;
        }

    .task-row-assign {
        display: flex;
        flex-wrap: wrap;
        gap: 0.35rem;
        align-items: center;
        margin-top: 0.55rem;
        padding-top: 0.5rem;
        border-top: 1px dashed rgba(0, 45, 98, 0.08);
    }

    .task-row-assign-empty {
        margin-top: 0.55rem;
        padding-top: 0.5rem;
        border-top: 1px dashed rgba(0, 45, 98, 0.08);
        font-size: 0.82rem;
    }

    /* Závislosti (předchůdci) v řádku úkolu */
    .task-row-deps {
        display: flex;
        flex-wrap: wrap;
        gap: 0.35rem;
        align-items: center;
        margin-top: 0.4rem;
        font-size: 0.82rem;
    }

        .task-row-deps-label {
            color: #64748b;
        }

    .dep-chip {
        display: inline-flex;
        align-items: center;
        gap: 0.25rem;
        padding: 0.1rem 0.2rem 0.1rem 0.5rem;
        background: #eef2f7;
        border: 1px solid #cbd5e1;
        border-radius: 999px;
        font-size: 0.78rem;
    }

    .dep-chip-x {
        border: none;
        background: transparent;
        cursor: pointer;
        color: #64748b;
        font-size: 0.9rem;
        line-height: 1;
        padding: 0 0.15rem;
    }

    .task-dep-select {
        max-width: 180px;
        font-size: 0.82rem;
        padding: 0.25rem 0.5rem;
    }

    .task-assign-select {
        flex: 0 1 220px;
        min-width: 150px;
        padding: 0.25rem 0.5rem;
        font-size: 0.82rem;
    }

    .assignment-chip {
        display: inline-flex;
        align-items: center;
        gap: 0.3rem;
        padding: 0.25rem 0.55rem;
        border-radius: 4px;
        background: rgba(0, 45, 98, 0.05);
        border: 1px solid rgba(0, 45, 98, 0.10);
        cursor: pointer;
        font-size: 0.8rem;
        transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    }

        .assignment-chip input[type="checkbox"] {
            accent-color: #0f5d6e;
            margin: 0;
        }

        .assignment-chip:hover {
            background: rgba(15, 93, 110, 0.08);
        }

    .assignment-chip-active {
        background: rgba(15, 93, 110, 0.14);
        border-color: rgba(15, 93, 110, 0.50);
        color: #0f5d6e;
        font-weight: 600;
    }
    /* --- Panel subsection (uvnitř záložky) --- */
    .panel-subsection + .panel-subsection {
        margin-top: 1.75rem;
        padding-top: 1.5rem;
        border-top: 1px solid rgba(0, 45, 98, 0.08);
    }
    /* --- Tabs (customer detail) --- */
    .tabs-bar {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
        border-bottom: 1px solid rgba(0, 45, 98, 0.10);
        margin-bottom: 1rem;
    }

    .tabs-bar-detail {
        margin: -0.25rem 0 0.75rem;
        padding: 0 0.25rem;
    }

    .tab-button {
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        padding: 0.6rem 1rem;
        background: transparent;
        border: 0;
        border-bottom: 2px solid transparent;
        color: #55565A;
        font-size: 0.9rem;
        font-weight: 600;
        cursor: pointer;
        transition: color 0.15s ease, border-color 0.15s ease;
    }

        .tab-button:hover {
            color: #002D62;
        }

    .tab-button-active {
        color: #0f5d6e;
        border-bottom-color: #FFC40C;
    }

    /* Záložka jen pro administrátora — vidí ji i ostatní, ale je šedá a nedostupná. */
    .tab-button-locked {
        opacity: 0.45;
        filter: grayscale(0.55);
        cursor: not-allowed;
        pointer-events: none;
    }

    .tab-count {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 1.4rem;
        padding: 0 0.45rem;
        height: 1.4rem;
        border-radius: 4px;
        background: rgba(15, 93, 110, 0.12);
        color: #0f5d6e;
        font-size: 0.72rem;
        font-weight: 700;
    }

    .tab-button-active .tab-count {
        background: #FFC40C;
        color: #002D62;
    }
    /* --- Customer Overview layout --- */
    .overview-grid {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 1.5rem;
    }

        .overview-grid h3 {
            margin: 0 0 0.6rem;
            font-size: 0.95rem;
            color: #002D62;
        }

            .overview-grid h3:not(:first-child) {
                margin-top: 1.25rem;
            }

    .kv-list {
        display: grid;
        grid-template-columns: max-content 1fr;
        column-gap: 1rem;
        row-gap: 0.3rem;
        margin: 0;
        font-size: 0.88rem;
    }

        .kv-list dt {
            color: #55565A;
            font-weight: 600;
        }

        .kv-list dd {
            margin: 0;
            color: #1B1C1E;
        }
    /* --- Contact card --- */
    .contact-card {
        display: grid;
        gap: 0.15rem;
        padding: 0.65rem 0.85rem;
        margin-bottom: 0.5rem;
        background: rgba(255, 255, 255, 0.7);
        border: 1px solid rgba(0, 45, 98, 0.08);
        border-radius: 6px;
    }

        .contact-card .status-pill {
            margin-left: 0.5rem;
        }
    /* --- Inline form helpers --- */
    .checkbox-row {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        font-weight: 500;
        color: #1B1C1E;
    }

    .row-actions {
        display: flex;
        gap: 0.5rem;
        justify-content: flex-end;
    }

    .link-button {
        background: transparent;
        border: 0;
        padding: 0.15rem 0.35rem;
        color: #0f5d6e;
        font-weight: 600;
        cursor: pointer;
    }

        .link-button:hover {
            text-decoration: underline;
        }

        .link-button.danger {
            color: #C5221F;
        }

    @media (max-width: 900px) {
        .overview-grid {
            grid-template-columns: 1fr;
        }
    }
    /* === Customers module — Phase 2 tab content === */

    .tab-toolbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 0.75rem;
        padding: 0 0.1rem;
    }
    /* Renewal alert row */
    .row-alert td {
        background: rgba(251, 191, 36, 0.06);
    }

    .renewal-badge {
        display: inline-block;
        margin-left: 0.5rem;
        padding: 0.1rem 0.45rem;
        border-radius: 4px;
        background: rgba(251, 191, 36, 0.18);
        color: #92400e;
        font-size: 0.7rem;
        font-weight: 700;
        letter-spacing: 0.02em;
        vertical-align: middle;
    }
    /* Activities timeline */
    .thread-list {
        display: grid;
        gap: 0.6rem;
    }

    .thread-item {
        display: grid;
        gap: 0.18rem;
        padding: 0.75rem 1rem;
        background: rgba(255, 255, 255, 0.7);
        border: 1px solid rgba(0, 45, 98, 0.08);
        border-radius: 6px;
    }

    .thread-meta {
        font-size: 0.74rem;
        color: #5a6a7e;
        letter-spacing: 0.02em;
    }
    /* === Customers module — Phase 3: Timesheets tab === */

    .ts-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
        align-items: start;
    }

    @media (max-width: 960px) {
        .ts-grid {
            grid-template-columns: 1fr;
        }
    }

    .ts-bar-wrap {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        min-width: 120px;
    }

    .ts-bar {
        height: 0.55rem;
        border-radius: 4px;
        background: linear-gradient(90deg, #6366f1, #4338ca);
        flex-shrink: 0;
        transition: width 0.3s ease;
        min-width: 2px;
    }

    .ts-bar-teal {
        background: linear-gradient(90deg, #14b8a6, #0f766e);
    }

    .ts-bar-label {
        font-size: 0.72rem;
        color: #5a6a7e;
        white-space: nowrap;
        min-width: 2.5rem;
    }

    .text-right {
        text-align: right;
    }

    .data-table tfoot td {
        border-top: 2px solid rgba(0, 45, 98, 0.12);
        padding-top: 0.6rem;
        font-weight: 600;
    }
    /* === Customers module — Phase 5: Customer Team === */

    .team-add-form {
        display: grid;
        grid-template-columns: 1fr 1fr auto;
        gap: 0.5rem;
        align-items: start;
        margin-bottom: 0.75rem;
        padding: 0.75rem;
        background: rgba(99, 102, 241, 0.05);
        border: 1px solid rgba(99, 102, 241, 0.15);
        border-radius: 6px;
    }

    .team-member-card {
        border-left: 3px solid rgba(99, 102, 241, 0.4);
    }
    /* === Customers module — Phase 6: Health Score === */

    .health-badge {
        display: inline-block;
        padding: 0.15rem 0.55rem;
        border-radius: 4px;
        font-size: 0.74rem;
        font-weight: 700;
        letter-spacing: 0.03em;
        white-space: nowrap;
    }

    .health-healthy {
        background: rgba(22, 163, 74, 0.12);
        color: #15803d;
        border: 1px solid rgba(22, 163, 74, 0.25);
    }

    .health-warning {
        background: rgba(234, 179, 8, 0.12);
        color: #a16207;
        border: 1px solid rgba(234, 179, 8, 0.3);
    }

    .health-atrisk {
        background: rgba(220, 38, 38, 0.10);
        color: #b91c1c;
        border: 1px solid rgba(220, 38, 38, 0.25);
    }
    /* === ActivityScope pill v položkách prodeje === */

    .scope-pill {
        background: rgba(99, 102, 241, 0.1);
        color: #4338ca;
        border: 1px solid rgba(99, 102, 241, 0.25);
        font-size: 0.72rem;
        font-weight: 600;
        margin-left: 0.4rem;
        vertical-align: middle;
    }
    /* Odznak nově provisionovaného uživatele z Entry (dosud nepřihlášen). */
    .entra-badge {
        display: inline-block;
        margin-left: 0.5rem;
        padding: 0.05rem 0.4rem;
        border-radius: 999px;
        font-size: 0.68rem;
        font-weight: 600;
        background: rgba(217, 119, 6, 0.12);
        color: #b45309;
        border: 1px solid rgba(217, 119, 6, 0.3);
        vertical-align: middle;
    }

    /* Klikací progressbar stavu příležitosti (přepínání stavu jako u leadů). */
    .detail-stage-strip-clickable .detail-stage-node {
        cursor: pointer;
    }

        .detail-stage-strip-clickable .detail-stage-node:hover .detail-stage-bar {
            filter: brightness(0.92);
        }

        .detail-stage-strip-clickable .detail-stage-node:hover .detail-stage-label {
            text-decoration: underline;
        }

    /* === Kvalifikace příležitosti (BANT + fit) === */
    .qual-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        margin-bottom: 0.25rem;
    }

        .qual-header h3 {
            margin: 0;
            font-size: 0.95rem;
        }

    /* Parametry kvalifikace pod sebou; rozpočet/termín se při známé hodnotě rozšíří do strany. */
    .qual-list {
        display: flex;
        flex-direction: column;
        gap: 0.7rem;
        max-width: 820px;
    }

    .qual-row {
        display: flex;
        gap: 1rem;
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .qual-field {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
        flex: 1 1 260px;
        min-width: 220px;
    }

    .qual-band {
        display: inline-block;
        padding: 0.1rem 0.5rem;
        border-radius: 999px;
        font-size: 0.75rem;
        font-weight: 700;
        white-space: nowrap;
    }

    .qual-band-a { background: rgba(22, 163, 74, 0.14); color: #15803d; border: 1px solid rgba(22, 163, 74, 0.35); }
    .qual-band-b { background: rgba(217, 119, 6, 0.14); color: #b45309; border: 1px solid rgba(217, 119, 6, 0.35); }
    .qual-band-c { background: rgba(220, 38, 38, 0.14); color: #b91c1c; border: 1px solid rgba(220, 38, 38, 0.35); }
    .qual-band-none { background: rgba(100, 116, 139, 0.12); color: #64748b; border: 1px solid rgba(100, 116, 139, 0.3); }

    /* === Nastavení notifikací === */

    .notif-card {
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 0.9rem 1.1rem;
        margin-bottom: 0.9rem;
        background: #fff;
    }

    .notif-head {
        display: flex;
        align-items: flex-start;
        gap: 0.6rem;
        cursor: pointer;
    }

        .notif-head input {
            margin-top: 0.25rem;
        }

    .notif-params {
        margin: 0.75rem 0 0.2rem;
        padding-left: 1.7rem;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .notif-param-label {
        font-size: 0.82rem;
        color: #6b7280;
        font-weight: 500;
    }

    .notif-chips {
        display: flex;
        flex-wrap: wrap;
        gap: 0.4rem 0.9rem;
    }

    .notif-chip {
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        font-size: 0.86rem;
    }

    /* === Přenos odhadu do prodeje — modál === */

    .transfer-mode-list {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        margin-bottom: 0.9rem;
    }

    .transfer-mode-option {
        display: flex;
        align-items: flex-start;
        gap: 0.6rem;
        padding: 0.6rem 0.75rem;
        border: 1px solid #e2e8f0;
        border-radius: 6px;
        cursor: pointer;
    }

        .transfer-mode-option input {
            margin-top: 0.2rem;
        }

    .transfer-field {
        display: flex;
        flex-direction: column;
        gap: 0.3rem;
        margin-bottom: 0.9rem;
    }

        .transfer-field label {
            font-size: 0.84rem;
            font-weight: 500;
        }

    .transfer-checkbox {
        display: flex;
        align-items: flex-start;
        gap: 0.5rem;
        margin-bottom: 0.9rem;
        font-size: 0.86rem;
    }

    .transfer-preview {
        padding: 0.7rem 0.9rem;
        background: rgba(248, 250, 252, 0.7);
        border: 1px solid #e2e8f0;
        border-radius: 6px;
        font-size: 0.88rem;
        margin-bottom: 1rem;
    }

    /* === Sale item modal — cenový rámecek === */

    .sale-price-box {
        display: flex;
        flex-direction: column;
        gap: 0.55rem;
        padding: 1rem 1.1rem;
        background: rgba(248, 250, 252, 0.7);
        border: 1px solid #e2e8f0;
        border-radius: 6px;
    }

    .sale-price-row {
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

        .sale-price-row label {
            flex: 0 0 220px;
            font-size: 0.84rem;
            font-weight: 500;
            color: #475569;
            margin: 0;
        }

        .sale-price-row .form-control {
            flex: 1 1 auto;
            max-width: 180px;
            text-align: right;
        }

    .sale-price-divider {
        border-top: 1px solid #cbd5e1;
        margin: 0.2rem 0;
    }

    .sale-price-result {
        font-size: 0.9rem;
    }

    .sale-price-result-label {
        flex: 0 0 220px;
        font-weight: 600;
        color: #1e293b;
    }

    .sale-price-result-value {
        flex: 1 1 auto;
        text-align: right;
        font-weight: 700;
        color: #1e293b;
        font-size: 0.95rem;
    }

    .sale-price-result-pct {
        font-weight: 500;
        color: #64748b;
        font-size: 0.82rem;
    }

    .sale-price-result-negative .sale-price-result-value {
        color: #dc2626;
    }
    /* === Settings — Okruhy činností === */

    .settings-scope-layout {
        display: grid;
        grid-template-columns: 260px 1fr;
        gap: 1.5rem;
        align-items: start;
    }

    .scope-categories-panel,
    .scope-items-panel {
        border: 1px solid var(--border-soft);
        border-radius: 8px;
        padding: 1rem;
        background: var(--bg-panel);
    }

    .scope-category-list {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
        margin-bottom: 0.75rem;
    }

    .scope-category-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.45rem 0.75rem;
        border-radius: 6px;
        cursor: pointer;
        transition: background 0.12s;
    }

        .scope-category-item:hover {
            background: rgba(126, 164, 213, 0.12);
        }

    .scope-category-active {
        background: rgba(59, 130, 246, 0.1);
        font-weight: 600;
    }

    .scope-category-name {
        font-size: 0.88rem;
    }

    .scope-category-count {
        font-size: 0.78rem;
        color: var(--text-soft);
        background: rgba(126, 164, 213, 0.18);
        border-radius: 4px;
        padding: 0.1rem 0.5rem;
    }

    .scope-add-row {
        display: flex;
        gap: 0.5rem;
        margin-top: 0.75rem;
    }

        .scope-add-row .form-control {
            flex: 1;
        }
    /* ============================================================
   Org chart (P-3c)
   ============================================================ */

    .module-organization.page-panel {
        background: #ffffff;
        border-color: var(--border-soft);
        box-shadow: none;
    }

    .org-tree {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 2rem 1rem;
        overflow-x: auto;
    }

        .org-tree > .org-node {
            margin-bottom: 1rem;
        }

    .org-node {
        display: flex;
        flex-direction: column;
        align-items: center;
        position: relative;
    }

    .org-node-card-wrapper {
        position: relative;
        display: inline-block;
    }

    .org-node-card {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        min-width: 240px;
        max-width: 320px;
        padding: 0.75rem 1rem;
        background: #ffffff;
        border: 1px solid rgba(99, 102, 241, 0.20);
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
        cursor: pointer;
        transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    }

        .org-node-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 24px rgba(15, 23, 42, 0.10);
            border-color: rgba(99, 102, 241, 0.45);
        }

        .org-node-card[draggable="true"]:active {
            opacity: 0.6;
            cursor: grabbing;
        }

    .org-node-avatar {
        flex-shrink: 0;
        width: 42px;
        height: 42px;
        border-radius: 50%;
        background: linear-gradient(135deg, #6366f1, #4338ca);
        color: white;
        font-weight: 700;
        font-size: 0.95rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .org-node-info {
        flex: 1;
        min-width: 0;
    }

        .org-node-info strong {
            display: block;
            font-size: 0.95rem;
            color: #1e293b;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .org-node-info .muted {
            font-size: 0.78rem;
            margin-top: 1px;
        }

    .org-node-position {
        font-size: 0.75rem;
        color: #4338ca;
        font-weight: 600;
        margin-top: 2px;
    }

    .org-node-team {
        display: inline-block;
        margin-top: 4px;
        padding: 1px 6px;
        background: rgba(99, 102, 241, 0.10);
        color: #4338ca;
        border-radius: 4px;
        font-size: 0.7rem;
        font-weight: 600;
    }

    .org-node-add {
        position: absolute;
        right: -10px;
        bottom: -10px;
        width: 26px;
        height: 26px;
        border-radius: 50%;
        border: 2px solid white;
        background: #6366f1;
        color: white;
        font-size: 1rem;
        font-weight: 700;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
        transition: transform 0.15s ease, background 0.15s ease;
        opacity: 0;
    }

    .org-node-card-wrapper:hover .org-node-add {
        opacity: 1;
    }

    .org-node-add-below {
        margin-top: 0.5rem;
        padding: 0.35rem 0.85rem;
        background: rgba(99, 102, 241, 0.10);
        color: #4338ca;
        border: 1px dashed rgba(99, 102, 241, 0.45);
        border-radius: 8px;
        font-size: 0.78rem;
        font-weight: 600;
        cursor: pointer;
        transition: background 0.15s ease, color 0.15s ease;
    }

        .org-node-add-below:hover {
            background: #6366f1;
            color: white;
            border-style: solid;
        }

    .org-page-layout {
        display: flex;
        gap: 1rem;
        align-items: flex-start;
    }

    .org-main {
        flex: 1;
        min-width: 0;
    }
    /* Read-only hierarchie (manažerská linie) v Nastavení → Organizace */
    .org-hierarchy {
        border: 1px solid var(--border-soft, #e2e8f0);
        border-radius: 10px;
        overflow: hidden;
        background: #fff;
    }

    .org-hier-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.8rem;
        padding: 0.55rem 0.8rem;
        border-bottom: 1px solid #f1f5f9;
        cursor: pointer;
    }

        .org-hier-row:last-child {
            border-bottom: none;
        }

        .org-hier-row:hover {
            background: #f8fafc;
        }

    .org-hier-main {
        display: flex;
        flex-direction: column;
        gap: 1px;
        min-width: 0;
    }

    .org-hier-meta {
        font-size: 0.8rem;
        display: flex;
        flex-wrap: wrap;
        gap: 0.35rem;
    }
    /* Pilulky výsledku v logu odeslání */
    .status-pill.pill-ok {
        background: #dcfce7;
        color: #166534;
    }

    .status-pill.pill-warn {
        background: #fef3c7;
        color: #92400e;
    }

    .status-pill.pill-error {
        background: #fee2e2;
        color: #991b1b;
    }
    /* Detail uživatele — vlevo hlavní sekce pod sebou, vpravo stav účtu */
    .user-detail-layout {
        display: grid;
        grid-template-columns: 2fr 1fr;
        gap: 1rem;
        align-items: start;
    }

    .user-detail-main {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        min-width: 0;
    }

    @media (max-width: 720px) {
        .user-detail-layout {
            grid-template-columns: 1fr;
        }
    }

    .org-side-panel {
        width: 380px;
        flex-shrink: 0;
        position: sticky;
        top: 1rem;
        background: white;
        border: 1px solid rgba(99, 102, 241, 0.20);
        border-radius: 12px;
        padding: 1.25rem;
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.10);
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }

        .org-side-panel .panel-header {
            margin-bottom: 1rem;
            padding-bottom: 0.75rem;
            border-bottom: 1px solid rgba(99, 102, 241, 0.15);
        }

    .org-position-chip {
        display: inline-block;
        margin-top: 2px;
        padding: 2px 8px;
        background: rgba(99, 102, 241, 0.10);
        color: #4338ca;
        border: 1px solid rgba(99, 102, 241, 0.25);
        border-radius: 4px;
        font-size: 0.78rem;
        font-weight: 600;
        cursor: pointer;
        transition: background 0.15s ease;
    }

        .org-position-chip:hover {
            background: rgba(99, 102, 241, 0.20);
        }

    .org-inline-new {
        display: flex;
        gap: 0.4rem;
        margin-top: 0.5rem;
        padding: 0.5rem;
        background: rgba(99, 102, 241, 0.05);
        border: 1px dashed rgba(99, 102, 241, 0.45);
        border-radius: 8px;
        align-items: center;
        flex-wrap: wrap;
    }

        .org-inline-new .form-control {
            min-width: 140px;
            flex: 1;
        }

    @media (max-width: 1024px) {
        .org-page-layout {
            flex-direction: column;
        }

        .org-side-panel {
            width: 100%;
            position: static;
            max-height: none;
        }
    }

    .org-node-add:hover {
        transform: scale(1.15);
        background: #4338ca;
    }

    .org-node-children {
        display: flex;
        flex-direction: row;
        gap: 2rem;
        margin-top: 2rem;
        position: relative;
        padding-top: 1.5rem;
    }
        /* Connecting lines */
        .org-node-children::before {
            content: '';
            position: absolute;
            top: -1px;
            left: 0;
            right: 0;
            height: 1.5rem;
            border-top: 2px solid rgba(99, 102, 241, 0.35);
            border-left: 2px solid rgba(99, 102, 241, 0.35);
            border-right: 2px solid rgba(99, 102, 241, 0.35);
            border-top-left-radius: 8px;
            border-top-right-radius: 8px;
        }
    /* Vertical line from card to children-block */
    .org-node:has(.org-node-children)::after {
        content: '';
        position: absolute;
        top: calc(100% - 1px);
        left: 50%;
        width: 2px;
        height: 1rem;
        background: rgba(99, 102, 241, 0.35);
        transform: translateX(-50%);
    }
    /* Single child = no horizontal connector */
    .org-node-children:has(> .org-node:only-child)::before {
        border-left: none;
        border-right: none;
        border-radius: 0;
    }
    /* Vertical line above each child */
    .org-node-children > .org-node::before {
        content: '';
        position: absolute;
        top: -1.5rem;
        left: 50%;
        width: 2px;
        height: 1.5rem;
        background: rgba(99, 102, 241, 0.35);
        transform: translateX(-50%);
    }

    .org-node-children:has(> .org-node:only-child) > .org-node::before {
        height: 1.5rem;
    }
    /* ============================================================
   Servisní protokol (ServisMan) — modul + mobilní formulář
   ============================================================ */

    .module-service.page-panel {
        background: #ffffff;
        border-color: var(--border-soft);
        box-shadow: none;
    }

    .module-service .section-eyebrow {
        color: #b45309;
    }
    /* Mobilní formulář servisního protokolu */
    /* Box-sizing reset pro mobilní servisní formulář — statická stránka /servis/
   nelinkuje bootstrap, takže bez tohohle inputy s width:100% + padding přetékaly. */
    .service-mobile,
    .service-mobile *,
    .service-mobile *::before,
    .service-mobile *::after {
        box-sizing: border-box;
    }

    .service-mobile {
        max-width: 720px;
        margin: 0 auto;
        padding: 1rem;
        overflow-x: hidden;
    }
    /* fieldsety nesmí roztáhnout obsah mimo rámec */
    .service-form .service-section {
        min-width: 0;
    }

    .service-form .form-control,
    .service-form textarea.form-control {
        max-width: 100%;
    }

    .service-mobile-header {
        margin-bottom: 1rem;
    }

        .service-mobile-header h1 {
            font-size: 1.4rem;
            margin: 0.3rem 0;
        }

    .service-form .service-section {
        border: 1px solid rgba(180, 83, 9, 0.22);
        border-radius: 12px;
        padding: 1rem;
        margin-bottom: 1rem;
        background: #fff;
    }

        .service-form .service-section legend {
            font-weight: 700;
            color: #b45309;
            padding: 0 0.4rem;
            font-size: 0.95rem;
        }

    .service-form label {
        display: block;
        font-size: 0.85rem;
        font-weight: 600;
        margin: 0.6rem 0 0.25rem;
        color: #334155;
    }

    .service-form .form-control {
        width: 100%;
        font-size: 1rem; /* >=16px aby iOS nezoomoval */
        padding: 0.6rem 0.7rem;
    }

    .service-form textarea.form-control {
        resize: vertical;
        min-height: 3rem;
    }
    /* Našeptávač (zákazník / kontakt) */
    .typeahead {
        position: relative;
    }

        .typeahead .form-control {
            padding-right: 2.2rem; /* místo pro ✕ */
        }

    .typeahead-clear {
        position: absolute;
        top: 0;
        right: 0;
        height: 100%;
        width: 2.2rem;
        border: none;
        background: transparent;
        color: #94a3b8;
        font-size: 1rem;
        cursor: pointer;
        border-radius: 0 8px 8px 0;
    }

        .typeahead-clear:hover {
            color: #dc2626;
        }

    .typeahead-list {
        position: absolute;
        z-index: 30;
        left: 0;
        right: 0;
        top: calc(100% + 2px);
        margin: 0;
        padding: 0.25rem 0;
        list-style: none;
        background: #fff;
        border: 1px solid rgba(180, 83, 9, 0.35);
        border-radius: 10px;
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
        max-height: 16rem;
        overflow-y: auto;
    }

        .typeahead-list li {
            padding: 0.6rem 0.8rem;
            font-size: 0.95rem;
            cursor: pointer;
            color: #1e293b;
        }

            .typeahead-list li:hover {
                background: rgba(180, 83, 9, 0.1);
            }

            .typeahead-list li.typeahead-empty {
                color: #94a3b8;
                cursor: default;
                font-style: italic;
            }

                .typeahead-list li.typeahead-empty:hover {
                    background: transparent;
                }
    /* Podpisový canvas */
    .signature-wrap {
        border: 2px dashed rgba(180, 83, 9, 0.45);
        border-radius: 12px;
        background: #fffdf7;
        touch-action: none;
    }

    .signature-canvas {
        display: block;
        width: 100%;
        height: 180px;
        touch-action: none;
        border-radius: 12px;
    }
    /* Pole s tlačítkem skenování (typové / sériové číslo) */
    .service-disclaimer {
        margin-top: 0.6rem;
        font-size: 0.72rem;
        line-height: 1.35;
        color: #64748b;
    }

    /* Bloky zařízení v servisním formuláři (1..N) */
    .device-block {
        border: 1px solid rgba(180, 83, 9, 0.25);
        border-radius: 10px;
        padding: 0.75rem;
        margin-bottom: 0.75rem;
        background: rgba(180, 83, 9, 0.03);
    }

        .device-block-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 0.4rem;
        }

        .device-block-title {
            font-weight: 700;
            color: #b45309;
            font-size: 0.9rem;
            text-transform: uppercase;
            letter-spacing: 0.02em;
        }

        .device-block .device-remove {
            color: #b91c1c;
        }

    #add-device-btn {
        width: 100%;
    }

    .scan-field {
        display: flex;
        gap: 0.4rem;
        align-items: stretch;
    }

        .scan-field .form-control {
            flex: 1;
            min-width: 0;
        }

    .scan-btn {
        flex: 0 0 auto;
        border: 1px solid rgba(180, 83, 9, 0.35);
        background: #fff;
        border-radius: 8px;
        padding: 0 0.7rem;
        font-size: 1.15rem;
        cursor: pointer;
    }
    /* Miniatury fotek */
    .photo-thumbs {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-top: 0.6rem;
    }

    .photo-thumb {
        position: relative;
        width: 84px;
        height: 84px;
        border-radius: 8px;
        overflow: hidden;
        border: 1px solid #e2e8f0;
    }

        .photo-thumb img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }

    .photo-thumb-remove {
        position: absolute;
        top: 2px;
        right: 2px;
        width: 22px;
        height: 22px;
        border: none;
        border-radius: 50%;
        background: rgba(0, 0, 0, 0.6);
        color: #fff;
        font-size: 0.8rem;
        line-height: 1;
        cursor: pointer;
    }
    /* Celoobrazovkový skener kódů */
    .scan-overlay {
        position: fixed;
        inset: 0;
        height: 100dvh; /* stabilní výška i při zobrazení/skrytí lišty prohlížeče */
        z-index: 1000;
        background: #000;
        display: flex;
        flex-direction: column;
        overflow: hidden; /* video nesmí přerůst a vytlačit ovládací lištu mimo obraz */
    }

        .scan-overlay[hidden] {
            display: none;
        }

        .scan-overlay video {
            flex: 1 1 auto;
            min-height: 0; /* jinak min-height:auto = intrinsická výška videa přeteče sloupec */
            width: 100%;
            object-fit: cover;
        }

    /* Zaměřovací rámeček + laserová čára přes obraz kamery */
    .scan-reticle {
        position: absolute;
        inset: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        pointer-events: none;
        z-index: 1;
    }

    .scan-frame {
        position: relative;
        width: 82%;
        max-width: 440px;
        height: 32%;
        border: 2px solid rgba(255, 255, 255, 0.95);
        border-radius: 12px;
        box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.4); /* ztmavit okolí rámečku */
    }

    .scan-laser {
        position: absolute;
        left: 5%;
        right: 5%;
        height: 2px;
        background: #ff3b30;
        box-shadow: 0 0 8px 1px rgba(255, 59, 48, 0.9);
        animation: scan-laser-move 1.8s ease-in-out infinite;
    }

    @keyframes scan-laser-move {
        0%, 100% { top: 12%; }
        50% { top: 88%; }
    }

    .scan-overlay-bar {
        position: relative;
        z-index: 2;
        flex: 0 0 auto;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 0.6rem 1rem;
        padding: 0.8rem 1rem;
        /* Nepodlézat pod systémovou navigační lištu (Android gesta / 3 tlačítka, iOS home indicator) */
        padding-bottom: calc(0.8rem + env(safe-area-inset-bottom, 0px));
        background: #111;
        color: #fff;
    }

        .scan-overlay-bar .scan-hint {
            flex: 1 1 55%;
            min-width: 0;
            font-size: 0.9rem;
        }

        .scan-overlay-bar .scan-buttons {
            display: flex;
            gap: 0.5rem;
        }

        .scan-overlay-bar .ghost-button {
            color: #fff;
            border-color: rgba(255, 255, 255, 0.6);
        }

        .scan-overlay-bar .ghost-button.is-on {
            background: #f59e0b;
            border-color: #f59e0b;
            color: #111;
        }

    .scan-zoom-wrap {
        flex: 1 1 100%;
        display: flex;
        align-items: center;
        gap: 0.6rem;
        color: #fff;
    }

        .scan-zoom-wrap .scan-zoom {
            flex: 1;
            accent-color: #f59e0b;
        }

    .scan-camera-wrap {
        flex: 1 1 100%;
        display: flex;
        align-items: center;
        gap: 0.6rem;
        color: #fff;
        font-size: 0.9rem;
    }

        .scan-camera-wrap .scan-camera {
            flex: 1;
            min-width: 0;
            padding: 0.4rem 0.5rem;
            border-radius: 8px;
            border: 1px solid rgba(255, 255, 255, 0.6);
            background: #1b1b1b;
            color: #fff;
        }

    .service-submit-bar {
        position: sticky;
        bottom: 0;
        padding: 0.75rem 0;
        background: linear-gradient(180deg, rgba(255,255,255,0), #fff 30%);
    }

    .service-submit {
        width: 100%;
        font-size: 1.05rem;
        padding: 0.85rem;
    }

    .service-validation {
        color: #dc2626;
        font-weight: 600;
        margin-bottom: 0.75rem;
    }

    .service-result {
        border-radius: 12px;
        padding: 1.25rem;
        margin-top: 1rem;
    }
    /* Banner stavu připojení / fronty (offline PWA) */
    .service-net-banner {
        border-radius: 10px;
        padding: 0.7rem 0.9rem;
        margin-bottom: 1rem;
        font-size: 0.9rem;
        font-weight: 600;
    }

        .service-net-banner.offline {
            background: #fef3c7;
            color: #92400e;
            border: 1px solid #fcd34d;
        }

        .service-net-banner.pending {
            background: #dbeafe;
            color: #1e40af;
            border: 1px solid #93c5fd;
        }
    /* Výsledek: protokol uložen do fronty (čeká na odeslání) */
    .service-result-pending {
        background: #eff6ff;
        border: 1px solid #93c5fd;
        color: #1e3a8a;
    }
    /* Detail uživatele — read-only výpis rolí (zdroj Entra ID) */
    .user-role-descriptions {
        margin: 0.6rem 0 0;
        padding-left: 1.1rem;
        font-size: 0.85rem;
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }

    /* Reporty → Admin: vertikální sloupcový graf aktivity uživatelů */
    .activity-bar-chart {
        display: flex;
        align-items: flex-end;
        gap: 4px;
        height: 240px;
        overflow-x: auto;
        padding: 0.5rem 0.25rem 0;
    }

        .activity-bar-col {
            flex: 1 0 24px;
            min-width: 24px;
            height: 100%;
            display: flex;
            flex-direction: column;
            justify-content: flex-end;
            align-items: center;
        }

        .activity-bar-value {
            font-size: 0.68rem;
            color: #475569;
            margin-bottom: 2px;
            min-height: 0.9rem;
        }

        .activity-bar-fill {
            width: 62%;
            background: linear-gradient(180deg, #3b82f6, #2563eb);
            border-radius: 4px 4px 0 0;
            min-height: 2px;
        }

        .activity-bar-label {
            font-size: 0.62rem;
            color: #64748b;
            margin-top: 3px;
            white-space: nowrap;
        }

    /* Zaškrtávací sloupec pro hromadný výběr protokolů (admin) */
    .service-table .service-select-col {
        width: 2.2rem;
        text-align: center;
    }

        .service-table .service-select-col input[type="checkbox"] {
            width: 1.05rem;
            height: 1.05rem;
            cursor: pointer;
        }

    /* Podpis / odeslání — barevná ikona + drobné datum a čas pod ní */
    .signsend {
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        gap: 1px;
        line-height: 1.1;
    }

        .signsend .ss-icon {
            font-size: 1.15rem;
            line-height: 1;
        }

            .signsend .ss-icon.ss-signed {
                color: #16a34a;
            }

            .signsend .ss-icon.ss-sent {
                color: #2563eb;
            }

        .signsend .ss-time {
            font-size: 0.62rem;
            color: #94a3b8;
            white-space: nowrap;
        }

    .ss-none {
        color: #cbd5e1;
    }

    /* Neodesláno — červená přeškrtnutá obálka, klikací (spustí opětovné odeslání) */
    .signsend-button {
        background: none;
        border: none;
        margin: 0;
        padding: 3px 6px;
        cursor: pointer;
        font: inherit;
        border-radius: 6px;
        transition: background-color 0.12s ease;
    }

        .signsend-button:hover {
            background: rgba(220, 38, 38, 0.1);
        }

        .signsend-button:focus-visible {
            outline: 2px solid #dc2626;
            outline-offset: 1px;
        }

    .signsend .ss-icon.ss-notsent {
        color: #dc2626;
        position: relative;
        display: inline-block;
    }

        /* diagonální přeškrtnutí obálky */
        .signsend .ss-icon.ss-notsent::after {
            content: "";
            position: absolute;
            left: -2px;
            right: -2px;
            top: 50%;
            height: 2px;
            background: #dc2626;
            transform: translateY(-50%) rotate(-20deg);
            border-radius: 2px;
        }

    .signsend .ss-time.ss-notsent-label {
        color: #dc2626;
        font-weight: 600;
    }

    .service-result-ok {
        background: rgba(34, 197, 94, 0.10);
        border: 1px solid rgba(34, 197, 94, 0.4);
    }

    .service-result-error {
        background: rgba(220, 38, 38, 0.08);
        border: 1px solid rgba(220, 38, 38, 0.4);
    }
    /* === Responzivní tabulka → karty (mobil) === */
    @media (max-width: 720px) {
        .responsive-cards thead {
            display: none;
        }

        .responsive-cards,
        .responsive-cards tbody,
        .responsive-cards tr,
        .responsive-cards td {
            display: block;
            width: 100%;
        }

            .responsive-cards tr {
                margin-bottom: 0.85rem;
                border: 1px solid rgba(0, 45, 98, 0.12);
                border-radius: 12px;
                padding: 0.5rem 0.85rem;
                background: #fff;
            }

            .responsive-cards td {
                display: flex;
                justify-content: space-between;
                align-items: center;
                gap: 1rem;
                padding: 0.35rem 0;
                border: none;
                text-align: right;
            }

                .responsive-cards td::before {
                    content: attr(data-label);
                    font-weight: 600;
                    color: #5a6a7e;
                    text-align: left;
                    flex: 0 0 auto;
                }

                .responsive-cards td.row-actions {
                    justify-content: flex-end;
                    flex-wrap: wrap;
                    gap: 0.75rem;
                    padding-top: 0.6rem;
                    border-top: 1px solid rgba(0, 45, 98, 0.08);
                    margin-top: 0.3rem;
                }

                    .responsive-cards td.row-actions::before {
                        content: none;
                    }

                    .responsive-cards td.row-actions .link-button {
                        padding: 0.4rem 0.75rem;
                        background: rgba(245, 158, 11, 0.12);
                        border-radius: 8px;
                    }
    }
    /* === Responzivní login na malých displejích === */
    @media (max-width: 520px) {
        .login-shell {
            min-height: 100dvh; /* přesnější výška na mobilu než 100vh (bez lišty prohlížeče) */
            padding: 1rem;
            align-items: start;
            padding-top: 2.5rem; /* místo pro fixní přepínač jazyka */
        }

        .login-card {
            padding: 1.1rem 1.25rem 1.35rem;
            border-radius: 8px;
            gap: 0.8rem;
        }

        .login-copy {
            gap: 0.25rem;
        }

        .login-copy h1 {
            font-size: 1.5rem;
        }

        .login-copy p {
            font-size: 0.92rem;
        }

        /* Kruhová lasička zůstává — jen se zmenší, ať se přihlášení vejde i na nižší displeje. */
        .login-logo {
            max-width: 230px;
            max-height: 24vh;
        }

        .login-language-switch {
            top: 0.6rem !important;
            right: 0.6rem !important;
        }
    }

    /* Velmi nízké displeje (na výšku i na šířku) — ještě víc přitáhnout, ať se vejde bez scrollu. */
    @media (max-width: 520px) and (max-height: 640px) {
        .login-shell {
            padding-top: 1.5rem;
        }

        .login-logo {
            max-width: 180px;
            max-height: 20vh;
        }
    }
    /* ============================================================
   Nav icon glyphs — globální scope (Blazor CSS isolation
   nepřidá b-xxx na MarkupString SVG, proto sem)
   ============================================================ */
    .menu-icon-glyph {
        display: grid;
        place-items: center;
        width: 20px;
        height: 20px;
        color: inherit;
        position: relative;
        z-index: 1;
    }

        .menu-icon-glyph svg {
            width: 20px;
            height: 20px;
            fill: currentColor;
            display: block;
            flex-shrink: 0;
        }

    .submenu-icon .menu-icon-glyph {
        width: 14px;
        height: 14px;
    }

        .submenu-icon .menu-icon-glyph svg {
            width: 14px;
            height: 14px;
        }
    /* ============================================================
   Modul Plánovač (Gantt + kapacita)
   ============================================================ */
    .module-planner .section-eyebrow {
        color: #0e7490;
    }

    .planner-toolbar {
        display: flex;
        flex-wrap: wrap;
        gap: 0.45rem 0.7rem;
        align-items: flex-end;
        margin: 0.4rem 0 0.8rem;
    }

    .planner-toolbar-group {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }

        .planner-toolbar-group label {
            font-size: 0.8rem;
        }

    .planner-toolbar-end {
        margin-left: auto;
    }

    /* Jednotný vzhled a rozměr všech ovládacích prvků nad plánem */
    .planner-toolbar .form-select,
    .planner-toolbar .form-control,
    .planner-toolbar .proj-filter-btn,
    .planner-toolbar .view-btn,
    .planner-toolbar .primary-button,
    .planner-toolbar .secondary-button {
        height: 34px;
        box-sizing: border-box;
        font-size: 0.82rem;
        border-radius: 8px;
        line-height: 1.2;
    }

        .planner-toolbar .form-select,
        .planner-toolbar .form-control,
        .planner-toolbar .proj-filter-btn {
            min-width: 0;
            width: 150px;
            padding: 0 0.55rem;
            border: 1px solid #cbd5e1;
            background-color: #fff;
            color: #1e293b;
        }

        /* Nativní select má vpravo bootstrap šipku — nech jí místo */
        .planner-toolbar select.form-select {
            padding-right: 1.9rem;
        }

    .planner-toolbar .proj-filter-btn {
        display: inline-flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.4rem;
        text-align: left;
        cursor: pointer;
    }

        .planner-toolbar .proj-filter-btn .caret {
            float: none;
            opacity: 0.6;
        }

    /* Měřítko — segmentové přepínače navazují výškou i radiusem */
    .planner-toolbar .view-switch {
        height: 34px;
    }

    .planner-toolbar .view-btn {
        display: inline-flex;
        align-items: center;
        padding: 0 0.6rem;
    }

    /* Tlačítka Plán projektu */
    .planner-toolbar .primary-button,
    .planner-toolbar .secondary-button {
        padding: 0 0.7rem;
        font-weight: 600;
    }

    .planner-toolbar .inline-actions {
        display: flex;
        align-items: center;
        gap: 0.35rem;
    }

    .planner-toolbar .planner-date {
        min-width: 0;
        width: 7.5rem;
    }

    /* Potvrzovací / varovný pruh nad plánem */
    .planner-confirm {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 0.6rem;
        padding: 0.6rem 0.9rem;
        background: #fef3c7;
        border: 1px solid #f59e0b;
        border-radius: 8px;
        font-size: 0.9rem;
    }

    .view-switch {
        display: inline-flex;
        gap: 0.25rem;
    }

    .view-btn {
        border: 1px solid #cbd5e1;
        background: #fff;
        border-radius: 8px;
        padding: 0.35rem 0.7rem;
        cursor: pointer;
        font-size: 0.85rem;
    }

    .view-btn-active {
        background: #0e7490;
        color: #fff;
        border-color: #0e7490;
    }

    .planner-gantt {
        overflow-x: auto;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        background: #fff;
        min-height: 120px;
    }

    .gantt-popup {
        font-size: 0.8rem;
        line-height: 1.35;
    }
    /* Barvy pruhů podle typu položky */
    .gantt .bar-wrapper.gantt-kind-project .bar {
        fill: #475569;
    }

    .gantt .bar-wrapper.gantt-kind-estimatetask .bar {
        fill: #0e7490;
    }

    .gantt .bar-wrapper.gantt-kind-worktask .bar {
        fill: #7c3aed;
    }

    .gantt .bar-wrapper.gantt-kind-other .bar {
        fill: #b45309;
    }

    .gantt .bar-wrapper.gantt-locked .bar {
        stroke: #1e293b;
        stroke-width: 2px;
        stroke-dasharray: 3 2;
    }
    /* Kapacitní tabulka */
    .planner-capacity th, .planner-capacity td {
        text-align: center;
    }

        .planner-capacity td:first-child, .planner-capacity th:first-child {
            text-align: left;
        }

    .cap-cell {
        font-weight: 600;
    }

    .cap-ok {
        background: #dcfce7;
        color: #166534;
    }

    .cap-full {
        background: #fef3c7;
        color: #92400e;
    }

    .cap-over {
        background: #fee2e2;
        color: #991b1b;
    }
    /* Plánovač — rozbalovací filtr projektů */
    .proj-filter {
        position: relative;
    }

    .proj-filter-btn {
        text-align: left;
        cursor: pointer;
        min-width: 180px;
    }

        .proj-filter-btn .caret {
            float: right;
            opacity: 0.6;
        }

    .proj-panel {
        position: absolute;
        z-index: 40;
        top: calc(100% + 2px);
        left: 0;
        min-width: 240px;
        max-height: 280px;
        overflow-y: auto;
        background: #fff;
        border: 1px solid #cbd5e1;
        border-radius: 10px;
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
        padding: 0.5rem;
    }

    .proj-panel-actions {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        padding-bottom: 0.4rem;
        margin-bottom: 0.4rem;
        border-bottom: 1px solid #f1f5f9;
        font-size: 0.78rem;
    }

    .proj-panel-item {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.3rem 0.25rem;
        cursor: pointer;
        font-size: 0.9rem;
    }

        .proj-panel-item:hover {
            background: #f8fafc;
            border-radius: 6px;
        }

    /* Barevný čtvereček projektu ve výběru */
    .proj-swatch {
        flex: 0 0 auto;
        width: 12px;
        height: 12px;
        border-radius: 3px;
        box-shadow: inset 0 0 0 1px rgba(15,23,42,0.15);
    }

    /* Neviditelná vrstva pro zavření rozbalovacího panelu klikem kamkoliv mimo */
    .dropdown-backdrop {
        position: fixed;
        inset: 0;
        z-index: 35;
        background: transparent;
    }
    /* Plánovač — pohled „Lidé" (resource timeline) */
    .resource-timeline {
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        background: #fff;
        overflow: hidden;
    }

    .rtl {
        display: flex;
    }

    .rtl-names {
        flex: 0 0 170px;
        border-right: 1px solid #e2e8f0;
        background: #f8fafc;
    }

    .rtl-corner {
        height: 28px;
        display: flex;
        align-items: center;
        padding: 0 0.6rem;
        font-size: 0.75rem;
        font-weight: 700;
        color: #475569;
        border-bottom: 1px solid #e2e8f0;
    }

    .rtl-name {
        display: flex;
        align-items: center;
        padding: 0 0.6rem;
        font-size: 0.85rem;
        font-weight: 600;
        color: #1e293b;
        border-bottom: 1px solid #f1f5f9;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .rtl-scroll {
        flex: 1;
        overflow-x: auto;
    }

    .rtl-track {
        position: relative;
    }

    .rtl-axis {
        position: relative;
        height: 28px;
        border-bottom: 1px solid #e2e8f0;
    }

    .rtl-tick {
        position: absolute;
        top: 0;
        height: 100%;
        border-left: 1px solid #eef2f7;
        padding-left: 4px;
        font-size: 0.68rem;
        color: #64748b;
        display: flex;
        align-items: center;
    }

        .rtl-tick.rtl-tick-strong {
            color: #334155;
            font-weight: 600;
            border-left-color: #cbd5e1;
        }

        /* Aktuální týden v ose */
        .rtl-tick.rtl-tick-weeknow {
            color: #1d4ed8;
            font-weight: 700;
            border-left-color: #1d4ed8;
        }

        /* Dnešní den v ose */
        .rtl-tick.rtl-tick-today {
            color: #fff;
            font-weight: 700;
            background: #ef4444;
            border-left-color: #ef4444;
            border-radius: 4px;
            padding-right: 4px;
        }

    /* Tělo timeline s mřížkou pevných denních/týdenních slotů */
    .rtl-body {
        position: relative;
    }

    .rtl-grid {
        position: absolute;
        top: 0;
        left: 0;
        z-index: 0;
        pointer-events: none;
    }

    /* Zvýraznění aktuálního týdne (pruh) a dneška (sloupec) — pod úkoly */
    .rtl-weeknow {
        position: absolute;
        top: 0;
        z-index: 0;
        background: rgba(29, 78, 216, 0.07);
        border-left: 1px solid rgba(29, 78, 216, 0.35);
        border-right: 1px solid rgba(29, 78, 216, 0.35);
        pointer-events: none;
    }

    .rtl-todaycol {
        position: absolute;
        top: 0;
        z-index: 0;
        background: rgba(239, 68, 68, 0.12);
        pointer-events: none;
    }

    /* Šipky závislostí mezi úkoly (nad bary) */
    .rtl-deps {
        position: absolute;
        top: 0;
        left: 0;
        z-index: 2;
        pointer-events: none;
        overflow: visible;
    }

        .rtl-deps .dep-line {
            fill: none;
            stroke: #475569;
            stroke-width: 1.5;
        }

        .rtl-deps .dep-bad {
            stroke: #dc2626;
            stroke-width: 2;
            stroke-dasharray: 4 3;
        }

    .rtl-row {
        position: relative;
        z-index: 1;
        border-bottom: 1px solid #f1f5f9;
    }

    .rtl-bar {
        position: absolute;
        border-radius: 5px;
        color: #fff;
        font-size: 0.74rem;
        line-height: 1.25;
        padding: 4px 7px 7px;
        display: flex;
        align-items: flex-start;
        overflow: hidden;
        box-shadow: 0 1px 2px rgba(0,0,0,0.15);
        cursor: grab;
        touch-action: none;
        user-select: none;
    }

        .rtl-bar.rtl-bar-dragging {
            cursor: grabbing;
            z-index: 3;
            opacity: 0.9;
            box-shadow: 0 3px 8px rgba(0,0,0,0.3);
        }

        /* Víceřádkový text v těle úkolu — využije vyšší řádek */
        .rtl-bar span {
            position: relative;
            z-index: 1;
            overflow: hidden;
            white-space: normal;
            overflow-wrap: anywhere;
            display: -webkit-box;
            -webkit-line-clamp: 4;
            -webkit-box-orient: vertical;
        }

        /* Rozpracovanost úkolu (z výkazů) — světlý pruh u dolní hrany baru */
        .rtl-bar .rtl-bar-progress {
            position: absolute;
            left: 0;
            bottom: 0;
            height: 4px;
            background: rgba(255, 255, 255, 0.9);
            border-bottom-left-radius: 5px;
            pointer-events: none;
        }

        .rtl-bar.gantt-kind-estimatetask {
            background: #0e7490;
        }

        .rtl-bar.gantt-kind-worktask {
            background: #7c3aed;
        }

        .rtl-bar.gantt-kind-other {
            background: #b45309;
        }

        .rtl-bar.gantt-locked {
            outline: 2px dashed rgba(255,255,255,0.6);
            outline-offset: -3px;
        }

        /* Jeden řádek na osobu: časově se překrývající úkoly = přetížení.
           Poloprůhlednost způsobí, že se překryv vizuálně ztmaví; červený rámeček signalizuje kolizi. */
        .rtl-bar.rtl-overlap {
            opacity: 0.78;
            border: 1.5px solid #ef4444;
            box-shadow: 0 0 0 1px rgba(239,68,68,0.35), 0 1px 3px rgba(239,68,68,0.5);
            z-index: 1;
        }

    .rtl-today {
        position: absolute;
        top: 0;
        bottom: 0;
        width: 2px;
        background: #ef4444;
        z-index: 2;
    }

    /* Plovoucí nápověda u kurzoru při tažení bez CTRL */
    .planner-drag-tip {
        position: fixed;
        z-index: 2000;
        display: none;
        padding: 0.3rem 0.55rem;
        background: #0f172a;
        color: #fff;
        font-size: 0.78rem;
        border-radius: 6px;
        box-shadow: 0 4px 12px rgba(15, 23, 42, 0.35);
        pointer-events: none;
        white-space: nowrap;
    }

    /* Cílový řádek při přetahování úkolu mezi řešiteli */
    .rtl-row.rtl-row-droptarget {
        background: rgba(16, 185, 129, 0.12);
        box-shadow: inset 0 0 0 2px rgba(5, 150, 105, 0.55);
    }

    /* Přepínač „mezi řešiteli" v toolbaru */
    .planner-toggle {
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        cursor: pointer;
        font-size: 0.85rem;
        white-space: nowrap;
    }

/* === Leady — tagy, výběr existujícího záznamu, banner dalšího kroku === */
.lead-picker-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

@media (max-width: 720px) {
    .lead-picker-row {
        grid-template-columns: 1fr;
    }
}

.lead-tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0.25rem 0;
}

.lead-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    line-height: 1.4;
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
    border: 1px solid rgba(16, 185, 129, 0.28);
    white-space: nowrap;
}

.lead-tag-chip.removable {
    padding-right: 0.25rem;
}

.lead-tag-remove {
    border: none;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 0.75rem;
    line-height: 1;
    padding: 0 0.15rem;
    opacity: 0.7;
}

.lead-tag-remove:hover {
    opacity: 1;
}

.lead-tag-input-row {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.4rem;
}

.lead-tag-input-row .form-control {
    flex: 1 1 auto;
}

.lead-nextstep-banner {
    border: 1px solid rgba(16, 185, 129, 0.28);
    background: rgba(16, 185, 129, 0.08);
    border-radius: 0.6rem;
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.75rem;
}

.lead-nextstep-banner.overdue {
    border-color: rgba(220, 38, 38, 0.35);
    background: rgba(220, 38, 38, 0.08);
}

.lead-nextstep-label {
    display: block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.7;
    margin-bottom: 0.15rem;
}

.lead-status-field {
    display: flex;
    align-items: center;
    min-height: 2.4rem;
}

.lead-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(100, 116, 139, 0.14);
    color: #334155;
    border: 1px solid rgba(100, 116, 139, 0.3);
}

/* Kvalifikovaný (5) — zelená */
.lead-status-badge.status-5 {
    background: rgba(16, 185, 129, 0.14);
    color: #047857;
    border-color: rgba(16, 185, 129, 0.32);
}

/* Konvertovaný (7) — modrá */
.lead-status-badge.status-7 {
    background: rgba(37, 99, 235, 0.14);
    color: #1d4ed8;
    border-color: rgba(37, 99, 235, 0.32);
}

/* Nekvalifikovaný (6) — červená */
.lead-status-badge.status-6 {
    background: rgba(220, 38, 38, 0.12);
    color: #b91c1c;
    border-color: rgba(220, 38, 38, 0.3);
}

@media (prefers-color-scheme: dark) {
    .lead-status-badge { color: #cbd5e1; }
    .lead-status-badge.status-5 { color: #6ee7b7; }
    .lead-status-badge.status-7 { color: #93c5fd; }
    .lead-status-badge.status-6 { color: #fca5a5; }
}

:root[data-theme="dark"] .lead-status-badge { color: #cbd5e1; }
:root[data-theme="dark"] .lead-status-badge.status-5 { color: #6ee7b7; }
:root[data-theme="dark"] .lead-status-badge.status-7 { color: #93c5fd; }
:root[data-theme="dark"] .lead-status-badge.status-6 { color: #fca5a5; }

/* Bublina „Lead z e-mailu" v mřížce metrik — drop zóna pro přetažený e-mail z Outlooku */
.metric-card-dropzone {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    border: 1.5px dashed rgba(15, 93, 110, 0.45);
    background: rgba(15, 93, 110, 0.05);
    cursor: default;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.metric-card-dropzone.drag-over {
    border-style: solid;
    border-color: #0f5d6e;
    background: rgba(15, 93, 110, 0.14);
    box-shadow: 0 0 0 3px rgba(15, 93, 110, 0.15);
}

.metric-card-dropzone.busy {
    opacity: 0.65;
}

.metric-card-dropzone .dropzone-hint {
    font-size: 0.9rem;
    color: #0f5d6e;
}

.lead-email-file-label {
    color: var(--text-soft);
    font-size: 0.7rem;
    text-decoration: underline;
    cursor: pointer;
    pointer-events: auto;
}

.lead-email-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}

.lead-email-import-message {
    margin: -0.35rem 0 1rem;
    padding: 0.55rem 0.85rem;
    border-radius: 8px;
    background: rgba(15, 93, 110, 0.08);
    color: #0f5d6e;
    font-size: 0.85rem;
}

@media (prefers-color-scheme: dark) {
    .metric-card-dropzone .dropzone-hint,
    .lead-email-import-message { color: #6ee7b7; }
}

:root[data-theme="dark"] .metric-card-dropzone .dropzone-hint,
:root[data-theme="dark"] .lead-email-import-message { color: #6ee7b7; }

/* Progressbar stavu v seznamu leadů (stejný vzhled jako u příležitostí, ale 4 kroky) */
.lead-status-cell {
    min-width: 8.5rem;
    overflow: visible !important;
}

.lead-status-cell .status-inline-label {
    margin-bottom: 0.35rem;
}

.lead-status-track {
    grid-template-columns: repeat(4, 1fr);
    max-width: 8rem;
    margin-bottom: 0;
}

/* Malý příznak archivace vedle stavu */
.lead-archived-flag {
    display: inline-flex;
    align-items: center;
    margin-left: 0.4rem;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: rgba(100, 116, 139, 0.16);
    color: #475569;
    border: 1px solid rgba(100, 116, 139, 0.28);
}

@media (prefers-color-scheme: dark) {
    .lead-archived-flag { color: #cbd5e1; }
}

:root[data-theme="dark"] .lead-archived-flag { color: #cbd5e1; }

/* Inline zaškrtávátko s popiskem (filtry) */
.checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
}

.checkbox-inline input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
}

/* === Kvalifikační modal — BANT segmentovaná tlačítka === */
.bant-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.2rem;
}

.bant-option {
    padding: 0.35rem 0.7rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(100, 116, 139, 0.35);
    background: rgba(100, 116, 139, 0.08);
    color: inherit;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.bant-option:hover {
    border-color: rgba(16, 185, 129, 0.5);
}

.bant-option.active {
    background: rgba(16, 185, 129, 0.16);
    border-color: rgba(16, 185, 129, 0.6);
    color: #047857;
    font-weight: 600;
}

.bant-score-row {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
}

.bant-score-row > div:first-child {
    flex: 0 0 140px;
}

.bant-score-hint {
    padding-bottom: 0.55rem;
    font-size: 0.85rem;
    opacity: 0.85;
}

@media (prefers-color-scheme: dark) {
    .bant-option.active { color: #6ee7b7; }
}

:root[data-theme="dark"] .bant-option.active { color: #6ee7b7; }
:root[data-theme="light"] .bant-option.active { color: #047857; }

@media (prefers-color-scheme: dark) {
    .lead-tag-chip {
        color: #6ee7b7;
    }
}

:root[data-theme="dark"] .lead-tag-chip {
    color: #6ee7b7;
}

:root[data-theme="light"] .lead-tag-chip {
    color: #047857;
}

/* Servis — stav odeslání v seznamu protokolů */
.signsend-button.send-failed .ss-notsent-label {
    color: #b91c1c;
    font-weight: 600;
}
.signsend-button.send-failed .ss-notsent {
    color: #b91c1c;
}

/* ============================================================
   Nápověda modulu (HelpModal + obsah)
   ============================================================ */
.modal-panel.help-modal {
    width: min(860px, calc(100vw - 2rem));
    display: flex;
    flex-direction: column;
    overflow: hidden; /* scrolluje tělo, hlavička zůstává nahoře */
    padding: 0;
}

.help-modal .help-modal-header {
    margin: 0;
    padding: 1.25rem 1.35rem 0.85rem;
    border-bottom: 1px solid var(--border-soft);
}

.help-modal-body {
    overflow-y: auto;
    padding: 1.1rem 1.35rem 1.35rem;
}

.help-doc {
    color: var(--text-soft);
    line-height: 1.55;
}

.help-doc .help-section {
    margin-bottom: 1.35rem;
}

.help-doc .help-section:last-child {
    margin-bottom: 0;
}

.help-doc h3 {
    color: var(--text-main);
    font-size: 1.03rem;
    margin: 0 0 0.45rem;
}

.help-doc p {
    margin: 0 0 0.5rem;
}

.help-doc ul {
    margin: 0 0 0.5rem;
    padding-left: 1.15rem;
}

.help-doc li {
    margin-bottom: 0.28rem;
}

.help-doc .help-why {
    background: rgba(0, 45, 98, 0.05);
    border-left: 3px solid var(--kodys-yellow);
    padding: 0.5rem 0.8rem;
    border-radius: 0 6px 6px 0;
    margin: 0.5rem 0 0;
}

.help-doc code {
    background: rgba(0, 0, 0, 0.06);
    padding: 0.05rem 0.32rem;
    border-radius: 4px;
    font-size: 0.85em;
}

/* --- Vývojový diagram v nápovědě --- */
.flow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    margin: 0.25rem 0 1rem;
}

.flow-node {
    width: 100%;
    max-width: 460px;
    text-align: center;
    background: #ffffff;
    border: 1px solid var(--border-soft);
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    padding: 0.55rem 0.85rem;
    box-shadow: 0 1px 3px rgba(0, 45, 98, 0.08);
}

.flow-node strong {
    display: block;
    color: var(--text-main);
    font-size: 0.95rem;
}

.flow-gate {
    display: inline-block;
    margin-top: 0.3rem;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.35;
    background: rgba(255, 196, 12, 0.18);
    color: #7a5c00;
    border-radius: 8px;
    padding: 0.15rem 0.5rem;
}

.flow-arrow {
    color: var(--primary);
    font-size: 1.05rem;
    line-height: 1;
    padding: 0.3rem 0;
    opacity: 0.55;
}

.flow-branch {
    display: flex;
    gap: 0.7rem;
    width: 100%;
    max-width: 560px;
    justify-content: center;
}

.flow-branch .flow-node {
    flex: 1;
    min-width: 0;
}

.flow-node-ok {
    border-left-color: #10b981;
}

.flow-node-bad {
    border-left-color: #dc2626;
}

.flow-node small {
    color: var(--text-soft);
    font-size: 0.78rem;
}

.help-note {
    font-size: 0.85rem;
    color: var(--text-soft);
    margin: 0.15rem 0;
}

.help-note strong {
    color: var(--text-main);
}

/* Decentní ikona uvnitř tlačítka (dědí barvu textu). */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    margin-right: 0.4rem;
    flex: 0 0 auto;
}

.btn-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* ============================================================
   Prvky jen pro administrátora
   Zobrazují se i ostatním, ale šedě a nepoužitelně (uzamčené).
   ============================================================ */
.perm-locked,
button.perm-locked,
input.perm-locked {
    opacity: 0.5;
    filter: grayscale(0.55);
    cursor: not-allowed;
    pointer-events: none;
}


/* ============================================================
   Slovní pásmo subjektivní pravděpodobnosti (štítek u hodnoty %)
   ============================================================ */
.prob-input-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.prob-input-row .form-control {
    max-width: 8rem;
}

.prob-legend {
    font-size: 0.72rem;
    margin-top: 0.3rem;
}

.prob-band {
    display: inline-flex;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    white-space: nowrap;
}

.prob-band-no { background: rgba(220, 38, 38, 0.12); color: #b91c1c; }
.prob-band-maybe { background: rgba(100, 116, 139, 0.16); color: #475569; }
.prob-band-lean { background: rgba(255, 196, 12, 0.22); color: #8a6d00; }
.prob-band-yes { background: rgba(16, 185, 129, 0.14); color: #047857; }
.prob-band-sure { background: rgba(16, 185, 129, 0.24); color: #065f46; }

/* ============================================================
   Teploměr subjektivní pravděpodobnosti (posuvník s výplní podle pásma)
   ============================================================ */
.prob-thermo-field { max-width: 520px; }

.prob-thermo-input {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 0.85rem;
    border-radius: 999px;
    margin: 0.55rem 0 0.15rem;
    cursor: pointer;
    background: linear-gradient(to right,
        var(--fill) 0, var(--fill) var(--pct),
        var(--border-soft) var(--pct), var(--border-soft) 100%);
}

.prob-thermo-input:focus { outline: none; }

.prob-thermo-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 1.3rem;
    height: 1.3rem;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    margin-top: -0.23rem;
    cursor: pointer;
}

.prob-thermo-input::-moz-range-track {
    height: 0.85rem;
    border-radius: 999px;
    background: linear-gradient(to right,
        var(--fill) 0, var(--fill) var(--pct),
        var(--border-soft) var(--pct), var(--border-soft) 100%);
}

.prob-thermo-input::-moz-range-thumb {
    width: 1.3rem;
    height: 1.3rem;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    cursor: pointer;
}

.prob-thermo-caption {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.25rem;
}

.prob-thermo-caption strong {
    font-size: 1.05rem;
    color: var(--text-main);
}
