/* Ověření C3: klávesnicový focus je na správě nástěnky viditelný i na tlačítkách hlavičky. */
body.notice-page :is(a, button, input, select, textarea):focus-visible {
    outline: 3px solid #b4aaff !important;
    outline-offset: 3px;
}

/* Ověření C3: sekundární tlačítko má v tmavé správě dostatečný kontrast textu. */
body.notice-page .btn-outline-secondary {
    color: #c6c9d1 !important;
    border-color: #a1a6b2 !important;
}

body.notice-page .btn-outline-primary {
    color: #b4aaff !important;
    border-color: #b4aaff !important;
}

body.notice-page .btn-outline-primary:hover {
    color: #fff !important;
    background-color: #41369b !important;
}

body.notice-page .btn-outline-secondary:hover {
    color: #fff !important;
    background-color: #454955 !important;
}

@font-face {
    font-family: "Roboto";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/roboto-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Roboto";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/roboto-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Roboto";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("../fonts/roboto-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Roboto";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("../fonts/roboto-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    --bs-body-font-family: "Roboto", Arial, sans-serif;
    --app-font-family: "Roboto", Arial, sans-serif;
}

body {
    background: var(--om-bg);
    color: var(--om-text);
    font-family: var(--app-font-family);
    font-weight: 400;
}

.login-page {
    min-height: 100vh;
    padding: 1.5rem;
    background:
        radial-gradient(circle at 50% 20%, rgba(var(--om-primary-rgb), .12), transparent 24rem),
        var(--om-bg);
}

.login-card {
    width: 100%;
    max-width: 430px;
    background: var(--om-surface);
    border: 1px solid var(--om-border);
    color: var(--om-text);
    box-shadow: 0 1.5rem 3.5rem rgba(0, 0, 0, .32);
}

.login-card h1,
.login-card .app-brand,
.login-card .form-label { color: var(--om-text-strong); }

.login-card .text-muted { color: var(--om-text-muted) !important; }

.login-card .form-control {
    background: var(--om-bg);
    border-color: var(--om-border);
    color: var(--om-text);
}

.login-card .form-control:focus {
    background: var(--om-bg);
    border-color: var(--om-primary);
    box-shadow: 0 0 0 .2rem rgba(var(--om-primary-rgb), .22);
    color: #fff;
}

.login-card .btn-primary {
    background: var(--om-primary);
    border-color: var(--om-primary);
}

.login-card .btn-primary:hover,
.login-card .btn-primary:focus {
    background: var(--om-primary-hover);
    border-color: var(--om-primary-hover);
}

.municipality-switcher .form-select {
    min-width: 12rem;
    max-width: 20rem;
}

.municipality-current {
    color: var(--om-text);
}

.map-page {
    overflow: clip;
}
html:has(body.map-page) { overflow: clip; }

.map-page .page-body {
    height: calc(100vh - 80px);
    min-height: 30rem;
    overflow: hidden;
}

.map-page .page-body > .container-fluid {
    height: 100%;
    padding: 0;
}

.municipality-map-workspace,
.municipality-map,
.map-empty-state {
    height: 100%;
    min-height: 30rem;
    width: 100%;
}

.municipality-map-workspace {
    position: relative;
}

.municipality-map {
    background: #e9eeec;
    z-index: 0;
}

.map-toolbar {
    left: 3.5rem;
    position: absolute;
    top: 0.75rem;
    z-index: 500;
    flex-wrap: wrap;
    max-width: calc(100% - 4.25rem);
}

.map-toolbar > .map-ui-button { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 36px; }
.map-toolbar > .map-ui-button svg { width: 16px; height: 16px; }
.map-floating-panel {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    width: min(20rem, calc(100vw - 4.25rem));
    max-height: min(32rem, calc(100dvh - 13rem));
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--om-surface);
    border: 1px solid var(--om-border);
    border-radius: 0.4rem;
    box-shadow: 0 0.35rem 1rem rgba(0, 0, 0, 0.35);
    padding: 0.8rem;
}
.map-floating-panel-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 0.6rem; }
.map-floating-panel-header strong { font-size: 0.9rem; }
.map-floating-panel-header .btn-close { flex-shrink: 0; }
.map-add-panel .map-ui-button { display: flex; align-items: center; gap: 0.6rem; min-height: 44px; }
.map-line-drawing-control {
    position: absolute; left: 3.5rem; top: 0.75rem; z-index: 1052;
    width: min(26rem, calc(100% - 4.25rem)); padding: 0.8rem;
    background: var(--om-surface); color: var(--om-text); border: 1px solid var(--om-border); border-radius: 0.4rem;
}
.map-line-drawing-control button { min-height: 44px; }
.map-line-drawing .leaflet-interactive { pointer-events: none; }
.map-line-edit-control { max-height: calc(100% - 1.5rem); overflow-y: auto; }
.map-line-editing .leaflet-registeredParcelsPane-pane .leaflet-interactive,
.map-line-editing .leaflet-mapObjectsPane-pane .leaflet-interactive,
.map-line-editing .leaflet-infrastructureLinesPane-pane .leaflet-interactive { pointer-events: none; }


.app-shell .map-ui-button {
    background: #262932;
    border: 1px solid #596575;
    box-shadow: 0 0.15rem 0.45rem rgba(0, 0, 0, 0.38);
    color: #f4f7f8;
    font-weight: 500;
    opacity: 1;
}

.app-shell .map-ui-button:hover,
.app-shell .map-ui-button:focus-visible {
    background: #343945;
    border-color: #7d8998;
    box-shadow: 0 0 0 0.18rem rgba(var(--om-primary-rgb), .24), 0 0.15rem 0.5rem rgba(0, 0, 0, 0.42);
    color: #fff;
}

.app-shell .map-ui-button[aria-expanded="true"] {
    background: var(--om-primary);
    border-color: #72aa9c;
    color: #fff;
}

.app-shell .map-ui-button:disabled,
.app-shell .map-ui-button.disabled {
    background: #262932;
    border-color: #485261;
    color: rgba(244, 247, 248, 0.58);
    cursor: not-allowed;
    opacity: 0.78;
}

.map-detail-panel {
    --bs-offcanvas-width: min(26.25rem, 100%);
    background: #fff !important;
    border-left: 1px solid rgba(31, 50, 45, 0.16) !important;
    bottom: 0 !important;
    box-shadow: -0.25rem 0 1rem rgba(31, 50, 45, 0.12);
    display: flex !important;
    flex-direction: column;
    height: 100% !important;
    left: auto !important;
    max-height: none !important;
    max-width: 100% !important;
    overflow: hidden;
    position: absolute !important;
    right: 0 !important;
    top: 0 !important;
    width: var(--bs-offcanvas-width) !important;
    z-index: 1050;
}

.map-detail-panel.offcanvas-end {
    transform: translateX(100%);
}

.map-detail-panel.offcanvas-end.show:not(.hiding),
.map-detail-panel.offcanvas-end.showing {
    transform: none;
}

.map-detail-panel .offcanvas-header {
    align-items: flex-start;
    border-bottom: 1px solid #e8eceb;
    flex: 0 0 auto;
}

.map-detail-heading { flex: 1 1 auto; min-width: 0; }
.map-detail-heading .offcanvas-title { overflow-wrap: anywhere; }
.map-detail-panel .offcanvas-header { max-height: max(76px, 40%); overflow-y: auto; }
.map-detail-heading [data-map-detail-actions]:empty { display: none !important; }
.map-detail-panel .offcanvas-header > .btn-close { flex: 0 0 auto; align-self: flex-start; position: sticky; top: 0; }

.map-detail-panel .offcanvas-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
}
.map-detail-panel :is(button, input, textarea, select) { scroll-margin-block: .5rem; }

