:root {
    --insp-primary: #0088ca;    --insp-primary-dark: #006c9f;
    --insp-accent: #00aad3;
    /* Kreslené ikonky přepínačů v menu — masky, takže přebírají barvu textu. */
    --icon-moon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.5 14.6A8.6 8.6 0 0 1 9.4 3.5 8.6 8.6 0 1 0 20.5 14.6z'/%3E%3C/svg%3E");
    --icon-sun: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='4.2'/%3E%3Cpath d='M12 2.4v2.4M12 19.2v2.4M2.4 12h2.4M19.2 12h2.4M5.2 5.2l1.7 1.7M17.1 17.1l1.7 1.7M18.8 5.2l-1.7 1.7M6.9 17.1l-1.7 1.7'/%3E%3C/svg%3E");
    --icon-chevrons: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 5.5 4.5 12 11 18.5M19.5 5.5 13 12l6.5 6.5'/%3E%3C/svg%3E");    --insp-yellow: #ffed36;    --insp-yellow-dark: #ebd713;
    --icon-logout: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.5 21H5.2A2.2 2.2 0 0 1 3 18.8V5.2A2.2 2.2 0 0 1 5.2 3h4.3'/%3E%3Cpath d='M16.2 16.5 20.7 12l-4.5-4.5M20.7 12H9.4'/%3E%3C/svg%3E");
    --insp-text: #475363;
    --insp-bg: #eff0f2;
    --area-color: #ff2d78;
}

html, body {
    font-family: 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--insp-bg);
}

h1 {
    font-size: 1.6rem;
    font-weight: 650;
    color: var(--insp-text);
    margin-bottom: 1rem;
    border-bottom: 3px solid var(--insp-yellow);
    display: inline-block;
    padding-bottom: 0.2rem;
}

h4 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--insp-primary-dark);
    margin-top: 1.4rem;
    padding-bottom: 0.3rem;
    border-bottom: 2px solid #dde7f0;}

a, .btn-link {
    color: var(--insp-accent);
    text-decoration: none;
}

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

.btn-primary {
    color: #fff;
    background-color: var(--insp-primary);
    border-color: var(--insp-primary-dark);
}

    .btn-primary:hover, .btn-primary:focus, .btn-primary:active {
        background-color: var(--insp-primary-dark) !important;
        border-color: var(--insp-primary-dark) !important;
    }

.btn-outline-primary {
    color: var(--insp-primary);
    border-color: var(--insp-primary);
}

    .btn-outline-primary:hover, .btn-check:checked + .btn-outline-primary {
        background-color: var(--insp-primary) !important;
        border-color: var(--insp-primary) !important;
        color: #fff;
    }

.badge.bg-primary {
    background-color: var(--insp-primary) !important;
}

.badge.bg-warning {
    background-color: var(--insp-yellow) !important;
    color: #475363 !important;
}

.card {
    border: none;
    border-radius: 0.6rem;
    box-shadow: 0 1px 4px rgba(14, 42, 71, 0.08);
}

.relation-toggle {
    background: none;
    border: none;
    padding: 0 0.4rem 0 0;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    vertical-align: baseline;
}

    .relation-toggle.off {
        color: #b6c2cc;
    }

        .relation-toggle.off:hover {
            color: #6c757d;
        }

    .relation-toggle.on-favorite {
        color: #f0a904;
    }

    .relation-toggle.on-blocked {
        color: #dc3545;
        font-weight: 700;
    }

    .relation-toggle.on-note {
        color: var(--insp-primary);
    }

.entity-avatar {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex: 0 0 auto;
    color: #fff;
    font-weight: 600;
    line-height: 1;
    user-select: none;
}

    .entity-avatar img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

