/* Puvodni CSS designu v1 - extrahovano z layouts/app.blade.php (design-v1-stary). */
        :root {
            color-scheme: light;
            --bg: #f5f7fa;
            --panel: #ffffff;
            --text: #1f2933;
            --muted: #6b7280;
            --border: #d8dee6;
            --primary: #1f4e79;
            --primary-dark: #153a5b;
            --danger: #b3261e;
            --surface: #ffffff;
            --surface-2: #eef2f7;
            --accent-soft: #eef4fa;
            --badge-bg: #edf2f7;
            --flash-bg: #eaf6ea;
            --flash-border: #2e7d32;
            --nav-bg: #ffffff;
            --nav-bg-soft: #e6f5fb;
            --nav-hover: #f1f4f7;
            --nav-text: #1f2933;
            --nav-muted: #7b8086;
            --nav-active: #0097c7;
            --topbar-height: 64px;
            --sidebar-width: 286px;
            --sidebar-collapsed-width: 74px;
        }

        :root[data-theme="dark"] {
            color-scheme: dark;
            --bg: #101418;
            --panel: #171b20;
            --text: #e7eaee;
            --muted: #a2a8af;
            --border: #2e343b;
            --primary: #00a3d7;
            --primary-dark: #101418;
            --danger: #e0645c;
            --surface: #1d232a;
            --surface-2: #252c34;
            --accent-soft: #192a33;
            --badge-bg: #252c34;
            --flash-bg: #16351d;
            --flash-border: #3a7d43;
            --nav-bg: #191b1d;
            --nav-bg-soft: #1d3038;
            --nav-hover: #242628;
            --nav-text: #e7eaee;
            --nav-muted: #9a9da1;
            --nav-active: #00a3d7;
        }

        * {
            box-sizing: border-box;
        }

        body {
            margin: 0;
            background: var(--bg);
            color: var(--text);
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
            line-height: 1.5;
        }

        a {
            color: var(--primary);
            text-decoration: none;
        }

        .page {
            margin: 0 auto;
            max-width: 1180px;
            padding: 28px 24px;
        }

        .app-shell {
            min-height: 100vh;
            padding-left: var(--sidebar-width);
            transition: padding-left 180ms ease;
        }

        .app-shell.is-collapsed {
            padding-left: var(--sidebar-collapsed-width);
        }

        .sidebar {
            background: var(--nav-bg);
            border-right: 1px solid var(--border);
            bottom: 0;
            color: var(--nav-text);
            display: flex;
            flex-direction: column;
            left: 0;
            position: fixed;
            top: 0;
            transition: width 180ms ease;
            width: var(--sidebar-width);
            z-index: 80;
        }

        .app-shell.is-collapsed .sidebar {
            width: var(--sidebar-collapsed-width);
        }

        .sidebar-header {
            align-items: center;
            border-bottom: 1px solid var(--border);
            display: flex;
            gap: 12px;
            min-height: var(--topbar-height);
            padding: 0 16px;
        }

        .sidebar-toggle {
            align-items: center;
            background: transparent;
            border: 0;
            border-radius: 6px;
            color: var(--nav-muted);
            cursor: pointer;
            display: inline-flex;
            height: 42px;
            justify-content: center;
            padding: 0;
            position: relative;
            width: 42px;
        }

        .sidebar-toggle:hover {
            background: var(--nav-hover);
            color: var(--nav-text);
        }

        .brand {
            color: var(--nav-text);
            font-size: 22px;
            font-weight: 750;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .upload-dropzone {
            position: relative;
        }

        .upload-dropzone-actions {
            display: flex;
            gap: 6px;
            position: absolute;
            right: 10px;
            top: 10px;
            z-index: 5;
        }

        /* Vyber ikony z uz nahranych fotek stavby (rada pod dropzonou). */
        .icon-source-row {
            align-items: center;
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin-top: 10px;
        }

        .icon-gallery-panel {
            max-width: 760px;
        }

        .icon-gallery-status {
            color: var(--muted);
            font-size: 14px;
            padding: 10px 0;
        }

        .icon-gallery-status[hidden] {
            display: none;
        }

        .icon-gallery-grid {
            display: grid;
            gap: 10px;
            grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        }

        .icon-gallery-grid[hidden] {
            display: none;
        }

        .icon-gallery-item {
            background: var(--surface-2);
            border: 1px solid var(--border);
            border-radius: 12px;
            cursor: pointer;
            display: block;
            overflow: hidden;
            padding: 0;
            text-align: left;
            transition: border-color 0.15s ease, transform 0.15s ease;
            width: 100%;
        }

        .icon-gallery-item:hover,
        .icon-gallery-item:focus-visible {
            border-color: var(--primary);
            transform: translateY(-1px);
        }

        .icon-gallery-item.is-busy {
            opacity: 0.5;
            pointer-events: none;
        }

        .icon-gallery-item img {
            aspect-ratio: 1 / 1;
            display: block;
            height: auto;
            object-fit: cover;
            width: 100%;
        }

        .icon-gallery-item span {
            color: var(--muted);
            display: block;
            font-size: 12px;
            padding: 6px 8px;
        }

        /* Editor ikony stavby: zobrazi se misto dropzony, jakmile je fotka. */
        .upload-dropzone-face[hidden],
        .icon-editor[hidden] {
            display: none;
        }

        .icon-editor {
            align-items: center;
            background: var(--surface);
            border: 2px dashed var(--border);
            border-radius: 12px;
            display: flex;
            gap: 20px;
            padding: 18px 20px;
        }

        .upload-dropzone.is-dragover .icon-editor {
            background: var(--accent-soft);
            border-color: var(--primary);
        }

        .icon-editor-controls {
            display: flex;
            flex-direction: column;
            gap: 10px;
            min-width: 0;
        }

        .icon-editor-title {
            font-weight: 750;
            margin: 0;
        }

        .icon-editor-hint {
            color: var(--muted);
            font-size: 13px;
            margin: 0;
            max-width: 44ch;
        }

        .icon-zoom-row {
            align-items: center;
            display: flex;
            gap: 8px;
        }

        .icon-zoom-range {
            accent-color: var(--primary);
            flex: 1 1 160px;
            max-width: 220px;
            min-width: 120px;
        }

        .icon-zoom-value {
            color: var(--muted);
            font-size: 13px;
            font-variant-numeric: tabular-nums;
            min-width: 42px;
        }

        .icon-editor-buttons {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }

        .icon-tool:disabled {
            cursor: default;
            opacity: 0.45;
        }

        @media (max-width: 720px) {
            .icon-editor {
                align-items: flex-start;
                flex-direction: column;
            }
        }

        .icon-tool {
            align-items: center;
            background: var(--panel);
            border: 1px solid var(--border);
            border-radius: 999px;
            color: inherit;
            cursor: pointer;
            display: inline-flex;
            font: inherit;
            font-size: 14px;
            font-weight: 750;
            height: 30px;
            justify-content: center;
            min-width: 30px;
            padding: 0 10px;
        }

        .icon-tool:hover {
            background: var(--surface-2);
        }

        .dropzone-icon-preview img {
            transition: transform 0.15s ease;
        }

        .upload-dropzone-face {
            align-items: center;
            background: var(--surface);
            border: 2px dashed var(--border);
            border-radius: 12px;
            cursor: pointer;
            display: flex;
            gap: 14px;
            padding: 18px 20px;
            position: relative;
            transition: border-color 0.15s ease, background-color 0.15s ease;
        }

        .upload-dropzone-face:hover,
        .upload-dropzone.is-dragover .upload-dropzone-face {
            background: var(--accent-soft);
            border-color: var(--primary);
        }

        .upload-dropzone-icon {
            align-items: center;
            background: var(--nav-bg-soft);
            border-radius: 12px;
            color: var(--nav-active);
            display: inline-flex;
            flex: 0 0 56px;
            height: 56px;
            justify-content: center;
            width: 56px;
        }

        .upload-dropzone-icon svg {
            display: block;
            height: 32px;
            stroke: currentColor;
            stroke-width: 2;
            width: 32px;
        }

        .dropzone-icon-preview {
            align-items: center;
            background: var(--nav-bg-soft);
            border: 1px solid var(--border);
            /* zaobleny ctverec misto kruhu - konzistentni s ikonami v menu,
               seznamech a prepinaci staveb (2026-07-20) */
            border-radius: 22px;
            color: var(--nav-active);
            display: inline-flex;
            flex: 0 0 180px;
            height: 180px;
            justify-content: center;
            overflow: hidden;
            touch-action: none;
            width: 180px;
        }

        .dropzone-icon-preview.has-image {
            cursor: grab;
        }

        .dropzone-icon-preview.is-panning {
            cursor: grabbing;
        }

        .dropzone-icon-preview.is-panning img {
            transition: none;
        }

        .project-icon-upload .upload-dropzone-clear {
            display: none;
        }

        .dropzone-icon-preview img {
            height: 100%;
            object-fit: cover;
            width: 100%;
        }

        .dropzone-icon-preview svg {
            display: block;
            height: 64px;
            stroke: currentColor;
            stroke-linecap: round;
            stroke-linejoin: round;
            stroke-width: 2;
            width: 64px;
        }

        .upload-dropzone-text {
            display: flex;
            flex-direction: column;
            gap: 2px;
            min-width: 0;
        }

        .upload-dropzone-hint {
            font-size: 13px;
            opacity: 0.7;
        }

        .upload-dropzone-input {
            height: 1px;
            left: 50%;
            opacity: 0;
            pointer-events: none;
            position: absolute;
            top: 100%;
            width: 1px;
        }

        .upload-dropzone-selected {
            align-items: center;
            display: flex;
            gap: 12px;
            justify-content: space-between;
            margin-top: 8px;
        }

        .upload-dropzone-files {
            font-size: 13px;
            list-style: none;
            margin: 0;
            min-width: 0;
            overflow-wrap: anywhere;
            padding: 0;
        }

        .upload-dropzone-files li {
            align-items: center;
            display: flex;
            gap: 8px;
            padding: 2px 0;
        }

        .upload-dropzone-thumb {
            border: 1px solid var(--border);
            border-radius: 6px;
            flex: none;
            height: 34px;
            object-fit: cover;
            width: 34px;
        }

        .upload-dropzone-clear {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 8px;
            color: var(--danger);
            cursor: pointer;
            flex: 0 0 auto;
            font: inherit;
            font-size: 13px;
            padding: 6px 12px;
        }

        .upload-dropzone-clear:hover {
            border-color: var(--danger);
        }

        /* Fullscreen overlay behem nahravani souboru - viz JS "upload overlay"
           dole v layoutu. Ukazuje spinner, pocet/velikost souboru a u AJAX
           odeslani (quick-add) i skutecny prubeh v procentech. */
        .upload-overlay {
            align-items: center;
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            background: rgba(15, 23, 32, 0.55);
            bottom: 0;
            display: flex;
            justify-content: center;
            left: 0;
            padding: 16px;
            position: fixed;
            right: 0;
            top: 0;
            z-index: 1000;
        }

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

        .upload-overlay-panel {
            background: var(--panel);
            border: 1px solid var(--border);
            border-radius: 14px;
            box-shadow: 0 24px 64px rgba(15, 23, 32, 0.35);
            max-width: 340px;
            padding: 22px 24px;
            text-align: center;
            width: 100%;
        }

        .upload-overlay-spinner {
            animation: upload-overlay-spin 0.9s linear infinite;
            border: 3px solid var(--accent-soft);
            border-radius: 50%;
            border-top-color: var(--primary);
            height: 38px;
            margin: 0 auto 14px;
            width: 38px;
        }

        @keyframes upload-overlay-spin {
            to { transform: rotate(360deg); }
        }

        .upload-overlay-title {
            color: var(--text);
            font-size: 16px;
            font-weight: 600;
            margin: 0 0 4px;
        }

        .upload-overlay-detail {
            color: var(--muted);
            font-size: 13px;
            margin: 0 0 12px;
            min-height: 18px;
        }

        .upload-overlay-bar {
            background: var(--surface-2);
            border-radius: 999px;
            height: 8px;
            overflow: hidden;
        }

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

        .upload-overlay-bar-fill {
            background: var(--primary);
            border-radius: 999px;
            height: 100%;
            transition: width 0.2s ease;
            width: 0%;
        }

        .upload-overlay-hint {
            color: var(--muted);
            font-size: 12px;
            margin: 10px 0 0;
        }

        [data-drop-proxy].is-dragover {
            outline: 2px dashed var(--primary);
            outline-offset: 3px;
        }

        .org-switcher {
            padding: 10px 14px 2px;
        }

        .org-switcher-label {
            display: block;
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            color: var(--nav-text);
            opacity: 0.6;
            margin-bottom: 4px;
        }

        .org-switcher-select {
            width: 100%;
            padding: 7px 8px;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: var(--surface);
            color: var(--nav-text);
            font: inherit;
            font-size: 13px;
        }

        .app-shell.is-collapsed .org-switcher {
            display: none;
        }

        .app-shell.is-collapsed .brand,
        .app-shell.is-collapsed .nav-text,
        .app-shell.is-collapsed .nav-chevron,
        .app-shell.is-collapsed .nav-section-label,
        .app-shell.is-collapsed .active-project-label,
        .app-shell.is-collapsed .active-project-meta,
        .app-shell.is-collapsed .active-project-chevron,
        .app-shell.is-collapsed .active-project-empty span {
            display: none;
        }

        .app-shell.is-collapsed .active-project {
            padding: 10px 10px 0;
        }

        .app-shell.is-collapsed .active-project-card {
            justify-content: center;
            padding: 5px;
        }

        .app-shell.is-collapsed .active-project-empty {
            justify-content: center;
            padding: 8px 5px;
        }

        /* ===== Aktivni stavba (karta v levem menu + prepinac) ===== */
        .active-project {
            padding: 10px 14px 0;
        }

        .active-project-label {
            display: block;
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            color: var(--nav-text);
            opacity: 0.6;
            margin-bottom: 4px;
        }

        .active-project-card {
            align-items: center;
            background: var(--nav-bg-soft);
            border: 1px solid color-mix(in srgb, var(--nav-active) 35%, transparent);
            border-left: 3px solid var(--nav-active);
            border-radius: 10px;
            color: var(--nav-text);
            cursor: pointer;
            display: flex;
            font: inherit;
            gap: 10px;
            padding: 8px 10px;
            text-align: left;
            transition: box-shadow 120ms ease;
            width: 100%;
        }

        .active-project-card:hover,
        .active-project-card:focus-visible {
            box-shadow: 0 0 0 3px color-mix(in srgb, var(--nav-active) 15%, transparent);
        }

        .active-project-icon {
            background: var(--accent-soft);
            border-radius: 9px;
            color: var(--primary);
            display: grid;
            flex: 0 0 auto;
            height: 34px;
            overflow: hidden;
            place-items: center;
            width: 34px;
        }

        .active-project-icon svg {
            fill: none;
            height: 18px;
            width: 18px;
        }

        .active-project-icon img {
            display: block;
            height: 100%;
            object-fit: cover;
            width: 100%;
        }

        .active-project-meta {
            flex: 1;
            min-width: 0;
        }

        .active-project-name {
            display: block;
            font-size: 14px;
            font-weight: 700;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .active-project-sub {
            align-items: center;
            color: var(--nav-muted);
            display: flex;
            font-size: 12px;
            gap: 6px;
            overflow: hidden;
            white-space: nowrap;
        }

        .active-project-status-dot {
            border-radius: 50%;
            flex: 0 0 auto;
            height: 7px;
            width: 7px;
        }

        .active-project-chevron {
            color: var(--nav-muted);
            flex: 0 0 auto;
        }

        .active-project-chevron svg {
            fill: none;
            height: 16px;
            width: 16px;
        }

        .active-project-card:hover .active-project-chevron {
            color: var(--nav-active);
        }

        .active-project-empty {
            align-items: center;
            background: none;
            border: 1px dashed var(--border);
            border-radius: 10px;
            color: var(--nav-muted);
            cursor: pointer;
            display: flex;
            font: inherit;
            font-size: 13px;
            gap: 10px;
            padding: 10px;
            width: 100%;
        }

        .active-project-empty:hover {
            background: var(--nav-hover);
            color: var(--nav-text);
        }

        .active-project-empty svg {
            fill: none;
            height: 16px;
            width: 16px;
        }









        /* ===== Breadcrumb / chip aktivni stavby v topbaru ===== */


























        .link-btn {
            background: none;
            border: 0;
            color: var(--primary);
            cursor: pointer;
            font: inherit;
            font-size: 13px;
            padding: 4px 0;
        }

        .link-btn.danger {
            color: var(--danger);
        }

        .sidebar-nav {
            display: flex;
            flex: 1;
            flex-direction: column;
            overflow-y: auto;
            padding: 18px 10px 20px;
            text-transform: uppercase;
        }

        .nav-section {
            margin-top: 8px;
        }

        .nav-section:first-child {
            margin-top: 0;
        }

        .nav-bottom {
            border-top: 1px solid var(--border);
            margin-top: auto;
            padding-top: 14px;
        }

        .nav-section-label {
            color: var(--nav-muted);
            font-size: 11px;
            font-weight: 800;
            letter-spacing: 0;
            margin: 8px 18px;
            text-transform: uppercase;
        }

        .nav-summary.nav-entry-action,
        .nav-entry-group[open] > .nav-entry-action {
            background: var(--nav-active);
            color: #fff;
            justify-content: center;
            margin: 0 0 12px;
            min-height: 48px;
            padding: 8px 14px;
        }

        .nav-summary.nav-entry-action:hover {
            background: var(--nav-active);
            color: #fff;
            filter: brightness(0.94);
        }

        .nav-entry-action .nav-icon {
            flex-basis: 24px;
            height: 24px;
            width: 24px;
        }

        .nav-entry-action .nav-icon svg {
            height: 22px;
            width: 22px;
        }

        .nav-entry-action .nav-text {
            font-size: 14px;
        }

        .nav-entry-group {
            margin: 0 0 12px;
        }

        .nav-entry-group .nav-entry-action {
            margin-bottom: 0;
        }

        .nav-entry-group .nav-submenu {
            margin: 0;
        }

        .nav-entry-action .nav-summary-main {
            flex: 0 1 auto;
            gap: 10px;
            justify-content: center;
        }

        .nav-item,
        .nav-summary {
            align-items: center;
            border-radius: 7px;
            color: var(--nav-text);
            display: flex;
            gap: 18px;
            min-height: 56px;
            padding: 10px 18px;
            position: relative;
        }

        .nav-item:hover,
        .nav-summary:hover {
            background: var(--nav-hover);
            color: var(--nav-text);
        }

        .nav-item.active,
        .nav-summary.active {
            background: var(--nav-bg-soft);
            color: var(--nav-active);
        }

        .nav-item.active::before,
        .nav-summary.active::before {
            display: none;
        }

        .nav-icon {
            align-items: center;
            display: inline-flex;
            flex: 0 0 30px;
            height: 30px;
            justify-content: center;
            width: 30px;
        }

        .nav-icon svg,
        .profile-avatar svg {
            display: block;
            height: 28px;
            stroke: currentColor;
            stroke-width: 2;
            width: 28px;
        }

        .nav-text {
            font-size: 17px;
            font-weight: 760;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .nav-chevron {
            color: var(--nav-muted);
            margin-left: auto;
        }

        .nav-group {
            margin: 2px 0;
            position: relative;
        }

        .nav-group summary {
            cursor: pointer;
            list-style: none;
        }

        .nav-group summary::-webkit-details-marker {
            display: none;
        }

        .nav-chevron {
            font-size: 18px;
            font-weight: 700;
            line-height: 1;
            transition: color 120ms ease, transform 120ms ease;
        }

        .nav-group:hover > .nav-summary .nav-chevron,
        .nav-group:focus-within > .nav-summary .nav-chevron {
            color: var(--nav-active);
            transform: translateX(2px);
        }

        .nav-summary-main {
            align-items: center;
            color: inherit;
            display: flex;
            flex: 1;
            gap: 18px;
            min-width: 0;
        }

        .nav-summary-main:hover {
            color: inherit;
        }

        /* Obnova ze zalohy v uvitacim pruvodci - sbaleny blok, aby bezna
           nova instalace nepusobila slozitejsi, nez je. */
        .setup-restore {
            background: var(--surface-2);
            border: 1px solid var(--border);
            border-radius: 12px;
            margin: 16px 0 4px;
            padding: 12px 16px;
        }

        .setup-restore > summary {
            cursor: pointer;
            font-weight: 650;
            list-style: none;
        }

        .setup-restore > summary::-webkit-details-marker {
            display: none;
        }

        .setup-restore > summary::before {
            color: var(--muted);
            content: '▸ ';
        }

        .setup-restore[open] > summary::before {
            content: '▾ ';
        }

        /* ===== Pocasi v hlavicce nastenky (2026-08-02) =====
           Ctyri sloupce: dnesek zabira prvni dva, zitra a pozitri po jednom
           a jsou zamerne jednodussi. Barevny nadech ridi trida .is-<stav>. */
        .weather-hero {
            background: linear-gradient(135deg, var(--weather-a, #eef2f7), var(--weather-b, #f7f9fc));
            border: 1px solid var(--border);
            border-radius: 16px;
            display: grid;
            gap: 20px;
            grid-template-columns: 2fr 1fr 1fr;
            margin-bottom: 20px;
            padding: 22px 24px;
        }

        .weather-hero.is-clear   { --weather-a: #fff1c9; --weather-b: #ffe2e0; --weather-ink: #7d5c07; }
        .weather-hero.is-partly  { --weather-a: #e6f0ff; --weather-b: #fff3d6; --weather-ink: #2f5590; }
        .weather-hero.is-cloudy  { --weather-a: #e7ebf1; --weather-b: #f4f7fa; --weather-ink: #414c5a; }
        .weather-hero.is-fog     { --weather-a: #e9ecee; --weather-b: #f5f6f8; --weather-ink: #4f5963; }
        .weather-hero.is-rain    { --weather-a: #dbe9fa; --weather-b: #ecf3fb; --weather-ink: #1f4a80; }
        .weather-hero.is-snow    { --weather-a: #e3f1fb; --weather-b: #f5fafe; --weather-ink: #325f7d; }
        .weather-hero.is-storm   { --weather-a: #e0dff0; --weather-b: #f0eaf7; --weather-ink: #3f3470; }

        /* Tmavy motiv: svetle prechody by na tmavem podkladu svitily jako
           papir a text v nich byl necitelny. Podklad jde do tmavych odstinu
           daneho pocasi, "ink" naopak zesvetli, aby ikona i teplota drzely
           kontrast. */
        :root[data-theme="dark"] .weather-hero.is-clear   { --weather-a: #33280d; --weather-b: #2a1d1c; --weather-ink: #f0c860; }
        :root[data-theme="dark"] .weather-hero.is-partly  { --weather-a: #16263c; --weather-b: #2b2413; --weather-ink: #8fc0ff; }
        :root[data-theme="dark"] .weather-hero.is-cloudy  { --weather-a: #1b2129; --weather-b: #222932; --weather-ink: #b7c3d0; }
        :root[data-theme="dark"] .weather-hero.is-fog     { --weather-a: #1d2126; --weather-b: #242930; --weather-ink: #b3bcc6; }
        :root[data-theme="dark"] .weather-hero.is-rain    { --weather-a: #132437; --weather-b: #1a2c40; --weather-ink: #7fb4f2; }
        :root[data-theme="dark"] .weather-hero.is-snow    { --weather-a: #152633; --weather-b: #1d303e; --weather-ink: #9fd0ee; }
        :root[data-theme="dark"] .weather-hero.is-storm   { --weather-a: #1f1b33; --weather-b: #29223d; --weather-ink: #b3a5f0; }

        :root[data-theme="dark"] .weather-hero {
            --weather-day-bg: rgba(255, 255, 255, 0.06);
        }

        /* --- dnesek (prvni dva sloupce) --- */
        .weather-today {
            align-items: center;
            display: flex;
            gap: 20px;
            min-width: 0;
        }

        .weather-icon svg {
            display: block;
            height: 92px;
            width: 92px;
            stroke: var(--weather-ink, #414c5a);
            stroke-width: 2.6;
            stroke-linecap: round;
            stroke-linejoin: round;
        }

        .weather-today-text {
            display: grid;
            gap: 2px;
            min-width: 0;
        }

        .weather-place {
            color: var(--weather-ink, #414c5a);
            font-size: 13px;
            font-weight: 700;
            letter-spacing: 0.04em;
            opacity: 0.85;
            text-transform: uppercase;
        }

        .weather-temp {
            color: var(--weather-ink, inherit);
            font-size: 46px;
            font-variant-numeric: tabular-nums;
            font-weight: 750;
            line-height: 1.05;
        }

        .weather-unit {
            font-size: 22px;
            font-weight: 650;
            margin-left: 2px;
            vertical-align: super;
        }

        .weather-label {
            font-size: 17px;
            font-weight: 650;
        }

        /* Popisek NAD hodnotou - kratke radky vedle sebe se v jednom
           odstavci slevaly do necitelne kase. */
        .weather-facts {
            display: flex;
            flex-wrap: wrap;
            gap: 6px 22px;
            margin: 10px 0 0;
        }

        .weather-facts div {
            display: grid;
            gap: 1px;
        }

        .weather-facts dt {
            color: var(--muted);
            font-size: 11px;
            font-weight: 700;
            letter-spacing: 0.05em;
            text-transform: uppercase;
        }

        .weather-facts dd {
            font-size: 14px;
            font-weight: 650;
            margin: 0;
            white-space: nowrap;
        }

        /* --- zitra a pozitri (po jednom sloupci, jednodussi) --- */
        .weather-outlook {
            display: grid;
            gap: 12px;
            grid-column: 2 / -1;
            grid-template-columns: 1fr 1fr;
        }

        .weather-day {
            align-content: start;
            background: var(--weather-day-bg, rgba(255, 255, 255, 0.62));
            border-radius: 12px;
            display: grid;
            gap: 4px;
            justify-items: center;
            padding: 12px 10px;
            text-align: center;
        }

        .weather-day-name {
            color: var(--muted);
            font-size: 11px;
            font-weight: 700;
            letter-spacing: 0.05em;
            text-transform: uppercase;
        }

        .weather-day-icon svg {
            display: block;
            height: 38px;
            width: 38px;
            stroke: var(--weather-ink, #414c5a);
            stroke-width: 3;
            stroke-linecap: round;
            stroke-linejoin: round;
        }

        .weather-day-temp {
            font-variant-numeric: tabular-nums;
            white-space: nowrap;
        }

        .weather-day-temp strong {
            font-size: 20px;
        }

        .weather-day-temp .muted {
            font-size: 14px;
            margin-left: 4px;
        }

        .weather-day-label {
            font-size: 12px;
            line-height: 1.25;
        }

        @media (max-width: 900px) {
            .weather-hero {
                grid-template-columns: 1fr;
            }

            .weather-outlook {
                grid-column: 1;
            }
        }

        @media (max-width: 640px) {
            .weather-hero {
                gap: 14px;
                padding: 16px;
            }

            .weather-today {
                gap: 14px;
            }

            .weather-icon svg {
                height: 68px;
                width: 68px;
            }

            .weather-temp {
                font-size: 36px;
            }
        }

        /* Nadpis skupiny uvnitr rozbaleneho menu "+" (Do stavby / Zalozit). */
        .nav-submenu-label {
            color: var(--muted);
            font-size: 11px;
            font-weight: 700;
            letter-spacing: 0.06em;
            padding: 8px 12px 4px;
            text-transform: uppercase;
        }

        .nav-submenu-label + a {
            margin-top: 0;
        }

        .nav-submenu-label:not(:first-child) {
            border-top: 1px solid var(--border);
            margin-top: 6px;
        }

        .nav-submenu {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 10px;
            box-shadow: 0 14px 34px rgba(31, 41, 51, 0.22);
            display: grid;
            gap: 2px;
            margin: 0;
            max-width: 300px;
            min-width: 232px;
            max-height: calc(100vh - 24px);
            opacity: 0;
            overflow-y: auto;
            padding: 8px;
            pointer-events: none;
            position: fixed;
            /* Sane CSS-only defaults (JS overrides left/top precisely per row) */
            left: calc(var(--sidebar-width) + 8px);
            top: 12px;
            transform: translateX(-6px);
            transition: opacity 140ms ease, transform 140ms ease;
            visibility: hidden;
            z-index: 200;
        }

        .app-shell.is-collapsed .nav-submenu {
            left: calc(var(--sidebar-collapsed-width) + 8px);
        }

        /* Primary trigger: pure CSS hover/focus, independent of JS so the
           flyout always works even if the positioning script fails. */
        .nav-group:hover > .nav-submenu,
        .nav-group:focus-within > .nav-submenu,
        .nav-submenu.is-flyout-open {
            opacity: 1;
            pointer-events: auto;
            transform: translateX(0);
            visibility: visible;
        }

        .nav-submenu > a,
        .nav-submenu > span {
            align-items: center;
            border-radius: 6px;
            color: var(--nav-muted);
            display: flex;
            font-size: 13px;
            font-weight: 600;
            gap: 8px;
            padding: 6px 10px;
        }

        .nav-subicon {
            align-items: center;
            display: inline-flex;
            flex: 0 0 18px;
            height: 18px;
            justify-content: center;
            width: 18px;
        }

        .nav-subicon svg {
            display: block;
            height: 17px;
            stroke: currentColor;
            stroke-width: 2;
            width: 17px;
        }

        .nav-submenu a:hover,
        .nav-submenu a.active {
            background: var(--surface-2);
            color: var(--nav-active);
        }

        .nav-submenu > span {
            cursor: not-allowed;
            opacity: 0.58;
        }

        .nav-item.is-pending,
        .nav-submenu > span.is-pending {
            opacity: 0.74;
        }

        .nav-item.is-pending {
            cursor: not-allowed;
        }

        .nav-item.is-pending:hover {
            background: transparent;
            color: var(--nav-text);
        }

        .nav-pending-badge {
            background: var(--surface-2);
            border: 1px solid var(--border);
            border-radius: 999px;
            color: var(--nav-muted);
            font-size: 9px;
            font-weight: 850;
            line-height: 1;
            margin-left: auto;
            padding: 4px 6px;
            text-transform: uppercase;
            white-space: nowrap;
        }

        .nav-submenu .nav-pending-badge {
            font-size: 8px;
            padding: 3px 5px;
        }

        .nav-submenu > .nav-submenu-heading {
            color: var(--nav-muted);
            cursor: default;
            font-size: 10px;
            font-weight: 850;
            margin-top: 8px;
            opacity: 0.82;
            padding-bottom: 2px;
            text-transform: uppercase;
        }

        .app-shell.is-collapsed .nav-item,
        .app-shell.is-collapsed .nav-summary {
            justify-content: center;
            padding-left: 0;
            padding-right: 0;
        }

        .app-shell.is-collapsed .nav-summary-main {
            flex: 0 0 auto;
            justify-content: center;
        }

        .app-shell.is-collapsed .sidebar-nav {
            overflow: visible;
        }

        .nav-item[data-tooltip]::after,
        .nav-summary[data-tooltip]::after,
        .sidebar-toggle[data-tooltip]::after {
            background: var(--text);
            border-radius: 6px;
            color: var(--panel);
            content: attr(data-tooltip);
            display: none;
            font-size: 12px;
            font-weight: 700;
            line-height: 1.2;
            opacity: 0;
            padding: 7px 9px;
            pointer-events: none;
            position: absolute;
            left: calc(100% + 10px);
            top: 50%;
            transform: translate(-4px, -50%);
            transition: opacity 120ms ease, transform 120ms ease;
            white-space: nowrap;
            z-index: 120;
        }

        .app-shell.is-collapsed .nav-item[data-tooltip]::after,
        .app-shell.is-collapsed .nav-summary[data-tooltip]::after,
        .app-shell.is-collapsed .sidebar-toggle[data-tooltip]::after {
            display: block;
        }

        .app-shell.is-collapsed .nav-item[data-tooltip]:hover::after,
        .app-shell.is-collapsed .nav-item[data-tooltip]:focus-visible::after,
        .app-shell.is-collapsed .nav-summary[data-tooltip]:hover::after,
        .app-shell.is-collapsed .nav-summary[data-tooltip]:focus-visible::after,
        .app-shell.is-collapsed .sidebar-toggle[data-tooltip]:hover::after,
        .app-shell.is-collapsed .sidebar-toggle[data-tooltip]:focus-visible::after {
            opacity: 1;
            transform: translate(0, -50%);
        }

        .app-topbar {
            align-items: center;
            background: var(--panel);
            border-bottom: 1px solid var(--border);
            display: flex;
            gap: 16px;
            height: var(--topbar-height);
            justify-content: space-between;
            padding: 0 24px;
            position: sticky;
            top: 0;
            z-index: 50;
        }

        /* Faze 2: hamburger (jen mobil) + zatmavovaci overlay draweru. */
        .nav-hamburger {
            display: none;
            align-items: center;
            background: transparent;
            border: 0;
            border-radius: 8px;
            color: var(--text);
            cursor: pointer;
            height: 40px;
            justify-content: center;
            margin-right: 2px;
            padding: 0;
            width: 40px;
        }

        .nav-hamburger svg {
            fill: none;
            height: 22px;
            stroke: currentColor;
            stroke-width: 2;
            width: 22px;
        }

        .nav-hamburger:hover {
            background: var(--surface-2);
        }

        .nav-overlay {
            display: none;
        }

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

        .topbar-title strong {
            display: block;
            font-size: 16px;
            line-height: 1.2;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .topbar-title span {
            color: var(--muted);
            display: block;
            font-size: 12px;
            margin-top: 2px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }





        .topbar-actions {
            align-items: center;
            display: flex;
            gap: 10px;
        }

        .profile-link,
        .topbar-icon-button {
            align-items: center;
            background: transparent;
            border: 1px solid var(--border);
            border-radius: 999px;
            color: var(--text);
            cursor: pointer;
            display: inline-flex;
            font: inherit;
            height: 42px;
            justify-content: center;
            padding: 4px;
            position: relative;
            width: 42px;
        }

        .profile-link:hover,
        .topbar-icon-button:hover {
            background: var(--surface-2);
        }

        .profile-link::after,
        .topbar-icon-button::after {
            background: var(--text);
            border-radius: 6px;
            color: var(--panel);
            content: attr(data-tooltip);
            font-size: 12px;
            font-weight: 700;
            line-height: 1.2;
            opacity: 0;
            padding: 7px 9px;
            pointer-events: none;
            position: absolute;
            right: 0;
            top: calc(100% + 8px);
            transform: translateY(-4px);
            transition: opacity 120ms ease, transform 120ms ease;
            white-space: nowrap;
            z-index: 90;
        }

        .profile-link:hover::after,
        .profile-link:focus-visible::after,
        .topbar-icon-button:hover::after,
        .topbar-icon-button:focus-visible::after {
            opacity: 1;
            transform: translateY(0);
        }

        .topbar-icon-button svg {
            display: block;
            height: 23px;
            stroke: currentColor;
            stroke-width: 2;
            width: 23px;
        }

        .topbar-icon-button.is-pending {
            opacity: 0.78;
        }

        .topbar-pending-dot {
            background: var(--nav-active);
            border: 2px solid var(--panel);
            border-radius: 999px;
            height: 10px;
            position: absolute;
            right: 4px;
            top: 4px;
            width: 10px;
        }

        .profile-avatar {
            align-items: center;
            background: var(--primary);
            border-radius: 50%;
            color: #ffffff;
            display: inline-flex;
            font-size: 13px;
            font-weight: 800;
            height: 32px;
            justify-content: center;
            overflow: hidden;
            width: 32px;
        }

        .profile-avatar img,
        .profile-hero-avatar img {
            height: 100%;
            object-fit: cover;
            width: 100%;
        }

        .guest-topbar {
            background: var(--primary-dark);
            color: #ffffff;
            padding: 14px 24px;
        }

        .guest-topbar .brand {
            color: #ffffff;
        }

        .panel {
            background: var(--panel);
            border: 1px solid var(--border);
            border-radius: 8px;
            padding: 22px;
        }

        .panel + .panel {
            margin-top: 18px;
        }

        .toolbar {
            align-items: flex-start;
            display: flex;
            gap: 16px;
            justify-content: space-between;
        }

        .page-title {
            font-size: 28px;
            line-height: 1.2;
            margin: 0 0 8px;
        }

        .muted {
            color: var(--muted);
        }

        .dashboard-hero,
        .dashboard-section,
        .dashboard-stat-card,
        .period-card,
        .project-card,
        .profile-hero,
        .profile-card {
            background: var(--panel);
            border: 1px solid var(--border);
            border-radius: 8px;
        }

        .dashboard-hero,
        .profile-hero {
            align-items: center;
            display: flex;
            gap: 16px;
            justify-content: space-between;
            padding: 22px;
        }

        .profile-identity {
            align-items: center;
            display: flex;
            gap: 16px;
            min-width: 0;
        }

        .profile-photo-panel {
            align-items: center;
            display: grid;
            flex: 0 0 auto;
            gap: 8px;
            justify-items: center;
        }

        .profile-hero-avatar {
            align-items: center;
            background: var(--primary);
            border: 1px solid color-mix(in srgb, var(--primary), #ffffff 28%);
            border-radius: 50%;
            color: #ffffff;
            display: inline-flex;
            flex: 0 0 64px;
            font-size: 22px;
            font-weight: 850;
            height: 64px;
            justify-content: center;
            overflow: hidden;
            width: 64px;
        }

        .profile-hero-avatar svg {
            height: 30px;
            stroke: currentColor;
            stroke-width: 2;
            width: 30px;
        }

        .profile-hero-avatar.has-photo {
            background: var(--surface-2);
            border-color: var(--border);
        }

        .profile-photo-controls {
            align-items: center;
            display: grid;
            gap: 7px;
            justify-items: center;
        }

        .profile-photo-form {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            justify-content: center;
        }

        .profile-photo-action,
        .profile-photo-remove {
            align-items: center;
            background: var(--surface-2);
            border: 1px solid var(--border);
            border-radius: 999px;
            color: var(--text);
            cursor: pointer;
            display: inline-flex;
            font-size: 12px;
            font-weight: 800;
            gap: 5px;
            min-height: 30px;
            padding: 5px 9px;
        }

        .profile-photo-action:hover,
        .profile-photo-remove:hover {
            background: var(--nav-bg-soft);
            color: var(--primary);
        }

        .profile-photo-action svg {
            height: 15px;
            stroke: currentColor;
            stroke-width: 2;
            width: 15px;
        }

        .profile-photo-input {
            inline-size: 1px;
            opacity: 0;
            pointer-events: none;
            position: absolute;
        }

        .profile-photo-remove {
            color: var(--danger);
        }

        .profile-photo-error {
            color: var(--danger);
            font-size: 13px;
            font-weight: 650;
            max-width: 180px;
            text-align: center;
        }

        .profile-badges,
        .profile-actions {
            align-items: center;
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-top: 10px;
        }

        .profile-actions {
            justify-content: flex-end;
            margin-top: 0;
        }

        .profile-grid {
            display: grid;
            gap: 18px;
            grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
            margin-top: 18px;
        }

        .profile-card {
            padding: 20px;
        }

        .profile-card + .profile-card {
            margin-top: 18px;
        }

        .profile-grid .profile-card {
            margin-top: 0;
        }

        .profile-card-header {
            align-items: center;
            display: flex;
            gap: 12px;
            margin-bottom: 18px;
        }

        .profile-card-header h2 {
            font-size: 20px;
            line-height: 1.2;
            margin: 0 0 3px;
        }

        .profile-subsection {
            border-top: 1px solid var(--border);
            margin: 6px 0 14px;
            padding-top: 18px;
        }

        .profile-subsection h3 {
            font-size: 17px;
            margin: 0 0 4px;
        }

        .profile-subsection p {
            font-size: 14px;
            margin: 0;
        }

        .profile-info-list {
            display: grid;
            gap: 10px;
        }

        .profile-info-list div,
        .profile-preview {
            background: var(--surface-2);
            border-radius: 7px;
            padding: 11px 12px;
        }

        .profile-info-list span,
        .profile-preview span {
            color: var(--muted);
            display: block;
            font-size: 13px;
        }

        .profile-info-list strong {
            color: var(--text);
            display: block;
            font-size: 14px;
            margin-top: 2px;
        }

        .profile-preview {
            display: grid;
            gap: 5px;
            margin: 6px 0 18px;
        }

        .profile-preview strong {
            color: var(--text);
            display: block;
            font-size: 15px;
        }

        .dashboard-stat-grid {
            display: grid;
            gap: 14px;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            margin-top: 18px;
        }

        .dashboard-stat-card {
            align-items: center;
            display: flex;
            gap: 14px;
            min-height: 116px;
            padding: 18px;
        }

        .dashboard-stat-card strong {
            display: block;
            font-size: 28px;
            line-height: 1.1;
            margin: 4px 0;
        }

        .dashboard-stat-label {
            color: var(--muted);
            display: block;
            font-size: 13px;
            font-weight: 800;
            text-transform: uppercase;
        }

        .dashboard-stat-icon,
        .project-card-icon,
        .project-recent-icon,
        .project-list-icon,
        .project-form-icon-preview,
        .project-hero-icon {
            align-items: center;
            background: var(--nav-bg-soft);
            border-radius: 8px;
            color: var(--nav-active);
            display: inline-flex;
            overflow: hidden;
        }

        .dashboard-stat-icon,
        .project-card-icon {
            flex: 0 0 44px;
            height: 44px;
            justify-content: center;
            width: 44px;
        }

        .dashboard-stat-icon svg,
        .project-card-icon svg,
        .project-recent-icon svg,
        .project-list-icon svg,
        .project-form-icon-preview svg,
        .project-hero-icon svg,
        .button-icon svg {
            display: block;
            height: 24px;
            stroke: currentColor;
            stroke-width: 2;
            width: 24px;
        }

        .project-card-icon img,
        .project-recent-icon img,
        .project-list-icon img,
        .project-form-icon-preview img,
        .project-hero-icon img {
            height: 100%;
            object-fit: cover;
            width: 100%;
        }

        .project-list-title,
        .project-heading,
        .project-icon-upload {
            align-items: center;
            display: flex;
            gap: 12px;
            min-width: 0;
        }

        .project-icon-upload > div {
            flex: 1 1 auto;
            min-width: 0;
        }

        .project-list-icon {
            flex: 0 0 34px;
            height: 34px;
            justify-content: center;
            width: 34px;
        }

        .project-list-icon svg {
            height: 20px;
            width: 20px;
        }

        .projects-recent-section {
            padding: 18px;
        }

        .projects-recent-section h2 {
            color: var(--muted);
            font-size: 15px;
            font-weight: 850;
            letter-spacing: 0;
            margin: 0;
            text-transform: uppercase;
        }

        .project-recent-header {
            align-items: center;
            display: flex;
            gap: 14px;
            justify-content: space-between;
            margin-bottom: 12px;
        }

        .project-recent-pager .calendar-nav-current {
            min-width: 56px;
        }

        button.calendar-nav-button {
            appearance: none;
            border: 0;
            cursor: pointer;
            font: inherit;
        }

        button.calendar-nav-button:disabled {
            cursor: not-allowed;
            opacity: 0.45;
        }

        .project-recent-grid {
            display: grid;
            gap: 14px;
            grid-template-columns: repeat(3, minmax(0, 1fr));
        }

        .project-recent-link {
            align-items: center;
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 8px;
            color: var(--text);
            display: flex;
            gap: 16px;
            min-height: 216px;
            outline-offset: 3px;
            padding: 16px;
            width: 100%;
        }

        .project-recent-link:hover {
            border-color: color-mix(in srgb, var(--nav-active), transparent 42%);
            box-shadow: 0 8px 24px rgba(31, 41, 51, 0.08);
        }

        .project-recent-link:hover .project-recent-icon {
            color: var(--nav-active);
        }

        .project-recent-icon {
            border: 1px solid var(--border);
            flex: 0 0 184px;
            height: 184px;
            justify-content: center;
            width: 184px;
        }

        .project-recent-icon svg {
            height: 100px;
            width: 100px;
        }

        .project-recent-name {
            color: var(--text);
            display: block;
            font-size: 16px;
            font-weight: 800;
            line-height: 1.25;
            min-width: 0;
            overflow-wrap: anywhere;
        }

        .project-form-icon-preview {
            flex: 0 0 96px;
            height: 96px;
            justify-content: center;
            width: 96px;
        }

        .project-form-icon-preview svg {
            height: 44px;
            width: 44px;
        }

        .project-form-section {
            border-top: 1px solid var(--border);
            margin-top: 24px;
            padding-top: 24px;
        }

        .project-form-section:first-of-type {
            border-top: 0;
            margin-top: 0;
            padding-top: 0;
        }

        .project-form-section-header {
            align-items: flex-start;
            display: flex;
            gap: 12px;
            margin-bottom: 18px;
        }

        .project-form-section-header h2 {
            font-size: 19px;
            line-height: 1.25;
            margin: 0 0 3px;
        }

        .project-form-section-header p {
            color: var(--muted);
            font-size: 13px;
            margin: 0;
        }

        .project-form-section-number {
            align-items: center;
            background: var(--nav-bg-soft);
            border-radius: 7px;
            color: var(--nav-active);
            display: inline-flex;
            flex: 0 0 32px;
            font-size: 14px;
            font-weight: 800;
            height: 32px;
            justify-content: center;
            width: 32px;
        }

        .project-map-field {
            margin-top: -4px;
        }

        .project-map-heading {
            align-items: center;
            display: flex;
            justify-content: space-between;
            margin-bottom: 6px;
        }

        .project-map-heading label {
            margin-bottom: 0;
        }

        .project-map-link {
            color: var(--primary);
            font-size: 13px;
            font-weight: 700;
        }

        .project-address-map {
            background: var(--surface-2);
            border: 1px solid var(--border);
            border-radius: 8px;
            height: clamp(360px, 54vw, 570px);
            overflow: hidden;
            position: relative;
        }

        .project-address-map iframe {
            border: 0;
            height: 100%;
            width: 100%;
        }

        .project-address-map [hidden] {
            display: none;
        }

        .project-address-map-placeholder {
            align-items: center;
            color: var(--muted);
            display: flex;
            flex-direction: column;
            gap: 10px;
            height: 100%;
            justify-content: center;
            padding: 24px;
            text-align: center;
        }

        .project-address-map-placeholder svg {
            height: 32px;
            stroke: var(--nav-active);
            stroke-linecap: round;
            stroke-linejoin: round;
            stroke-width: 1.8;
            width: 32px;
        }

        .weather-suggestion-control {
            align-items: stretch;
            display: grid;
            gap: 8px;
            grid-template-columns: minmax(0, 1fr) auto;
        }

        .weather-suggestion-control .button {
            white-space: nowrap;
        }

        .project-hero-icon {
            flex: 0 0 58px;
            height: 58px;
            justify-content: center;
            width: 58px;
        }

        .project-hero-icon svg {
            height: 30px;
            width: 30px;
        }

        .dashboard-stat-icon.small {
            flex-basis: 38px;
            height: 38px;
            width: 38px;
        }

        .dashboard-main-grid {
            display: grid;
            gap: 18px;
            grid-template-columns: minmax(0, 1.1fr) minmax(330px, 0.9fr);
            margin-top: 18px;
        }

        .dashboard-section {
            padding: 20px;
        }

        .dashboard-section + .dashboard-section {
            margin-top: 18px;
        }

        .dashboard-main-grid .dashboard-section {
            margin-top: 0;
        }

        .dashboard-section-header {
            align-items: flex-start;
            display: flex;
            gap: 14px;
            justify-content: space-between;
            margin-bottom: 16px;
        }

        .dashboard-section-header h2 {
            font-size: 20px;
            line-height: 1.2;
            margin: 0 0 4px;
        }

        .calendar-section-header {
            align-items: flex-start;
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto;
        }

        .calendar-section-header .calendar-nav {
            justify-self: end;
        }

        .period-grid,
        .project-card-grid {
            display: grid;
            gap: 12px;
        }

        .period-card {
            padding: 16px;
        }

        .period-card-title {
            align-items: center;
            display: flex;
            gap: 12px;
            margin-bottom: 14px;
        }

        .period-card-title strong,
        .project-card strong {
            color: var(--text);
            display: block;
            font-size: 16px;
        }

        .period-card-title span,
        .project-card span {
            color: var(--muted);
            display: block;
            font-size: 13px;
        }

        .period-metrics {
            display: grid;
            gap: 8px;
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }

        .period-metrics span {
            background: var(--surface-2);
            border-radius: 7px;
            color: var(--muted);
            font-size: 13px;
            padding: 9px 10px;
        }

        .period-metrics strong {
            color: var(--text);
            display: block;
            font-size: 16px;
        }

        .period-metrics .finance {
            background: var(--nav-bg-soft);
            color: var(--nav-active);
        }

        .period-metrics .money-value {
            color: var(--nav-active);
            font-size: 17px;
            font-variant-numeric: tabular-nums;
            line-height: 1.15;
            overflow-wrap: normal;
            text-rendering: optimizeLegibility;
            white-space: nowrap;
        }

        .period-metrics .money-value span {
            background: transparent;
            border-radius: 0;
            color: inherit;
            display: inline;
            font-size: 13px;
            padding: 0;
        }

        .period-metrics em {
            color: var(--muted);
            display: block;
            font-size: 13px;
            font-style: normal;
            margin-top: 2px;
        }

        .calendar-nav {
            align-items: center;
            display: flex;
            gap: 8px;
        }

        .calendar-nav-stack {
            --calendar-nav-control-width: 214px;
            align-items: center;
            display: grid;
            gap: 6px;
            min-width: var(--calendar-nav-control-width);
            width: var(--calendar-nav-control-width);
        }

        .calendar-nav-line {
            align-items: center;
            display: flex;
            justify-content: center;
            width: var(--calendar-nav-control-width);
        }

        .calendar-nav-group {
            align-items: center;
            border: 1px solid var(--border);
            border-radius: 8px;
            display: inline-flex;
            overflow: hidden;
            width: 100%;
        }

        .calendar-nav-button {
            align-items: center;
            background: var(--surface);
            color: var(--text);
            display: inline-flex;
            font-size: 13px;
            font-weight: 800;
            height: 36px;
            justify-content: center;
            min-width: 44px;
            padding: 0 12px;
        }

        .calendar-nav-button + .calendar-nav-button {
            border-left: 1px solid var(--border);
        }

        .calendar-nav-button:hover {
            background: var(--nav-bg-soft);
            color: var(--nav-active);
        }

        .calendar-nav-button svg {
            display: block;
            height: 18px;
            stroke: currentColor;
            stroke-width: 2.4;
            width: 18px;
        }

        .calendar-nav-current {
            align-items: center;
            background: var(--surface-2);
            color: var(--text);
            display: inline-flex;
            flex: 1;
            font-size: 13px;
            font-weight: 850;
            height: 36px;
            justify-content: center;
            min-width: 92px;
            padding: 0 12px;
            text-align: center;
            white-space: nowrap;
        }

        .calendar-nav-current + .calendar-nav-button,
        .calendar-nav-button + .calendar-nav-current {
            border-left: 1px solid var(--border);
        }

        .calendar-today-link {
            align-items: center;
            background: var(--nav-bg-soft);
            border: 1px solid color-mix(in srgb, var(--nav-active), transparent 65%);
            border-radius: 8px;
            color: var(--nav-active);
            display: inline-flex;
            font-size: 13px;
            font-weight: 850;
            height: 36px;
            justify-content: center;
            padding: 0 12px;
            width: 100%;
        }

        .company-calendar-grid {
            display: grid;
            gap: 5px;
            grid-template-columns: repeat(7, minmax(0, 1fr));
        }

        .company-calendar-weekday {
            color: var(--muted);
            font-size: 12px;
            font-weight: 800;
            padding: 0 4px 4px;
            text-align: center;
        }

        .company-calendar-day {
            align-items: flex-start;
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 7px;
            color: var(--text);
            display: flex;
            flex-direction: column;
            gap: 5px;
            justify-content: space-between;
            min-height: 74px;
            padding: 7px;
        }

        .company-calendar-day-head {
            align-items: center;
            display: flex;
            gap: 5px;
            justify-content: space-between;
            width: 100%;
        }

        .company-calendar-day.outside {
            opacity: 0.42;
        }

        .company-calendar-day.has-work {
            background: var(--nav-bg-soft);
            border-color: transparent;
            color: var(--nav-active);
        }

        .company-calendar-day.has-events:not(.has-work) {
            background: var(--surface-2);
        }

        a.company-calendar-day:hover {
            box-shadow: inset 0 0 0 2px var(--nav-active);
        }

        .company-calendar-day.today {
            border-color: var(--nav-active);
            box-shadow: inset 0 0 0 2px var(--nav-active);
        }

        .company-calendar-day.today .calendar-day-number {
            color: var(--nav-active);
            font-weight: 800;
        }

        .company-calendar-dot {
            background: var(--nav-active);
            border-radius: 999px;
            color: #ffffff;
            display: inline-flex;
            font-size: 11px;
            font-weight: 800;
            justify-content: center;
            min-width: 20px;
            padding: 2px 6px;
        }

        .company-calendar-events {
            display: grid;
            gap: 3px 5px;
            grid-template-areas:
                "work work"
                "extra payment";
            grid-template-columns: 18px 18px;
            grid-template-rows: 18px 18px;
            min-height: 39px;
        }

        .calendar-event-slot {
            align-items: center;
            display: inline-flex;
            height: 18px;
            justify-content: center;
            width: 18px;
        }

        .calendar-event-slot-work {
            grid-area: work;
            justify-self: start;
        }

        .calendar-event-slot-extra {
            grid-area: extra;
        }

        .calendar-event-slot-payment {
            grid-area: payment;
        }

        .calendar-event-icon {
            align-items: center;
            border: 1px solid transparent;
            border-radius: 5px;
            display: inline-flex;
            height: 18px;
            justify-content: center;
            width: 18px;
        }

        .calendar-event-icon svg {
            display: block;
            height: 13px;
            stroke: currentColor;
            stroke-width: 2.2;
            width: 13px;
        }

        .calendar-event-icon.work {
            background: color-mix(in srgb, var(--nav-active) 14%, transparent);
            color: var(--nav-active);
        }

        .calendar-event-icon.payment {
            background: rgba(126, 101, 51, 0.13);
            color: #7e6533;
        }

        .calendar-event-icon.extra {
            background: rgba(119, 76, 96, 0.13);
            color: #774c60;
        }

        [data-theme="dark"] .calendar-event-icon.payment {
            background: rgba(210, 177, 104, 0.16);
            color: #d2b168;
        }

        [data-theme="dark"] .calendar-event-icon.extra {
            background: rgba(210, 132, 168, 0.16);
            color: #d284a8;
        }

        .calendar-legend {
            align-items: center;
            color: var(--muted);
            display: flex;
            flex-wrap: wrap;
            font-size: 12px;
            gap: 10px 14px;
            margin-top: 10px;
        }

        .calendar-legend > span {
            align-items: center;
            display: inline-flex;
            gap: 5px;
        }

        .calendar-today-swatch {
            border: 2px solid var(--nav-active);
            border-radius: 5px;
            display: inline-block;
            height: 18px;
            width: 18px;
        }

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

        .project-card {
            display: flex;
            gap: 14px;
            padding: 16px;
        }

        .project-card:hover {
            border-color: var(--nav-active);
            box-shadow: 0 8px 24px rgba(31, 41, 51, 0.08);
        }

        .project-card-body {
            min-width: 0;
        }

        .project-card-meta {
            margin-top: 6px;
        }

        .dashboard-filter-grid {
            align-items: end;
            display: grid;
            gap: 16px;
            grid-template-columns: minmax(220px, 1fr) 190px auto;
            margin-bottom: 16px;
        }

        .dashboard-table-wrap {
            overflow-x: auto;
        }

        .dashboard-action,
        .button-icon {
            gap: 8px;
        }

        .button.icon-only {
            justify-content: center;
            min-width: 42px;
            padding-left: 10px;
            padding-right: 10px;
        }

        .button {
            align-items: center;
            background: var(--primary);
            border: 1px solid var(--primary);
            border-radius: 6px;
            color: #ffffff;
            cursor: pointer;
            display: inline-flex;
            font: inherit;
            font-weight: 600;
            min-height: 40px;
            padding: 8px 13px;
        }

        .button.secondary {
            background: var(--surface);
            color: var(--primary);
        }

        .button.ghost {
            background: transparent;
            border-color: rgba(255, 255, 255, 0.45);
            color: #ffffff;
            min-height: 34px;
            padding: 5px 10px;
        }

        .field {
            margin-bottom: 16px;
        }

        label {
            display: block;
            font-size: 14px;
            font-weight: 650;
            margin-bottom: 6px;
        }

        input[type="email"],
        input[type="password"],
        input[type="text"],
        input[type="date"],
        input[type="time"],
        input[type="number"],
        select,
        textarea {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 6px;
            color: var(--text);
            font: inherit;
            min-height: 42px;
            padding: 9px 10px;
            width: 100%;
        }

        textarea {
            min-height: 110px;
            resize: vertical;
        }

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

        /* Ctyrsloupcova varianta filtru (desktop); na mobilu prepnuta na 1fr. */
        .form-grid-4 {
            grid-template-columns: repeat(4, minmax(0, 1fr));
        }

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

        .actions {
            align-items: center;
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin-top: 6px;
        }

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

        .segmented-control {
            background: var(--surface-2);
            border: 1px solid var(--border);
            border-radius: 8px;
            display: inline-grid;
            gap: 4px;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            padding: 4px;
        }

        .segmented-option {
            margin: 0;
        }

        .segmented-option input {
            inline-size: 1px;
            opacity: 0;
            position: absolute;
        }

        .segmented-option span {
            align-items: center;
            border-radius: 6px;
            color: var(--muted);
            cursor: pointer;
            display: flex;
            font-size: 14px;
            font-weight: 750;
            justify-content: center;
            min-height: 38px;
            padding: 7px 12px;
            white-space: nowrap;
        }

        .segmented-option input:checked + span {
            background: var(--panel);
            box-shadow: 0 1px 4px rgba(31, 41, 51, 0.12);
            color: var(--primary);
        }

        .segmented-option input:focus-visible + span {
            outline: 2px solid var(--primary);
            outline-offset: 2px;
        }

        .radio-list {
            display: flex;
            flex-wrap: wrap;
            gap: 10px 22px;
            padding: 6px 2px 2px;
        }

        .radio-option {
            align-items: center;
            cursor: pointer;
            display: flex;
            font-weight: 650;
            gap: 9px;
            margin: 0;
        }

        .radio-option input {
            accent-color: var(--primary);
            cursor: pointer;
            flex: none;
            height: 18px;
            margin: 0;
            width: 18px;
        }

        .radio-option input:focus-visible {
            outline: 2px solid var(--primary);
            outline-offset: 2px;
        }

        .customer-search-box {
            position: relative;
        }

        .customer-search-results {
            background: var(--panel);
            border: 1px solid var(--border);
            border-radius: 8px;
            box-shadow: 0 12px 32px rgba(31, 41, 51, 0.18);
            left: 0;
            max-height: 280px;
            overflow: auto;
            position: absolute;
            right: 0;
            top: calc(100% + 4px);
            z-index: 40;
        }

        .customer-search-results button {
            background: none;
            border: 0;
            cursor: pointer;
            display: block;
            font: inherit;
            padding: 9px 12px;
            text-align: left;
            width: 100%;
        }

        .customer-search-results button:hover,
        .customer-search-results button:focus-visible {
            background: var(--surface-2);
        }

        .customer-search-result-meta {
            color: var(--muted);
            font-size: 12.5px;
        }

        .customer-search-add {
            border-top: 1px solid var(--border) !important;
            color: var(--primary);
            font-weight: 700;
        }

        .customer-card {
            background: var(--surface-2);
            border: 1px solid var(--border);
            border-radius: 8px;
            display: grid;
            gap: 7px;
            padding: 12px 14px;
        }

        .customer-card-row {
            display: flex;
            font-size: 14px;
            gap: 12px;
        }

        .customer-card-label {
            color: var(--muted);
            flex: 0 0 140px;
        }

        .modal-backdrop {
            align-items: center;
            backdrop-filter: blur(6px);
            -webkit-backdrop-filter: blur(6px);
            background: rgba(15, 23, 32, 0.45);
            bottom: 0;
            display: flex;
            justify-content: center;
            left: 0;
            padding: 16px;
            position: fixed;
            right: 0;
            top: 0;
            z-index: 100;
        }

        .modal-backdrop[hidden] {
            display: none;
        }

        .modal-panel {
            background: var(--panel);
            border: 1px solid var(--border);
            border-radius: 14px;
            box-shadow: 0 24px 64px rgba(15, 23, 32, 0.35);
            max-height: calc(100vh - 32px);
            max-width: 560px;
            overflow: auto;
            padding: 18px 20px;
            width: 100%;
        }

        .modal-head {
            align-items: center;
            display: flex;
            justify-content: space-between;
            margin-bottom: 12px;
        }

        .modal-head h3 {
            font-size: 18px;
            margin: 0;
        }

        /* Pruvodce schovava kroky a akce atributem hidden - musi prebit
           i tridy s vlastnim display (napr. .actions { display: flex }). */
        form[data-wizard] [hidden] {
            display: none !important;
        }

        .date-clear-wrap {
            align-items: center;
            display: flex;
            gap: 8px;
        }

        .date-clear-wrap input {
            flex: 1;
        }

        .time-wheel {
            background: var(--panel);
            border: 1px solid var(--border);
            border-radius: 14px;
            box-shadow: 0 18px 48px rgba(15, 23, 32, 0.3);
            padding: 10px;
            position: absolute;
            width: 230px;
            z-index: 90;
        }

        .time-wheel[hidden] {
            display: none;
        }

        .time-wheel-cols {
            display: flex;
            gap: 6px;
            position: relative;
        }

        .time-wheel-cols::before {
            background: var(--surface-2);
            border: 1px solid var(--border);
            border-radius: 8px;
            content: '';
            height: 36px;
            left: 0;
            pointer-events: none;
            position: absolute;
            right: 0;
            top: 72px;
        }

        .wheel-col {
            flex: 1;
            height: 180px;
            overflow-y: auto;
            overscroll-behavior: contain;
            position: relative;
            scroll-snap-type: y mandatory;
            scrollbar-width: none;
        }

        .wheel-col::-webkit-scrollbar {
            display: none;
        }

        .wheel-pad {
            height: 72px;
        }

        .wheel-item {
            align-items: center;
            background: none;
            border: 0;
            color: var(--muted);
            cursor: pointer;
            display: flex;
            font: inherit;
            font-size: 17px;
            font-variant-numeric: tabular-nums;
            font-weight: 650;
            height: 36px;
            justify-content: center;
            scroll-snap-align: center;
            width: 100%;
        }

        .wheel-item.is-selected {
            color: var(--primary);
            font-size: 19px;
        }

        .time-wheel-done {
            margin-top: 8px;
            min-height: 34px;
            padding: 5px 10px;
            width: 100%;
        }

        @media (max-width: 640px) {
            .time-wheel {
                bottom: 0;
                border-radius: 14px 14px 0 0;
                box-shadow: 0 -12px 40px rgba(15, 23, 32, 0.35);
                left: 0 !important;
                position: fixed;
                right: 0;
                top: auto !important;
                width: auto;
            }
        }

        .wizard-steps {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-bottom: 18px;
        }

        .wizard-step-chip {
            align-items: center;
            background: var(--surface-2);
            border: 1px solid var(--border);
            border-radius: 999px;
            color: var(--muted);
            cursor: pointer;
            display: inline-flex;
            font: inherit;
            font-size: 14px;
            font-weight: 650;
            gap: 8px;
            padding: 7px 14px 7px 8px;
        }

        .wizard-step-num {
            align-items: center;
            background: var(--panel);
            border: 1px solid var(--border);
            border-radius: 50%;
            display: inline-flex;
            flex: none;
            font-size: 12.5px;
            height: 24px;
            justify-content: center;
            width: 24px;
        }

        .wizard-step-chip.is-active {
            background: var(--panel);
            box-shadow: 0 2px 10px rgba(31, 41, 51, 0.12);
            color: var(--primary);
        }

        .wizard-step-chip.is-active .wizard-step-num {
            background: var(--primary);
            border-color: var(--primary);
            color: #fff;
        }

        .wizard-step-chip.is-done {
            color: var(--flash-border);
        }

        .wizard-step-chip.is-done .wizard-step-num::before {
            content: '✓';
        }

        .wizard-step-chip.is-done .wizard-step-num {
            font-size: 0;
        }

        .wizard-step-chip.is-done .wizard-step-num::before {
            font-size: 12.5px;
        }

        .wizard-nav {
            justify-content: space-between;
        }

        .wizard-nav-right {
            align-items: center;
            display: inline-flex;
            flex-wrap: wrap;
            gap: 10px;
        }

        @media (max-width: 640px) {
            .wizard-step-chip:not(.is-active) .wizard-step-label {
                display: none;
            }

            .wizard-step-chip:not(.is-active) {
                padding: 7px 8px;
            }
        }

        @media (max-width: 640px) {
            .modal-backdrop {
                align-items: flex-end;
                padding: 0;
            }

            .modal-panel {
                border-radius: 14px 14px 0 0;
                max-height: 92vh;
            }

            .customer-card-label {
                flex-basis: 110px;
            }
        }

        .readonly-value {
            background: var(--surface-2);
            border: 1px solid var(--border);
            border-radius: 6px;
            min-height: 42px;
            padding: 9px 10px;
        }

        .entry-form-tools {
            align-items: end;
            display: grid;
            gap: 12px;
            grid-template-columns: minmax(220px, 1fr) 160px minmax(320px, auto);
            margin-bottom: 12px;
        }

        /* Design v3: nastroje nad tabulkou pracovniku. Tri samostatne radky
           (vstupy / rozdeleny den / akce). Nahrazuje pouziti .entry-form-tools,
           ktery ma 3 sloupce a 4 deti, takze .actions padaly do druheho radku
           a tlacitka se rozjizdela. */
        .worker-bulkbar {
            display: flex;
            flex-direction: column;
            gap: 10px;
            margin-bottom: 12px;
        }

        .worker-bulkbar-fields {
            align-items: end;
            display: flex;
            flex-wrap: wrap;
            gap: 12px;
        }

        .worker-bulkbar-fields .field {
            margin: 0;
            min-width: 0;
        }

        .worker-bulkbar-filter {
            flex: 1 1 220px;
            max-width: 320px;
        }

        /* Pole "Hodiny" si stepper obali dvema tlacitky po 46 px (design-v2.css,
           .v2-time-step) - pri 140 px na vstup nezbylo skoro nic a cislo neslo
           precist. Sirka pocita se stepperem i s tlacitkem dopoctu. */
        .worker-bulkbar-hours {
            flex: 0 0 272px;
        }

        .worker-bulkbar-hours-row {
            align-items: stretch;
            display: flex;
            gap: 6px;
        }

        .worker-bulkbar-hours-row .v2-time-stepper {
            flex: 1;
            min-width: 0;
        }

        .worker-bulkbar-hours-row input {
            min-width: 74px;
        }

        .worker-bulkbar-hours-row .time-toggle {
            flex: none;
            padding: 0 10px;
        }

        .worker-bulkbar-split-grid .time-toggle {
            min-height: 38px;
            padding: 0 10px;
        }

        .worker-bulkbar-place {
            flex: 0 0 200px;
        }

        .worker-bulkbar-split {
            background: var(--surface-2);
            border: 1px solid var(--border);
            border-radius: 10px;
            padding: 8px 12px;
        }

        .worker-bulkbar-split > summary {
            cursor: pointer;
            font-weight: 650;
            list-style: none;
        }

        .worker-bulkbar-split > summary::-webkit-details-marker {
            display: none;
        }

        .worker-bulkbar-split > summary::before {
            content: '▸ ';
            color: var(--muted);
        }

        .worker-bulkbar-split[open] > summary::before {
            content: '▾ ';
        }

        .worker-bulkbar-split-grid {
            align-items: end;
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin-top: 10px;
        }

        .worker-bulkbar-split-grid input {
            max-width: 92px;
        }

        .worker-bulkbar-actions {
            align-items: center;
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
        }

        .worker-bulkbar-actions .button {
            margin: 0;
        }

        .worker-bulkbar-actions .button[disabled] {
            cursor: not-allowed;
            opacity: 0.45;
        }

        .worker-bulkbar-crew {
            align-items: center;
            display: inline-flex;
            gap: 6px;
        }

        .worker-bulkbar-crew select {
            max-width: 220px;
        }

        /* Modal "Prepsat uz zadane hodiny?" - vypis zmen z -> na. */
        .overwrite-list {
            display: grid;
            gap: 6px;
            list-style: none;
            margin: 12px 0 16px;
            padding: 0;
        }

        .overwrite-list li {
            align-items: baseline;
            background: var(--surface-2);
            border-radius: 8px;
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            justify-content: space-between;
            padding: 8px 12px;
        }

        .overwrite-change {
            color: #b23b2e;
            font-variant-numeric: tabular-nums;
            font-weight: 700;
            white-space: nowrap;
        }

        [data-overwrite-modal] .actions {
            flex-wrap: wrap;
            margin-top: 0;
        }

        [data-overwrite-modal] .button.danger {
            background: var(--v2-danger-soft, #fbe9e7);
            border-color: transparent;
            color: var(--danger, #b23b2e);
        }

        /* Sprava part: nastroje nad seznamem clenu (filtr, pocitadlo). */
        /* Stitek "dnes jinde X h" u pracovnika, ktery ma v tentyz den zaznam
           i na jine stavbe. Varovani, ne chyba - proto teple, ne cervene. */
        .worker-elsewhere {
            background: #fff6e2;
            border-radius: 999px;
            color: #8a6d3b;
            display: inline-block;
            font-size: 12px;
            font-weight: 650;
            margin-left: 8px;
            padding: 2px 9px;
            white-space: nowrap;
        }

        .crew-member-tools {
            align-items: center;
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin: 8px 0;
        }

        .crew-member-tools .button {
            margin: 0;
            min-height: 34px;
            padding: 4px 12px;
        }

        .crew-member-list {
            max-height: 320px;
        }

        .worker-select-all {
            align-items: center;
            cursor: pointer;
            display: inline-flex;
            gap: 6px;
            margin: 0;
        }

        @media (max-width: 640px) {
            .worker-bulkbar-filter,
            .worker-bulkbar-hours,
            .worker-bulkbar-place {
                flex: 1 1 100%;
                max-width: none;
            }

            .worker-bulkbar-actions .button,
            .worker-bulkbar-crew {
                flex: 1 1 100%;
            }

            .worker-bulkbar-crew select {
                flex: 1 1 auto;
                max-width: none;
            }
        }

        .compact-check-list {
            display: grid;
            gap: 5px;
            max-height: 150px;
            overflow-y: auto;
        }

        .compact-check-list label {
            align-items: center;
            display: flex;
            font-size: 13px;
            font-weight: 500;
            gap: 6px;
            margin: 0;
        }

        .compact-check-list input {
            min-height: auto;
            width: auto;
        }

        .compact-checkbox {
            align-items: center;
            display: flex;
            font-size: 13px;
            font-weight: 600;
            gap: 7px;
            margin: 0;
        }

        /* Atribut [hidden] jinak prohraje s `display: flex` vyse (autorske
           pravidlo prebije UA `[hidden]{display:none}`), takze JS skryvani
           (napr. "Stejna jako sidlo firmy" u fyzicke osoby, nebo "Stejna jako
           adresa stavby" bez adresy stavby) nefungovalo. Tohle to spravi. */
        .compact-checkbox[hidden] {
            display: none;
        }

        .compact-checkbox input {
            appearance: none;
            -webkit-appearance: none;
            background: var(--panel);
            border: 1px solid var(--border);
            border-radius: 50%;
            cursor: pointer;
            display: inline-grid;
            flex: none;
            height: 18px;
            margin: 0;
            min-height: auto;
            place-content: center;
            width: 18px;
        }

        .compact-checkbox input::before {
            background: var(--primary);
            border-radius: 50%;
            content: '';
            height: 9px;
            transform: scale(0);
            transition: transform 0.12s ease;
            width: 9px;
        }

        .compact-checkbox input:checked {
            border-color: var(--primary);
        }

        .compact-checkbox input:checked::before {
            transform: scale(1);
        }

        .compact-checkbox input:focus-visible {
            outline: 2px solid var(--primary);
            outline-offset: 2px;
        }

        .error {
            color: var(--danger);
            font-size: 14px;
            margin-top: 6px;
        }

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

        .table th,
        .table td {
            border-bottom: 1px solid var(--border);
            padding: 10px 8px;
            text-align: left;
            vertical-align: top;
        }

        .table th {
            color: var(--muted);
            font-size: 13px;
            font-weight: 700;
            text-transform: uppercase;
        }

        .empty {
            border: 1px dashed var(--border);
            border-radius: 8px;
            color: var(--muted);
            padding: 22px;
            text-align: center;
        }

        .flash {
            background: var(--flash-bg);
            border: 1px solid var(--flash-border);
            border-radius: 8px;
            margin-bottom: 18px;
            padding: 12px 14px;
        }

        /* Chybova varianta flash hlasky (napr. selhani generovani PDF). */
        .flash-error {
            background: color-mix(in srgb, #c62828 12%, transparent);
            border-color: #c62828;
        }

        .badge {
            background: var(--badge-bg);
            border-radius: 999px;
            color: var(--text);
            display: inline-flex;
            font-size: 13px;
            font-weight: 650;
            padding: 3px 9px;
        }

        .badge.active {
            background: #eaf6ea;
            color: #1b5e20;
        }

        .badge.completed {
            background: #eaf2f8;
            color: var(--primary-dark);
        }

        .badge.archived {
            background: #f1f3f5;
            color: #57606a;
        }





















        /* ===== Kartovy seznam staveb (mrizka s fotkou) + prepinac zobrazeni ===== */
        .view-toggle {
            border: 1px solid var(--border);
            border-radius: 10px;
            display: inline-flex;
            margin-left: auto;
            overflow: hidden;
        }

        .view-toggle-btn {
            background: var(--surface);
            border: 0;
            color: var(--muted);
            cursor: pointer;
            display: grid;
            height: 32px;
            min-height: auto;
            place-items: center;
            width: 40px;
        }

        .view-toggle-btn + .view-toggle-btn {
            border-left: 1px solid var(--border);
        }

        .view-toggle-btn:hover {
            color: var(--text);
        }

        .view-toggle-btn.active {
            background: var(--nav-bg-soft);
            color: var(--nav-active);
        }

        .view-toggle-btn svg {
            fill: none;
            height: 17px;
            stroke: currentColor;
            stroke-linecap: round;
            stroke-linejoin: round;
            stroke-width: 1.8;
            width: 17px;
        }

        .project-cards-grid {
            display: grid;
            gap: 14px;
            grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
        }
        .project-cards-grid[hidden] { display: none; }

        .project-card-tile {
            background: var(--panel);
            border: 1px solid var(--border);
            border-radius: 14px;
            color: var(--text);
            display: flex;
            flex-direction: column;
            overflow: hidden;
            transition: box-shadow 120ms ease, transform 120ms ease;
        }

        .project-card-tile:hover {
            box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
            transform: translateY(-2px);
        }

        .project-card-photo {
            aspect-ratio: 16 / 10;
            background: var(--nav-bg-soft);
            color: var(--nav-active);
            display: grid;
            overflow: hidden;
            place-items: center;
        }

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

        .project-card-photo svg {
            fill: none;
            height: 40px;
            opacity: 0.65;
            stroke: currentColor;
            stroke-linecap: round;
            stroke-linejoin: round;
            stroke-width: 1.6;
            width: 40px;
        }

        .project-card-body {
            display: flex;
            flex-direction: column;
            gap: 4px;
            padding: 12px 14px 14px;
        }

        .project-card-name {
            font-size: 15px;
            line-height: 1.3;
        }

        .project-card-sub {
            color: var(--muted);
            font-size: 13px;
            min-height: 1.4em;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .project-card-meta {
            display: flex;
            flex-wrap: wrap;
            gap: 4px;
            margin-top: 2px;
        }

        .project-card-term {
            font-size: 12.5px;
        }

        /* ===== Prubeh stavby (karty seznamu + prehled) ===== */
        .project-progress {
            align-items: center;
            display: flex;
            gap: 8px;
            margin-top: 6px;
        }

        .project-progress-bar {
            background: var(--surface-2);
            border-radius: 999px;
            flex: 1;
            height: 7px;
            overflow: hidden;
        }

        .project-progress-bar > span {
            background: #2e7d32;
            border-radius: 999px;
            display: block;
            height: 100%;
            transition: width 200ms ease;
        }

        .project-progress-value {
            color: #2e7d32;
            flex: 0 0 auto;
            font-size: 12.5px;
            font-weight: 700;
        }

        /* prekroceny plan (vic odpracovanych dnu nez planovanych) */
        .project-progress.over .project-progress-bar > span {
            background: #b3661e;
        }

        .project-progress.over .project-progress-value {
            color: #b3661e;
        }

        /* ===== Misto vykonu prace (denik): prepinac, rozdeleny den, chipy ===== */
        .worker-place-cell {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 8px 12px;
        }

        .worker-place-single {
            align-items: center;
            display: flex;
            flex-wrap: wrap;
            gap: 8px 10px;
        }

        .place-seg {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 999px;
            display: inline-flex;
            overflow: hidden;
        }

        .place-seg button {
            background: none;
            border: 0;
            color: var(--muted);
            cursor: pointer;
            font: inherit;
            font-size: 12.5px;
            min-height: auto;
            padding: 4px 10px;
            white-space: nowrap;
        }

        .place-seg button + button {
            border-left: 1px solid var(--border);
        }

        .place-seg button.on {
            font-weight: 650;
        }

        .place-seg button.on[data-place="site"],
        .place-chip.site,
        .place-text-site {
            background: #e7f0ea;
            color: #1b5e20;
        }

        .place-seg button.on[data-place="workshop"],
        .place-chip.workshop,
        .place-text-workshop {
            background: #fbeecb;
            color: #8a5a00;
        }

        .place-seg button.on[data-place="nakup"],
        .place-chip.nakup,
        .place-text-nakup {
            background: #f0e7f7;
            color: #6a2fa0;
        }

        .place-seg button.on[data-place="office"],
        .place-chip.office,
        .place-text-office {
            background: #eaf2f8;
            color: #215a8c;
        }

        .place-seg button.on[data-place="loss"],
        .place-chip.loss,
        .place-text-loss {
            background: #fdecea;
            color: #b23b2e;
        }

        .place-text-site,
        .place-text-workshop,
        .place-text-nakup,
        .place-text-office,
        .place-text-loss {
            background: none;
        }

        .place-chip {
            border-radius: 999px;
            display: inline-flex;
            font-size: 12.5px;
            font-weight: 650;
            margin: 1px 2px 1px 0;
            padding: 2px 10px;
            white-space: nowrap;
        }

        .worker-place-split {
            align-items: flex-end;
            display: flex;
            flex-wrap: wrap;
            gap: 8px 12px;
        }

        .split-fld {
            display: inline-flex;
            flex-direction: column;
            gap: 2px;
        }

        .split-fld-label {
            font-size: 11px;
            font-weight: 650;
        }

        .split-fld input {
            max-width: 88px;
            min-height: auto;
            padding: 6px 8px;
            text-align: center;
        }

        .split-total {
            font-size: 12px;
            padding-bottom: 8px;
            white-space: nowrap;
        }

        .place-split-toggle {
            background: none;
            border: 0;
            color: var(--primary);
            cursor: pointer;
            font: inherit;
            font-size: 12.5px;
            min-height: auto;
            padding: 2px 0;
            white-space: nowrap;
        }

        .place-split-toggle:hover {
            text-decoration: underline;
        }

        /* Order-status badge - barva podle OrderStatus::tone() (seznam + detail) */
        .badge.info { background: #eaf2f8; color: #215a8c; }
        .badge.warn { background: #fbeecb; color: #8a5a00; }
        .badge.done { background: #e7f0ea; color: #1b5e20; }
        .badge.danger { background: #fbe3e0; color: #a4262c; }
        .badge.muted { background: #f1f3f5; color: #57606a; }

        /* Klikaci filtr-chipy stavu zakazky na seznamu staveb */
        .status-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 14px; }
        .status-chips .chips-label { font-size: 12px; font-weight: 650; color: var(--muted); margin-right: 2px; }
        .status-chips .chip { border: 1px solid var(--border); border-radius: 999px; padding: 3px 11px; font-size: 12px; font-weight: 600; color: var(--text); background: var(--panel); text-decoration: none; line-height: 1.7; white-space: nowrap; }
        .status-chips .chip:hover { border-color: var(--primary); }
        .status-chips .chip.is-active { border-color: currentColor; }
        .status-chips .chip.is-active.info { background: #eaf2f8; color: #215a8c; }
        .status-chips .chip.is-active.active { background: #eaf6ea; color: #1b5e20; }
        .status-chips .chip.is-active.warn { background: #fbeecb; color: #8a5a00; }
        .status-chips .chip.is-active.done { background: #e7f0ea; color: #1b5e20; }
        .status-chips .chip.is-active.danger { background: #fbe3e0; color: #a4262c; }
        .status-chips .chip.is-active.muted { background: #f1f3f5; color: #57606a; }
        .status-chips .chip.chip-preset { border-style: dashed; }
        .status-chips .chip.chip-preset.is-active { background: #fbe3e0; color: #a4262c; border-style: solid; border-color: #a4262c; }

        .tabs {
            border-bottom: 2px solid var(--border);
            display: flex;
            gap: 4px;
            margin-bottom: 18px;
            overflow-x: auto;
        }

        .tabs a,
        .tabs span,
        .tabs button {
            border-bottom: 3px solid transparent;
            border-radius: 6px 6px 0 0;
            color: var(--text);
            display: inline-flex;
            font-size: 15px;
            font-weight: 650;
            margin-bottom: -2px;
            padding: 9px 14px;
            white-space: nowrap;
        }

        .tabs button {
            background: transparent;
            border-left: 0;
            border-right: 0;
            border-top: 0;
            cursor: pointer;
            font-family: inherit;
        }

        .tabs a:hover,
        .tabs button:hover {
            background: var(--surface-2);
            color: var(--primary);
        }

        .tabs .active {
            background: var(--accent-soft);
            border-bottom: 3px solid var(--primary);
            color: var(--primary);
        }

        /* Ikonova varianta zalozek stavby: ikona nad popiskem, aktivni barevne. */
        .tabs.tabs-icons a,
        .tabs.tabs-icons span.active,
        .tabs.tabs-icons button {
            align-items: center;
            color: var(--muted);
            flex-direction: column;
            font-size: 12px;
            font-weight: 600;
            gap: 4px;
            min-width: 74px;
            padding: 9px 10px 7px;
            text-align: center;
        }

        .tabs.tabs-icons a:hover,
        .tabs.tabs-icons button:hover {
            background: var(--surface-2);
            color: var(--text);
        }

        .tabs.tabs-icons svg {
            fill: none;
            height: 21px;
            stroke: currentColor;
            stroke-linecap: round;
            stroke-linejoin: round;
            stroke-width: 1.8;
            width: 21px;
        }

        .tabs.tabs-icons .active {
            background: var(--nav-bg-soft);
            border-bottom: 3px solid var(--nav-active);
            color: var(--nav-active);
        }

        .tabs .soon {
            color: var(--muted);
            opacity: 0.5;
        }

        /* ===== Sticky lista stavby (2026-07): zalozky drzi pod topbarem ===== */
        .project-subnav {
            background: var(--panel);
            border: 1px solid var(--border);
            border-radius: 8px;
            margin-bottom: 18px;
            padding: 4px 14px 0;
            position: sticky;
            top: var(--topbar-height);
            z-index: 40;
        }

        .project-subnav .tabs {
            border-bottom: 0;
            margin-bottom: 0;
            scrollbar-width: none;
        }

        .project-subnav .tabs::-webkit-scrollbar {
            display: none;
        }

        .tabs-more {
            display: flex;
            flex: 0 0 auto;
            margin-left: auto;
        }

        /* Menu "Vice" je potomek .project-subnav (ne .tabs - ta ma overflow-x
           auto a menu by orizla). */
        .tabs-more-menu {
            background: var(--panel);
            border: 1px solid var(--border);
            border-radius: 12px;
            box-shadow: 0 14px 34px rgba(10, 20, 30, 0.18);
            display: none;
            min-width: 230px;
            padding: 6px;
            position: absolute;
            right: 8px;
            top: calc(100% + 6px);
            z-index: 60;
        }

        .project-subnav.is-more-open .tabs-more-menu {
            display: block;
        }

        .tabs-more-menu a {
            align-items: center;
            border-radius: 8px;
            color: var(--text);
            display: flex;
            font-size: 13.5px;
            font-weight: 600;
            gap: 10px;
            padding: 8px 10px;
        }

        .tabs-more-menu a:hover {
            background: var(--nav-hover);
        }

        .tabs-more-menu a.active {
            background: var(--nav-bg-soft);
            color: var(--nav-active);
        }

        .tabs-more-menu a svg {
            fill: none;
            flex: 0 0 17px;
            height: 17px;
            stroke: currentColor;
            stroke-linecap: round;
            stroke-linejoin: round;
            stroke-width: 1.8;
            width: 17px;
        }

        .tabs-more-sep {
            background: var(--border);
            height: 1px;
            margin: 6px 4px;
        }

        .tabs-more-heading {
            color: var(--nav-muted);
            font-size: 10.5px;
            font-weight: 800;
            letter-spacing: 0.06em;
            padding: 6px 10px 2px;
            text-transform: uppercase;
        }

        .time-field {
            display: flex;
            gap: 6px;
            position: relative;
        }

        .time-field input {
            flex: 1;
        }

        .time-toggle {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 6px;
            cursor: pointer;
            font: inherit;
            min-height: 42px;
            padding: 0 12px;
        }

        .time-toggle:hover {
            background: var(--surface-2);
        }

        .time-popover {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 8px;
            box-shadow: 0 8px 24px rgba(31, 41, 51, 0.16);
            display: none;
            max-height: 230px;
            overflow-y: auto;
            position: absolute;
            right: 0;
            top: calc(100% + 4px);
            width: 120px;
            z-index: 30;
        }

        .time-popover.open {
            display: block;
        }

        .time-popover button {
            background: transparent;
            border: 0;
            cursor: pointer;
            display: block;
            font: inherit;
            padding: 7px 12px;
            text-align: center;
            width: 100%;
        }

        .time-popover button:hover {
            background: var(--surface-2);
            color: var(--primary);
        }

        .photo-grid {
            display: grid;
            gap: 12px;
            grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        }

        .photo-card img {
            border: 1px solid var(--border);
            border-radius: 6px;
            display: block;
            height: 130px;
            object-fit: cover;
            width: 100%;
        }

        .photo-meta {
            align-items: center;
            display: flex;
            flex-wrap: wrap;
            font-size: 13px;
            gap: 6px;
            margin-top: 6px;
        }

        .photo-delete {
            background: transparent;
            border: 0;
            color: var(--danger);
            cursor: pointer;
            font: inherit;
            font-size: 13px;
            padding: 0;
        }

        .toast {
            background: #fff8e1;
            border: 1px solid #f0b429;
            color: #5b4a00;
            border-radius: 8px;
            bottom: 20px;
            box-shadow: 0 8px 24px rgba(31, 41, 51, 0.18);
            font-size: 14px;
            max-width: 360px;
            padding: 12px 16px;
            position: fixed;
            right: 20px;
            z-index: 50;
        }

        .stats {
            display: grid;
            gap: 12px;
            grid-template-columns: repeat(4, minmax(0, 1fr));
        }

        .stat {
            border: 1px solid var(--border);
            border-radius: 8px;
            color: var(--text);
            display: block;
            padding: 14px;
        }

        a.stat:hover {
            background: var(--accent-soft);
            border-color: var(--primary);
        }

        .diary-calendar {
            border: 1px solid var(--border);
            border-radius: 8px;
            margin: 18px 0;
            padding: 14px;
        }

        .diary-calendar-header,
        .entry-day-nav {
            align-items: center;
            display: flex;
            gap: 12px;
            justify-content: space-between;
        }

        .diary-calendar h2 {
            font-size: 20px;
            margin: 0 0 2px;
        }

        .calendar-nav {
            align-items: center;
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }

        .calendar-nav .button {
            justify-content: center;
            min-width: 42px;
        }

        .calendar-scroll {
            margin-top: 14px;
            overflow-x: auto;
        }

        .calendar-grid {
            border: 1px solid var(--border);
            border-radius: 8px;
            display: grid;
            grid-template-columns: repeat(7, minmax(0, 1fr));
            min-width: 680px;
            overflow: hidden;
        }

        .calendar-weekday {
            background: var(--surface-2);
            color: var(--muted);
            font-size: 12px;
            font-weight: 750;
            padding: 8px;
            text-transform: uppercase;
        }

        .calendar-day {
            background: var(--surface);
            border-left: 1px solid var(--border);
            border-top: 1px solid var(--border);
            color: var(--text);
            display: flex;
            flex-direction: column;
            gap: 8px;
            min-height: 96px;
            padding: 8px;
        }

        .calendar-day:nth-child(7n + 1) {
            border-left: 0;
        }

        .calendar-day.outside {
            color: var(--muted);
            opacity: 0.58;
        }

        .calendar-day.has-entry {
            background: var(--accent-soft);
        }

        a.calendar-day:hover {
            border-color: var(--primary);
            color: var(--primary);
        }

        .calendar-day.today .calendar-day-number {
            border: 1px solid var(--primary);
            border-radius: 999px;
            color: var(--primary);
            display: inline-flex;
            justify-content: center;
            min-width: 28px;
            padding: 1px 6px;
        }

        .calendar-day-number {
            font-weight: 750;
            line-height: 1.2;
        }

        .calendar-entry-meta {
            align-items: flex-start;
            display: flex;
            flex-direction: column;
            font-size: 12px;
            gap: 5px;
        }

        .calendar-entry-meta .badge {
            font-size: 12px;
            line-height: 1.2;
            padding: 3px 7px;
        }

        .entry-day-nav {
            border-top: 1px solid var(--border);
            margin-top: 18px;
            padding-top: 14px;
        }

        .stat strong {
            display: block;
            font-size: 24px;
            line-height: 1.1;
        }

        .lightbox {
            align-items: center;
            background: rgba(15, 23, 32, 0.93);
            display: flex;
            flex-direction: column;
            inset: 0;
            justify-content: center;
            position: fixed;
            z-index: 100;
        }

        .lightbox[hidden] {
            display: none;
        }

        .lightbox img {
            border-radius: 6px;
            max-height: 78vh;
            max-width: 92vw;
        }

        .lightbox-info {
            align-items: center;
            color: #ffffff;
            display: flex;
            flex-wrap: wrap;
            font-size: 14px;
            gap: 14px;
            justify-content: center;
            margin-top: 14px;
            max-width: 92vw;
            text-align: center;
        }

        .lightbox-info a {
            color: #9ec5e8;
        }

        .lightbox-button {
            background: rgba(255, 255, 255, 0.14);
            border: 0;
            border-radius: 8px;
            color: #ffffff;
            cursor: pointer;
            font: inherit;
            font-size: 30px;
            line-height: 1;
            padding: 10px 16px;
            position: absolute;
        }

        .lightbox-button:hover {
            background: rgba(255, 255, 255, 0.28);
        }

        .lightbox-prev {
            left: 14px;
            top: 50%;
            transform: translateY(-50%);
        }

        .lightbox-next {
            right: 14px;
            top: 50%;
            transform: translateY(-50%);
        }

        .lightbox-close {
            font-size: 24px;
            right: 14px;
            top: 14px;
        }

        @media (max-width: 720px) {
            .toolbar {
                align-items: flex-start;
                flex-direction: column;
            }

            /* ===== Faze 2: navigace = off-canvas drawer (F5) =====
               Sidebar se schova mimo obrazovku a vysune se pres obsah po
               klepnuti na hamburger; plne popisky, submenu inline. */
            .app-shell,
            .app-shell.is-collapsed {
                padding-left: 0;
            }

            .sidebar,
            .app-shell.is-collapsed .sidebar {
                box-shadow: 0 0 44px rgba(0, 0, 0, 0.4);
                transform: translateX(-100%);
                transition: transform 0.25s ease;
                width: min(84vw, var(--sidebar-width));
                z-index: 100;
            }

            .app-shell.nav-open .sidebar {
                transform: translateX(0);
            }

            /* Popisky a sekce zpet - drawer je plnohodnotny, ne ikonovy rail. */
            .nav-item,
            .nav-summary {
                justify-content: flex-start;
            }

            /* Submenu inline pod polozkou (misto hover-flyoutu). */
            .nav-submenu {
                background: transparent;
                border: 0;
                border-radius: 0;
                box-shadow: none;
                left: auto;
                margin: 0;
                max-height: none;
                max-width: none;
                min-width: 0;
                opacity: 1;
                padding: 2px 0 6px 30px;
                pointer-events: auto;
                position: static;
                top: auto;
                transform: none;
                visibility: visible;
            }

            /* Overlay pod drawerem. */
            .nav-overlay {
                background: rgba(8, 12, 16, 0.5);
                display: block;
                inset: 0;
                opacity: 0;
                position: fixed;
                transition: opacity 0.25s ease;
                visibility: hidden;
                z-index: 90;
            }

            .app-shell.nav-open .nav-overlay {
                opacity: 1;
                visibility: visible;
            }

            .nav-hamburger {
                display: inline-flex;
            }

            .app-topbar {
                justify-content: flex-start;
            }

            .topbar-actions {
                margin-left: auto;
            }

            .app-topbar {
                padding: 0 14px;
            }

            /* Faze 3: pohodlnejsi touch-target pro hlavni tlacitka. */
            .button {
                min-height: 44px;
            }

            .dashboard-hero,
            .profile-hero,
            .dashboard-section-header {
                align-items: stretch;
                flex-direction: column;
            }

            .profile-identity {
                align-items: flex-start;
            }

            .project-icon-upload,
            .project-heading {
                align-items: flex-start;
            }

            .project-icon-upload {
                flex-direction: column;
            }

            .project-icon-upload > div,
            .project-icon-upload input[type="file"] {
                max-width: 100%;
                min-width: 0;
                width: 100%;
            }

            .project-address-map {
                height: 340px;
            }

            .weather-suggestion-control {
                grid-template-columns: 1fr;
            }

            .weather-suggestion-control .button {
                justify-content: center;
                width: 100%;
            }

            .profile-actions,
            .profile-actions form,
            .profile-actions .button {
                width: 100%;
            }

            .profile-actions .button {
                justify-content: center;
            }

            .dashboard-stat-grid,
            .dashboard-main-grid,
            .dashboard-filter-grid,
            .profile-grid,
            .form-grid {
                grid-template-columns: 1fr;
            }

            .segmented-control {
                display: grid;
                width: 100%;
            }

            .dashboard-stat-card {
                min-height: auto;
            }

            .period-metrics {
                grid-template-columns: 1fr;
            }

            .calendar-section-header {
                display: flex;
                grid-template-columns: none;
            }

            .calendar-nav,
            .calendar-nav-stack {
                width: 100%;
            }

            .calendar-section-header .calendar-nav {
                justify-self: stretch;
                margin-left: 0;
            }

            .calendar-nav-group,
            .calendar-today-link {
                width: 100%;
            }

            .calendar-nav-line {
                width: 100%;
            }

            .company-calendar-grid {
                gap: 4px;
            }

            .company-calendar-day {
                min-height: 66px;
                padding: 5px;
            }

            .company-calendar-dot {
                font-size: 10px;
                min-width: 18px;
                padding: 1px 5px;
            }

            .company-calendar-events {
                gap: 2px;
                grid-template-columns: 16px 16px;
                grid-template-rows: 16px 16px;
                min-height: 34px;
            }

            .calendar-event-slot {
                height: 16px;
                width: 16px;
            }

            .calendar-event-icon {
                height: 16px;
                width: 16px;
            }

            .calendar-event-icon svg {
                height: 11px;
                width: 11px;
            }

            .project-card-grid {
                grid-template-columns: 1fr;
            }

            .project-recent-grid {
                grid-template-columns: 1fr;
            }

            .page {
                padding: 20px 14px;
            }

            .panel {
                padding: 16px;
            }

            .form-grid,
            .entry-form-tools,
            .stats {
                grid-template-columns: 1fr;
            }

            .diary-calendar-header,
            .entry-day-nav {
                align-items: stretch;
                flex-direction: column;
            }

            /* ===== Faze 0: mobilni zaplaty (F1, F4, F6, F7) ===== */

            /* F1: bezobalove tabulky -> vodorovny scroll misto preteceni cele stranky.
               Tabulky uz obalene v .dashboard-table-wrap se nemeni. */
            .table:not(.dashboard-table-wrap .table) {
                display: block;
                width: max-content;
                min-width: 100%;
                max-width: 100%;
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
            }

            /* F4: ctyrsloupcovy filtr (napr. Denik) na mobilu pod sebe. */
            .form-grid-4 {
                grid-template-columns: 1fr;
            }

            /* F6: Seznam staveb = karty misto vodorovne scrollujici tabulky. */
            [data-projects-grid] {
                display: grid !important;
            }

            [data-projects-table] {
                display: none !important;
            }

            /* F7: kalendar deniku se vejde na sirku (jako firemni), bez scrollu.
               Textove detaily v bunce skryty; zustava cislo dne + podbarveni
               dnu se zaznamem (.has-entry). */
            .calendar-grid {
                min-width: 0;
            }

            .calendar-scroll {
                overflow-x: visible;
            }

            .calendar-day {
                gap: 4px;
                min-height: 52px;
                padding: 5px;
            }

            .calendar-entry-meta {
                display: none;
            }
        }

        /* ===== Faze 1: zapisove tabulky -> karty na telefonu (F2/F3) =====
           Oznacene tabulky (.entry-cards: pracovnici, material, viceprace ve
           formulari) se pod 640px prekloti z radku do karet: hlavicka skryta,
           kazda bunka = popisek (data-label) nad polem, na celou sirku. */
        @media (max-width: 640px) {
            table.entry-cards,
            table.entry-cards tbody {
                display: block;
                min-width: 0 !important;
                width: 100% !important;
            }

            table.entry-cards thead {
                display: none;
            }

            /* Faze 3: radek souhrnu (bunky th) na mobilu skryt - karty ukazuji
               kazdou polozku zvlast; souhrn zustava na desktopu. */
            table.entry-cards tr.is-total {
                display: none;
            }

            table.entry-cards tr {
                background: var(--surface);
                border: 1px solid var(--border);
                border-radius: 12px;
                display: block;
                margin-bottom: 10px;
                padding: 10px 12px;
            }

            table.entry-cards td {
                border: 0;
                display: block;
                padding: 6px 0;
                width: auto !important;
            }

            table.entry-cards td::before {
                color: var(--muted);
                content: attr(data-label);
                display: block;
                font-size: 12px;
                font-weight: 650;
                letter-spacing: 0.02em;
                margin-bottom: 3px;
                text-transform: uppercase;
            }

            /* Bunky bez popisku (napr. tlacitko Odebrat) a colspan prazdne stavy. */
            table.entry-cards td[data-label=""]::before,
            table.entry-cards td:not([data-label])::before {
                content: none;
            }

            table.entry-cards td[data-label=""] {
                padding-top: 2px;
                text-align: right;
            }

            /* Pole roztahnout na sirku karty (mimo zaskrtavatka). */
            table.entry-cards td > input:not([type="checkbox"]),
            table.entry-cards td > select,
            table.entry-cards td > textarea,
            table.entry-cards td > .readonly-value {
                width: 100%;
            }

            /* Segment mist prace (5 tlacitek) se v karte zalomi misto preteceni. */
            table.entry-cards .place-seg {
                flex-wrap: wrap;
            }
        }


        /* Compact dropzona do bunky tabulky - faktura u radku materialu
           (denik, krok 4). Stejne chovani jako velka zona, jen mensi. */
        .upload-dropzone--compact .upload-dropzone-face {
            border-radius: 10px;
            gap: 8px;
            padding: 8px 10px;
        }

        .upload-dropzone--compact .upload-dropzone-icon {
            border-radius: 8px;
            flex: 0 0 28px;
            height: 28px;
            width: 28px;
        }

        .upload-dropzone--compact .upload-dropzone-icon svg {
            height: 18px;
            width: 18px;
        }

        .upload-dropzone--compact .upload-dropzone-text strong {
            font-size: 12px;
        }

        .upload-dropzone--compact .upload-dropzone-hint {
            font-size: 11px;
        }

        .upload-dropzone--compact .upload-dropzone-selected {
            gap: 8px;
            margin-top: 6px;
        }

        .upload-dropzone--compact .upload-dropzone-files {
            font-size: 12px;
        }

        .upload-dropzone--compact .upload-dropzone-thumb {
            height: 26px;
            width: 26px;
        }

        .upload-dropzone--compact .upload-dropzone-clear {
            font-size: 12px;
            padding: 4px 8px;
        }

        /* Mobilni kartovy rezim tabulky roztahuje primy input v bunce na 100 %;
           dropzona je div, takze si sirku musime rict samy. */
        .material-receipt-upload {
            width: 100%;
        }

/* ------------------------------------------------------------------
   Kalendar: spolecna lista pro rok / mesic / tyden.
   Jeden radek, zadny nadpisovy panel navic - stranka ma nazev uz
   v topbaru a kazdy dalsi blok jen ubiral misto samotnemu kalendari.
   ------------------------------------------------------------------ */
.cal-bar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}
.cal-switch {
    background: var(--badge-bg);
    border-radius: 999px;
    display: inline-flex;
    padding: 3px;
}
.cal-switch-item {
    border-radius: 999px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
    padding: 5px 14px;
    text-decoration: none;
}
.cal-switch-item.on {
    background: var(--panel);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
    color: var(--text);
}
.cal-nav { align-items: center; display: inline-flex; gap: 4px; }
.cal-nav-btn {
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    display: inline-flex;
    font-size: 16px;
    height: 28px;
    justify-content: center;
    line-height: 1;
    text-decoration: none;
    width: 28px;
}
.cal-nav-label { font-size: 14px; font-weight: 700; min-width: 120px; text-align: center; }
.cal-nav-today { font-size: 12.5px; margin-left: 4px; text-decoration: none; }
.cal-bar-tools { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.cal-bar > form.cal-bar-tools { margin: 0; }
.cal-bar-tools select,
.cal-bar-tools input {
    font-size: 13px;
    min-height: 30px;
    padding: 3px 8px;
    width: auto;
}

/* Rocni teplotni mapa. */
.cal-year { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.cal-year-month h3 { font-size: 13.5px; margin: 0 0 2px; }
.cal-year-month-total { color: var(--muted); font-size: 11.5px; }
.cal-year-grid { display: grid; gap: 3px; grid-template-columns: repeat(7, 1fr); margin-top: 6px; }
.cal-year-weekday { color: var(--muted); font-size: 9.5px; text-align: center; }
.cal-year-day {
    aspect-ratio: 1;
    background: var(--badge-bg);
    border-radius: 4px;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9.5px;
    text-decoration: none;
}
.cal-year-day.lvl-1 { background: #cde9d6; color: #14532d; }
.cal-year-day.lvl-2 { background: #8fd3aa; color: #14532d; }
.cal-year-day.lvl-3 { background: #46b47b; color: #06281a; }
.cal-year-day.lvl-4 { background: #1f8f5a; color: #eafff3; }
.cal-year-day.is-today { outline: 2px solid var(--nav-active); outline-offset: 1px; }
.cal-year-day.is-empty { background: transparent; }
/* Den, kde je zaroven prace i nepritomnost: teplotni barva zustava,
   absenci hlasi rozek dlazdice. */
.cal-year-day.has-absence { position: relative; }
.cal-year-day.has-absence::after {
    border-color: transparent var(--absence-color, #f5a524) transparent transparent;
    border-style: solid;
    border-width: 0 7px 7px 0;
    content: '';
    position: absolute;
    right: 0;
    top: 0;
}
.cal-year-legend { align-items: center; color: var(--muted); display: flex; font-size: 12px; gap: 6px; }
.cal-year-legend i { border-radius: 3px; display: inline-block; height: 12px; width: 12px; }

/* Navigace na adresu stavby (partial projects/partials/address-nav) -
   kompaktni tlacitka pod adresou; na mobilu se zalamuji pod sebe. */
.address-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.address-nav-text { display: block; }
.address-nav-link {
    align-items: center;
    display: inline-flex;
    font-size: 13px;
    gap: 6px;
    min-height: 34px;
    padding: 5px 12px;
}
.address-nav-link svg { height: 16px; width: 16px; flex: 0 0 auto; }
@media (max-width: 520px) {
    .address-nav { gap: 6px; }
    .address-nav-link { flex: 1 1 auto; justify-content: center; }
}

/* Panely mimo formular navazane na krok pruvodce (data-wizard-step) -
   `hidden` musi prebit i tridy s vlastnim display. */
[data-wizard-step][hidden] { display: none !important; }

/* Den, kde je zaroven prace i nepracovni den (prekazka v praci): teplotni
   barva zustava, prekazku hlasi rozek dlazdice vlevo dole. */
.cal-year-day.has-stoppage { position: relative; }
.cal-year-day.has-stoppage::before {
    border-color: transparent transparent var(--stoppage-color, #4a90d9) transparent;
    border-style: solid;
    border-width: 0 0 7px 7px;
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
}

/* O aplikaci: overeni aktualizaci sedi hned vedle cisla verze (uzivatelsky
   pokyn 2026-09-14). Odsazeni doprava (margin-left: auto) je pryc - tlacitko
   ma patrit k verzi, ne k pravemu okraji tabulky. Vzhled tlacitka resi
   stylopis stranky admin/updates/index.blade.php. */
.update-version-row { align-items: center; display: flex; flex-wrap: wrap; gap: 8px 12px; }