/* Jeden detail pro všechna zařízení; na úzké ploše zůstává nad ním mapa. */
@media (max-width: 899.98px) {
    .municipality-map-workspace .map-toolbar .map-floating-panel {
        top: 0;
        max-height: calc(var(--map-workspace-height, 100dvh) - 1.5rem);
    }
    body.app-shell .municipality-map-workspace .map-detail-panel {
        top: auto !important;
        bottom: 0 !important;
        width: 100% !important;
        height: min(74%, calc(100% - 56px)) !important;
        border-radius: .75rem .75rem 0 0;
    }
    .map-detail-panel.offcanvas-end { transform: translateY(100%); }
    .municipality-map-workspace:has(.map-detail-panel.show) .map-toolbar,
    .municipality-map-workspace:has(.map-detail-panel.showing) .map-toolbar { visibility: hidden; }
}
@media (max-height: 500px) and (max-width: 899.98px) {
    body.app-shell .municipality-map-workspace .map-detail-panel { height: calc(100% - 48px) !important; }
}
@media (max-width: 1184px), (pointer: coarse) {
    .municipality-map-workspace :is(.btn, .btn-close, .map-icon-action, .map-ui-button),
    .parcel-detail-dashboard :is(.btn, .btn-close, .map-icon-action) { min-width: 44px; min-height: 44px; }
    .municipality-map-workspace :is(.form-control, .form-select),
    .parcel-detail-dashboard :is(.form-control, .form-select) { min-height: 44px; font-size: 16px; }
    .municipality-map-workspace .map-layer-option { min-height: 44px; }
    .municipality-map-workspace .municipality-map .leaflet-control-zoom a { width: 44px; height: 44px; line-height: 44px; }
    .municipality-map-workspace .map-toolbar { left: 4rem; max-width: calc(100% - 4.75rem); }
    .map-detail-panel :is(form, .d-flex) { min-width: 0; }
    .map-detail-panel form .d-flex { flex-wrap: wrap; }
    .map-detail-panel :is(input, textarea, select) { max-width: 100%; }
    .map-detail-panel .offcanvas-body { overflow-wrap: anywhere; }
}

.map-owner-add-button {
    display: inline-flex;
    position: relative;
    z-index: 1;
}

.map-detail-subtitle {
    font-size: 0.875rem;
    margin-top: 0.2rem;
}

/* Bootstrap text-muted vychází ze světlého motivu; detail mapy má tmavé pozadí. */
#map-detail-panel .map-detail-subtitle,
#map-detail-panel .text-muted {
    color: #b8c0cc !important;
}

.map-detail-list {
    display: grid;
    grid-template-columns: minmax(8rem, 1fr) minmax(8rem, 1.2fr);
    margin-bottom: 1rem;
}

.map-detail-list dt,
.map-detail-list dd {
    border-bottom: 1px solid #e8eceb;
    margin: 0;
    padding: 0.45rem 0;
}

.map-detail-list dt {
    color: #62716d;
    font-weight: 400;
    padding-right: 0.75rem;
}

.map-detail-list dd {
    font-weight: 500;
    min-width: 0;
    overflow-wrap: anywhere;
}

.map-parcel-summary {
    background: #f7f9f8;
    border: 1px solid #e2e8e5;
    border-radius: 0.45rem;
    display: grid;
    gap: 0.65rem 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 1rem;
    padding: 0.8rem 0.9rem;
}

.map-parcel-summary-item {
    min-width: 0;
}

.map-parcel-summary-item strong,
.map-parcel-summary-label {
    display: block;
}

.map-parcel-summary-item strong {
    font-size: 0.875rem;
    font-weight: 500;
    overflow-wrap: anywhere;
}

.map-parcel-summary-label {
    color: #6b7874;
    font-size: 0.7rem;
    margin-bottom: 0.1rem;
    text-transform: uppercase;
}

.map-parcel-summary-empty {
    color: #62716d;
    font-size: 0.82rem;
    grid-column: 1 / -1;
    margin: 0;
}

.map-parcel-owners-summary {
    border-top: 1px solid #e2e8e5;
    grid-column: 1 / -1;
    padding-top: 0.65rem;
}

.map-parcel-owners-summary > strong {
    font-size: 0.875rem;
    font-weight: 500;
}

.map-parcel-owners-content {
    align-items: center;
    display: flex;
    gap: 0.75rem;
    min-width: 0;
}

.map-ownership-chart {
    flex: 0 0 84px;
    height: 84px;
    width: 84px;
}

.map-parcel-owner-list {
    flex: 1 1 auto;
    font-size: 0.78rem;
    list-style: none;
    margin: 0;
    min-width: 0;
    padding: 0;
}

.map-parcel-owner-list li {
    align-items: baseline;
    display: flex;
    gap: 0.35rem;
    line-height: 1.35;
    min-width: 0;
}