/* Technik i firma mají stejný tvar (zaoblený čtverec) — liší se barvou, ne obrysem. */
.entity-avatar-technician {
    border-radius: 0.55rem;
    background: linear-gradient(135deg, #8b5cf6, #6f42c1);
}

.entity-avatar-company {
    border-radius: 0.55rem;
    background: linear-gradient(135deg, #14b8a6, #0f766e);
}

.report-corner {
    position: absolute;
    top: 0.6rem;
    right: 1rem;
}

.icon-action {
    background: none;
    border: 1px solid transparent;
    border-radius: 0.4rem;
    padding: 0.1rem 0.45rem;
    font-size: 1.15rem;
    line-height: 1.3;
    color: #6c757d;
    cursor: pointer;
    text-decoration: none;
}

    .icon-action:hover {
        background: #eef2f7;
        border-color: #ced4da;
        color: #212529;
    }

    .icon-action.primary {
        color: var(--insp-primary);
    }

    .icon-action.success {
        color: #198754;
    }

    .icon-action.danger:hover {
        background: #fdecee;
        border-color: #f1aeb5;
        color: #dc3545;
    }

.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.8rem;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.25;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    background: none;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
}

    .btn-action.success {
        color: #146c43;
        background: rgba(25, 135, 84, 0.14);
        border-color: rgba(25, 135, 84, 0.5);
    }

    .btn-action.success:hover {
        background: rgba(25, 135, 84, 0.24);
        border-color: #198754;
        color: #0f5132;
    }

    .btn-action.primary {
        color: var(--insp-primary-dark);
        background: rgba(0, 136, 202, 0.12);
        border-color: rgba(0, 136, 202, 0.45);
    }

    .btn-action.primary:hover {
        background: rgba(0, 136, 202, 0.22);
        border-color: var(--insp-primary);
        color: var(--insp-primary-dark);
    }

    .btn-action.neutral {
        color: #495057;
        background: rgba(108, 117, 125, 0.12);
        border-color: rgba(108, 117, 125, 0.4);
    }

    .btn-action.neutral:hover {
        background: rgba(108, 117, 125, 0.2);
        border-color: #6c757d;
        color: #212529;
    }

    .btn-action.danger {
        color: #b02a37;
        background: rgba(220, 53, 69, 0.11);
        border-color: rgba(220, 53, 69, 0.45);
    }

    .btn-action.danger:hover {
        background: rgba(220, 53, 69, 0.2);
        border-color: #dc3545;
        color: #842029;
    }

.markdown-page h1 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.markdown-page h2 {
    font-size: 1.2rem;
    margin: 1.75rem 0 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e9ecef;
}

.markdown-page h3 {
    font-size: 1.05rem;
    margin: 1.25rem 0 0.4rem;
}

.markdown-page p,
.markdown-page li {
    font-size: 0.95rem;
}

.markdown-page table {
    width: 100%;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

    .markdown-page table th,
    .markdown-page table td {
        border: 1px solid #dee2e6;
        padding: 0.35rem 0.5rem;
        vertical-align: top;
    }

    .markdown-page table th {
        background: #f8f9fa;
    }

.markdown-page code {
    background: #f1f5f9;
    border-radius: 0.25rem;
    padding: 0 0.25rem;
}

.markdown-page hr {
    display: none;}

.markdown-page :is(h1, h2, h3, h4, h5) {
    scroll-margin-top: 4.75rem;
}

.help-highlight {
    animation: help-pulse 1.15s ease-in-out 3;
    border-radius: 4px;
}

@keyframes help-pulse {
    0%, 100% { background-color: transparent; }
    50% { background-color: rgba(255, 237, 54, 0.35); }}

html[data-bs-theme="dark"] .help-highlight {
    animation-name: help-pulse-dark;}

@keyframes help-pulse-dark {
    0%, 100% { background-color: transparent; }
    50% { background-color: rgba(255, 237, 54, 0.16); }
}

.qualification-chip {
    padding: 0 0.4rem;
    border-radius: 0.3rem;
    background: #eef2f7;
    color: #475569;
    font-size: 0.72rem;
    line-height: 1.5;
    white-space: nowrap;
}

.copyable {
    cursor: pointer;
    border-bottom: 1px dotted #adb5bd;
}

    .copyable:hover {
        background: #eef2f7;
    }

    .copyable.copied {
        background: #d1e7dd;
        color: #0f5132;
        border-bottom-color: transparent;
        border-radius: 0.3rem;
        padding: 0 0.25rem;
        animation: copied-in 0.18s ease-out;
    }

@keyframes copied-in {
    from {
        opacity: 0.4;
        transform: scale(0.96);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.copied-flash {
    margin-left: 0.4rem;
    padding: 0 0.35rem;
    border-radius: 0.3rem;
    background: #d1e7dd;
    color: #0f5132;
    font-size: 0.75rem;
    white-space: nowrap;
}

.chart-bar {
    cursor: pointer;
    transition: opacity 0.15s;
}

    .chart-bar:hover {
        opacity: 0.7;
        stroke: #1f2937;
        stroke-width: 1;
    }

.address-suggestions {
    position: absolute;
    z-index: 1050;    left: 0;
    right: 0;
    top: calc(100% + 0.15rem);
    max-height: 15rem;
    overflow-y: auto;
    padding: 0.25rem;
}

.address-suggestion {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    border-radius: 4px;
    padding: 0.3rem 0.5rem;
    font-size: 0.9rem;
    line-height: 1.25;
}

    .address-suggestion:hover,
    .address-suggestion:focus {
        background: var(--insp-surface-2, #eef2f7);
    }

.map-box {
    height: 16rem;
    max-width: 100%;
    border-radius: 6px;
    border: 1px solid var(--insp-border, #dee2e6);
    z-index: 0;}

[data-bs-theme="dark"] .map-box .leaflet-tile-pane {
    filter: brightness(0.78) saturate(0.85);
}

.table-scroll {
    overflow-x: auto;
    max-width: 100%;
}

.table-scroll.fit {
    width: max-content;
}

.chart-dot {
    cursor: pointer;
    transition: r 0.15s;
}

    .chart-dot:hover {
        r: 4.5;
        stroke: #1f2937;
        stroke-width: 1;
    }

.searchable-select {
    display: inline-block;
    width: 100%;}

.searchable-select-arrow {
    position: absolute;
    top: 0;
    right: 0.25rem;
    height: 100%;
    border: none;
    background: none;
    color: #94a3b8;
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0 0.35rem;
}

    .searchable-select-arrow:hover {
        color: var(--insp-primary);
    }

.searchable-select-menu {
    position: absolute;
    top: calc(100% + 0.2rem);
    left: 0;
    right: 0;
    z-index: 30;
    max-height: 15rem;
    overflow-y: auto;
    box-shadow: 0 4px 16px rgba(14, 42, 71, 0.18);
    animation: chooser-in 0.12s ease-out;
}

.searchable-select-item {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: none;
    padding: 0.35rem 0.75rem;
    font-size: 0.9rem;
    color: inherit;
}

    button.searchable-select-item:hover {
        background-color: rgba(13, 110, 253, 0.08);
        cursor: pointer;
    }

    .searchable-select-item.active {
        background-color: rgba(13, 110, 253, 0.12);
        font-weight: 600;
    }

html[data-bs-theme="dark"] button.searchable-select-item:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.date-presets {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
}

    .date-presets > .btn {
        white-space: nowrap;
    }

.date-presets-menu {
    position: absolute;
    top: calc(100% + 0.2rem);
    left: 0;
    z-index: 30;
    min-width: 7.5rem;
    padding: 0.15rem 0;
    box-shadow: 0 4px 16px rgba(14, 42, 71, 0.18);
    animation: chooser-in 0.12s ease-out;
}

.chooser-grip {
    cursor: grab;
    color: #94a3b8;
    user-select: none;
    font-size: 0.8rem;
    line-height: 1;
}

.chart-legend-link {
    color: inherit;
    text-decoration: none;
}

    .chart-legend-link:hover {
        text-decoration: underline;
    }

.chart-slice {
    cursor: pointer;
    transition: opacity 0.15s;
}

    .chart-slice:hover {
        opacity: 0.75;
    }

.profile-stat {
    background: #f1f5f9;
    border-radius: 0.6rem;
    padding: 0.6rem 0.75rem;
    height: 100%;
}

    .profile-stat .value {
        font-size: 1.45rem;
        font-weight: 650;
        line-height: 1.1;
        color: var(--insp-primary-dark);
    }

    .profile-stat .label {
        font-size: 0.78rem;
        color: #64748b;
        margin-left: 0.35rem;    }

.sidebar .about-link {
    /* Flex, ať ikonka sedí na střed textu (block ji posadil na účaří a vypadala vysoko). */
    display: flex;
    align-items: center;
    padding: 0.12rem 1rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    text-decoration: none;
}

    .sidebar .about-link:hover {
        color: rgba(255, 255, 255, 0.85);
    }

html.sidebar-collapsed .sidebar .about-link,
html.sidebar-collapsed .sidebar .operator-logo {
    display: none;}

.nav-scrollable > .nav {
    min-height: 100%;
}

.sidebar .nav-footer {
    margin-top: auto;
    padding-top: 2.5rem;
    margin-bottom: 1.5rem;
}

.sidebar .operator-row {
    margin-top: 1rem;
}

html.sidebar-collapsed .sidebar .nav-footer {
    display: none;
}

a.link-operator, .link-operator {
    color: var(--bs-secondary-color);
    font-style: italic;
}

a.link-technician, .link-technician {
    color: #6f42c1;
}

    a.link-technician:hover {
        color: #59359c;
    }

a.link-company, .link-company {
    color: #0f766e;
}

    a.link-company:hover {
        color: #0b5d57;
    }

a.link-project, .link-project {
    color: #b45309;
}

    a.link-project:hover {
        color: #92400e;
    }

.filter-tag {
    border: 1px solid #ced4da;
    background: #fff;
    color: #212529;
    border-radius: 0.4rem;
    padding: 0.1rem 0.55rem;
    font-size: 0.8rem;
    line-height: 1.4;
    cursor: pointer;
}

    .filter-tag:hover {
        border-color: var(--insp-primary);
    }

    .filter-tag.active {
        background: var(--insp-primary);
        border-color: var(--insp-primary);
        color: #fff;
    }

.sort-link {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

    .sort-link:hover {
        color: var(--insp-primary);
    }

.rating-star {
    background: none;
    border: none;
    padding: 0 2px;
    font-size: 1.25rem;
    line-height: 1;
    color: #cbd5e1;
    cursor: pointer;
}

    .rating-star.on {
        color: #f0a904;
    }

.stat-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

    .stat-link .card {
        transition: box-shadow 0.15s, transform 0.15s;
    }

    .stat-link:hover {
        color: inherit;
    }

        .stat-link:hover .card {
            box-shadow: 0 4px 12px rgba(14, 42, 71, 0.2);
            transform: translateY(-2px);
        }

.dashboard-header {
    container-type: inline-size;
}

.donut-box {
    width: 120px;
    width: clamp(96px, calc(100cqw - 440px), 160px);
}

.widget-donut-card {
    container-type: inline-size;
}

.widget-donut {
    flex-shrink: 0;
    width: 200px;
    width: clamp(120px, 30cqw, 360px);
}

.widget-donut.widget-donut-compact {
    width: 140px;
    width: clamp(110px, 22cqw, 200px);
}

.widget-fixed .widget-donut {
    width: 132px;
}

.widget-fixed .donut-box {
    width: 110px;
}

.widget-fixed .status-legend-row > svg {
    max-width: 150px;
}

.widget-fixed .chart-bars,
.widget-fixed .chart-lines {
    max-width: 520px;
}

.legend-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
    gap: .35rem;
    flex: 1 1 200px;
}

.legend-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .1rem;
    padding: .3rem .4rem;
    border: 1px solid var(--bs-border-color);
    border-left: 3px solid var(--tile-color, var(--insp-primary));
    border-radius: 6px;
    background: var(--bs-body-bg);
    color: inherit;
    text-decoration: none;
    transition: transform .12s ease, box-shadow .12s ease, opacity .15s ease, border-color .12s ease;
}

    .legend-tile:hover {
        transform: translateY(-2px);
        box-shadow: 0 3px 6px rgba(9, 30, 55, .16);
        color: inherit;
    }

    .legend-tile.chart-key-on {
        border-color: var(--tile-color, var(--insp-primary));
        box-shadow: inset 0 0 0 1px var(--tile-color, var(--insp-primary)), 0 3px 7px rgba(9, 30, 55, .18);
        transform: translateY(-2px);
    }

.legend-tiles:has(.chart-key-on) .legend-tile.chart-key-dim {
    opacity: .45;
}

    .legend-tile .value {
        font-size: 1.35rem;
        font-weight: 700;
        line-height: 1.1;
    }

    .legend-tile .label {
        font-size: .78rem;
        color: var(--bs-secondary-color);
        text-align: center;
        overflow-wrap: anywhere;
    }

html[data-bs-theme="dark"] .legend-tile:hover {
    box-shadow: 0 3px 7px rgba(0, 0, 0, .55);
}

/* Řádek odznaků aktivních filtrů se renderuje i prázdný (všechny odznaky jsou podmíněné) —
   prázdný ale nesmí přidávat mezeru, jinak začátek stránky vypadá rozhozeně. */
.filter-badges:not(:has(> *)) {
    display: none;
}

.hint-tile {
    background: var(--bs-tertiary-bg, #f3f5f7);
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    /* Rytmus začátku stránky: stejná mezera pod blokem, jakou má obsah nad sebou
       (.content padding-top i lišta akcí) — jinak bublina „visí" blíž k jedné straně. */
    margin-bottom: 0.65rem;
}

    /* Odkaz do příručky uvnitř bubliny — nápověda na stránce říká „co to je", příručka „jak na to". */
    .hint-tile .hint-more {
        margin-left: 0.4rem;
        white-space: nowrap;
    }

/* Lepivá horní lišta překrývá začátek stránky — cíl zarovnaný na horní hranu si musí nechat místo. */
[data-anchor-align="start"] {
    scroll-margin-top: 4.25rem;
}

.anchor-highlight {
    outline: 3px solid #ffed36;
    outline-offset: 3px;
    border-radius: 6px;
    animation: anchor-pulse 1s ease-in-out 3;
}

@keyframes anchor-pulse {
    50% { outline-color: rgba(255, 237, 54, 0.25); }
}

.availability-pin {
    display: inline-block;
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 50%;
    vertical-align: -0.1rem;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.page-header-tools {
    flex-wrap: wrap;    margin-bottom: 0.5rem;}

@media (min-width: 1200px) {
    .page-header-tools {
        position: sticky;
        top: 0.5rem;
        z-index: 4;
        margin-top: -4.05rem;
        /* Odsazení zleva = konec titulku stránky; pevná hodnota se s dlouhým názvem překryla. */
        margin-left: var(--tools-offset, 12rem);
        /* Rezerva vpravo = šířka agendy v pruhu (jméno, zvonek, nápověda, odhlášení). Měří ji
           js/page-title.js — pevná hodnota by se s dlouhým názvem firmy překryla. */
        margin-right: var(--tools-reserve, 22.5rem);
        margin-bottom: 0.65rem;
        flex-wrap: nowrap;
    }
}

    /* Nevejde-li se lišta mezi titulek a agendu, radši spadne pod pruh, než by ho překryla. */
    .page-header-tools.tools-below {
        position: static;
        margin: 0 0 0.75rem;
        flex-wrap: wrap;
    }

.search-box {
    position: relative;
}

    .search-box input {
        border-radius: 999px;
        padding-right: 2.2rem;
        padding-left: 0.9rem;
        background-color: color-mix(in srgb, var(--bs-body-bg) 55%, transparent);
        backdrop-filter: blur(6px);
        border-color: color-mix(in srgb, var(--bs-border-color, #dee2e6) 70%, transparent);
        transition: background-color 0.15s ease, border-color 0.15s ease;
    }

        .search-box input:focus {
            background-color: var(--bs-body-bg);
        }

    .search-box .search-go {
        position: absolute;
        right: 0.35rem;
        top: 50%;
        transform: translateY(-50%);
        border: 0;
        background: none;
        padding: 0 0.25rem;
        line-height: 1;
        font-size: 0.9rem;
        opacity: 0.55;
    }

        .search-box .search-go:hover {
            opacity: 1;
        }

.page-header-tools .btn {
    border-radius: 999px;
}

.filter-toggle > .btn {
    color: var(--bs-secondary-color, #6c757d);
    border-color: color-mix(in srgb, var(--bs-border-color, #dee2e6) 55%, transparent);
    background: transparent;
}

    .filter-toggle > .btn:hover {
        color: var(--bs-body-color);
        border-color: var(--bs-border-color, #dee2e6);
        background: color-mix(in srgb, var(--bs-body-bg) 60%, transparent);
    }

.filter-toggle > .btn:first-child {
    border-top-left-radius: 999px;
    border-bottom-left-radius: 999px;
    padding-left: 0.9rem;
}

.filter-toggle > .btn:last-child {
    border-top-right-radius: 999px;
    border-bottom-right-radius: 999px;
    padding-right: 0.9rem;
}

.submit-blocked {
    opacity: 0.7;
}

.submit-ready {
    box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.18);
}

.table-scroll.auto-hide {
    overflow-x: clip;
}

.table-scroll.auto-hide table[data-hide="1"] tr > *:nth-last-child(-n+3):nth-last-child(n+3),
.table-scroll.auto-hide table[data-hide="2"] tr > *:nth-last-child(-n+4):nth-last-child(n+3),
.table-scroll.auto-hide table[data-hide="3"] tr > *:nth-last-child(-n+5):nth-last-child(n+3),
.table-scroll.auto-hide table[data-hide="4"] tr > *:nth-last-child(-n+6):nth-last-child(n+3),
.table-scroll.auto-hide table[data-hide="5"] tr > *:nth-last-child(-n+7):nth-last-child(n+3),
.table-scroll.auto-hide table[data-hide="6"] tr > *:nth-last-child(-n+8):nth-last-child(n+3),
.table-scroll.auto-hide table[data-hide="7"] tr > *:nth-last-child(-n+9):nth-last-child(n+3),
.table-scroll.auto-hide table[data-hide="8"] tr > *:nth-last-child(-n+10):nth-last-child(n+3) {
    display: none;
}

.table-scroll.auto-hide thead th {
    position: sticky;
    top: 3.5rem;
    z-index: 2;
}

.status-legend-row {
    display: grid;
    grid-template-columns: minmax(96px, 1fr) minmax(0, auto);
    gap: 0.5rem;
    align-items: center;
    height: 100%;
}

    .status-legend-row > svg {
        width: 100%;
        height: auto;
        max-width: 240px;
        max-height: 100%;
        justify-self: center;
    }

.status-legend {
    line-height: 1.5;
    font-size: 0.8125rem;
}

    .status-legend a {
        display: inline-block;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        vertical-align: bottom;
    }

.status-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.35rem;
    align-items: center;
}

@media (max-width: 1399.98px) {
    .status-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .status-grid {
        grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
    }
}

    .status-grid .badge {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        vertical-align: bottom;
    }

.stat-inline {
    display: block;
    color: inherit;
    text-decoration: none;
    border-radius: 0.5rem;
    padding: 0.5rem 0.35rem;
    transition: background-color 0.15s, transform 0.15s;
    background-color: rgba(14, 42, 71, 0.035);
}

html[data-bs-theme="dark"] .stat-inline {
    background-color: rgba(255, 255, 255, 0.045);
}

    .stat-inline div {
        transition: transform 0.15s;
    }

    .stat-inline:hover {
        color: inherit;
        background-color: rgba(13, 110, 253, 0.08);
        transform: translateY(-2px);
    }

        .stat-inline:hover div {
            transform: scale(1.08);
        }

html[data-bs-theme="dark"] .stat-inline:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

/* ---------- Křížové zvýraznění grafů (třídy přiděluje js/charts.js) ----------
   Najetí na cokoli s data-key — výseč koláče, sloupec, čáru, dlaždici, položku legendy —
   zvýrazní vše se stejným klíčem v témže widgetu a ostatní části grafu ztlumí. Klíče se nikde
   nevypisují, takže pravidla platí pro každý graf stejně (dřív to byl výčet v :has). */
.chart-slice,
.chart-series {
    transition: opacity 0.15s;
}

.chart-slice.chart-key-dim,
.chart-series.chart-key-dim {
    opacity: 0.25;
}

.chart-slice.chart-key-on,
.chart-series.chart-key-on {
    opacity: 1;
}

.stat-inline.chart-key-on,
.tile-stat.chart-key-on {
    background-color: rgba(13, 110, 253, 0.08);
}

html[data-bs-theme="dark"] .stat-inline.chart-key-on,
html[data-bs-theme="dark"] .tile-stat.chart-key-on {
    background-color: rgba(255, 255, 255, 0.08);
}

.chart-legend-item.chart-key-on,
.legend-item.chart-key-on {
    font-weight: 700;
}

.tile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 0.75rem;
    height: 100%;
}

.tile-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    height: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-left: 4px solid var(--tile-accent);
    border-radius: 0.6rem;
    background: var(--tile-bg);
    box-shadow: 0 1px 4px rgba(14, 42, 71, 0.06);
    color: inherit;
    text-align: center;
    text-decoration: none;
    transition: box-shadow 0.15s, transform 0.15s;
}

    .tile-stat:hover {
        color: inherit;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(14, 42, 71, 0.18);
    }

    .tile-stat.active {
        box-shadow: inset 0 0 0 2px var(--tile-accent);
    }

    .tile-stat .value {
        font-size: 1.8rem;
        font-weight: 700;
        line-height: 1;
        color: var(--tile-accent);
    }

    .tile-stat .label {
        font-size: 0.8rem;
        color: #475569;
    }

.tile-progress {
    --tile-accent: #b45309;
    --tile-bg: #fffbeb;
}

.tile-invite {
    --tile-accent: #1d4ed8;
    --tile-bg: #eff6ff;
}

.tile-applied {
    --tile-accent: #475569;
    --tile-bg: #f8fafc;
}

.tile-done {
    --tile-accent: #15803d;
    --tile-bg: #f0fdf4;
}

.table {
    background-color: #fff;
    border-radius: 0.6rem;
    overflow: clip;
    box-shadow: 0 1px 4px rgba(14, 42, 71, 0.06);
}

    .table thead th {
        background-color: #e9eef4;
        color: var(--insp-primary-dark);
        font-weight: 600;
        border-bottom: none;
    }

.list-group-item {
    border-color: #e3e9f0;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--insp-accent);
}

.form-control:focus, .form-select:focus {
    border-color: var(--insp-accent);
}

.content {
    padding-top: 0.65rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.sidebar-toggle {
    display: none;}

.theme-lang-row {
    display: flex;
    gap: 0.35rem;
}

/* Přepínač režimu: kreslená ikona (maska), ne glyf — glyfy ☀/☾ vypadají v každém fontu
   jinak a většinou jako emoji. Měsíc = přepnout do tmy, slunce = zpátky do světla. */
.theme-toggle {
    display: block;
    flex: 1 1 0;
    min-width: 0;
    height: 2.1rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    background: transparent;
    color: #fff;
    font-size: 0;
    line-height: 1;
}

    .theme-toggle::before {
        content: "";
        display: block;
        width: 1.15rem;
        height: 1.15rem;
        margin: 0 auto;
        background: currentColor;
        -webkit-mask: var(--icon-moon) center / contain no-repeat;
        mask: var(--icon-moon) center / contain no-repeat;
    }

html[data-bs-theme="dark"] .theme-toggle::before {
    -webkit-mask-image: var(--icon-sun);
    mask-image: var(--icon-sun);
}

    .theme-toggle:hover {
        border-color: rgba(255, 255, 255, 0.45);
        background: rgba(255, 255, 255, 0.08);
    }

.lang-toggle {
    display: block;
    flex: 1 1 0;
    min-width: 0;
    height: 2.1rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    background-color: transparent;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 1.3rem auto;
}

    .lang-toggle:hover {
        border-color: rgba(255, 255, 255, 0.45);
        background-color: rgba(255, 255, 255, 0.08);
    }

    .lang-pick-group {
        display: inline-flex;
        gap: 0.25rem;
    }

    .lang-pick {
        width: 2rem;
        height: 1.6rem;
        border: 1px solid var(--bs-border-color, #dee2e6);
        border-radius: 6px;
        background-color: transparent;
        background-repeat: no-repeat;
        background-position: center;
        background-size: 1.3rem auto;
        opacity: 0.45;
    }

        .lang-pick:hover {
            opacity: 0.8;
        }

        .lang-pick.active {
            opacity: 1;
            border-color: #0088CA;
            box-shadow: 0 0 0 1px #0088CA;
        }

    .lang-toggle.lang-en,
    .lang-pick.lang-en {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 30'%3E%3CclipPath id='t'%3E%3Cpath d='M30,15 h30 v15 z v15 h-30 z h-30 v-15 z v-15 h30 z'/%3E%3C/clipPath%3E%3Cpath d='M0,0 v30 h60 v-30 z' fill='%23012169'/%3E%3Cpath d='M0,0 L60,30 M60,0 L0,30' stroke='%23fff' stroke-width='6'/%3E%3Cpath d='M0,0 L60,30 M60,0 L0,30' clip-path='url(%23t)' stroke='%23C8102E' stroke-width='4'/%3E%3Cpath d='M30,0 v30 M0,15 h60' stroke='%23fff' stroke-width='10'/%3E%3Cpath d='M30,0 v30 M0,15 h60' stroke='%23C8102E' stroke-width='6'/%3E%3C/svg%3E");
    }

    .lang-toggle.lang-cs,
    .lang-pick.lang-cs {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 6 4'%3E%3Crect width='6' height='4' fill='%23fff'/%3E%3Crect y='2' width='6' height='2' fill='%23d7141a'/%3E%3Cpath d='M0,0 L3,2 L0,4 z' fill='%2311457e'/%3E%3C/svg%3E");
    }

@media (min-width: 641px) {
    .sidebar {
        position: relative;
    }

    .sidebar .nav-scrollable {
        padding-bottom: 0.5rem;
    }

    .theme-lang-row {
        position: absolute;
        bottom: 0.6rem;
        left: 1rem;        right: 1rem;
    }

    .sidebar-toggle {
        display: block;
        flex: 1 1 0;
        min-width: 0;
        height: 2.1rem;
        border: 1px solid rgba(255, 255, 255, 0.25);
        border-radius: 6px;
        background: transparent;
        color: #fff;
        font-size: 0.85rem;
    }

        .sidebar-toggle:hover {
            border-color: rgba(255, 255, 255, 0.45);
            background: rgba(255, 255, 255, 0.08);
        }

        /* Sbalení menu: dvojitá šipka jako kreslená ikona («/» je interpunkce, ne ikona). */
        .sidebar-toggle::before {
            content: "";
            display: block;
            width: 1.05rem;
            height: 1.05rem;
            margin: 0 auto;
            background: currentColor;
            -webkit-mask: var(--icon-chevrons) center / contain no-repeat;
            mask: var(--icon-chevrons) center / contain no-repeat;
        }

    html.sidebar-collapsed .sidebar {
        width: 4.5rem;
    }

    html.sidebar-collapsed .sidebar-toggle::before {
        transform: rotate(180deg);
    }

    html.sidebar-collapsed .theme-lang-row {
        flex-direction: column;
    }

    html.sidebar-collapsed .theme-toggle,
    html.sidebar-collapsed .lang-toggle,
    html.sidebar-collapsed .sidebar-toggle {
        flex: 0 0 auto;
        border-color: transparent;
    }

        html.sidebar-collapsed .theme-toggle:hover,
        html.sidebar-collapsed .lang-toggle:hover,
        html.sidebar-collapsed .sidebar-toggle:hover {
            border-color: rgba(255, 255, 255, 0.45);
        }

    html.sidebar-collapsed .sidebar .nav-scrollable {
        margin-bottom: 8.1rem;    }

    html.sidebar-collapsed .sidebar .nav-link {
        font-size: 0;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    html.sidebar-collapsed .sidebar .nav-link .bi {
        margin-right: 0;
    }

    html.sidebar-collapsed .sidebar .navbar-brand strong,
    html.sidebar-collapsed .sidebar .account-watermark {
        display: none;
    }

    html.sidebar-collapsed .sidebar .navbar-brand img {
        margin-right: 0 !important;
        height: 42px !important;
    }

    html.sidebar-collapsed .sidebar .top-row {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    html.sidebar-collapsed .sidebar .top-row .container-fluid {
        flex-direction: column;
        align-items: center;
        gap: 0.15rem;
        padding: 0.35rem 0;
    }

    html.sidebar-collapsed .sidebar .navbar-brand {
        margin: 0;
        padding: 0;
    }

    html.sidebar-collapsed .sidebar .nav-item {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

html[data-bs-theme="dark"] {
    --insp-bg: #14181d;
    --insp-text: #d7dee8;
    --insp-primary: #35a6db;
    --insp-primary-dark: #79c8ec;    --insp-surface: #1d2228;    --insp-surface-2: #262d35;    --insp-border: #333b45;
    --area-color: #ff5c94;
}

html[data-bs-theme="dark"] body {
    color: var(--insp-text);
}

html[data-bs-theme="dark"] .btn-primary {
    color: #08151c;
    background-color: var(--insp-primary);
    border-color: var(--insp-primary);
}

html[data-bs-theme="dark"] h4 {
    border-bottom-color: var(--insp-border);
}

html[data-bs-theme="dark"] .table {
    background-color: var(--insp-surface);
}

html[data-bs-theme="dark"] .table thead th {
    background-color: var(--insp-surface-2);
    color: var(--insp-primary-dark);
}

html[data-bs-theme="dark"] .list-group-item {
    border-color: var(--insp-border);
}

html[data-bs-theme="dark"] .profile-stat {
    background: var(--insp-surface-2);
}

html[data-bs-theme="dark"] .profile-stat .label,
html[data-bs-theme="dark"] .tile-stat .label {
    color: #9fb0c3;
}

html[data-bs-theme="dark"] .tile-stat {
    border-color: var(--insp-border);
    background: var(--tile-bg-dark, var(--insp-surface-2));
}

html[data-bs-theme="dark"] .tile-progress { --tile-accent: #f0b45e; --tile-bg-dark: #2c2418; }
html[data-bs-theme="dark"] .tile-invite   { --tile-accent: #7aa7f5; --tile-bg-dark: #1b2436; }
html[data-bs-theme="dark"] .tile-applied  { --tile-accent: #a6b4c6; --tile-bg-dark: #232830; }
html[data-bs-theme="dark"] .tile-done     { --tile-accent: #63c98a; --tile-bg-dark: #182a1e; }

html[data-bs-theme="dark"] .filter-tag {
    background: var(--insp-surface-2);
    border-color: var(--insp-border);
    color: var(--insp-text);
}

html[data-bs-theme="dark"] .filter-tag.active {
    background: var(--insp-primary);
    border-color: var(--insp-primary);
    color: #08151c;
}

html[data-bs-theme="dark"] .qualification-chip {
    background: var(--insp-surface-2);
    color: #c3cede;
}

html[data-bs-theme="dark"] .icon-action {
    color: #a6b4c6;
}

html[data-bs-theme="dark"] .icon-action:hover {
    background: var(--insp-surface-2);
    border-color: var(--insp-border);
    color: #f1f5f9;
}

html[data-bs-theme="dark"] .btn-action.success {
    color: #6ee7b7;
    background: rgba(25, 135, 84, 0.22);
    border-color: rgba(110, 231, 183, 0.55);
}

html[data-bs-theme="dark"] .btn-action.success:hover {
    background: rgba(25, 135, 84, 0.34);
    border-color: #6ee7b7;
    color: #d1fae5;
}

html[data-bs-theme="dark"] .btn-action.primary {
    color: #7dd3fc;
    background: rgba(0, 136, 202, 0.24);
    border-color: rgba(125, 211, 252, 0.5);
}

html[data-bs-theme="dark"] .btn-action.primary:hover {
    background: rgba(0, 136, 202, 0.36);
    border-color: #7dd3fc;
    color: #e0f2fe;
}

html[data-bs-theme="dark"] .btn-action.neutral {
    color: #cbd5e1;
    background: rgba(148, 163, 184, 0.18);
    border-color: rgba(203, 213, 225, 0.4);
}

html[data-bs-theme="dark"] .btn-action.neutral:hover {
    background: rgba(148, 163, 184, 0.28);
    border-color: #cbd5e1;
    color: #f1f5f9;
}

html[data-bs-theme="dark"] .btn-action.danger {
    color: #fca5a5;
    background: rgba(220, 53, 69, 0.2);
    border-color: rgba(252, 165, 165, 0.45);
}

html[data-bs-theme="dark"] .btn-action.danger:hover {
    background: rgba(220, 53, 69, 0.32);
    border-color: #fca5a5;
    color: #fee2e2;
}

html[data-bs-theme="dark"] .copyable {
    border-bottom-color: #5a6674;
}

html[data-bs-theme="dark"] .copyable:hover {
    background: var(--insp-surface-2);
}

html[data-bs-theme="dark"] .copied-flash {
    background: #1c3b2c;
    color: #9ce0b7;
}

html[data-bs-theme="dark"] a.link-technician, html[data-bs-theme="dark"] .link-technician { color: #b69bf5; }
html[data-bs-theme="dark"] a.link-company, html[data-bs-theme="dark"] .link-company { color: #5cc6bc; }
html[data-bs-theme="dark"] a.link-project, html[data-bs-theme="dark"] .link-project { color: #f0b168; }

html[data-bs-theme="dark"] .chart-bar:hover,
html[data-bs-theme="dark"] .chart-dot:hover {
    stroke: #e5e7eb;
}

html[data-bs-theme="dark"] .markdown-page h2 { border-top-color: var(--insp-border); }
html[data-bs-theme="dark"] .markdown-page table th,
html[data-bs-theme="dark"] .markdown-page table td { border-color: var(--insp-border); }
html[data-bs-theme="dark"] .markdown-page table th { background: var(--insp-surface-2); }
html[data-bs-theme="dark"] .markdown-page code { background: var(--insp-surface-2); }

html[data-bs-theme="dark"] .btn:focus,
html[data-bs-theme="dark"] .btn:active:focus,
html[data-bs-theme="dark"] .form-control:focus,
html[data-bs-theme="dark"] .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem var(--insp-bg), 0 0 0 0.25rem var(--insp-accent);
}

html[data-bs-theme="dark"] .top-row {
    background-color: var(--insp-surface);
    border-bottom-color: var(--insp-border);
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 0.9rem;
    margin-bottom: 0.75rem;
}

.project-card {
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-top: 3px solid var(--proj-accent, var(--insp-primary));
    border-radius: 0.55rem;
    padding: 0.9rem 1rem;
    transition: box-shadow 0.12s ease, transform 0.12s ease;
}

    .project-card:hover {
        box-shadow: 0 4px 14px rgba(15, 40, 70, 0.12);
        transform: translateY(-1px);
    }

    .project-card.archived {
        opacity: 0.65;
        border-top-color: #94a3b8;
    }

.project-dot {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    background: var(--proj-accent);
    margin-top: 0.42rem;
    flex: 0 0 auto;
}

.project-name {
    font-weight: 600;
    font-size: 1.05rem;
    text-decoration: none;
}

    .project-name:hover {
        text-decoration: underline;
    }

.project-progress {
    height: 0.45rem;
    border-radius: 0.3rem;
    background: var(--bs-secondary-bg);
    overflow: hidden;
}

    .project-progress > div {
        height: 100%;
        border-radius: 0.3rem;
        background: var(--proj-accent, var(--insp-primary));
    }

.project-facts {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.7rem;
}

    .project-facts a {
        flex: 1 1 0;
        text-align: center;
        text-decoration: none;
        border: 1px solid color-mix(in srgb, var(--proj-accent) 25%, transparent);
        background: color-mix(in srgb, var(--proj-accent) 7%, transparent);
        border-radius: 0.45rem;
        padding: 0.35rem 0.2rem;
    }

        .project-facts a:hover {
            background: color-mix(in srgb, var(--proj-accent) 15%, transparent);
        }

    .project-facts .value {
        display: block;
        font-weight: 700;
        font-size: 1.05rem;
        color: var(--proj-accent);
    }

    .project-facts .label {
        display: block;
        font-size: 0.72rem;
        color: var(--bs-secondary-color);
    }

html[data-bs-theme="dark"] .project-card:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.table-scroll th {
    position: relative;
}

.col-resizer {
    position: absolute;
    top: 0;
    right: -5px;
    width: 10px;
    height: 100%;
    cursor: col-resize;
    touch-action: none;
    z-index: 2;
}

    .col-resizer::after {
        content: "";
        position: absolute;
        top: 15%;
        bottom: 15%;
        left: 4px;
        width: 2px;
        border-radius: 1px;
        background: transparent;
    }

    th:hover > .col-resizer::after {
        background: #cbd5e1;
    }

    .col-resizer:hover::after,
    .col-resizer.resizing::after {
        background: var(--insp-primary);
    }

html[data-bs-theme="dark"] th:hover > .col-resizer::after {
    background: #4a5568;
}

.table-gear-cell {
    width: 1.75rem;
    text-align: right;
}

.table-gear {
    background: none;
    border: none;
    padding: 0 0.1rem;
    color: #94a3b8;
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
}

    .table-gear:hover {
        color: var(--insp-primary);
    }

.column-chooser {
    position: absolute;
    top: 2.1rem;
    right: 0;
    z-index: 30;
    min-width: 12rem;
    border: 1px solid var(--insp-border, #dee2e6);
    border-radius: 0.6rem;
    box-shadow: 0 10px 28px rgba(14, 42, 71, 0.22);
    animation: chooser-in 0.12s ease-out;
}

    .column-chooser > strong,
    .column-chooser strong.small {
        text-transform: uppercase;
        letter-spacing: 0.04em;
        font-size: 0.7rem;
        color: var(--bs-secondary-color);
    }

    .column-chooser .form-check,
    .column-chooser > label {
        border-radius: 0.35rem;
        padding: 0.15rem 0.3rem 0.15rem 2.6rem;
    }

    .column-chooser .form-check-input[type="checkbox"] {
        width: 2em;
        height: 1em;
        margin-left: -2.3rem;
        border-radius: 2em;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='3' fill='rgba(0,0,0,.25)'/%3E%3C/svg%3E");
        background-position: left center;
        background-repeat: no-repeat;
        transition: background-position 0.15s ease-in-out;
    }

        .column-chooser .form-check-input[type="checkbox"]:checked {
            background-position: right center;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='3' fill='%23fff'/%3E%3C/svg%3E");
        }

        .column-chooser .form-check:hover,
        .column-chooser > label:hover {
            background: var(--insp-surface-2, #eef2f7);
        }

    .column-chooser.widget-picker .d-flex.small {
        border-radius: 0.35rem;
        padding: 0.15rem 0.3rem;
    }

        .column-chooser.widget-picker .d-flex.small:hover {
            background: var(--insp-surface-2, #eef2f7);
        }

    .column-chooser select,
    .column-chooser input[type="text"] {
        border-radius: 0.4rem;
    }

.chart-gear {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    z-index: 5;
}

@keyframes chooser-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.chooser-backdrop {
    position: fixed;
    inset: 0;
    z-index: 20;
    background: transparent;
}

.modal-backdrop-soft {
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: rgba(15, 23, 42, 0.35);
}

.leave-guard {
    position: fixed;
    z-index: 1051;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(30rem, calc(100vw - 2rem));
    box-shadow: 0 1.5rem 3rem rgba(15, 23, 42, 0.3);
}

th[draggable="true"] {
    cursor: grab;
}

.th-dragging {
    opacity: 0.5;
    background: var(--insp-surface-2, #e9eef4);
}

.col-narrow {
    width: 30px;
}

.page-head-gear {
    position: fixed;
    top: 0;
    height: 3.5rem;
    display: flex;
    align-items: center;
    left: calc(250px + 2rem);
    padding-left: var(--gear-offset, 7rem);
    z-index: 5;
    opacity: 0;
    transition: opacity 0.15s;
}

    .page-head-gear:hover,
    .page-head-gear.open {
        opacity: 1;
    }

    .page-head-gear .column-chooser {
        top: 3rem;
        right: auto;
        left: var(--gear-offset, 7rem);
    }

html.sidebar-collapsed .page-head-gear {
    left: calc(4.5rem + 2rem);
}

@media (max-width: 640.98px) {
    .page-head-gear {
        position: static;
        height: auto;
        padding-left: 0;
        justify-content: flex-end;
        opacity: 1;
    }

        .page-head-gear .column-chooser {
            top: 1.8rem;
            right: 0;
            left: auto;
        }
}

.widget-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    cursor: grab;
}

.dashboard-widget {
    margin-bottom: 1.5rem;
}

.widget-fill > .card {
    display: flex;
    flex-direction: column;
    padding-top: 0.4rem !important;
    padding-bottom: 0.4rem !important;
}

    .widget-fill .tile-grid {
        align-content: stretch;
        align-items: stretch;
        height: 100%;
        gap: 0.5rem;
        flex: 1 1 0;
        min-width: 0;
        max-width: none;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .widget-fill > .card > .d-flex {
        flex-wrap: nowrap !important;
    }

    .widget-fill > .card > .d-flex > svg {
        flex: 0 0 auto;
    }

.tile-stat.chart-key-on {
    box-shadow: 0 0 0 2px var(--tile-accent, var(--insp-primary));
}

.chart-slice.chart-key-on {
    filter: brightness(1.15);
    stroke: #fff;
    stroke-width: 1.5;
}

.dashboard-widget .widget-head .table-gear,
.dashboard-widget .widget-head .widget-remove {
    opacity: 0;
    transition: opacity 0.12s;
}

.dashboard-widget:hover .widget-head .table-gear,
.dashboard-widget:hover .widget-head .widget-remove,
.dashboard-widget:focus-within .widget-head .table-gear,
.dashboard-widget:focus-within .widget-head .widget-remove {
    opacity: 1;
}

.table-gear {
    border-radius: 50%;
    transition: background-color 0.12s, color 0.12s;
    font-size: 1.05rem;
    width: 1.75rem;
    height: 1.75rem;
    display: inline-grid;
    place-items: center;
}

    .table-gear:hover,
    .page-head-gear.open .table-gear {
        background: var(--insp-surface-2, #eef2f7);
        color: var(--insp-primary);
    }

.item-info {
    border: 0;
    background: none;
    color: var(--bs-secondary-color);
    padding: 0 0.25rem 0 0;
    line-height: 1;
    cursor: pointer;
}

    .item-info:hover {
        color: var(--insp-primary);
    }

.widget-remove {
    border: 0;
    background: none;
    color: var(--bs-secondary-color);
    padding: 0 0.15rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.65;
}

    .widget-remove:hover {
        color: #dc3545;
        opacity: 1;
    }

.dashboard-widget .card > svg:not([style*="width"]),
.dashboard-widget .card > div > svg:not([style*="width"]) {
    max-height: 13rem;
}

.widget-chips {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.3rem;
    margin-bottom: 0.4rem;
}

.widget-chip {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    padding: 0.3rem 0.45rem;
    border: 1px solid var(--insp-border, #dee2e6);
    border-left: 3px solid var(--insp-primary, #0088CA);
    border-radius: 0.45rem;
    background: color-mix(in srgb, var(--insp-primary, #0088CA) 7%, var(--insp-surface, #fff));
    font-size: 0.85rem;
    cursor: grab;
}

    .widget-chip:hover {
        border-color: var(--insp-primary);
    }

    .widget-chip > span.flex-fill {
        min-width: 0;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .widget-chip > .chooser-grip,
    .widget-chip > .widget-chip-remove {
        flex: 0 0 auto;
    }

.widget-chip-add {
    justify-content: center;
    border-style: dashed;
    border-left: 1px dashed var(--insp-border, #dee2e6);
    background: transparent;
    color: var(--bs-secondary-color, #6c757d);
    font-size: 1rem;
    cursor: pointer;
    opacity: 0.8;
}

    .widget-chip-add:hover {
        opacity: 1;
        color: var(--insp-primary);
    }

.widget-chip-remove {
    border: 0;
    background: none;
    color: var(--bs-secondary-color);
    line-height: 1;
    padding: 0 0.1rem;
    cursor: pointer;
}

    .widget-chip-remove:hover {
        color: #dc3545;
    }

.widget-title {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex: 1 1 auto;
    align-self: stretch;
    border: 0;
    background: none;
    padding: 0.1rem 0.3rem;
    border-radius: 0.4rem;
    text-align: left;
    color: inherit;
    cursor: grab;
}

    .widget-title:hover {
        background: var(--insp-surface-2, #eef2f7);
    }

    .widget-title:active {
        cursor: grabbing;
    }

    .widget-title .widget-chevron {
        color: var(--bs-secondary-color);
        font-size: 0.75rem;
        line-height: 1;
    }

    .widget-collapse:hover {
        color: var(--insp-primary);
    }

.dashboard-widget .list-group-item:hover {
    background: var(--insp-surface-2, #eef2f7);
}

        .widget-fill .tile-stat {
            padding: 0.3rem 0.55rem;
            min-height: 0;
            height: 100%;
        }

            .widget-fill .tile-stat .value {
                font-size: 1.5rem;
            }

            .widget-fill .tile-stat .label {
                font-size: 0.78rem;
            }

@media (max-width: 991.98px) {
    .widget-fill > .card {
        height: auto;
        min-height: 0;
    }
}

.avatar-edit {
    position: relative;
    display: inline-block;
    line-height: 0;
}

    .avatar-edit .avatar-edit-action,
    .avatar-edit .avatar-edit-remove {
        position: absolute;
        display: grid;
        place-items: center;
        width: 1.75rem;
        height: 1.75rem;
        border-radius: 50%;
        border: 1px solid var(--insp-border, #dee2e6);
        background: var(--insp-surface, #fff);
        color: inherit;
        font-size: 0.9rem;
        line-height: 1;
        cursor: pointer;
        opacity: 0;
        transition: opacity 0.15s;
        box-shadow: 0 1px 4px rgba(14, 42, 71, 0.2);
    }

    .avatar-edit .avatar-edit-action {
        right: -0.4rem;
        bottom: -0.4rem;
    }

    .avatar-edit .avatar-edit-remove {
        right: -0.4rem;
        top: -0.4rem;
        color: #dc3545;
    }

    .avatar-edit:hover .avatar-edit-action,
    .avatar-edit:hover .avatar-edit-remove,
    .avatar-edit:focus-within .avatar-edit-action,
    .avatar-edit:focus-within .avatar-edit-remove {
        opacity: 1;
    }

    .avatar-edit .avatar-edit-action input[type="file"] {
        position: absolute;
        inset: 0;
        opacity: 0;
        cursor: pointer;
    }

.online-dot {
    display: inline-block;
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 50%;
    background: var(--bs-secondary-bg, #ced4da);
    border: 1px solid rgba(0, 0, 0, 0.18);
    vertical-align: middle;
}

.online-dot.on {
    background: #22c55e;
    border-color: rgba(34, 197, 94, 0.6);
    animation: online-pulse 2.2s ease-out infinite;
}

@keyframes online-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55);
    }

    70% {
        box-shadow: 0 0 0 9px rgba(34, 197, 94, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .online-dot.on {
        animation: none;
        box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.25);
    }
}

html[data-bs-theme="dark"] .online-dot {
    background: #4b5563;
    border-color: rgba(255, 255, 255, 0.25);
}

/* ---------- Prohlížeč logů (admin) ---------- */

.log-files {
    max-height: 70vh;
    overflow-y: auto;
    gap: 0.15rem;
}

.log-file {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.1rem;
    text-align: left;
    border: 0;
    border-radius: 6px;
    background: transparent;
    padding: 0.35rem 0.5rem;
    font-size: 0.85rem;
    color: inherit;
}

    .log-file:hover {
        background: var(--insp-surface-2, #eef2f7);
    }

    .log-file.active {
        background: var(--insp-primary);
        color: #fff;
    }

        .log-file.active .text-muted,
        .log-file.active .badge {
            color: rgba(255, 255, 255, 0.85) !important;
        }

.log-view {
    max-height: 65vh;
    overflow: auto;
    border: 1px solid var(--insp-border, #dee2e6);
    border-radius: 6px;
    font-size: 0.85rem;
}

.log-day {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 0.25rem 0.6rem;
    font-weight: 600;
    background: var(--insp-surface-2, #eef2f7);
    border-bottom: 1px solid var(--insp-border, #dee2e6);
}

.log-line {
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
    padding: 0.25rem 0.6rem;
    border-bottom: 1px solid var(--insp-border, #dee2e6);
    border-left: 3px solid transparent;
}

    .log-line:hover {
        background: var(--insp-surface-2, #eef2f7);
    }

    .log-line.log-error {
        border-left-color: #dc3545;
    }

    .log-line.log-warning {
        border-left-color: #f59e0b;
    }

    .log-line.log-plain {
        color: var(--bs-secondary-color);
    }

.log-time {
    font-family: var(--bs-font-monospace);
    color: var(--bs-secondary-color);
    white-space: nowrap;
}

.log-level {
    min-width: 42px;
}

.log-message {
    font-family: var(--bs-font-monospace);
    white-space: pre-wrap;
    word-break: break-word;
}

    .log-message summary {
        cursor: pointer;
    }

.log-details {
    background: var(--insp-surface-2, #eef2f7);
    padding: 0.5rem;
    margin: 0.25rem 0 0;
    font-size: 0.8rem;
    border-radius: 4px;
}

.row-expanded > td,
.row-detail > td {
    background: var(--insp-surface-2, #eef2f7);
}

.row-expanded > td {
    border-top: 2px solid var(--insp-primary);
    border-bottom: 0;
}

.row-detail > td {
    border-bottom: 2px solid var(--insp-primary);
    padding-top: 0.25rem;
}

    .row-expanded > td:first-child,
    .row-detail > td:first-child {
        border-left: 2px solid var(--insp-primary);
    }

    .row-expanded > td:last-child,
    .row-detail > td:last-child {
        border-right: 2px solid var(--insp-primary);
    }

.column-chooser.widget-settings {
    top: 2rem;
    min-width: 14rem;
}

.column-chooser.widget-settings.in-card {
    top: 2.2rem;
    right: 0.6rem;
}

.column-chooser.widget-picker {
    min-width: 17rem;
    max-width: min(24rem, calc(100vw - 2rem));
}

.widget-bar {
    height: 8px;
    border-radius: 4px;
    background: var(--insp-primary);
    min-width: 6px;
    opacity: 0.85;
    transition: opacity 0.15s;
}

a:hover .widget-bar {
    opacity: 1;
}

.widget-bar-technician {
    background: #6f42c1;}

.item-todo {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    min-width: 15rem;
}

.item-todo-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

.item-todo-mark {
    width: 1rem;
    flex: 0 0 1rem;
    text-align: center;
    font-weight: 700;
    color: #7a5c00;
}

.item-todo-mark.done {
    color: #1b5e38;
}

.item-todo-text {
    flex: 1 1 8rem;
    line-height: 1.15;
}

[data-bs-theme="dark"] .item-todo-mark {
    color: #f0c869;
}

[data-bs-theme="dark"] .item-todo-mark.done {
    color: #7ddba6;
}

.job-form-section {
    display: flex;
    align-items: flex-start;
    gap: .625rem;
    margin-bottom: 1rem;
}

.job-form-step {
    flex: 0 0 1.75rem;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: var(--bs-primary);
    color: #fff;
    font-weight: 700;
    font-size: .875rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: .1rem;
}

.job-form-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    padding: .75rem 1rem;
    margin-bottom: 1rem;
    background: var(--bs-body-bg);
    border-top: 1px solid var(--bs-border-color);
}

.item-photos {
    background: #eef6fb;
    border-radius: 8px;
    padding: .45rem .6rem .3rem;
    align-self: flex-start;
}

html[data-bs-theme="dark"] .item-photos {
    background: #1d2b36;
}

.detail-head {
    position: sticky;
    top: 0;
    z-index: 6;
    padding: .5rem .75rem .35rem .75rem;
    background: var(--bs-body-bg);
    border-bottom: 1px solid var(--bs-border-color);
    margin-bottom: 1rem;
}

.section-head {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    margin: 1.25rem 0 .5rem;
}

.section-head.expanded {
    margin-bottom: .75rem;
}

.section-toggle {
    display: inline-flex;
    align-items: baseline;
    gap: .5rem;
    background: none;
    border: 0;
    padding: 0;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.section-toggle:hover .section-title {
    text-decoration: underline;
}

.section-toggle.inactive {
    opacity: .55;
    cursor: default;
}

.section-toggle.inactive:hover .section-title {
    text-decoration: none;
}

.section-hover-action {
    visibility: hidden;
}

.section-head:hover .section-hover-action,
.section-hover-action:focus-visible {
    visibility: visible;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 500;
}

.section-chevron {
    font-size: .7rem;
    color: var(--bs-secondary-color);
}

.job-waiting {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    border-left: 4px solid #0dcaf0;
    background: rgba(13, 202, 240, .08);
    border-radius: .375rem;
    padding: .625rem .875rem;
    margin-bottom: 1rem;
}

.profile-stat .hidden-value {
    font-size: 1rem;
    font-weight: 500;
    color: var(--bs-secondary-color);
}

a.profile-stat.stat-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

a.profile-stat.stat-link:hover {
    border-color: var(--bs-primary);
}

@media (max-width: 640.98px) {
    .theme-lang-row {
        display: none;
    }

    .navbar-toggler:checked ~ .theme-lang-row {
        display: flex;
        padding: 0.25rem 1rem 0.9rem;
    }

    .sidebar .nav-scrollable .nav-link {
        height: 2.4rem !important;
        line-height: 2.4rem !important;
    }

    .sidebar .nav-scrollable .nav-item {
        padding-bottom: 0.35rem;
    }

    main .top-row,
    main article.content {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    .table-scroll th,
    .table-scroll td {
        white-space: nowrap;
    }
}

.slot-tile {
    position: relative;
    width: 200px;
    padding: 0.5rem 0.65rem;
    border: 1px solid #dbe4ec;
    border-radius: 8px;
    background: #f1f5f9;
}

    .slot-tile.pending {
        background: #fff8e1;
        border-color: #ecd98a;
    }

    .slot-tile .slot-release {
        position: absolute;
        top: 0.15rem;
        right: 0.3rem;
        border: none;
        background: none;
        color: #b02a37;
        font-size: 0.85rem;
        line-height: 1;
        padding: 0.1rem 0.2rem;
        border-radius: 4px;
    }

        .slot-tile .slot-release:hover {
            background: rgba(176, 42, 55, 0.12);
        }

button.slot-tile.free {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    min-height: 4.6rem;
    border: 1.5px dashed #9fb3c8;
    background: transparent;
    color: #4a6a8a;
    font-size: 0.82rem;
}

    button.slot-tile.free .plus {
        font-size: 1.25rem;
        line-height: 1;
    }

    button.slot-tile.free:hover {
        background: rgba(13, 110, 253, 0.06);
        border-color: var(--insp-primary-dark, #0d6efd);
        color: var(--insp-primary-dark, #0d6efd);
    }

html[data-bs-theme="dark"] .slot-tile {
    background: var(--insp-surface-2, #1d2b36);
    border-color: #33475a;
}

html[data-bs-theme="dark"] .slot-tile.pending {
    background: #38311c;
    border-color: #6b5d2a;
}

html[data-bs-theme="dark"] button.slot-tile.free {
    background: transparent;
    color: #9fb0c3;
    border-color: #4a6076;
}

.slot-dots {
    display: inline-flex;
    gap: 3px;
    vertical-align: middle;
}

.slot-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 1px solid #8aa2b8;
    display: inline-block;
}

    .slot-dot.on {
        background: #198754;
        border-color: #198754;
    }

    .slot-dot.pending {
        background: #f5c542;
        border-color: #d9a520;
    }

.page-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    border-bottom: 1px solid var(--bs-border-color, #dee2e6);
}

.page-tab {
    border: none;
    background: none;
    padding: 0.45rem 0.9rem;
    font-weight: 600;
    color: var(--bs-secondary-color, #64748b);
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
}

    .page-tab:hover {
        color: var(--insp-primary-dark, #0d6efd);
    }

    .page-tab.active {
        color: var(--insp-text, #1f2937);
        border-bottom-color: var(--insp-yellow, #ffed36);
    }

html[data-bs-theme="dark"] .page-tab.active {
    color: #fff;
}

.report-pick {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.report-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    width: 230px;
    padding: 0.7rem 0.85rem;
    border: 1px solid #dbe4ec;
    border-radius: 10px;
    background: #f8fafc;
    color: inherit;
    text-align: left;
    text-decoration: none;
}

    .report-tile .icon {
        font-size: 1.45rem;
        line-height: 1;
    }

    .report-tile small {
        color: var(--bs-secondary-color, #64748b);
    }

    .report-tile:hover {
        border-color: var(--insp-primary-dark, #0d6efd);
        color: inherit;
    }

    .report-tile.active {
        border-color: var(--insp-primary-dark, #0d6efd);
        background: rgba(13, 110, 253, 0.06);
        box-shadow: inset 0 -3px 0 var(--insp-yellow, #ffed36);
    }

html[data-bs-theme="dark"] .report-tile {
    background: var(--insp-surface-2, #1d2b36);
    border-color: #33475a;
}

html[data-bs-theme="dark"] .report-tile.active {
    background: rgba(80, 140, 220, 0.15);
}

.map-breakdown {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.map-breakdown-map {
    flex: 1 1 0%;
    min-width: 380px;
    align-self: center;
}

.map-breakdown .category-breakdown {
    flex: 1 1 0%;
    min-width: 430px;
    gap: .875rem;
    flex-direction: row-reverse;
    align-items: center;
    align-self: center;
}

    .map-breakdown .category-donut svg {
        display: block;
    }

.map-breakdown .category-donut {
        flex: 1 1 0%;
        min-width: 190px;
        max-width: 30vw;
        padding-right: 9.8%;
    }

    .map-breakdown .category-breakdown .legend-tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .5rem;
        flex: 0 1 17vw;
        min-width: 220px;
    }

    .map-breakdown .legend-tile {
        padding: .55rem .7rem;
    }

        .map-breakdown .legend-tile .value {
            font-size: clamp(1.35rem, .95rem + .55vw, 2.4rem);
        }

        .map-breakdown .legend-tile .label {
            font-size: clamp(.78rem, .68rem + .12vw, 1.05rem);
        }

/* ---------- Mapa zakázek po krajích (JobsRegionMap) ---------- */
.region-map-wrap {
    --region-accent: #0088CA;
    --region-base: #e6edf5;    --region-empty: #f2f4f7;    --region-edge: #9fb4cb;    --region-label: #12304a;
    --area-halo: rgba(255, 255, 255, .85);
    --region-hatch: rgba(255, 255, 255, .8);    --region-hatch-empty: rgba(20, 45, 75, .3);}

.region-map {
    width: 100%;
}

.region-toolbar {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

.region-donut {
    flex: 0 1 148px;
    min-width: 96px;
}

    .region-donut .chart-slice {
        cursor: default;
    }

.region-map svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;}

.region-base path {
    fill: var(--region-base);
    stroke: none;
}

.region {
    cursor: pointer;
    transform-box: fill-box;
    transform-origin: center;
    transition: transform .18s cubic-bezier(.2, .8, .3, 1), filter .18s ease;
}

.region-shape {
    fill: var(--region-accent);
    fill-opacity: 0;    stroke: var(--region-edge);
    stroke-width: 1.6;
    transition: fill-opacity .18s ease, stroke-width .18s ease, stroke .18s ease;
}

.region.empty .region-shape {
    fill: var(--region-empty);
    fill-opacity: 1;
}

.region:hover {
    transform: translateY(-4px) scale(1.015);
}

.region:hover .region-shape {
    fill-opacity: 1;
    stroke: #ffffff;
    stroke-width: 3;
    filter: drop-shadow(0 3px 3px rgba(9, 30, 55, .38));
    animation: region-pulse 1.5s ease-in-out infinite;
}

.region.empty:hover .region-shape {
    fill-opacity: 1;
    stroke: var(--region-accent);
}

@keyframes region-pulse {
    0%, 100% { stroke-width: 2.4; stroke-opacity: .9; }
    50%      { stroke-width: 4.2; stroke-opacity: 1; }
}

.region-edge-top {
    fill: none;
    stroke: transparent;
    stroke-width: 3;
    pointer-events: none;
    transition: stroke .18s ease;
}

    .region-edge-top.chart-key-on {
        stroke: #ffffff;
        animation: region-pulse 1.5s ease-in-out infinite;
    }

    .region-edge-top.empty.chart-key-on {
        stroke: var(--region-accent);
    }

.region.selected .region-shape {
    stroke: #ffb020;
    stroke-width: 3.2;
}

.region.selected .region-shape {
    filter: drop-shadow(0 0 5px rgba(255, 176, 32, .65));
}

.region-count {
    font-size: 26px;
    font-weight: 600;
    fill: var(--region-label);
    text-anchor: middle;
    dominant-baseline: middle;
    paint-order: stroke;    stroke: var(--region-base);
    stroke-width: 4;
    pointer-events: none;
    user-select: none;
}

.region.empty .region-count {
    fill: #6b7787;
    font-weight: 400;
}

.region-name {
    font-size: 17px;
    font-weight: 600;
    fill: var(--region-label);
    text-anchor: middle;
    dominant-baseline: middle;
    paint-order: stroke;
    stroke: var(--region-base);
    stroke-width: 5;
    pointer-events: none;
    user-select: none;
    opacity: 0;
    transition: opacity .18s ease;
}

.region:hover .region-name {
    opacity: 1;
}

.region-hatch {
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
}

.region-hatch-line {
    stroke: var(--region-hatch, rgba(255, 255, 255, .75));
    stroke-width: 4.5;
}

.region-map-wrap:hover .region-hatch-line,
.region-map-wrap:has(.region.selected) .region-hatch-line,
.region-map-wrap:has(.region.chart-key-on) .region-hatch-line {
    animation: region-hatch-move 2s linear infinite;
}

.region:hover .region-hatch,
.region.chart-key-on .region-hatch,
.region.selected .region-hatch {
    opacity: .55;
}

.region.empty .region-hatch-line {
    stroke: var(--region-hatch-empty, rgba(20, 40, 70, .35));
}

@keyframes region-hatch-move {
    to { transform: translateX(18px); }
}

.region.chart-key-dim {
    opacity: .45;
}

.region.chart-key-on .region-shape {
    stroke: #ffffff;
    stroke-width: 2.6;
}

.region.chart-key-on .region-name {
    opacity: 1;
}

/* ---------- Hledané oblasti (skenující kruhy) ---------- */
.area-scan {
    pointer-events: none;
}

.area-halo {
    fill: none;
    stroke: var(--area-halo);
    stroke-width: 6;
}

.area-fill {
    fill: var(--area-color);
    fill-opacity: .12;
    stroke: var(--area-color);
    stroke-opacity: .85;
    stroke-width: 2.4;
    stroke-dasharray: 9 6;
    animation: area-march 1.6s linear infinite;}

.area-ring,
.area-sweep {
    fill: none;
    stroke: var(--area-color);
    stroke-width: 3;
    transform-box: fill-box;
    transform-origin: center;
    animation: area-scan 2.6s ease-out infinite;
}

.area-sweep {
    animation-delay: 1.3s;
}

.area-center {
    fill: var(--area-color);
    stroke: var(--area-halo);
    stroke-width: 2.5;
}

@keyframes area-scan {
    0%   { transform: scale(.12); stroke-opacity: .95; }
    70%  { stroke-opacity: .4; }
    100% { transform: scale(1); stroke-opacity: 0; }
}

@keyframes area-march {
    to { stroke-dashoffset: -30; }
}

.region-map.drawing {
    cursor: crosshair;
}

.draw-preview-circle {
    fill: var(--area-color);
    fill-opacity: .1;
    stroke: var(--area-color);
    stroke-width: 3;
    stroke-dasharray: 8 5;
    pointer-events: none;
}

.draw-preview-center {
    fill: var(--area-color);
    pointer-events: none;
}

.region-compact .region-count {
    font-size: 30px;
}

.region-compact .region-name {
    font-size: 20px;
}

    .legend-tile.selected {
        border-color: #ffb020;
        box-shadow: inset 0 0 0 1px #ffb020;
        font-weight: 600;
    }

    .legend-tile.empty {
        opacity: .55;
    }

    .legend-tile:disabled {
        cursor: default;
        transform: none;
    }

    .legend-tile:disabled:hover {
        transform: none;
        box-shadow: none;
    }

.legend-swatch {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    flex: 0 0 auto;
    border: 1px solid var(--region-edge);
}

.legend-value {
    font-variant-numeric: tabular-nums;
    min-width: 1.6rem;
    text-align: right;
}

.region-legend-areas {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    margin-bottom: .35rem;
}

.legend-area {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .8rem;
}

.legend-area-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--area-color);
    flex: 0 0 auto;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--area-color) 30%, transparent);
}

@media (prefers-reduced-motion: reduce) {
    .area-ring,
    .area-sweep,
    .area-fill,
    .region-hatch-line,
    .region:hover .region-shape {
        animation: none;
    }

    .area-ring,
    .area-sweep {
        stroke-opacity: .6;
    }

    .region:hover {
        transform: none;
    }
}

    .area-chip-remove {
        border: 0;
        background: transparent;
        color: var(--bs-secondary-color);
        line-height: 1;
        padding: 0 .2rem;
        cursor: pointer;
    }

        .area-chip-remove:hover {
            color: var(--bs-danger);
        }

html[data-bs-theme="dark"] .region-map-wrap {
    --region-accent: #35a6db;
    --region-base: #2b323b;
    --region-empty: #232a32;
    --region-edge: #55647a;
    --region-label: #eaf2f8;
    --area-halo: rgba(10, 14, 20, .85);
    --region-hatch: rgba(233, 245, 252, .7);
    --region-hatch-empty: rgba(200, 220, 240, .35);
}

html[data-bs-theme="dark"] .region.empty .region-count {
    fill: #8a97a6;
}

html[data-bs-theme="dark"] .region:hover .region-shape {
    filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .65));
}

html[data-bs-theme="dark"] .region:hover .region-shape,
html[data-bs-theme="dark"] .region.chart-key-on .region-shape {
    stroke: #d7ecf7;
}

/* ---------- Doplnění tmavého režimu (světlé plochy, které oslepovaly) ---------- */
.row-sub > td {
    background: var(--insp-surface-2, #eef2f7);
}

html[data-bs-theme="dark"] .icon-action.danger:hover {
    background: #3a1d22;
    border-color: #7b3b45;
    color: #f19aa5;
}

html[data-bs-theme="dark"] .markdown-page code {
    background: var(--insp-surface-2);
    color: #e4b8ff;
}

html[data-bs-theme="dark"] .copyable.copied {
    background: #123320;
    color: #8fdca9;
}

html[data-bs-theme="dark"] th:hover > .col-resizer::after {
    background: #4a5563;
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem;
    padding: .35rem .5rem;
    border-left: 3px solid var(--insp-primary);
    border-radius: 4px;
    background: color-mix(in srgb, var(--insp-primary) 7%, transparent);
}

.filter-chips:empty {
    display: none;
}

.category-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: flex-start;
}

.category-donut {
    flex: 0 1 150px;
    min-width: 108px;
}

    .category-breakdown .legend-tiles {
        flex: 1 1 150px;
        grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
        align-content: flex-start;
    }

    .category-donut .chart-slice {
        cursor: default;
    }

.map-breakdown .category-donut:not(:has(.chart-key-on)) .chart-slice.chart-key-dim {
    opacity: 1;
}

.donut-empty {
    stroke: currentColor;
    opacity: .12;
}

.legend-empty {
    grid-column: 1 / -1;
    align-self: center;
    text-align: center;
    font-size: .85rem;
}

.map-breakdown .category-donut svg {
    animation: donut-in .45s ease-out both;
}

@keyframes donut-in {
    from {
        opacity: 0;
        transform: scale(.94);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.map-breakdown .category-donut .chart-slice {
    transition: filter .18s ease, stroke-width .18s ease, opacity .15s ease;
}

    .map-breakdown .category-donut .chart-slice:hover,
    .map-breakdown .category-donut .chart-slice.chart-key-on {
        opacity: 1;        stroke: #fff;
        animation: donut-slice-pulse 1.6s ease-in-out infinite;
    }

@keyframes donut-slice-pulse {
    0%, 100% {
        stroke-width: 1;
        filter: brightness(1.06);
    }

    50% {
        stroke-width: 2.6;
        filter: brightness(1.22) drop-shadow(0 0 4px rgba(255, 255, 255, .35));
    }
}

@media (prefers-reduced-motion: reduce) {
    .map-breakdown .category-donut svg,
    .map-breakdown .category-donut .chart-slice:hover,
    .map-breakdown .category-donut .chart-slice.chart-key-on {
        animation: none;
    }
}

.area-section {
    margin-bottom: .6rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--bs-border-color);
}

.area-head {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
}

.area-head-title {
    font-size: .8rem;
    font-weight: 600;
    color: var(--bs-secondary-color);
    margin-left: .75rem;
}

.area-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
    min-width: 0;
}

.area-chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    max-width: 100%;
    padding: .1rem .2rem .1rem .35rem;
    border: 1px solid var(--area-color);
    border-radius: 999px;
    background: color-mix(in srgb, var(--area-color) 12%, transparent);
    font-size: .78rem;
    white-space: nowrap;
    overflow: hidden;
}

.area-chip-dot {
    width: .5rem;
    height: .5rem;
    border-radius: 50%;
    background: var(--area-color);
    flex: 0 0 auto;
}

.area-chip-km {
    color: var(--bs-secondary-color);
}

.chip-removable {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}

.chip-clear {
    border: 0;
    background: transparent;
    color: inherit;
    opacity: .75;
    line-height: 1;
    padding: 0;
    cursor: pointer;
}

    .chip-clear:hover {
        opacity: 1;
    }

/* ---------- Značka dokončení akce (ActionMark / ActionButton) ---------- */
/* Kolo z emblému, úder kladiva a blesk u běžných akcí; velké akce a potvrzení mají obíhající
   oblouk. Kresba je mono (bere barvu textu tlačítka), zelená fajfka je jediná pevná barva. */
/* Potvrzení akce: pilulka pod horním pruhem vpravo, drží se pár sekund a zmizí. */
.action-toast {
    position: fixed;
    top: 4.1rem;
    right: 1.6rem;
    z-index: 1100;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, #2e7d32 35%, transparent);
    background: var(--insp-surface, #fff);
    box-shadow: 0 0.4rem 1.1rem rgba(0, 0, 0, 0.16);
    font-size: 0.85rem;
    font-weight: 600;
    color: #2e7d32;
    animation: action-toast-in 0.25s ease-out;
}

@keyframes action-toast-in {
    from { opacity: 0; transform: translateY(-0.4rem); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .action-toast {
        animation: none;
    }
}

.action-mark {
    display: inline-flex;
    flex: 0 0 auto;
    vertical-align: -0.15em;
    color: inherit;
}

    .action-mark svg {
        width: 100%;
        height: 100%;
        display: block;
    }

    .action-mark .am-ink {
        fill: currentColor;
    }

    .action-mark .am-ring,
    .action-mark .am-arc {
        fill: none;
        stroke: currentColor;
        stroke-width: 3.4;
        stroke-linecap: round;
    }

    .action-mark .am-bolt,
    .action-mark .am-spark {
        fill: var(--insp-yellow, #ffed36);
        opacity: 0;
    }

    .action-mark .am-check {
        fill: none;
        stroke: #7ce4a8;
        stroke-width: 3.6;
        stroke-linecap: round;
        stroke-dasharray: 22;
        stroke-dashoffset: 22;
        opacity: 0;
    }

/* Průběh: kolo se točí (běžná akce), oblouk obíhá (velká akce). */
.action-mark .am-gear {
    transform-origin: 24px 24px;
    transform-box: view-box;
    animation: am-gear 1.1s linear infinite;
}

.action-mark .am-hammer {
    transform-origin: 33px 12px;
    transform-box: view-box;
    animation: am-hammer 1.1s ease-in-out infinite;
}

.action-mark .am-arc {
    stroke-dasharray: 28 72;
    animation: am-arc 1.2s linear infinite;
}

/* Dopad: kolo i kladivo odejdou, blesk sekne a zůstane fajfka. */
.action-mark-done .am-gear,
.action-mark-done .am-hammer,
.action-mark-done .am-arc {
    animation: am-out .45s ease-out forwards;
}

.action-mark-done .am-bolt,
.action-mark-done .am-spark {
    animation: am-strike .5s ease-out forwards;
}

.action-mark-done .am-check {
    animation: am-check .5s .28s ease-out forwards;
}

@keyframes am-gear {
    to { transform: rotate(1turn); }
}

@keyframes am-hammer {
    0%, 100% { transform: rotate(-46deg); }
    45% { transform: rotate(4deg); }
    60% { transform: rotate(-16deg); }
}

@keyframes am-arc {
    to { stroke-dashoffset: -100; }
}

@keyframes am-out {
    to { opacity: 0; transform: scale(.85); }
}

@keyframes am-strike {
    0% { opacity: 0; transform: scale(.6); }
    35% { opacity: 1; transform: scale(1.15); }
    100% { opacity: 0; transform: scale(1); }
}

@keyframes am-check {
    from { stroke-dashoffset: 22; opacity: 1; }
    to { stroke-dashoffset: 0; opacity: 1; }
}

/* V klidu si tlačítko drží svůj původní display (jinak inline-flex posune zarovnání v liště);
   flex se zapne teprve, když v něm běží značka. */
.action-button.is-busy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    vertical-align: middle;
    opacity: 1;
}

.action-button-label:empty {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    .action-mark .am-gear,
    .action-mark .am-hammer,
    .action-mark .am-arc,
    .action-mark-done .am-bolt,
    .action-mark-done .am-spark {
        animation: none;
    }

    .action-mark-done .am-check {
        animation: none;
        stroke-dashoffset: 0;
        opacity: 1;
    }
}