.map-parcel-owner-list li > span:not(.map-owner-swatch) {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.map-parcel-owner-list li > strong {
    flex: 0 0 auto;
    font-size: 0.75rem;
    font-weight: 500;
}

.map-owner-swatch {
    border-radius: 50%;
    flex: 0 0 0.45rem;
    height: 0.45rem;
    width: 0.45rem;
}

.map-parcel-owner-list .map-parcel-owner-more {
    color: #6b7874;
    display: block;
    margin-top: 0.2rem;
}

.map-ownership-tooltip {
    display: grid;
    gap: 0.15rem;
    padding: 0.45rem 0.55rem;
}

.map-ownership-tooltip strong {
    color: #fff;
    font-weight: 600;
}

.map-ownership-tooltip span {
    color: #fff;
    font-weight: 400;
}

.map-detail-collapse {
    border: 1px solid #e2e8e5;
    border-radius: 0.45rem;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.map-detail-collapse-header {
    align-items: center;
    background: #fff;
    color: var(--om-primary);
    cursor: pointer;
    display: flex;
    font-size: 0.875rem;
    font-weight: 500;
    justify-content: space-between;
    list-style: none;
    padding: 0.85rem 1rem;
    user-select: none;
}

.map-detail-collapse-header > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.map-detail-collapse-header [data-section-count] { flex-shrink: 0; margin-right: .6rem; }
.map-detail-collapse-header::after { flex-shrink: 0; }

.map-detail-collapse-header::-webkit-details-marker {
    display: none;
}

.map-detail-collapse-header::after {
    content: "›";
    font-size: 1.25rem;
    line-height: 1;
    transition: transform 0.15s ease;
}

.map-detail-collapse[open] > .map-detail-collapse-header::after {
    transform: rotate(90deg);
}

.map-detail-collapse[open] > .map-detail-collapse-header {
    border-bottom: 1px solid #e8eceb;
}

.map-detail-collapse-body {
    padding: 1rem;
}

.map-registration-form {
    border-top: 1px solid #e8eceb;
    margin-top: 1rem;
    padding-top: 1rem;
}

.map-registration-note {
    background: #f5f7f6;
    border-radius: 0.35rem;
    padding: 0.75rem;
    white-space: pre-wrap;
}

.leaflet-control-layers,
.leaflet-bar {
    font-family: var(--app-font-family);
}

.map-infrastructure-metadata dd,
.map-infrastructure-description {
    overflow-wrap: anywhere;
}

.map-infrastructure-description {
    white-space: pre-wrap;
}

.map-layer-control {
    min-width: 0;
}

.map-layer-heading {
    color: #62716d;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    margin: 0.35rem 0 0.2rem;
    text-transform: uppercase;
}

.map-layer-heading:first-child {
    margin-top: 0;
}

.map-layer-option {
    align-items: center;
    cursor: pointer;
    display: flex;
    font-size: 0.82rem;
    gap: 0.45rem;
    line-height: 1.4;
    margin: 0.15rem 0;
}

.map-layer-option input {
    margin: 0;
}

.map-filter-toggle {
    font-weight: 500;
}

.map-filter-panel {
    min-width: 0;
}

.map-filter-heading {
    color: #62716d;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
}

.map-filter-field {
    display: block;
    margin-bottom: 0.65rem;
}

.map-filter-field > span {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 0.2rem;
}

.map-filter-result {
    border-top: 1px solid #e8eceb;
    font-size: 0.78rem;
    font-weight: 500;
    margin-top: 0.8rem;
    padding-top: 0.65rem;
}

.map-filter-empty {
    color: #62716d;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.map-service-notice {
    bottom: 0.75rem;
    left: 50%;
    margin: 0;
    padding: 0.5rem 0.75rem;
    pointer-events: none;
    position: absolute;
    transform: translateX(-50%);
    z-index: 500;
}

.map-operational-timeline {
    margin-top: 0.25rem;
    padding-left: 0.35rem;
}

.map-operational-entry {
    display: flex;
    gap: 0.75rem;
    padding-bottom: 1.25rem;
    position: relative;
}

.map-operational-entry:not(:last-child)::before {
    border-left: 1px dashed #c9d2cf;
    content: "";
    left: 0.67rem;
    position: absolute;
    top: 0.7rem;
    bottom: -0.1rem;
}

.map-operational-marker {
    align-items: center;
    background: #7b8582;
    border: 2px solid #eef1f0;
    border-radius: 50%;
    color: #fff;
    display: inline-flex;
    flex: 0 0 1.35rem;
    font-size: 0.75rem;
    font-weight: 700;
    height: 1.35rem;
    justify-content: center;
    line-height: 1;
    position: relative;
    width: 1.35rem;
    z-index: 1;
}

.map-operational-marker-ok {
    background: var(--om-success);
    border-color: #d9f0e4;
}

.map-operational-marker-not-ok {
    background: var(--om-danger);
    border-color: #f8d7da;
}

.map-operational-marker-warning {
    background: var(--om-warning);
    border-color: #ffe8cc;
}

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

.map-result-option {
    align-items: center;
    border: 1px solid #dfe5e2;
    border-radius: 0.35rem;
    cursor: pointer;
    display: flex;
    font-size: 0.75rem;
    gap: 0.35rem;
    line-height: 1.25;
    min-height: 2.25rem;
    padding: 0.35rem 0.45rem;
}

.map-result-options .btn-check:checked + .map-result-option {
    background: #f3f0ff;
    border-color: var(--theme-default);
    box-shadow: 0 0 0 1px var(--theme-default);
}

.map-result-option-icon {
    font-size: 1rem;
    font-weight: 700;
}

.map-result-option-ok .map-result-option-icon { color: var(--om-success); }
.map-result-option-not-ok .map-result-option-icon { color: var(--om-danger); }
.map-result-option-warning .map-result-option-icon { color: var(--om-warning); }

.map-task-group-title {
    color: #66736f;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    margin: 0.6rem 0;
    text-transform: uppercase;
}

.map-task-item {
    display: flex;
    gap: 0.65rem;
    padding: 0.55rem 0;
}

.map-task-item + .map-task-item {
    border-top: 1px solid #edf0ef;
}

.map-task-marker {
    align-items: center;
    border: 2px solid #9aa4a1;
    border-radius: 50%;
    color: #66736f;
    display: inline-flex;
    flex: 0 0 1.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    height: 1.25rem;
    justify-content: center;
    line-height: 1;
    margin-top: 0.1rem;
    width: 1.25rem;
}

.map-task-overdue .map-task-marker {
    background: var(--om-danger);
    border-color: var(--om-danger);
    color: #fff;
}

.map-task-today .map-task-marker,
.map-task-due-soon .map-task-marker {
    border-color: var(--om-warning);
    color: var(--om-warning);
}

.map-task-completed .map-task-marker {
    background: var(--om-success);
    border-color: var(--om-success);
    color: #fff;
}

.map-task-cancelled {
    opacity: 0.65;
}

.map-task-content {
    min-width: 0;
    width: 100%;
}

.map-task-meta {
    color: #66736f;
    display: flex;
    font-size: 0.75rem;
    gap: 0.5rem;
}

.map-task-title {
    font-size: 0.88rem;
    margin: 0.15rem 0;
}

.map-task-description {
    font-size: 0.8rem;
    margin: 0.25rem 0 0;
    white-space: pre-line;
}

.map-task-history {
    border-top: 1px solid #e3e8e6;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
}

.map-task-history > summary {
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
}

.map-operational-entry-content {
    min-width: 0;
    width: 100%;
}

.map-operational-meta {
    align-items: center;
    color: #66736f;
    display: flex;
    font-size: 0.75rem;
    gap: 0.5rem;
    margin-bottom: 0.2rem;
}

.map-operational-title {
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0 0 0.3rem;
}

.map-operational-description {
    font-size: 0.82rem;
    margin: 0 0 0.4rem;
    white-space: pre-line;
}

.map-operational-details,
.map-operational-author {
    color: #66736f;
    display: flex;
    flex-direction: column;
    font-size: 0.75rem;
}

.map-operational-author {
    font-weight: 500;
    margin-top: 0.35rem;
}

@media (max-width: 420px) {
    .map-parcel-summary {
        grid-template-columns: 1fr;
    }

    .map-parcel-owners-content {
        align-items: flex-start;
    }

    .map-ownership-chart {
        flex-basis: 76px;
        height: 76px;
        width: 76px;
    }
}

@media (max-width: 991.98px) {
    .map-page .page-body {
        height: calc(100vh - 60px);
        min-height: 24rem;
        padding: 0 !important;
    }

    .municipality-map-workspace,
    .municipality-map,
    .map-empty-state {
        min-height: 24rem;
    }

    .map-layer-control {
        min-width: auto;
        padding: 0.5rem 0.6rem;
    }
}

button,
input,
optgroup,
select,
textarea,
.bootstrap-touchspin .input-group,
.dropdown .dropdown-menu,
.user-profile .like-comment span,
.main-invoice-1 body,
.page-body-wrapper .card .sub-title,
[class*="introjs-"] {
    font-family: var(--app-font-family);
}

.chart-sparkline,
.chart-sparkline .jqsfield {
    font-family: var(--app-font-family);
}

.monthly-target .apexcharts-canvas .apexcharts-datalabels-group .apexcharts-datalabel-value {
    font-family: var(--app-font-family) !important;
}

h1,
h2,
h3,
h4,
h5,
h6,
.btn,
.nav-link,
.sidebar-link,
.dropdown-item {
    font-weight: 500;
}

.app-brand {
    color: var(--theme-default);
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
}

.app-sidebar-toggle {
    border: 0;
    color: var(--theme-default);
    font-size: 1.4rem;
    line-height: 1;
}

.app-nav-icon {
    display: inline-block;
    font-size: 1.25rem;
    text-align: center;
    width: 1.5rem;
}

@media (max-width: 991.98px) {
    .page-wrapper.compact-wrapper .page-body-wrapper .sidebar-wrapper.app-sidebar-open {
        transform: translateX(0);
    }
}

/* Cuba application shell – selektivně adaptováno z template/map-js.html. */
body.app-shell {
    background: var(--om-bg);
    color: var(--om-text);
    min-height: 100vh;
    overflow-x: hidden;
}

.app-shell .page-wrapper,
.app-shell .page-body-wrapper {
    min-height: 100vh;
}

.app-shell .page-header {
    background: var(--om-header);
    border-bottom: 1px solid var(--om-border);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.22);
    height: 80px;
    margin-left: 265px;
    position: fixed;
    right: 0;
    top: 0;
    transition: margin-left 0.3s ease, width 0.3s ease;
    width: calc(100% - 265px);
    z-index: 1001;
}

.app-shell .header-wrapper {
    align-items: center;
    height: 100%;
    padding: 0 1.5rem;
}

.app-shell .header-logo-wrapper {
    align-items: center;
    display: flex;
    margin-right: 1rem;
}

.app-shell .app-sidebar-toggle,
.app-shell .app-profile-toggle {
    color: var(--om-text);
}

.app-shell .app-sidebar-toggle {
    align-items: center;
    display: inline-flex;
    height: 2.5rem;
    justify-content: center;
    padding: 0;
    width: 2.5rem;
}

.app-shell .page-header .header-wrapper .header-logo-wrapper .toggle-sidebar {
    display: none;
    margin: 0;
    padding: 0;
    position: static;
}

.app-shell .sidebar-wrapper .logo-wrapper .toggle-sidebar {
    display: block;
    margin-left: auto;
    position: static;
}

.app-shell .app-sidebar-toggle-sidebar {
    background: var(--om-primary-subtle);
    border-radius: 50%;
    color: var(--om-primary);
}

.app-shell .app-sidebar-toggle-header {
    background: var(--om-primary-subtle);
    border-radius: 50%;
    color: var(--om-primary);
}

.app-shell .app-sidebar-toggle:hover,
.app-shell .app-profile-toggle:hover,
.app-shell .app-profile-toggle:focus {
    color: #fff;
}

.app-shell .app-sidebar-toggle svg,
.app-shell .app-profile-toggle > svg,
.app-shell .app-user-avatar svg,
.app-shell .sidebar-link svg {
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.app-shell .app-sidebar-toggle svg {
    height: 1.4rem;
    width: 1.4rem;
}

.app-shell .sidebar-wrapper {
    background: var(--om-surface);
    border-right: 1px solid var(--om-border);
    bottom: 0;
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.18);
    left: 0;
    position: fixed;
    top: 0;
    transform: none;
    transition: transform 0.3s ease, width 0.3s ease;
    width: 265px;
    z-index: 1002;
}

.app-shell .sidebar-wrapper > div {
    height: 100%;
}

.app-shell .logo-wrapper {
    align-items: center;
    border-bottom: 1px solid var(--om-border);
    display: flex;
    height: 80px;
    justify-content: space-between;
    padding: 0 1.5rem;
}

.app-shell .logo-icon-wrapper {
    display: none;
}

.app-shell .app-brand {
    align-items: center;
    color: #fff;
    display: inline-flex;
    gap: 0.7rem;
}

.app-brand-mark {
    align-items: center;
    background: var(--theme-default);
    border-radius: 0.6rem;
    color: #fff;
    display: inline-flex;
    flex: 0 0 2.25rem;
    font-size: 1.2rem;
    font-weight: 700;
    height: 2.25rem;
    justify-content: center;
    text-decoration: none;
    width: 2.25rem;
}

.app-shell .app-brand-name {
    color: #fff;
}

.app-sidebar-close {
    color: var(--om-text-muted);
    display: none;
    font-size: 1.6rem;
    line-height: 1;
}

.app-shell .sidebar-main {
    height: calc(100vh - 80px);
    overflow-x: hidden;
    overflow-y: auto;
    padding: 1.25rem 0.9rem;
}

.app-shell .sidebar-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.app-shell .sidebar-main-title h6 {
    color: var(--om-text-muted);
    font-size: 0.68rem;
    letter-spacing: 0.09em;
    margin: 0 0 0.75rem;
    padding: 0 0.85rem;
    text-transform: uppercase;
}

.app-shell .sidebar-list {
    margin-bottom: 0.3rem;
}

.app-shell .sidebar-link {
    align-items: center;
    border-radius: 0.55rem;
    color: var(--om-text-muted);
    display: flex;
    gap: 0.85rem;
    padding: 0.8rem 0.9rem;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.app-shell .sidebar-link svg {
    flex: 0 0 1.25rem;
    height: 1.25rem;
    width: 1.25rem;
}

.app-shell .sidebar-link:hover,
.app-shell .sidebar-link.active {
    background: var(--om-primary-subtle);
    color: var(--om-primary);
}

.app-shell .page-body {
    background: var(--om-bg);
    margin-left: 265px;
    margin-top: 80px;
    min-height: calc(100vh - 80px);
    padding: 0;
    transition: margin-left 0.3s ease, width 0.3s ease;
    width: calc(100% - 265px);
}

.app-shell .app-content-area {
    min-height: calc(100vh - 80px);
}

.app-shell .municipality-current,
.app-shell .form-label,
.app-shell h1,
.app-shell h2,
.app-shell h3,
.app-shell h4,
.app-shell h5,
.app-shell h6 {
    color: rgba(255, 255, 255, 0.88);
}

body.app-shell.dark-only .page-wrapper .page-header form.municipality-switcher {
    background-color: transparent;
}

.app-shell .municipality-switcher .form-select {
    background-color: var(--om-bg);
    border-color: var(--om-border);
    color: var(--om-text);
}

.app-profile-toggle {
    border: 0;
    gap: 0.65rem;
    padding: 0.35rem 0;
}

.app-profile-toggle > svg {
    height: 1rem;
    width: 1rem;
}

.app-user-avatar {
    align-items: center;
    background: var(--om-primary-subtle);
    border-radius: 0.55rem;
    color: var(--om-primary);
    display: inline-flex;
    height: 2.5rem;
    justify-content: center;
    width: 2.5rem;
}

.app-user-avatar svg {
    height: 1.35rem;
    width: 1.35rem;
}

.app-profile-toggle .profile-media {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.app-profile-toggle .profile-media small {
    color: var(--om-text-muted);
    font-size: 0.72rem;
}

.app-profile-menu,
.app-shell .dropdown-menu {
    background: var(--om-surface);
    border: 1px solid var(--om-border);
    color: var(--om-text);
    min-width: 14rem;
}

/* Bootstrap text-muted má !important a sekundární barvu světlého motivu.
 * Korekce platí jen pro profilové menu (také po přesunu do body) a hlavičky stránek. */
.app-shell .app-profile-menu .text-muted,
.app-shell .page-title .text-muted,
.app-shell .page-body h1 + p.text-muted { color: var(--om-text-muted) !important; }

.parcel-restriction-history { margin-top: 1.5rem; }
.parcel-restriction-history-event { border-top: 1px solid var(--om-border); padding-top: .75rem; margin-top: .75rem; }
.parcel-restriction-history-event > summary { cursor: pointer; overflow-wrap: anywhere; }
.parcel-restriction-history-time { display: inline-block; margin: 0 .5rem .35rem 0; padding: .2rem .45rem; border: 1px solid rgba(var(--om-primary-rgb),.35); border-radius: .35rem; background: var(--om-primary-subtle); color: #c9c2ff; font-size: .75rem; font-weight: 400; }
.parcel-restriction-history-operation { color: var(--om-text-strong); }
.parcel-restriction-history-meta { display: block; color: var(--om-text-muted); font-size: .75rem; margin: .15rem 0 .5rem; }

.app-shell .dropdown-item {
    color: var(--om-text);
}

.app-shell .dropdown-item:hover,
.app-shell .dropdown-item:focus {
    background: var(--om-surface-elevated);
    color: #fff;
}

.dashboard-content {
    max-width: 1440px;
}

.dashboard-welcome-card,
.app-shell .card,
.app-shell .modal-content {
    background: var(--om-surface);
    border: 1px solid var(--om-border);
    color: var(--om-text);
}

.dashboard-welcome-card {
    overflow: hidden;
    position: relative;
}

.dashboard-welcome-card::after {
    background: radial-gradient(circle, rgba(var(--om-primary-rgb), .28), transparent 68%);
    content: "";
    height: 15rem;
    pointer-events: none;
    position: absolute;
    right: -4rem;
    top: -6rem;
    width: 15rem;
}

.dashboard-eyebrow {
    color: var(--om-primary);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.map-page .page-body,
.map-page .app-content-area {
    height: calc(100dvh - 80px);
    min-height: 30rem;
    overflow: hidden;
}

.map-page .app-content-area {
    padding: 0;
}

/* Mapa dostane pouze zbytek viewportu po hlavičce a informačních bannerech.
 * Pevná minimální výška by ořízla spodní část samostatně posuvného detailu. */
body.app-shell.map-page .page-body {
    height: calc(100dvh - 80px);
    min-height: 0;
    overflow: clip;
}
/* Mapové ovládání nesmí na tabletu překrýt 80px hlavička tématu. */
body.app-shell.map-page .page-wrapper.compact-wrapper .page-body-wrapper .page-body { margin-top: 80px; }
body.app-shell.map-page .app-content-area {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: clip;
}
body.app-shell.map-page .app-content-area > .alert { flex: 0 0 auto; }
body.app-shell.map-page .municipality-map-workspace,
body.app-shell.map-page .map-empty-state {
    flex: 1 1 0;
    height: auto;
    min-height: 0;
}
body.app-shell.map-page .municipality-map { min-height: 0; }
@media (max-width: 767.98px) {
    body.app-shell.map-page .page-body { height: calc(100dvh - 64px); }
    body.app-shell.map-page .page-wrapper.compact-wrapper .page-body-wrapper .page-body {
        margin-top: 64px;
    }
}

/* Profilové menu je při otevření přímo v body, mimo vrstvy hlavičky a mapy. */
.app-profile-menu.app-profile-menu-portal { z-index: 1060; }

.app-shell .map-detail-panel {
    background: var(--om-surface) !important;
    border-left-color: var(--om-border) !important;
    color: var(--om-text);
}

.app-shell .map-detail-panel .offcanvas-header,
.app-shell .map-detail-collapse[open] > .map-detail-collapse-header,
.app-shell .map-detail-list dt,
.app-shell .map-detail-list dd,
.app-shell .map-registration-form,
.app-shell .map-task-item + .map-task-item,
.app-shell .map-task-history,
.app-shell .map-parcel-owners-summary {
    border-color: var(--om-border);
}

.app-shell .map-detail-collapse {
    border-color: var(--om-border);
}

.app-shell .map-detail-collapse-header,
.app-shell .map-detail-collapse-body,
.app-shell .map-parcel-summary,
.app-shell .map-registration-note {
    background: var(--om-bg);
    color: var(--om-text);
}

.app-shell .map-parcel-summary {
    border-color: var(--om-border);
}

.app-shell .map-detail-list dt,
.app-shell .map-parcel-summary-label,
.app-shell .map-parcel-summary-empty,
.app-shell .map-task-meta,
.app-shell .map-task-group-title,
.app-shell .map-operational-meta,
.app-shell .map-operational-details,
.app-shell .map-operational-author {
    color: var(--om-text-muted);
}

.app-shell .map-detail-list dd { color: var(--om-text-strong); }

.app-shell .form-control,
.app-shell .form-select,
.app-shell textarea {
    background-color: var(--om-bg);
    border-color: var(--om-border);
    color: var(--om-text);
}

.app-shell .form-control:focus,
.app-shell .form-select:focus {
    background-color: var(--om-bg);
    border-color: var(--om-primary);
    box-shadow: 0 0 0 .2rem rgba(var(--om-primary-rgb), .22);
    color: #fff;
}

.app-shell .map-result-option {
    border-color: var(--om-border);
}

.app-shell .map-result-options .btn-check:checked + .map-result-option {
    background: var(--om-primary-subtle);
}

/* Leaflet dlaždice zůstávají beze změny; tmavé jsou pouze aplikační ovladače. */
.app-shell .map-layer-control,
.app-shell .map-filter-panel {
    background: var(--om-surface);
    border-color: var(--om-border);
    color: var(--om-text);
}

.app-shell .map-layer-heading,
.app-shell .map-filter-heading,
.app-shell .map-filter-empty {
    color: var(--om-text-muted);
}

.app-shell .map-filter-result {
    border-color: var(--om-border);
}

.app-sidebar-overlay {
    background: rgba(0, 0, 0, 0.55);
    border: 0;
    inset: 0;
    padding: 0;
    position: fixed;
    z-index: 1000;
}

@media (min-width: 1185px) {
    html.close_icon .app-shell .sidebar-wrapper,
    .app-shell .sidebar-wrapper.close_icon {
        width: 90px;
    }

    html.close_icon .app-shell .sidebar-wrapper .logo-wrapper,
    html.close_icon .app-shell .sidebar-wrapper .sidebar-main-title,
    html.close_icon .app-shell .sidebar-wrapper .sidebar-link span,
    .app-shell .sidebar-wrapper.close_icon .logo-wrapper,
    .app-shell .sidebar-wrapper.close_icon .sidebar-main-title,
    .app-shell .sidebar-wrapper.close_icon .sidebar-link span {
        display: none;
    }

    html.close_icon .app-shell .sidebar-wrapper .logo-icon-wrapper,
    .app-shell .sidebar-wrapper.close_icon .logo-icon-wrapper {
        align-items: center;
        display: flex;
        height: 80px;
        justify-content: center;
    }

    html.close_icon .app-shell .sidebar-wrapper .sidebar-main,
    .app-shell .sidebar-wrapper.close_icon .sidebar-main {
        padding-left: 0.8rem;
        padding-right: 0.8rem;
    }

    html.close_icon .app-shell .sidebar-wrapper .sidebar-link,
    .app-shell .sidebar-wrapper.close_icon .sidebar-link {
        justify-content: center;
    }

    html.close_icon .app-shell .page-header,
    .app-shell .page-header.close_icon {
        margin-left: 90px;
        width: calc(100% - 90px);
    }

    html.close_icon .app-shell .page-header .header-wrapper .header-logo-wrapper .toggle-sidebar,
    .app-shell .page-header.close_icon .header-wrapper .header-logo-wrapper .toggle-sidebar {
        display: block;
    }

    html.close_icon .app-shell .page-header + .page-body-wrapper .page-body,
    .app-shell .page-header.close_icon + .page-body-wrapper .page-body {
        margin-left: 90px;
        width: calc(100% - 90px);
    }
}

@media (max-width: 1184px) {
    .app-shell .page-wrapper.compact-wrapper .page-header,
    .app-shell .page-wrapper.compact-wrapper .page-body-wrapper .page-body {
        margin-left: 0;
        width: 100%;
    }

    .app-shell .sidebar-wrapper.close_icon {
        transform: translateX(-100%);
    }

    .app-sidebar-close {
        display: inline-flex;
    }

    .app-shell .page-header .header-wrapper .header-logo-wrapper .toggle-sidebar {
        display: block;
    }

    .app-shell .sidebar-wrapper .logo-wrapper .toggle-sidebar {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .app-shell .page-header {
        height: 64px;
    }

    .app-shell .header-wrapper {
        padding: 0 0.75rem;
    }

    .app-shell .page-body,
    .map-page .page-body {
        margin-top: 64px;
        min-height: calc(100dvh - 64px);
    }

    .map-page .page-body,
    .map-page .app-content-area {
        height: calc(100dvh - 64px);
    }

    .app-shell .app-municipality-area {
        display: block;
        min-width: 0;
    }

    .app-shell .municipality-switcher {
        gap: 0.35rem !important;
    }

    .app-shell .municipality-switcher .form-select {
        min-width: 0;
        width: min(42vw, 11rem);
    }

    .app-shell .profile-media,
    .app-shell .app-profile-toggle > svg {
        display: none !important;
    }

    .app-shell .municipality-current {
        max-width: 42vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .app-shell .map-detail-panel {
        --bs-offcanvas-width: 100%;
    }

    .dashboard-content {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

.dark-only .login-page {
    background: #1d1e26;
}

.dark-only .login-card {
    background: #262932;
    border: 1px solid #374558;
    color: rgba(255, 255, 255, 0.78);
}

.dark-only .login-card h1,
.dark-only .login-card .app-brand,
.dark-only .login-card .form-label {
    color: rgba(255, 255, 255, 0.9);
}

.dark-only .login-card .form-control {
    background: #1d1e26;
    border-color: #374558;
    color: #fff;
}

/* Milník 6B – provozní dashboard podle Cuba dashboard-12. */
.municipality-dashboard {
    max-width: 1600px;
}

.municipality-dashboard .card-header {
    background: transparent;
}

.municipality-dashboard .common-space {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.dashboard-kpi .project-state {
    align-items: center;
    border-radius: 50%;
    display: inline-flex;
    height: 3.75rem;
    justify-content: center;
    width: 3.75rem;
}

.dashboard-kpi .project-state svg {
    fill: none;
    height: 1.65rem;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
    width: 1.65rem;
}

.dashboard-kpi h2 {
    font-size: 2rem;
    margin-top: 0.35rem;
}

.dashboard-kpi-overdue .project-state {
    background: rgba(var(--om-danger-rgb), .14);
    color: var(--om-danger);
}

.dashboard-kpi-today .project-state,
.dashboard-kpi-soon .project-state {
    background: rgba(var(--om-warning-rgb), .14);
    color: var(--om-warning);
}

.dashboard-task-list {
    display: grid;
}

.dashboard-task-row {
    align-items: center;
    border-bottom: 1px solid #374558;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 0.9rem 0;
}

.dashboard-task-row:first-child {
    padding-top: 0;
}

.dashboard-task-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.dashboard-task-main {
    min-width: 0;
}

.dashboard-task-main h3 {
    overflow-wrap: anywhere;
}

.dashboard-task-date {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    flex-direction: row;
    gap: 0.75rem;
    text-align: right;
}

.dashboard-task-date time {
    color: rgba(255, 255, 255, 0.75);
    font-weight: 500;
}

.dashboard-due,
.dashboard-result {
    border-radius: 0.25rem;
    display: inline-flex;
    font-size: 0.72rem;
    font-weight: 500;
    padding: 0.2rem 0.45rem;
}

.dashboard-due-overdue,
.dashboard-result-not_ok {
    background: rgba(var(--om-danger-rgb), .14);
    color: var(--om-danger);
}

.dashboard-due-today,
.dashboard-due-due_soon,
.dashboard-result-warning {
    background: rgba(var(--om-warning-rgb), .14);
    color: var(--om-warning);
}

.dashboard-due-planned,
.dashboard-result-neutral {
    background: rgba(127, 138, 150, 0.16);
    color: #aab4bd;
}

.dashboard-result-ok {
    background: rgba(var(--om-success-rgb), .16);
    color: var(--om-success);
}

.dashboard-today-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dashboard-today-list li {
    align-items: flex-start;
    border-bottom: 1px solid #374558;
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0;
}

.dashboard-today-list li:first-child {
    padding-top: 0;
}

.dashboard-today-list li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.dashboard-today-list strong,
.dashboard-today-list span {
    display: block;
}

.dashboard-today-list span:not(.dashboard-today-marker) {
    color: #98a6ad;
    font-size: 0.75rem;
    margin-top: 0.2rem;
}

.dashboard-today-content {
    flex: 1 1 auto;
    min-width: 0;
}

.dashboard-entity-reference {
    align-items: center;
    display: inline-flex !important;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.dashboard-parcel-action,
.dashboard-complete-action {
    flex: 0 0 2rem;
}

.dashboard-action-column {
    text-align: center;
    width: 3.5rem;
}

.dashboard-today-marker {
    background: var(--om-warning);
    border: 4px solid rgba(var(--om-warning-rgb), .16);
    border-radius: 50%;
    box-sizing: content-box;
    flex: 0 0 0.5rem;
    height: 0.5rem;
    margin-top: 0.2rem;
    width: 0.5rem;
}

.dashboard-empty-state {
    align-items: center;
    border: 1px dashed #485261;
    border-radius: 0.5rem;
    color: #98a6ad;
    display: flex;
    justify-content: center;
    min-height: 7rem;
    padding: 1.25rem;
    text-align: center;
}

.dashboard-parcel-chart {
    min-height: 285px;
}

.object-evidence-table { width: 100%; table-layout: fixed; }
.object-evidence-table > :not(caption) > * > * { background: transparent; color: inherit; border-color: #374558; padding: .85rem .75rem; overflow-wrap: anywhere; }
.object-evidence-table th:first-child { width: 30%; }
.object-evidence-table th:last-child { width: 110px; }
.object-evidence [data-create-object] svg { width: 16px; height: 16px; vertical-align: -3px; }
@media (max-width: 767.98px) {
    .object-evidence-table, .object-evidence-table tbody { display: block; }
    .object-evidence-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .object-evidence-table tr { display: block; padding: .75rem 0; border-bottom: 1px solid #374558; }
    .object-evidence-table > tbody > tr > th { display: block; width: 100%; border: 0; padding: .5rem 0; }
    .object-evidence-table > tbody > tr > td { display: flex; gap: 1rem; justify-content: space-between; border: 0; padding: .4rem 0; }
    .object-evidence-table td::before { content: attr(data-label); flex: 0 0 4rem; color: #98a6ad; }
}

.dashboard-events-table > :not(caption) > * > * {
    background: transparent;
    border-color: #374558;
    color: inherit;
    padding: 0.85rem 1rem;
    white-space: nowrap;
}

.dashboard-events-table thead th {
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

@media (max-width: 575.98px) {
    .municipality-dashboard {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .dashboard-task-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-task-date {
        align-items: center;
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
        width: 100%;
    }
}
/* Dokumenty a fotografie */
.map-document-list { display: grid; gap: .75rem; }
.map-document-item { display: flex; gap: .75rem; align-items: flex-start; padding: .75rem; border: 1px solid #374558; border-radius: .5rem; background: #1d1e26; }
.map-document-thumbnail, .map-document-icon { flex: 0 0 54px; width: 54px; height: 54px; border-radius: .4rem; object-fit: cover; }
.map-document-gallery-thumbnail { display: block; flex: 0 0 54px; width: 54px; height: 54px; }
.document-gallery.pswp { z-index: 1055; }
.document-gallery.pswp--touch .pswp__button--arrow--left,
.document-gallery.pswp--touch .pswp__button--arrow--right { visibility: visible; }
.document-gallery .pswp__caption__center { overflow-wrap: anywhere; }
.document-gallery .pswp__caption__center small { display: block; }
.map-document-icon { display: grid; place-items: center; background: #323846; color: #c7ccd1; font-size: .68rem; font-weight: 700; }
.map-document-icon-pdf { color: #ff6b6b; }
.map-document-info { min-width: 0; flex: 1; }
.map-document-info strong, .map-document-info > span { display: block; overflow-wrap: anywhere; }
.map-document-primary { color: var(--om-text); line-height: 1.4; }
.map-document-primary-note { white-space: pre-wrap; }
.map-document-filename, .map-document-meta { color: var(--om-text-muted); font-size: .78rem; margin-top: .2rem; }
.map-document-actions { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .55rem; }
.btn-document-secondary { color: #e9edf2; border-color: #64748b; background: #293241; }
.btn-document-secondary:hover, .btn-document-secondary:focus-visible { color: #fff; border-color: #94a3b8; background: #3a4657; box-shadow: 0 0 0 .2rem rgba(148, 163, 184, .22); }
.map-icon-action { display: inline-flex; width: 2rem; height: 2rem; min-width: 2rem; padding: 0; align-items: center; justify-content: center; line-height: 1; }
.map-icon-action svg { width: 15px; height: 15px; margin: 0; }
.dashboard-priority-header { display: flex; flex-wrap: wrap; gap: 1rem; }
.dashboard-priority-header h2 { flex: 1 1 220px; min-width: 0; }
.dashboard-quick-search { flex: 0 1 220px; max-width: 100%; }
[data-dashboard-search-row][hidden], [data-dashboard-search-empty][hidden] { display: none !important; }
@media (max-width: 767.98px), (pointer: coarse) {
    .map-icon-action { width: 44px; height: 44px; min-width: 44px; }
    .dashboard-quick-search { flex-basis: 100%; }
}
.map-icon-action-danger { color: #ff8b8b; border-color: #dc5a5a; background: rgba(220, 53, 69, .08); }
.map-icon-action-danger:hover, .map-icon-action-danger:focus-visible { color: #fff; border-color: #ff747f; background: #c82333; box-shadow: 0 0 0 .2rem rgba(220, 53, 69, .25); }
.app-swal-dark { color: #e9edf2; background: #1d1e26; border: 1px solid #374558; }
.app-swal-dark .swal2-title { color: #fff; }
.app-swal-dark .swal2-html-container { color: #c7ccd1; }
.app-swal-dark .swal2-textarea { color: #e9edf2; background: #262932; border-color: #526174; }
.app-swal-dark .swal2-textarea:focus { color: #fff; border-color: var(--om-primary); box-shadow: 0 0 0 .2rem rgba(var(--om-primary-rgb), .25); }
.app-swal-confirm { color: #fff !important; border-width: 1px; border-style: solid; font-weight: 600; }
.app-swal-confirm-primary { background: var(--om-primary) !important; border-color: var(--om-primary) !important; }
.app-swal-confirm-primary:hover { color: #fff !important; background: var(--om-primary-hover) !important; border-color: var(--om-primary-hover) !important; }
.app-swal-confirm-primary:focus-visible { color: #fff !important; box-shadow: 0 0 0 .2rem rgba(var(--om-primary-rgb), .35) !important; }
.app-swal-confirm-danger { background: var(--om-danger) !important; border-color: var(--om-danger) !important; }
.app-swal-confirm-danger:hover { color: #fff !important; background: #bb2d3b !important; border-color: #b02a37 !important; }
.app-swal-confirm-danger:focus-visible { color: #fff !important; box-shadow: 0 0 0 .2rem rgba(225, 83, 97, .4) !important; }
.app-swal-confirm:disabled, .app-swal-confirm.disabled { color: #fff !important; opacity: .65; cursor: not-allowed; }
.document-dropzone { min-height: 190px; background: transparent; }
#document-upload-modal :is(button, .btn-close, input, select) { min-height: 44px; }
#document-upload-modal .btn-close { min-width: 44px; }
#document-upload-modal :is(input, select, textarea) { font-size: 16px; }
#document-upload-modal .modal-body { overflow-wrap: anywhere; overscroll-behavior: contain; }
#document-upload-modal .dz-preview { max-width: calc(100% - 2rem); }
#document-upload-modal .dz-error-message { position: static; opacity: 1; pointer-events: auto; }
#document-upload-modal .dz-error-message::after { display: none; }
#document-upload-modal .dz-remove { display: inline-flex; align-items: center; min-height: 44px; }
#document-upload-modal .document-dropzone { background: var(--om-surface); color: var(--om-text); border-color: var(--om-border); }
#document-upload-modal :is(.form-text, .text-muted) { color: var(--om-text-muted) !important; }
#document-upload-modal .dropzone .dz-preview { width: calc(100% - 2rem); display: flex; flex-direction: column; }
#document-upload-modal .dropzone .dz-preview .dz-details { position: static; opacity: 1; padding: .5rem; }
#document-upload-modal .dropzone .dz-preview .dz-image { margin-inline: auto; }
#document-upload-modal .dropzone .dz-preview :is(.dz-success-mark, .dz-error-mark) { display: none; }
#document-upload-modal .dropzone .dz-preview .dz-error-message { width: auto; max-width: 100%; background: #582c35 !important; color: #fff !important; border-color: #ad6675; }
#document-upload-modal .dropzone .dz-preview.dz-error .dz-error-message { display: block !important; }
#document-upload-modal .field-upload-result { margin-block: .5rem; font-weight: 500; }
#document-upload-modal .btn-outline-primary { color: var(--om-text); border-color: var(--om-primary); }
.document-dropzone .dz-message span { display: block; color: #98a6ad; margin-top: .4rem; }
body.dark-only .document-dropzone .dz-preview .dz-details span { color: #d7dce1 !important; }
/* Milník 6D: široký detail parcely a editor výchozího mapového pohledu. */
.parcel-detail-dashboard { max-width: 1500px; }
.parcel-detail-hero [data-feather], .parcel-mini-map-card [data-feather] { width: 16px; height: 16px; margin-right: .35rem; vertical-align: -3px; }
.app-shell .app-detail-card {
    margin-bottom: 0;
    overflow: hidden;
    color: rgba(255,255,255,.78);
    background: #1d1e26;
    border: 1px solid #374558;
    border-radius: .75rem;
}
.app-shell .app-detail-card-header {
    display: flex;
    align-items: center;
    min-height: 3.5rem;
    margin: 0;
    padding: 1rem 1.25rem;
    color: rgba(255,255,255,.88);
    background: #262932;
    border: 0;
    border-bottom: 1px solid #374558;
    font-size: 1rem;
    font-weight: 500;
}
.app-shell .app-detail-card-header h1,
.app-shell .app-detail-card-header h2,
.app-shell .app-detail-card-header h3 { color: inherit; font-weight: inherit; }
.app-shell .app-detail-card-body {
    padding: 1.25rem;
    color: rgba(255,255,255,.78);
    background: #1d1e26;
}
.map-detail-panel [data-map-detail-content] > .app-detail-card:not(:last-child),
.map-detail-panel [data-map-detail-content] > .map-object-actions:not(:last-child) {
    margin-bottom: 0.75rem;
}
.parcel-detail-summary-grid,
.parcel-detail-section-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
}
.parcel-detail-top-grid > div > .card { margin-bottom: 0; }
.parcel-detail-badge { border: 1px solid transparent; font-weight: 500; letter-spacing: .01em; padding: .4rem .65rem; }
.parcel-detail-badge-status { color: var(--om-success); background: rgba(var(--om-success-rgb),.2); border-color: rgba(var(--om-success-rgb),.3); }
.parcel-detail-badge-ownership { color: #d9d4ff; background: var(--om-primary-subtle); border-color: rgba(var(--om-primary-rgb),.35); }
.parcel-detail-badge-reason { color: #cbd5e1; background: rgba(100,116,139,.2); border-color: rgba(148,163,184,.3); }
.parcel-mini-map { width: 100%; height: 205px; min-height: 205px; border-radius: .55rem; overflow: hidden; }
.parcel-mini-map-empty { min-height: 180px; display: grid; place-items: center; color: #98a6ad; border: 1px dashed #465366; border-radius: .55rem; }
.parcel-mini-map-empty[hidden] { display: none; }
.parcel-detail-metrics { display: grid; gap: 1rem; }
.parcel-detail-metrics div { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px solid rgba(255,255,255,.08); padding-bottom: .75rem; }
.parcel-detail-metrics div:last-child { border-bottom: 0; padding-bottom: 0; }
.parcel-detail-metrics span { color: #98a6ad; }
.parcel-ownership-overview { display: flex; align-items: center; gap: 1.5rem; min-height: 180px; }
.parcel-ownership-chart { flex: 0 0 180px; }
.parcel-ownership-legend { list-style: none; margin: 0; padding: 0; flex: 1; }
.parcel-ownership-legend li { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem 0; }
.parcel-ownership-legend strong { white-space: nowrap; }
.parcel-detail-section-grid > div > .map-detail-collapse {
    margin: 0;
}
.parcel-detail-section-grid .map-detail-collapse-header {
    border-bottom: 1px solid transparent;
}
.app-shell .parcel-detail-section-grid .map-detail-collapse[open] > .map-detail-collapse-header { border-bottom-color: #374558; }
.parcel-detail-section-grid .map-document-image { min-height: 150px; object-fit: cover; }
.map-view-settings { height: min(68vh, 680px); min-height: 430px; border-radius: .75rem; overflow: hidden; }

@media (max-width: 991.98px) {
    .parcel-detail-summary-grid, .parcel-detail-section-grid { grid-template-columns: minmax(0, 1fr); }
    .parcel-mini-map { height: 190px; min-height: 190px; }
    .parcel-ownership-overview { align-items: flex-start; flex-direction: column; }
    .map-view-settings { min-height: 360px; }
}
.network-marker-badge { position:absolute;left:-8px;top:-9px;background:#17212b;color:#fff;border:3px solid;border-radius:4px;min-width:20px;height:21px;font:700 11px/15px Roboto,Arial,sans-serif;text-align:center;box-shadow:0 0 0 1px #fff; }
.network-symbol { display:inline-block;background:#17212b;color:#fff;border:3px solid;border-radius:4px;min-width:23px;padding:0 3px;font-weight:700;font-size:11px;text-align:center; }
.network-swatch { flex-shrink:0;vertical-align:middle; }
.network-line-label.leaflet-tooltip { background:#17212b;color:#fff;border:1px solid #fff;padding:1px 4px;font:700 11px Roboto,Arial,sans-serif;box-shadow:0 1px 3px #000; }
.map-layer-option .network-symbol { margin-right:5px; }
.map-layer-control .network-filter-help { font-size:12px;line-height:1.4;margin:8px 0; }
.leaflet-marker-icon.map-object-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--om-surface);
    color: var(--om-text-strong);
    border: 2px solid var(--om-primary);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .45);
}
.map-object-marker > svg {
    display: block;
    flex: none;
}
.map-object-marker::after {
    content: '';
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid var(--om-surface);
    background: var(--om-success);
}
.map-object-marker.status-ATTENTION::after { background: var(--om-warning); }
.map-object-marker.status-OUT_OF_SERVICE::after { background: var(--om-danger); }
.map-object-marker.status-PLANNED::after { background: var(--om-info); }
.map-object-marker.is-selected {
    outline: 3px solid var(--om-primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 7px rgba(178, 170, 255, .45), 0 3px 9px rgba(0, 0, 0, .55);
}
.map-object-marker.is-preview { border-style: dashed; }
.map-position-mode { cursor: crosshair; }
.map-object-mode {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 900;
    width: max-content;
    max-width: calc(100% - 24px);
    background: var(--om-surface);
    color: var(--om-text-strong);
    border: 1px solid var(--om-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}
.map-object-mode[hidden] { display: none; }
/* GPS sdílí ovládací panel mapy; stav zůstává oddělený od pracovních dat obce. */
.map-location-status { position: absolute; bottom: 1.75rem; left: .5rem; max-width: min(30rem, calc(100% - 1rem)); max-height: 6rem; overflow-y: auto; background: var(--om-surface); color: var(--om-text); padding: .4rem .6rem; border: 1px solid var(--om-border); border-radius: .4rem; z-index: 800; font-size: .8rem; }
.map-location-status[hidden] { display: none; }
.has-map-location:has(.map-position-mode) .map-location-status { display: none; }
.map-location-status.is-warning, [data-map-object-gps-status].is-warning { color: #ffcf70; }
.has-map-location:has(.map-detail-panel.show) .map-toolbar { max-width: calc(100% - 26.25rem - 4.25rem); }
.has-map-location .map-object-mode { flex-wrap: wrap; align-items: flex-start; width: min(38rem, calc(100% - 1rem)); bottom: .5rem; max-height: calc(45% - .5rem); overflow-y: auto; overscroll-behavior: contain; }
.has-map-location .map-object-mode [data-map-object-instruction],
.has-map-location .map-object-mode [data-map-object-gps-status] { flex-basis: 100%; }
.has-map-location .map-object-mode button { min-height: 44px; }
.map-object-marker.map-gps-proposal { background: #f2b45d; border: 3px dashed #522900; color: #522900; cursor: grab; }
.map-object-marker.map-gps-proposal:active { cursor: grabbing; }
@media (max-width: 899.98px) {
    .has-map-location:has(.map-detail-panel.show) .map-toolbar { max-width: calc(100% - 4.75rem); }
    .has-map-location:has(.map-detail-panel.show) .map-location-status { top: 2px; bottom: auto; left: 64px; right: 64px; max-height: 44px; max-width: none; padding: .2rem .4rem; }
}
.map-object-types { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.map-object-types .map-icon-action { width: 100%; min-width: 0; height: auto; min-height: 44px; padding: 8px; display: flex; gap: 8px; align-items: center; justify-content: flex-start; text-align: left; line-height: 1.35; white-space: normal; }
.map-object-types .map-icon-action svg { flex-shrink: 0; }
.map-object-types .map-icon-action span { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 575.98px) {
    .map-object-types { grid-template-columns: minmax(0, 1fr); }
}
.map-object-form .btn { margin-right: 8px; min-height: 44px; }
.map-object-description { white-space: pre-wrap; overflow-wrap: anywhere; }
.municipality-map-workspace:has(.map-position-mode) .map-toolbar { visibility: hidden; }
@media (max-width: 575.98px) {
    .municipality-map-workspace .map-toolbar {
        top: 0.75rem;
        bottom: auto;
        left: 3.5rem;
        flex-direction: row;
    }
    .map-toolbar > .map-ui-button { min-height: 44px; }
    .map-layer-option { min-height: 32px; }
}

.dashboard-statistics, .dashboard-summary-chart { min-width: 0; }
.dashboard-summary-chart { width: 100%; }
.dashboard-chart-legend { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; list-style: none; padding: 0; color: var(--om-text-muted); font-size: .85rem; }
.dashboard-cost-details summary { cursor: pointer; color: var(--om-text); }
.dashboard-cost-details .table { white-space: nowrap; }
.dashboard-cost-details { min-width: 0; }
.dashboard-cost-details:not([open]) > .table-responsive { display: none; }
.municipality-dashboard .table-responsive { position: relative; max-width: 100%; overflow-x: auto; }

.dashboard-overview-kpi {
    background: var(--om-surface);
    border: 1px solid var(--om-border);
    margin-bottom: 0;
}
.municipality-dashboard .dashboard-overview-kpi .card-body { display: flex; align-items: center; gap: 1rem; padding: 1.25rem; }
.dashboard-overview-kpi-icon {
    display: flex; align-items: center; justify-content: center;
    flex: 0 0 64px; width: 64px; height: 64px; border-radius: 1rem;
    color: var(--om-primary); background: rgba(var(--om-primary-rgb), .16);
}
.dashboard-overview-kpi-icon svg { width: 36px; height: 36px; stroke-width: 1.7; }
.dashboard-overview-kpi-objects .dashboard-overview-kpi-icon { color: var(--om-info); background: rgba(64, 184, 245, .14); }
.dashboard-overview-kpi-lines .dashboard-overview-kpi-icon { color: var(--om-warning); background: rgba(255, 184, 41, .14); }
.dashboard-overview-kpi-openTasks .dashboard-overview-kpi-icon { color: var(--om-success); background: rgba(var(--om-success-rgb), .14); }
.dashboard-overview-kpi-content { min-width: 0; }
.dashboard-overview-kpi-value { margin: 0 0 .25rem; color: var(--om-text-strong); font-size: 2rem; font-weight: 600; line-height: 1.1; overflow-wrap: anywhere; }
.dashboard-overview-kpi h2.dashboard-overview-kpi-label { margin: 0; color: var(--om-text-muted); font-size: .85rem; font-weight: 400; line-height: 1.4; }

/* Cuba dark a ApexCharts dark používají vlastní barvy textu i záhlaví tooltipu. */
.municipality-dashboard .apexcharts-tooltip,
.municipality-dashboard .apexcharts-xaxistooltip,
.municipality-dashboard .apexcharts-yaxistooltip {
    background: #fff !important;
    color: #1d1e26 !important;
    border: 1px solid #dce0e5 !important;
}
.municipality-dashboard .apexcharts-tooltip-title { background: #f3f4f6 !important; border-bottom: 1px solid #dce0e5 !important; }
.municipality-dashboard .apexcharts-tooltip { max-width: min(320px, calc(100vw - 64px)); white-space: normal; }
.municipality-dashboard .apexcharts-tooltip *,
.municipality-dashboard .apexcharts-xaxistooltip *,
.municipality-dashboard .apexcharts-yaxistooltip * { color: #1d1e26 !important; }
.municipality-dashboard .apexcharts-tooltip-text,
.municipality-dashboard .apexcharts-tooltip-y-group,
.municipality-dashboard .apexcharts-tooltip-text-y-value { white-space: normal; overflow-wrap: anywhere; }

@media (max-width: 575.98px) {
    .municipality-dashboard .dashboard-graph-header h2 { min-height: 2.4em; }
}
@media (max-width: 359.98px) {
    .municipality-dashboard .dashboard-graph-header h2 { min-height: 3.6em; }
}

/* Jednotné obrazovkové datové tabulky. Tiskové dokumenty tuto třídu nepoužívají.
 * Delší větev překonává specifitu Cuba .card pravidel bez !important.
 * Barvíme pouze buňky; odkazy, badge, ikony, utility a formuláře mají vlastní styly. */
body.app-shell.dark-only .table.obecnimapa-data-table:not(.table-light) {
    --bs-table-color: #FFFFFF;
    --bs-table-hover-color: #FFFFFF;
    --bs-table-striped-color: #FFFFFF;
    --bs-table-active-color: #FFFFFF;
}
body.app-shell.dark-only .table.obecnimapa-data-table:not(.table-light) > thead > tr > :is(th, td),
body.app-shell.dark-only .page-wrapper .page-body-wrapper .page-body .table.obecnimapa-data-table:not(.table-light) > thead > tr > :is(th, td) {
    color: #AEB8C7;
    font-weight: 600;
}
body.app-shell.dark-only .table.obecnimapa-data-table:not(.table-light) > :is(tbody, tfoot) > tr > :is(td, th),
body.app-shell.dark-only .page-wrapper .page-body-wrapper .page-body .table.obecnimapa-data-table:not(.table-light) > :is(tbody, tfoot) > tr > :is(td, th) {
    color: #FFFFFF;
    font-weight: var(--om-table-cell-weight, 400);
}
body.app-shell.dark-only .obecnimapa-data-table .catalog-item-name {
    --om-table-cell-weight: 500;
}
.app-system-context-banner { background: #262a38; color: #fff; border: 1px solid #56607a; }
.app-system-context-banner .btn { color: #fff; border-color: #aeb8ff; }
/* M18: Bootstrap Toast podle zakoupeného tématu, bezpečně i na mobilu. */
.internal-messages { position: fixed; right: 1rem; bottom: 1rem; z-index: 1090; width: min(420px, calc(100vw - 2rem)); }
.internal-messages .toast { width: 100%; max-width: 100%; }
.internal-messages .toast-header { gap: .5rem; }
.internal-messages .toast-header strong { overflow-wrap: anywhere; }
.internal-messages .toast-body { max-height: min(65vh, 600px); overflow-y: auto; }
.internal-message-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.internal-messages a { color: inherit; text-decoration: underline; }

/* Cílené UX: samostatná přihlašovací karta bez rozměrů Cuba .login-card wrapperu. */
body.dark-only .login-page { min-height: 100vh; min-height: 100dvh; padding: 1.5rem 1rem; }
body.dark-only .login-page > .login-card { display: block; flex: 0 1 430px; width: 100%; max-width: 430px; min-height: 0; height: auto; padding: 0; margin: 0; }
body.dark-only .login-page .card-body { width: 100%; }
body.dark-only .login-page .app-brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; }
body.dark-only .login-page .form-control { display: block; width: 100%; min-height: 44px; font-size: 1rem; }
body.dark-only .login-page .btn-primary { min-height: 44px; color: #fff; }
body.dark-only .login-page a:not(.btn) { color: var(--om-link); text-underline-offset: .2em; }
body.dark-only .login-page a:not(.app-brand):not(.btn) { text-decoration: underline; }
body.dark-only .login-page a:hover { color: #e3ddff; }
body.dark-only .login-page a:focus-visible { outline: 2px solid var(--om-info); outline-offset: 4px; border-radius: .2rem; }
body.dark-only .login-page .text-danger { color: #fca5a5 !important; }

/* Jedna čitelná komponenta pro významové panely, včetně odkazů v systémovém obsahu. */
body.dark-only .alert-info { --om-alert-rgb: var(--om-info-rgb); }
body.dark-only .alert-success { --om-alert-rgb: var(--om-success-rgb); }
body.dark-only .alert-warning { --om-alert-rgb: var(--om-warning-rgb); }
body.dark-only .alert-danger { --om-alert-rgb: var(--om-danger-rgb); }
body.dark-only .alert-primary { --om-alert-rgb: var(--om-primary-rgb); }
body.dark-only .alert:is(.alert-info,.alert-success,.alert-warning,.alert-danger,.alert-primary) {
    background: rgba(var(--om-alert-rgb), .13) !important;
    border-color: rgba(var(--om-alert-rgb), .55) !important;
    color: #f1f5f9 !important;
}
body.dark-only .alert a:not(.btn) { color: inherit !important; text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }
body.dark-only .alert a:not(.btn):hover { color: #fff !important; text-decoration-thickness: 2px; }
body.dark-only .alert a:not(.btn):focus-visible { color: #fff !important; outline: 2px solid currentColor; outline-offset: 3px; border-radius: 2px; }
