/* SVJ Manažer Online - Styly */

:root {
    --bg: #eef5fb;
    --bg-strong: #dfeaf6;
    --surface: rgba(255, 255, 255, 0.88);
    --surface-strong: #ffffff;
    --text: #1f2937;
    --muted: #5f6b7a;
    --line: rgba(31, 41, 55, 0.1);
    --accent: #0b4f79;
    --accent-soft: #c7def0;
    --ink: #102033;
    --shadow: 0 24px 70px rgba(9, 111, 172, 0.16);
    --radius-xl: 30px;
    --radius-lg: 24px;
    --radius-md: 18px;
    --primary: #096fac;
    --primary-dark: #298fcc;
    --primary-soft: #d8ecf9;
    --danger: #dc2626;
    --danger-dark: #b91c1c;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
    --radius: 6px;
}

html {
    overflow-y: scroll;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(41, 143, 204, 0.20), transparent 34%),
        radial-gradient(circle at 80% 10%, rgba(9, 111, 172, 0.16), transparent 30%),
        linear-gradient(180deg, #c7dfee 0%, #d9eaf6 42%, #f4f9fd 100%);
    background-attachment: fixed;
    background-size: 100% 100vh;
    min-width: 320px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.app-body {
    position: relative;
}

.app-body::before,
.app-body::after {
    content: "";
    position: fixed;
    border-radius: 50%;
    filter: blur(30px);
    pointer-events: none;
    z-index: -1;
}

.app-body::before {
    top: 8rem;
    left: -5rem;
    width: 18rem;
    height: 18rem;
    background: rgba(41, 143, 204, 0.16);
}

.app-body::after {
    right: -7rem;
    top: 48rem;
    width: 22rem;
    height: 22rem;
    background: rgba(9, 111, 172, 0.12);
}

/* Header */
.main-header {
    color: var(--ink);
    padding: 0;
    box-shadow: 0 8px 32px rgba(16, 32, 51, 0.18);
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(12px);
    background: rgba(239, 246, 252, 0.76);
    border-bottom: 1px solid rgba(9, 111, 172, 0.08);
}

.header-shell {
    display: grid;
    grid-template-columns: auto minmax(260px, 1fr) auto;
    grid-template-areas:
        "top selector user"
        "nav nav nav";
    align-items: center;
    gap: 14px 18px;
    padding-top: 14px;
    padding-bottom: 14px;
}

.header-top {
    grid-area: top;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 14px 18px;
    width: auto;
    flex: 0 1 auto;
    min-width: 0;
}

.header-nav {
    grid-area: nav;
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    /* padding-bottom: 14px; */
    flex-wrap: wrap;
}

.header-meta {
    display: contents;
}

.logo {
    display: flex;
    align-items: center;
    align-self: center;
    font-size: 1rem;
    font-weight: 700;
    font-family: "Sora", "Manrope", sans-serif;
}

.logo a {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
    color: var(--ink);
    text-decoration: none;
}

.logo img {
    display: block;
    transform: translateY(-1px);
    /* border-radius: 12px;
    box-shadow: 0 8px 20px rgba(9, 111, 172, 0.18); */
}

.logo-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    justify-content: center;
    transform: translateY(1px);
}

.logo-title {
    display: block;
    font-family: "Sora", "Manrope", sans-serif;
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.15;
}

.logo-subtitle {
    display: none;
    /* display: block;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.2; */
}

.mobile-nav-logout {
    display: none;
}

.demo-badge,
.demo-login-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    background: rgba(180, 83, 9, 0.12);
    color: #9a3412;
    border: 1px solid rgba(180, 83, 9, 0.22);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* House selector */
.dum-selector {
    grid-area: selector;
    flex-shrink: 0;
    margin-left: 0;
    margin-right: 0;
    align-self: center;
}

.dum-selector select {
    padding: 8px 30px 8px 14px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    border: 1px solid rgba(9, 111, 172, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%230b4f79'/%3E%3C/svg%3E") no-repeat right 12px center;
    color: var(--ink);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    text-align: left;
    box-shadow: 0 10px 24px rgba(16, 32, 51, 0.06);
}

.dum-selector select:focus {
    outline: none;
    border-color: rgba(9, 111, 172, 0.3);
    box-shadow: 0 0 0 4px rgba(9, 111, 172, 0.12);
}

.dum-selector select option {
    color: var(--gray-900);
    background: #fff;
}

/* Hamburger button – hidden on desktop */
.hamburger {
    display: none;
    position: relative;
    width: 3rem;
    height: 3rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 10px 30px rgba(16, 32, 51, 0.08);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.hamburger span {
    position: absolute;
    width: 1rem;
    height: 2px;
    background: var(--ink);
    border-radius: 999px;
    transition: transform 0.25s, opacity 0.25s;
}

.hamburger span:first-child {
    transform: translateY(-4px);
}

.hamburger span:last-child {
    transform: translateY(4px);
}

.hamburger.open span:first-child {
    transform: rotate(45deg);
}

.hamburger.open span:last-child {
    transform: rotate(-45deg);
}

.main-nav {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    align-items: center;
}

.main-nav a {
    color: var(--muted);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 999px;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
    font-weight: 700;
}

.main-nav a:hover {
    background: rgba(255, 255, 255, 0.72);
    color: var(--primary);
    transform: translateY(-1px);
}

.main-nav a.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 12px 28px rgba(9, 111, 172, 0.24);
}

/* Main content */
main.container {
    padding-top: 30px;
    padding-bottom: 40px;
}

/* Page header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.page-header h2 {
    font-size: clamp(1.5rem, 2.4vw, 1.5rem);
    font-family: "Sora", "Manrope", sans-serif;
    color: var(--ink);
}

.subtitle {
    font-size: 1rem;
    font-weight: 400;
    color: var(--gray-500);
}

.dashboard-date {
    color: var(--primary);
    font-size: 1.25rem;
    font-weight: 700;
    text-align: right;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid rgba(9, 111, 172, 0.1);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    color: var(--ink);
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    line-height: 1.4;
    box-shadow: 0 10px 24px rgba(16, 32, 51, 0.06);
}

.btn:hover {
    background: #fff;
    border-color: rgba(9, 111, 172, 0.22);
    transform: translateY(-1px);
}

.btn:disabled,
.btn[disabled] {
    cursor: not-allowed;
    opacity: 0.58;
    transform: none;
    box-shadow: none;
}

.btn:disabled:hover,
.btn[disabled]:hover {
    background: rgba(255, 255, 255, 0.78);
    color: var(--ink);
    border-color: rgba(9, 111, 172, 0.1);
    transform: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 12px 28px rgba(9, 111, 172, 0.24);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-primary:disabled:hover,
.btn-primary[disabled]:hover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    border-color: var(--primary);
}

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

.btn-danger:hover {
    background: var(--danger);
    color: #fff;
}

.btn-danger:disabled:hover,
.btn-danger[disabled]:hover {
    background: rgba(255, 255, 255, 0.78);
    color: var(--danger);
    border-color: var(--danger);
}

.btn-sm {
    padding: 4px 10px;
    font-size: 13px;
}

.btn[data-mobile-icon]::after {
    content: none;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 14px 32px rgba(16, 32, 51, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.8);
    /* backdrop-filter: blur(14px); */
}

.data-table thead {
    background: var(--gray-100);
}

.data-table th,
.data-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.data-table th.table-select-cell,
.data-table td.table-select-cell {
    width: 42px;
    padding-left: 12px;
    padding-right: 8px;
    text-align: center;
}

.table-select-cell input[type="checkbox"],
.mobile-row-select input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--primary);
    cursor: pointer;
}

.data-table th {
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--gray-500);
}

.data-table tbody tr:hover {
    background: var(--gray-50);
}

.data-table tbody tr.vazba-neplatna {
    background: var(--gray-50);
    color: var(--gray-500);
}

.data-table tbody tr.vazba-neplatna:hover {
    background: var(--gray-100);
}

.data-table tbody tr.vazba-neplatna a {
    color: var(--gray-500);
}

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

.data-table tbody tr.clickable-row:hover {
    background: var(--gray-100);
}

.data-table tbody tr.is-selected,
.data-table tbody tr.is-selected:hover,
.data-table tbody tr.vazba-neplatna.is-selected,
.data-table tbody tr.vazba-neplatna.is-selected:hover {
    background: var(--primary-soft);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table th.rizeni-name-col,
.data-table td.rizeni-name-col {
    min-width: 120px;
    width: 16%;
}

.data-table td.rizeni-name-col strong {
    white-space: nowrap;
}

.table-actions {
    white-space: nowrap;
    text-align: right;
}

.table-actions .btn-sm {
    margin-left: 4px;
}

.row-overdue {
    background: #fef2f2;
}

.row-overdue:hover {
    background: #fee2e2 !important;
}

.row-upcoming {
    background: #fffbeb;
}

.row-upcoming:hover {
    background: #fef3c7 !important;
}

.row-priority-high {
    border-left: 3px solid var(--danger);
}

.stav-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.stav-nevyreseno {
    background: #fef2f2;
    color: #991b1b;
}

.stav-probiha {
    background: #eff6ff;
    color: #1e40af;
}

.stav-vyreseno {
    background: #f0fdf4;
    color: #166534;
}

.stav-zamitnuto {
    background: var(--gray-100);
    color: var(--gray-500);
}

.stav-odlozeno {
    background: #fffbeb;
    color: #92400e;
}

.priorita-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.priorita-nizka {
    background: #f0fdf4;
    color: #166534;
}

.priorita-normalni {
    background: #eff6ff;
    color: #1e40af;
}

.priorita-vysoka {
    background: #fef2f2;
    color: #991b1b;
}

.typ-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.typ-byt {
    background: #eff6ff;
    color: #1e40af;
}

.typ-garaz {
    background: #fef3c7;
    color: #92400e;
}

.typ-nebyt {
    background: var(--gray-100);
    color: var(--gray-700);
}

.vazba-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.vazba-vlastnik {
    background: #f0fdf4;
    color: #166534;
}

.vazba-zastupce {
    background: #f0fdfa;
    color: #115e59;
}

.vazba-spolubydlici {
    background: #eff6ff;
    color: #1e40af;
}

.vazba-najemnik {
    background: #fff7ed;
    color: #9a3412;
}

.vazba-vylucne {
    background: #f5f3ff;
    color: #5b21b6;
}

.vazba-spravce {
    background: #eef2ff;
    color: #3730a3;
}

.vazba-nezapsany {
    background: #fffbeb;
    color: #92400e;
}

.osoba-name-with-flag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    vertical-align: middle;
}

.osoba-problem-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #dc2626;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    flex: 0 0 18px;
    box-shadow: 0 0 0 2px #fee2e2;
}

.vazba-neplatna .typ-badge,
.vazba-neplatna .vazba-badge {
    background: var(--gray-100);
    color: var(--gray-500);
}

.vazba-badge-mini {
    padding: 1px 4px;
    font-size: 10px;
    line-height: 1.2;
    border-radius: 6px;
    vertical-align: middle;
    margin-right: 1px;
}

.actions-col {
    white-space: nowrap;
    text-align: right;
}

.actions-col .btn-sm {
    margin-left: 4px;
}

/* Forms */
.form-section {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 14px 32px rgba(16, 32, 51, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.8);
    padding: 24px 28px;
    margin-bottom: 20px;
    /* backdrop-filter: blur(14px); */
}

.form-section h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
    margin: 0 0 14px 0;
    /* padding-bottom: 8px; */
    /* border-bottom: 1px solid var(--gray-200); */
    font-family: "Sora", "Manrope", sans-serif;
}

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

.form-fieldset {
    border: 0;
    margin: 0;
    min-width: 0;
    padding: 0;
}

.form-group {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.62);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    border: 1px solid rgba(9, 111, 172, 0.08);
}

.form-group-full {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.15s;
    background: #fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group textarea {
    resize: vertical;
}

.form-inline-action {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.form-inline-action input {
    min-width: 0;
}

.entity-registry-load-btn {
    white-space: nowrap;
}

.house-registry-load-btn {
    align-self: flex-start;
    margin-top: 8px;
}

.house-registry-status,
.entity-registry-status {
    gap: 10px;
    background: #f8fafc;
    border-color: rgba(9, 111, 172, 0.18);
    color: var(--gray-700);
    font-size: 14px;
    line-height: 1.45;
}

.house-registry-status.is-error,
.entity-registry-status.is-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: var(--danger-dark);
}

.house-registry-status.is-success,
.entity-registry-status.is-success {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.house-registry-status-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px 14px;
    margin-top: 2px;
}

.house-registry-status-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.house-registry-status-label {
    color: var(--gray-500);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.house-registry-status a {
    color: inherit;
    font-weight: 700;
}

.form-actions {
    margin-top: 24px;
    display: flex;
    gap: 10px;
}

/* Checkbox group */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    padding: 10px 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 400;
    font-size: 14px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.empty-hint {
    color: var(--gray-500);
    font-size: 13px;
    font-style: italic;
}

/* Dashboard */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.card {
    background: var(--surface);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: 0 14px 32px rgba(16, 32, 51, 0.08);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.8);
    /* backdrop-filter: blur(14px); */
}

.card h3 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--gray-500);
    margin-bottom: 8px;
}

.card-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--gray-500);
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 14px 32px rgba(16, 32, 51, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.8);
    /* backdrop-filter: blur(14px); */
}

.mono {
    font-family: "IBM Plex Mono", "Fira Code", monospace;
    font-size: 0.92em;
}

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

.access-denied-page {
    min-height: min(560px, calc(100vh - 260px));
    display: grid;
    place-items: center;
    padding: 48px 0;
}

.access-denied-panel {
    width: min(100%, 680px);
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.84);
    border-left: 5px solid var(--primary);
    border-radius: var(--radius-lg);
    box-shadow: 0 18px 44px rgba(16, 32, 51, 0.12);
    padding: 34px 38px;
}

.access-denied-status {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 4px 11px;
    margin-bottom: 18px;
    border-radius: var(--radius);
    background: rgba(9, 111, 172, 0.1);
    color: var(--primary);
    font-weight: 800;
    font-size: 13px;
}

.access-denied-panel h2 {
    margin: 0 0 12px;
    color: var(--ink);
    font-size: 1.8rem;
}

.access-denied-message {
    max-width: 58ch;
    color: var(--gray-700);
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.access-denied-detail {
    max-width: 64ch;
    color: var(--muted);
    margin-bottom: 0;
}

.access-denied-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

@media (max-width: 640px) {
    .access-denied-page {
        min-height: auto;
        padding: 28px 0;
        place-items: start;
    }

    .access-denied-panel {
        padding: 26px 22px;
    }

    .access-denied-panel h2 {
        font-size: 1.45rem;
    }

    .access-denied-actions {
        flex-direction: column;
    }

    .access-denied-actions .btn {
        width: 100%;
        text-align: center;
    }
}

/* Detail view - Varianta A: karty se sekcemi */
.detail-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 14px 32px rgba(16, 32, 51, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.8);
    /* border-top: 1px solid var(--gray-300);
    border-right: 1px solid var(--gray-300);
    border-bottom: 1px solid var(--gray-300); */
    padding: 24px 28px;
    margin-bottom: 20px;
    /* backdrop-filter: blur(14px); */
}

.backup-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
}

.backup-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 10px;
    border-radius: var(--radius);
    background: rgba(9, 111, 172, 0.08);
    color: var(--gray-600);
    font-size: 13px;
}

.backup-health-status,
.backup-offsite-status,
.backup-restore-help {
    margin-top: 14px;
    padding: 14px 16px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.62);
}

.backup-health-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}

.backup-offsite-status {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}

.backup-offsite-status > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.backup-badge,
.backup-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 24px;
    padding: 3px 9px;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

.backup-pill {
    background: rgba(9, 111, 172, 0.1);
    color: var(--primary-dark);
}

.badge-ok {
    background: #dcfce7;
    color: #166534;
}

.badge-warning {
    background: #ffedd5;
    color: #9a3412;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-muted {
    background: var(--gray-100);
    color: var(--gray-600);
}

.backup-restore-help summary,
.backup-restore-details summary {
    cursor: pointer;
}

.backup-restore-help ol {
    margin: 12px 0 0 20px;
    color: var(--gray-600);
}

.backup-table-wrap {
    overflow-x: auto;
    margin-top: 16px;
}

.backup-upload-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
    margin-top: 14px;
    padding: 14px 16px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.62);
}

.backup-upload-form label {
    display: grid;
    gap: 5px;
    min-width: min(100%, 320px);
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-600);
}

.backup-upload-form input[type="file"] {
    width: 100%;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    background: var(--surface);
    font-size: 13px;
}

.backup-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
}

.backup-actions .inline-form {
    display: inline-flex;
}

.backup-restore-details {
    position: relative;
}

.backup-restore-details summary {
    list-style: none;
}

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

.backup-restore-form {
    display: grid;
    gap: 10px;
    min-width: 260px;
    margin-top: 8px;
    padding: 12px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: 0 14px 32px rgba(16, 32, 51, 0.12);
}

.backup-restore-form label {
    display: grid;
    gap: 4px;
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-600);
}

.backup-restore-form input {
    width: 100%;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
}

.detail-card h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 14px;
    margin-top: 0;
    padding-top: 0;
    /* padding-bottom: 8px; */
    border-top: none;
    /* border-bottom: 1px solid var(--gray-200); */
    font-family: "Sora", "Manrope", sans-serif;
}

.detail-card h3.detail-card-first-heading {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.log-detail {
    white-space: pre-wrap;
    word-break: break-word;
    max-width: 48rem;
    font-size: 0.92rem;
    line-height: 1.45;
}

.settings-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.settings-tab-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    color: var(--primary);
    background: #fff;
    border: 1px solid var(--gray-300);
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.settings-tab-link:hover {
    background: var(--gray-50);
    border-color: var(--primary);
}

.settings-tab-link.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.settings-card-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
    position: relative;
    padding-right: 2rem;
    margin-bottom: 0;
}

.settings-card-toggle h3 {
    flex: 1;
    margin-bottom: 0;
}

.settings-card-toggle::after {
    content: "+";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-52%);
    font-size: 1.5rem;
    line-height: 1;
    color: var(--primary);
}

.settings-card-toggle[aria-expanded="true"]::after {
    content: "−";
}

.settings-card-toggle[aria-expanded="true"] {
    margin-bottom: 16px;
}

.settings-section[hidden] {
    display: none !important;
}

[hidden] {
    display: none !important;
}

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

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--gray-100);
    border-radius: var(--radius);
    padding: 12px 16px;
}

.detail-item-full {
    grid-column: 1 / -1;
    margin-top: 0;
}

.detail-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
}

.detail-value {
    font-size: 15px;
    font-weight: 500;
    color: var(--gray-900);
    min-height: 1.4em;
}

.detail-preformatted {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font: 13px/1.5 "IBM Plex Mono", "Fira Code", monospace;
}

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

.detail-value a:hover {
    text-decoration: underline;
}

.detail-value a.btn {
    color: var(--ink);
    text-decoration: none;
}

.detail-value a.btn:hover {
    text-decoration: none;
}

.detail-value a.btn-primary,
.detail-value a.btn-primary:hover {
    color: #fff;
}

.detail-value a.btn-danger {
    color: var(--danger);
}

.detail-value a.btn-danger:hover {
    color: #fff;
}

.detail-actions {
    margin-top: 16px;
}

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

.dum-main-column,
.dum-insights-column {
    min-width: 0;
}

.dum-insights-column {
    display: flex;
    flex-direction: column;
}

.detail-card-insight {
    background: color-mix(in srgb, var(--primary-dark) 14%, #ffffff);
    border: 1px solid color-mix(in srgb, var(--primary-dark) 22%, #ffffff);
    box-shadow: 0 18px 44px rgba(9, 111, 172, 0.16);
}

.pinboard-card {
    overflow: hidden;
}

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

.pinboard-header h3 {
    margin: 0 0 3px;
}

.pinboard-header p {
    margin: 0;
    color: var(--gray-500);
    font-size: 0.92rem;
}

.pinboard-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.pinboard-board {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 16px;
    padding: 0;
}

.pinboard-empty {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 18px;
    border-radius: var(--radius-md);
    border: 1px dashed rgba(9, 111, 172, 0.22);
    background: rgba(255, 255, 255, 0.62);
    color: var(--gray-500);
}

.pinboard-empty strong {
    color: var(--ink);
}

.pin-note {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 170px;
    padding: 20px 16px 14px;
    border-radius: var(--radius);
    box-shadow: 0 14px 24px rgba(44, 34, 22, 0.18);
    color: #1f2937;
    transform: rotate(-0.5deg);
}

.pin-note:nth-child(2n) {
    transform: rotate(0.7deg);
}

.pin-note:nth-child(3n) {
    transform: rotate(-0.2deg);
}

.pin-note.is-pinned {
    box-shadow: 0 18px 30px rgba(44, 34, 22, 0.24);
}

.pin-note-link,
.pin-note-link:link,
.pin-note-link:visited,
.pin-note-link:hover,
.pin-note-link:focus,
.pin-note-link:active {
    color: #1f2937;
    text-decoration: none;
}

.pin-note-link {
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.pin-note-link:hover,
.pin-note-link:focus {
    box-shadow: 0 18px 32px rgba(44, 34, 22, 0.24);
}

.pin-note-zluta { background: #fff3a6; }
.pin-note-modra { background: #c7e7ff; }
.pin-note-zelena { background: #c9f3d7; }
.pin-note-ruzova { background: #ffd1dc; }
.pin-note-seda { background: #f3f4f6; }

.pin-note-pin {
    position: absolute;
    top: 7px;
    left: 50%;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #ffffff 0 16%, #ef4444 18% 62%, #991b1b 100%);
    box-shadow: 0 2px 5px rgba(44, 34, 22, 0.28);
    transform: translateX(-50%);
}

.pin-note-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.pin-note h4 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.25;
    font-family: "Sora", "Manrope", sans-serif;
}

.pin-note-badge {
    flex: 0 0 auto;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.58);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pin-note-body {
    flex: 1;
    font-size: 0.8rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.pin-note-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(31, 41, 55, 0.12);
    color: rgba(31, 41, 55, 0.66);
    font-size: 0.74rem;
    font-weight: 700;
}

.note-color-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.note-color-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 8px 12px;
    border: 1px solid rgba(9, 111, 172, 0.12);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.68);
    cursor: pointer;
    font-weight: 700;
}

.note-color-option input {
    accent-color: var(--primary);
}

.note-color-swatch {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 1px solid rgba(31, 41, 55, 0.14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.note-color-option-zluta .note-color-swatch { background: #fff3a6; }
.note-color-option-modra .note-color-swatch { background: #c7e7ff; }
.note-color-option-zelena .note-color-swatch { background: #c9f3d7; }
.note-color-option-ruzova .note-color-swatch { background: #ffd1dc; }
.note-color-option-seda .note-color-swatch { background: #f3f4f6; }

.form-group .pinboard-checkbox {
    min-height: 39px;
    margin: 0;
    text-transform: none;
    letter-spacing: 0;
    color: var(--gray-700);
    font-size: 14px;
}

.note-edit-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 24px;
}

.note-edit-actions-primary,
.note-edit-actions-secondary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.note-edit-actions-secondary {
    justify-content: flex-end;
}

.note-edit-actions form {
    margin: 0;
}

.inline-form {
    display: inline;
    margin: 0;
}

.insight-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.insight-stat-grid-single {
    grid-template-columns: 1fr;
}

.insight-stat-grid-compact .insight-stat-value {
    font-size: 1.3rem;
}

.insight-stat {
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 14px 16px;
}

.insight-stat-link {
    display: block;
    color: inherit;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.insight-stat-link:link,
.insight-stat-link:visited,
.insight-stat-link:hover,
.insight-stat-link:focus,
.insight-stat-link:active {
    color: inherit;
    text-decoration: none;
}

.insight-stat-link:hover,
.insight-stat-link:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.insight-stat-upcoming {
    background: #fffbeb;
    border-color: #fcd34d;
}

.insight-stat-overdue {
    background: #fef2f2;
    border-color: #fca5a5;
}

.insight-stat-full {
    width: 100%;
}

.insight-stat-value {
    display: block;
    font-size: 1.6rem;
    line-height: 1.15;
    font-weight: 700;
    color: var(--gray-900);
}

.insight-stat-label {
    display: block;
    margin-top: 6px;
    color: var(--gray-500);
    font-size: 12px;
}

.insight-metrics {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.insight-alert-group {
    padding-top: 10px;
    /* border-top: 1px solid var(--gray-100); */
}

.insight-alert-group:first-child {
    padding-top: 0;
    border-top: none;
}

.insight-alert-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    font-size: 13px;
    font-weight: 700;
    padding: 0px 5px;
}

.insight-alert-heading strong {
    color: var(--gray-500);
    font-size: 12px;
}

.insight-alert-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: var(--radius);
    background: var(--gray-50);
}

.insight-alert-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    /* padding: 10px 12px; */
    /* border-radius: 14px; */
    /* background: var(--gray-50); */
    text-decoration: none;
    color: inherit;
}

.insight-alert-main {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.insight-alert-meta {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-shrink: 0;
    margin-left: auto;
}

.insight-alert-name {
    color: var(--gray-900);
    font-size: 13px;
    /* font-weight: 600; */
}

.insight-alert-priority {
    flex-shrink: 0;
    padding: 1px 6px;
    border-radius: 10px;
    background: #fef2f2;
    color: #991b1b;
    font-size: 11px;
    font-weight: 500;
    line-height: 16px;
    white-space: nowrap;
}

.insight-alert-date {
    color: var(--gray-500);
    font-size: 12px;
    white-space: nowrap;
}

.insight-metric-row,
.insight-list-item,
.insight-bar-head,
.insight-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.insight-metric-row,
.insight-list-item {
    padding: 10px 0;
    border-top: 1px solid var(--gray-100);
    font-size: 14px;
}

.insight-metric-row:first-child,
.insight-list-item:first-child {
    border-top: none;
    padding-top: 0;
}

.insight-metric-row:last-child,
.insight-list-item:last-child {
    padding-bottom: 0;
}

.insight-metric-row span,
.insight-list-label,
.insight-inline-note {
    font-size: 14px;
}

.insight-list {
    display: flex;
    flex-direction: column;
}

.insight-status-row {
    margin-bottom: 14px;
    align-items: flex-start;
}

.insight-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: var(--gray-100);
    color: var(--gray-700);
}

.insight-badge.is-positive {
    background: #d1fae5;
    color: #065f46;
}

.insight-badge.is-muted {
    background: #e5e7eb;
    color: #4b5563;
}

.insight-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.insight-pie-layout {
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: center;
}

.insight-pie-wrap {
    display: flex;
    justify-content: center;
}

.insight-pie-chart {
    width: 210px;
    height: 210px;
    border-radius: 50%;
    position: relative;
    background-color: #e5e7eb;
}

.insight-pie-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    overflow: visible;
}

.insight-pie-ring,
.insight-pie-segment {
    fill: none;
    stroke-width: 20;
}

.insight-pie-ring {
    stroke: #e5e7eb;
}

.insight-pie-segment {
    stroke-linecap: butt;
}

.insight-pie-hole {
    position: absolute;
    inset: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.insight-pie-value {
    font-size: 1.8rem;
    line-height: 1.1;
    font-weight: 700;
    color: var(--gray-900);
}

.insight-pie-label {
    margin-top: 4px;
    font-size: 12px;
    color: var(--gray-500);
}

.insight-pie-legend {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px 14px;
    width: 100%;
}

.insight-pie-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.insight-pie-swatch {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    flex-shrink: 0;
}

.insight-pie-legend-text {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    width: 100%;
}

.insight-pie-legend-text span {
    font-size: 13px;
    color: var(--gray-700);
    line-height: 1.25;
}

.insight-pie-legend-text strong {
    font-size: 11px;
    color: var(--gray-500);
    font-weight: 600;
    white-space: nowrap;
}

.insight-bar-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.insight-bar-head {
    font-size: 13px;
}

.insight-bar-head strong {
    white-space: nowrap;
}

.insight-bar-track {
    width: 100%;
    height: 10px;
    background: var(--gray-100);
    border-radius: 999px;
    overflow: hidden;
}

.insight-bar-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #0f766e 0%, #14b8a6 100%);
}

.insight-bar-fill-alt {
    background: linear-gradient(90deg, #1d4ed8 0%, #60a5fa 100%);
}

.insight-empty {
    margin: 0;
    color: var(--gray-500);
    font-size: 14px;
}

.insight-sparkline {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 6px;
    align-items: end;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-100);
}

.spark-bar-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: end;
    gap: 6px;
    min-width: 0;
}

.spark-bar {
    width: 100%;
    min-height: 10px;
    border-radius: 999px 999px 4px 4px;
}

.spark-bar.is-positive {
    background: linear-gradient(180deg, #34d399 0%, #059669 100%);
}

.spark-bar.is-negative {
    background: linear-gradient(180deg, #f87171 0%, #dc2626 100%);
}

.spark-label {
    font-size: 10px;
    color: var(--gray-500);
}

.section-title {
    margin-top: 32px;
    margin-bottom: 12px;
    font-size: 1.1rem;
}

/* Footer */
.main-footer {
    border-top: 1px solid rgba(9, 111, 172, 0.1);
    padding: 20px 0;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    margin-top: 40px;
}

/* User info v headeru */
.user-info {
    grid-area: user;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    position: static;
    justify-self: end;
}

.user-name {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.user-role {
    color: var(--gray-500);
    font-size: 12px;
    font-weight: 700;
    padding: 3px 8px;
    border: 1px solid rgba(9, 111, 172, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.62);
}

.btn-logout {
    color: var(--ink);
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 14px;
    border: 1px solid rgba(9, 111, 172, 0.12);
    border-radius: 999px;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 10px 24px rgba(16, 32, 51, 0.06);
}

.btn-logout:hover {
    background: #fff;
    border-color: rgba(9, 111, 172, 0.22);
    transform: translateY(-1px);
}

/* Login page */
.login-body {
    background:
        radial-gradient(circle at top left, rgba(41, 143, 204, 0.18), transparent 28%),
        radial-gradient(circle at 80% 10%, rgba(9, 111, 172, 0.14), transparent 26%),
        linear-gradient(180deg, #f7fbfe 0%, var(--bg) 42%, #edf4fa 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-wrapper {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: var(--surface);
    padding: 36px 32px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.8);
    /* backdrop-filter: blur(20px); */
}

.demo-login-badge {
    margin: 0 auto 18px;
}

.login-logo {
    text-align: center;
    margin-bottom: 16px;
}

.login-title {
    text-align: center;
    font-size: 1.55rem;
    color: var(--ink);
    margin-bottom: 24px;
    font-family: "Sora", "Manrope", sans-serif;
}

.login-subtitle {
    text-align: center;
    color: var(--gray-500);
    font-size: 14px;
    margin-bottom: 24px;
}

.login-field {
    margin-bottom: 16px;
}

.login-field label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: var(--gray-700);
    margin-bottom: 4px;
}

.login-field input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(9, 111, 172, 0.12);
    border-radius: 16px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    background: rgba(255, 255, 255, 0.82);
}

.login-field input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.login-btn {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    margin-top: 8px;
}

.login-alt-action {
    margin-top: 14px;
    text-align: center;
    font-size: 14px;
}

.login-footer {
    text-align: center;
    color: var(--gray-500);
    font-size: 12px;
    margin-top: 20px;
}

/* Alert */
.alert {
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 14px;
    margin-bottom: 16px;
}

.alert-danger {
    background: #fef2f2;
    color: var(--danger);
    border: 1px solid #fecaca;
}

.alert-success {
    background: #ecfdf5;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-warning {
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fdba74;
}

.two-factor-panel {
    display: grid;
    gap: 14px;
}

.two-factor-help {
    margin-bottom: 18px;
    color: var(--gray-600);
}

.two-factor-help p,
.two-factor-help ul,
.two-factor-instructions ol {
    margin-bottom: 10px;
}

.two-factor-help ul,
.two-factor-instructions ol {
    padding-left: 20px;
}

.two-factor-help li,
.two-factor-instructions li {
    margin-bottom: 6px;
}

.two-factor-enabled-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    margin-bottom: 18px;
    padding: 16px 18px;
    border: 1px solid #86efac;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(220, 252, 231, 0.9), rgba(240, 253, 244, 0.72));
    box-shadow: 0 14px 32px rgba(22, 101, 52, 0.08);
}

.two-factor-enabled-main {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    min-width: 0;
}

.two-factor-enabled-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #16a34a;
    color: #fff;
    font-weight: 800;
    line-height: 1;
}

.two-factor-enabled-summary h4,
.two-factor-recovery-codes h4,
.two-factor-action h4 {
    margin: 0 0 6px;
    color: var(--ink);
    font-size: 1rem;
}

.two-factor-enabled-summary p,
.two-factor-action p,
.two-factor-recovery-codes p {
    margin: 0;
    color: var(--gray-700);
}

.two-factor-enabled-meta {
    display: grid;
    justify-items: center;
    min-width: 132px;
    padding: 10px 12px;
    border: 1px solid rgba(22, 101, 52, 0.18);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.74);
    color: #166534;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
}

.two-factor-count {
    display: block;
    color: #14532d;
    font-size: 26px;
    font-weight: 800;
    line-height: 1;
}

.two-factor-setup-block,
.two-factor-instructions {
    padding: 14px 16px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.62);
}

.two-factor-setup-block h4,
.two-factor-instructions h4,
.two-factor-panel form h4 {
    margin: 0 0 8px;
    color: var(--ink);
    font-size: 1rem;
}

.two-factor-secret-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.two-factor-enroll {
    display: grid;
    grid-template-columns: minmax(150px, 220px) 1fr;
    gap: 16px;
    align-items: center;
}

.two-factor-qr {
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(220px, 100%);
    aspect-ratio: 1;
    padding: 10px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: #fff;
}

.two-factor-qr img {
    display: block;
    width: 100%;
    height: auto;
}

.two-factor-secret {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.82);
    color: var(--ink);
    font-family: "IBM Plex Mono", "Fira Code", monospace;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.two-factor-instructions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px 18px;
}

.two-factor-recovery-codes {
    margin-bottom: 18px;
    padding: 14px 16px;
    border: 1px solid #fdba74;
    border-radius: var(--radius-md);
    background: #fff7ed;
}

.two-factor-manage {
    display: grid;
    gap: 16px;
}

.two-factor-action {
    padding: 16px;
    border: 1px solid rgba(9, 111, 172, 0.14);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.66);
}

.two-factor-action-danger {
    border-color: rgba(220, 38, 38, 0.22);
    background: rgba(254, 242, 242, 0.58);
}

.two-factor-action-header {
    margin-bottom: 14px;
}

.two-factor-action .entity-form {
    display: grid;
    gap: 10px;
}

.two-factor-action .form-actions {
    margin-top: 0;
}

.two-factor-recovery-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
    margin-bottom: 18px;
}

.two-factor-recovery-list code {
    display: block;
    padding: 9px 10px;
    border-radius: var(--radius);
    background: var(--gray-100);
    color: var(--ink);
    font-family: "IBM Plex Mono", "Fira Code", monospace;
    font-weight: 700;
    text-align: center;
}

@media (max-width: 640px) {
    .two-factor-enroll {
        grid-template-columns: 1fr;
    }

    .two-factor-enabled-summary {
        grid-template-columns: 1fr;
    }

    .two-factor-enabled-meta {
        justify-items: start;
        width: 100%;
        text-align: left;
    }
}

.field-error {
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.08);
}

/* Inline vazby table */
.inline-vazby-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}

.inline-vazby-table th,
.inline-vazby-table td {
    padding: 6px 8px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
    vertical-align: middle;
}

.inline-vazby-table thead {
    background: var(--gray-100);
}

.inline-vazby-table th {
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--gray-500);
}

.inline-vazby-table select,
.inline-vazby-table input[type="text"],
.inline-vazby-table input[type="date"] {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 13px;
    font-family: inherit;
    min-width: 90px;
}

.inline-vazby-table select:focus,
.inline-vazby-table input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Dynamické seznamy (vchody, patra) */
.dynamic-list-item {
    display: flex;
    gap: 6px;
    margin-bottom: 4px;
    align-items: center;
}

.dynamic-list-item input[type="text"] {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 14px;
}

.dynamic-list-item input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
}

/* Compact dynamic list (vchody, patra) */
.dynamic-list-compact {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.dynamic-list-compact .dynamic-list-item {
    margin-bottom: 0;
}

.dynamic-list-compact .dynamic-list-item input[type="text"] {
    flex: none;
}

/* Settings sections */
.settings-section {
    margin-bottom: 32px;
}

.settings-section h3 {
    font-size: 1.2rem;
}

.theme-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}

.theme-option-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 18px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(9, 111, 172, 0.1);
    cursor: pointer;
}

.theme-option-card input[type="radio"] {
    margin-top: 4px;
    accent-color: var(--primary);
}

.theme-option-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.theme-option-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
}

.theme-option-description {
    color: var(--gray-500);
    line-height: 1.55;
}

/* Search & Filters */
.table-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.table-row-count {
    font-size: 13px;
    color: #6b7280;
    white-space: nowrap;
}

.table-selection-count {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
}

.table-search {
    position: relative;
    flex: 0 1 300px;
    min-width: 180px;
}

.table-search input {
    width: 100%;
    padding: 8px 32px 8px 34px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s;
    background: #fff;
}

.table-search .search-clear-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: var(--gray-300);
    color: #fff;
    font-size: 14px;
    line-height: 20px;
    text-align: center;
    cursor: pointer;
    padding: 0;
    display: none;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.table-search .search-clear-btn:hover {
    background: var(--gray-500);
}

.table-search .search-clear-btn.visible {
    display: flex;
}

.table-search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.table-search::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    background: var(--gray-500);
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat center;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat center;
    pointer-events: none;
}

.table-filter-select {
    padding: 7px 30px 7px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236b7280'/%3E%3C/svg%3E") no-repeat right 10px center;
    color: var(--gray-700);
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color 0.15s;
    min-width: 140px;
}

.table-filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.table-no-results {
    text-align: center;
    padding: 24px;
    color: var(--gray-500);
    display: none;
}

/* ============================================ */
/* View toggle (cards / list)                   */
/* ============================================ */
.view-toggle {
    display: flex;
    gap: 2px;
    margin-left: auto;
    background: var(--gray-100);
    border-radius: var(--radius);
    padding: 2px;
}

.view-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 30px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--gray-500);
    cursor: pointer;
    transition: all 0.15s;
}

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

.view-toggle-btn.active {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.view-toggle-btn svg {
    width: 16px;
    height: 16px;
}

/* ============================================ */
/* Index card grid (Variant B)                  */
/* ============================================ */
.index-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.index-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 14px 32px rgba(16, 32, 51, 0.08);
    /* border: 1px solid rgba(255, 255, 255, 0.8); */
    padding: 20px;
    cursor: pointer;
    transition: box-shadow 0.15s, transform 0.15s;
    text-decoration: none;
    color: inherit;
    display: block;
    /* backdrop-filter: blur(14px); */
    border-top: 3px solid var(--primary);
}

.index-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.index-card.vazba-neplatna {
    background: var(--gray-50);
    border-top-color: var(--gray-300);
}

.index-card.vazba-neplatna:hover {
    background: var(--gray-100);
}

.index-card.vazba-neplatna .index-card-title,
.index-card.vazba-neplatna .index-card-footer,
.index-card.vazba-neplatna .index-card-details strong {
    color: var(--gray-500);
}

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

.index-card-header > :last-child:not(.index-card-title) {
    margin-left: auto;
}

.index-card-header .index-list-badges {
    width: auto;
    flex-shrink: 1;
}

.index-card-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--gray-900);
}

.index-card-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-left: auto;
}

.index-card-details {
    display: flex;
    gap: 16px;
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--gray-500);
}

.index-card-details span {
    display: flex;
    gap: 4px;
}

.index-card-details strong {
    color: var(--gray-700);
    font-weight: 600;
}

.index-card-footer {
    font-size: 13px;
    color: var(--gray-700);
    padding-top: 10px;
    border-top: 1px solid var(--gray-100);
}

.index-card-footer-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.index-card.card-overdue {
    border-top-color: var(--danger);
    background: #fef2f2;
}

.index-card.card-upcoming {
    border-top-color: #f59e0b;
    background: #fffbeb;
}

.index-card.card-active {
    border-top-color: #16a34a;
    background: #f0fdf4;
}

.index-card.card-priority-high {
    border-left: 3px solid var(--danger);
}

/* ============================================ */
/* Index compact list (Variant C)               */
/* ============================================ */
.index-list {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 14px 32px rgba(16, 32, 51, 0.08);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.8);
    /* backdrop-filter: blur(14px); */
}

.index-list-item {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--gray-100);
    cursor: pointer;
    transition: background 0.1s;
    gap: 16px;
    text-decoration: none;
    color: inherit;
}

.index-list-item:last-child {
    border-bottom: none;
}

.index-list-item:hover {
    background: var(--gray-50);
}

.index-list-item.is-selected,
.index-list-item.is-selected:hover,
.index-list-item.vazba-neplatna.is-selected,
.index-list-item.vazba-neplatna.is-selected:hover {
    background: var(--primary-soft);
}

.index-list-item.vazba-neplatna {
    background: var(--gray-50);
}

.index-list-item.vazba-neplatna:hover {
    background: var(--gray-100);
}

.index-list-item.list-overdue {
    background: #fef2f2;
}

.index-list-item.list-overdue:hover {
    background: #fee2e2;
}

.index-list-item.list-income {
    background: #f0fdf4;
}

.index-list-item.list-income:hover {
    background: #dcfce7;
}

.index-list-item.list-active {
    background: #f0fdf4;
}

.index-list-item.list-active:hover {
    background: #dcfce7;
}

.index-list-item.list-upcoming {
    background: #fffbeb;
}

.index-list-item.list-upcoming:hover {
    background: #fef3c7;
}

.index-list-item.list-priority-high {
    border-left: 3px solid var(--danger);
}

.data-table tbody tr.clickable-row.list-overdue {
    background: #fef2f2;
}

.data-table tbody tr.clickable-row.list-overdue:hover {
    background: #fee2e2;
}

.data-table tbody tr.clickable-row.list-income {
    background: #f0fdf4;
}

.data-table tbody tr.clickable-row.list-income:hover {
    background: #dcfce7;
}

.data-table tbody tr.clickable-row.list-active {
    background: #f0fdf4;
}

.data-table tbody tr.clickable-row.list-active:hover {
    background: #dcfce7;
}

.data-table tbody tr.clickable-row.list-upcoming {
    background: #fffbeb;
}

.data-table tbody tr.clickable-row.list-upcoming:hover {
    background: #fef3c7;
}

.index-list-item.is-selected,
.index-list-item.is-selected:hover,
.index-list-item.vazba-neplatna.is-selected,
.index-list-item.vazba-neplatna.is-selected:hover,
.index-list-item.list-overdue.is-selected,
.index-list-item.list-overdue.is-selected:hover,
.index-list-item.list-income.is-selected,
.index-list-item.list-income.is-selected:hover,
.index-list-item.list-active.is-selected,
.index-list-item.list-active.is-selected:hover,
.index-list-item.list-upcoming.is-selected,
.index-list-item.list-upcoming.is-selected:hover {
    background: var(--primary-soft);
}

.data-table tbody tr.clickable-row.is-selected,
.data-table tbody tr.clickable-row.is-selected:hover,
.data-table tbody tr.clickable-row.vazba-neplatna.is-selected,
.data-table tbody tr.clickable-row.vazba-neplatna.is-selected:hover,
.data-table tbody tr.clickable-row.list-overdue.is-selected,
.data-table tbody tr.clickable-row.list-overdue.is-selected:hover,
.data-table tbody tr.clickable-row.list-income.is-selected,
.data-table tbody tr.clickable-row.list-income.is-selected:hover,
.data-table tbody tr.clickable-row.list-active.is-selected,
.data-table tbody tr.clickable-row.list-active.is-selected:hover,
.data-table tbody tr.clickable-row.list-upcoming.is-selected,
.data-table tbody tr.clickable-row.list-upcoming.is-selected:hover {
    background: var(--primary-soft);
}

.index-type-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot-byt { background: #3b82f6; }
.dot-garaz { background: #f59e0b; }
.dot-nebyt { background: #6b7280; }
.dot-overdue { background: var(--danger); }
.dot-upcoming { background: #f59e0b; }
.dot-normal { background: var(--primary); }
.dot-high { background: var(--danger); }

.index-list-main {
    flex: 1;
    min-width: 0;
}

.mobile-row-select {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 18px;
}

.index-list-row1 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.index-list-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-900);
}

.index-list-item.vazba-neplatna .index-list-title,
.index-list-item.vazba-neplatna .index-list-secondary {
    color: var(--gray-500);
}

.index-list-subtitle {
    font-size: 12px;
    color: var(--gray-500);
    margin-left: 8px;
    font-weight: 400;
}

.index-list-location {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: var(--gray-500);
}

.index-list-location.index-list-desktop {
    margin-left: auto;
}

.index-list-mobile-loc {
    display: none;
}

.index-loc {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.index-loc-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.index-list-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--gray-500);
}

.index-list-stats > span {
    display: inline-block;
    width: 70px;
    text-align: right;
}

.index-list-badges {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    width: 180px;
    flex-shrink: 0;
}

.index-list-meta {
    display: flex;
    gap: 16px;
    margin-top: 2px;
    font-size: 13px;
    color: var(--gray-500);
}

.index-list-meta-right {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.index-list-secondary {
    flex: 0 1 300px;
    font-size: 13px;
    color: var(--gray-700);
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.index-list-mobile {
    display: none;
}

.index-list-arrow {
    color: var(--gray-300);
    flex-shrink: 0;
    font-size: 18px;
}

.vazba-neplatna .index-type-dot {
    background: var(--gray-400, #9ca3af);
}

/* Responsive */
@media (max-width: 768px) {
    body.app-body {
        background: #bdd8ed;
        background-attachment: scroll;
        background-repeat: no-repeat;
        background-size: auto;
    }

    .app-body::before,
    .app-body::after {
        display: none;
    }

    .header-shell {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: stretch;
        gap: 8px;
        position: static;
    }

    .header-top {
        flex: 1 0 100%;
        gap: 14px;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }

    .logo {
        order: 1;
        flex: 1 1 auto;
        min-width: 0;
    }

    .hamburger {
        display: inline-flex;
        order: 3;
        flex: 0 0 auto;
        margin-left: 0;
    }

    .demo-badge {
        order: 2;
    }

    .header-nav {
        order: 2;
        flex: 1 0 100%;
        width: 100%;
        padding-bottom: 0;
    }

    .header-meta {
        display: flex;
        order: 3;
        flex: 1 0 100%;
        flex-wrap: wrap;
        position: static;
        width: 100%;
        gap: 12px;
    }

    .user-info {
        display: none;
    }

    .mobile-user-summary {
        display: block;
        color: var(--muted);
        font-size: 0.72rem;
        font-weight: 700;
        line-height: 1.2;
        margin-top: 2px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .dum-selector {
        order: 1;
        margin-left: 0;
        width: 100%;
        margin-right: 0;
    }

    .dum-selector select {
        width: 100%;
    }

    .main-nav {
        display: none;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        position: static;
        width: 100%;
        background: rgba(255, 255, 255, 0.97);
        align-items: stretch;
        justify-content: flex-start;
        gap: 1.15rem;
        padding: 1.5rem 1.7rem;
        margin-top: 6px;
        box-shadow: 0 18px 48px rgba(16, 32, 51, 0.12);
        border-radius: 2rem;
        border: 1px solid rgba(9, 111, 172, 0.12);
        /* backdrop-filter: blur(18px); */
        max-height: min(60vh, 28rem);
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .main-nav.open {
        display: flex;
    }

    .main-nav a {
        display: block;
        width: 100%;
        max-width: 100%;
        flex: 0 0 auto;
        padding: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        font-weight: 500;
        font-size: 1rem;
        color: #5f6b7a;
        white-space: normal;
        word-break: break-word;
    }

    .main-nav a:hover {
        background: transparent;
        transform: none;
        color: var(--primary);
    }

    .main-nav a.active {
        background: transparent;
        color: var(--primary);
        box-shadow: none;
    }

    .main-nav a.mobile-nav-logout {
        display: block;
        color: var(--ink);
        font-weight: 700;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .dashboard-date {
        display: none;
    }

    .data-table {
        display: block;
        overflow-x: auto;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-inline-action {
        grid-template-columns: 1fr;
    }

    .entity-registry-load-btn {
        justify-self: start;
    }
}

/* =============================================
   Pokladna – souhrnné boxy
   ============================================= */

.pokladna-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.pokladna-summary-box {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border-top: 3px solid var(--primary);
    padding: 20px;
}

.pokladna-box-prijem {
    border-top-color: #22c55e;
}

.pokladna-box-vydej {
    border-top-color: #ef4444;
}

.pokladna-box-stav {
    border-top-color: #3b82f6;
}

.pokladna-summary-label {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 8px;
}

.pokladna-summary-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-800);
}

.pokladna-summary-value.pokladna-negative {
    color: #ef4444;
}

/* Pokladna – typ badge */

.pokladna-typ-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.pokladna-typ-prijem {
    background: #dcfce7;
    color: #166534;
}

.pokladna-typ-vydej {
    background: #fee2e2;
    color: #991b1b;
}

/* Pokladna – tabulka */

.pokladna-castka {
    font-weight: 600;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .dum-layout {
        grid-template-columns: 1fr;
    }

    .pinboard-header {
        flex-direction: column;
        align-items: stretch;
    }

    .pinboard-header .btn {
        align-self: flex-start;
    }

    .pinboard-header-actions {
        justify-content: flex-start;
    }

    .pinboard-board {
        grid-template-columns: 1fr;
        padding: 0;
    }

    .pin-note,
    .pin-note:nth-child(2n),
    .pin-note:nth-child(3n) {
        transform: none;
    }

    .note-edit-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .note-edit-actions-primary,
    .note-edit-actions-secondary {
        justify-content: flex-start;
    }

    .insight-stat-grid {
        grid-template-columns: 1fr;
    }

    .insight-status-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .insight-bar-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .insight-pie-chart {
        width: 180px;
        height: 180px;
    }

    .insight-pie-hole {
        inset: 31px;
    }

    .insight-sparkline {
        gap: 4px;
    }

    .index-list-item {
        flex-wrap: wrap;
        padding: 12px 16px;
        gap: 8px;
    }

    .index-list-main {
        flex: 1 1 0;
        min-width: 0;
    }

    .index-list-row1 {
        min-width: 0;
        width: 100%;
    }

    .index-list-row1 > span:first-child {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .index-list-meta {
        display: none;
    }

    .index-list-badges {
        flex: 0 0 auto;
        margin-left: auto;
        width: auto;
        justify-content: flex-end;
    }

    .index-list-secondary {
        flex: 1 1 100%;
        text-align: left;
        white-space: normal;
        padding-left: 20px;
        font-size: 12px;
        color: var(--gray-500);
    }

    .index-list-mobile-loc {
        display: inline-flex;
    }

    .index-list-desktop {
        display: none;
    }

    .index-list-mobile {
        display: block;
    }

    .index-list-arrow {
        display: none;
    }
}

/* ─── Hlasování ──────────────────────────────────────────── */

/* ─── Shromáždění ────────────────────────────────────────── */

.section-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.section-heading-row h3 {
    margin: 0;
}

.agenda-list {
    display: grid;
    gap: 14px;
}

.agenda-item {
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 14px;
    background: var(--white);
}

.agenda-item h4 {
    margin: 0 0 8px;
    font-size: 16px;
}

.agenda-item-content {
    color: var(--gray-700);
    line-height: 1.6;
    white-space: normal;
}

.agenda-item-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.agenda-section,
.agenda-attachments {
    margin-top: 14px;
}

.agenda-section.form-group,
.agenda-attachments.form-group,
.agenda-resolutions.form-group {
    padding: 12px 16px;
    border-top: 1px solid rgba(9, 111, 172, 0.08);
}

.agenda-resolutions {
    margin-top: 14px;
}

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

.resolution-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: var(--gray-50);
}

.resolution-item-link {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.resolution-item-link:hover,
.resolution-item-link:focus-visible {
    border-color: rgba(9, 111, 172, 0.28);
    background: var(--white);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    text-decoration: none;
}

.detail-value a.resolution-item-link:hover,
.detail-value a.resolution-item-link:focus-visible {
    text-decoration: none;
}

.resolution-item-link:focus-visible {
    outline: 2px solid rgba(9, 111, 172, 0.35);
    outline-offset: 2px;
}

.resolution-main {
    flex: 1 1 auto;
    min-width: 0;
}

.resolution-text {
    color: var(--gray-900);
    line-height: 1.45;
}

.resolution-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    margin-top: 8px;
    color: var(--gray-500);
    font-size: 13px;
}

.resolution-status.vysledek-badge {
    padding: 3px 9px;
    font-size: 12px;
    letter-spacing: 0;
    white-space: normal;
}

.resolution-vote-results {
    display: flex;
    flex: 0 0 100%;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
    font-variant-numeric: tabular-nums;
}

.resolution-vote-result.hlas-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    font-size: 11px;
    line-height: 1.2;
    white-space: nowrap;
}

.resolution-vote-result strong {
    font-weight: 700;
}

.resolution-vote-result-ucast {
    background: color-mix(in srgb, var(--primary) 12%, #ffffff);
    color: var(--primary-dark);
}

.resolution-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.resolution-vote-link {
    white-space: nowrap;
}

.resolution-copy-form {
    margin: 0;
}

@media (max-width: 720px) {
    .resolution-item {
        flex-direction: column;
    }

    .resolution-actions {
        align-self: stretch;
        width: 100%;
    }
}

.agenda-section > strong,
.agenda-attachments > strong,
.agenda-resolutions > strong {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--gray-700);
}

.muted-text {
    color: var(--gray-500);
    font-size: 13px;
}

.inline-add-form {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--gray-200);
}

.inline-add-form h4 {
    margin: 0 0 12px;
}

.inline-edit-form {
    margin-top: 14px;
    padding: 14px 16px;
    border: 1px solid rgba(9, 111, 172, 0.12);
    border-radius: 8px;
    background: var(--gray-50);
}

.inline-edit-form h4 {
    margin: 0 0 12px;
}

.inline-add-toggle {
    margin-top: 18px;
}

.attachment-add-toggle {
    margin-top: 12px;
}

.attachment-inline-form {
    margin-top: 12px;
}

.add-bod-prilohy {
    margin-top: 16px;
}

.add-bod-prilohy h4 {
    margin: 0 0 12px;
}

.shromazdeni-bod-prilohy-wrap {
    margin-top: 20px;
}

.shromazdeni-bod-prilohy-wrap > .detail-card {
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.shromazdeni-tabs .settings-tab-link {
    cursor: pointer;
    font: inherit;
}

.shromazdeni-tab-panel[hidden] {
    display: none;
}

@media (max-width: 980px) {
    .shromazdeni-index-layout,
    .shromazdeni-detail-layout {
        grid-template-columns: 1fr;
    }
}

.hlasovani-navigation-item {
    align-items: flex-start;
}

.hlasovani-navigation-meta {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.hlasovani-navigation-badge.vysledek-badge {
    max-width: 190px;
    padding: 2px 7px;
    font-size: 10px;
    line-height: 1.25;
    letter-spacing: 0;
    text-align: right;
}

.agenda-item {
    padding: 0;
    overflow: hidden;
}

.agenda-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    cursor: pointer;
    list-style: none;
}

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

.agenda-summary::before {
    content: "\25B8";
    flex: 0 0 auto;
    color: var(--gray-500);
    transition: transform 0.16s ease;
}

.agenda-item[open] .agenda-summary::before {
    transform: rotate(90deg);
}

.agenda-summary-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.agenda-summary-title {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 700;
    color: var(--gray-900);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agenda-summary-meta {
    flex: 0 0 auto;
    color: var(--gray-500);
    font-size: 12px;
    font-weight: 600;
}

.agenda-summary-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.agenda-summary-actions .btn-sm {
    white-space: nowrap;
}

.usneseni-edit-row td {
    background: var(--gray-50);
}

.usneseni-inline-edit-form {
    margin: 0;
}

.agenda-item-body {
    padding: 0 16px 16px;
    border-top: 1px solid var(--gray-100);
}

/* Výsledky - panel */
.hlasovani-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.hlasovani-layout-row {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 20px;
    align-items: start;
}

.hlasovani-stack-column,
.hlasovani-main-column,
.hlasovani-results-column,
.hlasovani-units-column {
    min-width: 0;
}

.hlasovani-stack-column > .detail-card:last-child,
.hlasovani-main-column > .detail-card,
.hlasovani-results-column > .detail-card,
.hlasovani-units-column > .detail-card {
    margin-bottom: 0;
}

.hlasovani-units-column {
    display: flex;
    flex-direction: column;
}

.hlasovani-units-card {
    margin-bottom: 0;
    overflow: auto;
}

.hlasovani-units-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.hlasovani-units-header h3 {
    margin-bottom: 0;
}

.hlasujici-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.hlasujici-card-header h3 {
    margin-bottom: 0;
}

.hlasovani-units-search {
    margin-bottom: 12px;
    max-width: none;
}

.hlasovani-units-toolbar {
    flex-wrap: nowrap;
    gap: 10px;
    margin-bottom: 12px;
}

.hlasovani-units-toolbar .hlasovani-units-search {
    flex: 1 1 auto;
    min-width: 0;
    margin-bottom: 0;
}

.hlasovani-units-toolbar .checkbox-label {
    flex-shrink: 0;
    white-space: nowrap;
}

.hlasovani-results-column .vysledky-details,
.hlasovani-results-column .vysledky-stats,
.hlasovani-results-column .vysledky-bars {
    max-width: none;
}

.hlasovani-results-column .vysledky-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
}

.hlasovani-unit-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hlasovani-unit-card {
    background: rgba(255, 255, 255, 1);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 4px 6px;
}

.hlasovani-unit-head,
.hlasovani-unit-title,
.hlasovani-unit-meta,
.hlasovani-unit-owner-main,
.hlasovani-unit-owner-meta {
    display: flex;
    align-items: center;
    gap: 6px;
}

.hlasovani-unit-head,
.hlasovani-unit-meta,
.hlasovani-unit-owner-main,
.hlasovani-unit-owner-meta {
    justify-content: space-between;
}

.hlasovani-unit-head {
    align-items: center;
    cursor: pointer;
}

.hlasovani-unit-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 20px;
    border: none;
    background: transparent;
    color: var(--gray-500);
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.hlasovani-unit-toggle:hover,
.hlasovani-unit-toggle:focus {
    background: var(--gray-200);
    color: var(--gray-700);
    outline: none;
}

.hlasovani-unit-toggle .expander-icon {
    transition: transform 0.2s ease;
}

.hlasovani-unit-toggle[aria-expanded="true"] .expander-icon {
    transform: rotate(90deg);
}

.hlasovani-unit-title {
    min-width: 0;
    flex-wrap: wrap;
    flex: 1;
}

.hlasovani-unit-title strong {
    color: var(--gray-900);
    font-size: 13px;
}

.hlasovani-unit-title .typ-badge {
    padding: 0 6px;
    font-size: 11px;
}

.hlasovani-unit-head .hlas-badge {
    padding: 2px 8px;
    font-size: 11px;
}

.hlasovani-unit-meta,
.hlasovani-unit-owner-meta,
.hlasovani-unit-result {
    color: var(--gray-500);
    font-size: 12px;
}

.hlasovani-unit-meta {
    margin-top: 6px;
    padding: 0px 4px 0px 28px;
}

.hlasovani-unit-result {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 6px;
    padding: 0px 4px 0px 28px;
    /* background: var(--gray-50); */
    border-radius: var(--radius);
}

.hlasovani-unit-result strong {
    color: var(--gray-900);
    font-size: 13px;
    line-height: 1.35;
}

.hlasovani-unit-result small {
    color: #854d0e;
    font-size: 12px;
}

.hlasovani-unit-card.is-collapsed .hlasovani-unit-meta,
.hlasovani-unit-card.is-collapsed .hlasovani-unit-result {
    display: none;
}

.hlasovani-unit-body {
    margin: 6px -6px -4px;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    padding: 4px 10px 4px 34px;
}

.hlasovani-unit-owners {
    display: flex;
    flex-direction: column;
}

.hlasovani-unit-owner {
    padding: 3px 0;
    font-size: 12px;
}

.hlasovani-unit-owner:not(:last-child) {
    border-bottom: 1px solid var(--gray-200);
}

.hlasovani-unit-owner-name {
    min-width: 0;
    color: var(--gray-900);
    font-size: 12px;
    font-weight: 600;
}

.hlasovani-unit-owner-meta {
    margin-top: 1px;
}

.hlasovani-unit-empty {
    margin: 10px 0 0;
    color: var(--gray-500);
    font-size: 13px;
}

@media (max-width: 640px) {
    .hlasovani-layout-row {
        grid-template-columns: 1fr;
    }

    .hlasovani-units-card {
        position: static;
        height: auto;
        max-height: none;
    }
}

.vysledky-panel {
    background: color-mix(in srgb, var(--primary-dark) 14%, #ffffff);
    border: 1px solid color-mix(in srgb, var(--primary-dark) 22%, #ffffff);
    box-shadow: 0 18px 44px rgba(9, 111, 172, 0.16);
}

.vysledky-hlavni {
    margin-bottom: 16px;
    text-align: center;
}

/* Výsledky - expander podrobnosti */
.vysledky-details {
    max-width: 600px;
    margin: 12px auto 0;
}

.vysledky-details summary {
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
    text-align: center;
    padding: 6px 0;
    list-style: none;
    user-select: none;
}

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

.vysledky-details summary::before {
    content: "\25B8\00a0";
}

.vysledky-details[open] summary::before {
    content: "\25BE\00a0";
}

.vysledky-details summary:hover {
    color: var(--primary);
}

/* Výsledky - statistiky */
.vysledky-stats {
    margin-top: 12px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.vysledky-stats-grid {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 10px 20px;
    min-width: 100px;
}

.stat-card-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.stat-card-total {
    font-size: 0.9rem;
    color: var(--gray-500);
    font-weight: 600;
}

.stat-card-label {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 2px;
}

.stat-card-warn {
    color: #ca8a04;
}

.vysledky-stats-votes {
    margin-top: 12px;
}

.stats-vote-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: center;
}

.stats-vote-table th {
    padding: 4px 10px;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 2px solid var(--gray-200);
}

.stat-col-pro { color: #16a34a; }
.stat-col-proti { color: #dc2626; }
.stat-col-zdrzel { color: #ca8a04; }
.stat-col-neplatny { color: var(--gray-500); }

.stats-vote-table td {
    padding: 6px 10px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.stats-vote-table tbody tr:first-child td { border-bottom: 1px solid var(--gray-100); }

.stats-vote-label {
    text-align: right !important;
    font-weight: 500 !important;
    color: var(--gray-500);
}

.vysledek-badge {
    display: inline-block;
    padding: 8px 24px;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.vysledek-pro { background: #16a34a; color: #fff; }
.vysledek-proti { background: #dc2626; color: #fff; }
.vysledek-zdržel { background: #ca8a04; color: #fff; }
.vysledek-neprijato { background: #dc2626; color: #fff; }
.vysledek-neplatný { background: #6b7280; color: #fff; }

.data-table .vysledek-badge {
    padding: 3px 10px;
    font-size: 12px;
    white-space: nowrap;
}

/* Výsledky - progress bary */
.vysledky-bars {
    max-width: 600px;
    margin: 0 auto;
}

.vysledky-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.vysledky-bar-label {
    width: 92px;
    font-size: 13px;
    text-align: right;
    color: var(--gray-700);
}

.vysledky-bar-track {
    flex: 1;
    height: 22px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.vysledky-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
    min-width: 0;
}

.bar-ucast { background: var(--primary); }
.bar-pro { background: #16a34a; }
.bar-proti { background: #dc2626; }
.bar-zdrzel { background: #ca8a04; }
.bar-neplatny { background: #6b7280; }
.bar-nehlasoval { background: #9ca3af; }

.vysledky-bar-value {
    width: 90px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.status-ok { color: #16a34a; font-weight: 700; }
.status-fail { color: #dc2626; font-weight: 700; }

/* Skupiny osob (hlasování) */
.osoba-group {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: 4px;
    overflow: hidden;
}

.osoba-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 6px;
    background: #fff;
    font-size: 13px;
    flex-wrap: wrap;
    gap: 4px;
    border-bottom: 1px solid transparent;
    cursor: pointer;
}

.osoba-group:hover .osoba-header {
    background: var(--gray-50);
}

.osoba-header-left {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.osoba-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.osoba-expander {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--gray-500);
    border-radius: 4px;
    transition: all 0.15s;
    flex-shrink: 0;
    padding: 0;
}

.osoba-expander:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

.osoba-expander .expander-icon {
    transition: transform 0.2s ease;
}

.osoba-expander[aria-expanded="true"] .expander-icon {
    transform: rotate(90deg);
}

.osoba-jmeno {
    font-weight: 600;
    font-size: 13px;
    min-width: 0;
}

.osoba-jmeno small {
    color: var(--gray-500);
    font-size: 12px;
    font-weight: 400;
}

.osoba-jednotky-count {
    font-size: 11px;
    color: var(--gray-500);
    background: var(--gray-100);
    padding: 0 6px;
    border-radius: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

.checkbox-pritomen {
    font-size: 12px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 3px;
}

/* Rozbalené jednotky osoby */
.osoba-jednotky {
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    padding: 4px 12px 4px 32px;
}

.osoba-jednotka-item {
    /* display: flex; */
    align-items: center;
    gap: 6px;
    padding: 3px 0;
    font-size: 12px;
}

.jednotka-row1,
.jednotka-row2 {
    display: flex;
    align-items: center;
    gap: 6px;
}

.jednotka-row1 {
    flex: 0 0 160px;
}

.jednotka-row2 {
    flex: 1;
    align-items: flex-start;
}

.jednotka-row2 .hlas-badge {
    margin-left: auto;
    flex-shrink: 0;
}

.osoba-jednotka-item:not(:last-child) {
    border-bottom: 1px solid var(--gray-200);
}

.jednotka-cislo {
    font-weight: 600;
    color: var(--gray-900);
}

.jednotka-podil {
    /* font-weight: 400;
    color: var(--gray-500);
    font-size: 12px; */
    display: inline-block;
    /* background: var(--gray-200);
    padding: 1px 6px;
    border-radius: 3px; */
    font-size: 12px;
    color: var(--gray-700);
}

.jednotka-detail-values {
    display: flex;
    flex: 1;
    flex-wrap: wrap;
    gap: 4px 8px;
    min-width: 0;
}

.jednotka-detail-label {
    font-weight: 600;
}

.podil-info {
    display: inline-block;
    /* background: var(--gray-200);
    padding: 1px 6px;
    border-radius: 3px; */
    font-size: 12px;
    color: var(--gray-700);
}

.spoluvlastnici-info {
    flex-basis: 100%;
    font-size: 12px;
    color: var(--gray-500);
    white-space: normal;
    overflow-wrap: anywhere;
}

.osoba-jednotky-empty {
    color: var(--gray-500);
    font-size: 13px;
    font-style: italic;
    padding: 4px 0;
}

/* Hlasovací tlačítka */
.hlas-buttons {
    display: flex;
    gap: 4px;
}

.hlas-btn {
    padding: 2px 10px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    background: #fff;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.15s;
    line-height: 1.4;
}

.hlas-btn:hover:not(:disabled) {
    background: var(--gray-100);
}

.hlas-btn.active.hlas-pro {
    background: #16a34a;
    color: #fff;
    border-color: #16a34a;
}

.hlas-btn.active.hlas-proti {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
}

.hlas-btn.active.hlas-zdrzel {
    background: #ca8a04;
    color: #fff;
    border-color: #ca8a04;
}

.hlas-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* Badge hlasu jednotky */
.hlas-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--radius);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.hlas-pro { background: #dcfce7; color: #166534; }
.hlas-proti { background: #fef2f2; color: #991b1b; }
.hlas-zdrzel, .hlas-zdržel { background: #fefce8; color: #854d0e; }
.hlas-neplatny, .hlas-neplatný { background: var(--gray-200); color: var(--gray-700); }
.hlas-none { background: var(--gray-100); color: var(--gray-500); }

/* Badge režimu hlasování */
.typ-badge-rollam {
    background: #dbeafe;
    color: #1e40af;
}

.typ-badge-pritomni {
    background: #dcfce7;
    color: #166534;
}

/* Hlasování - responzivita */
@media (max-width: 640px) {
    .osoba-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .osoba-header-right {
        width: 100%;
        justify-content: space-between;
        padding-left: 32px;
    }

    .osoba-jednotky {
        padding-left: 16px;
    }

    .osoba-jednotka-item {
        flex-wrap: wrap;
        gap: 4px;
    }

    .jednotka-row1,
    .jednotka-row2 {
        flex-basis: 100%;
    }

    .jednotka-row1 .typ-badge {
        margin-left: auto;
    }

    .jednotka-row2 .hlas-badge {
        margin-left: auto;
    }

    .jednotka-row2 {
        margin-left: 0;
    }

    .vysledky-bar-label {
        width: 40px;
        font-size: 12px;
    }

    .vysledky-bar-value {
        width: 70px;
        font-size: 12px;
    }

    .stat-card {
        padding: 8px 12px;
        min-width: 80px;
    }

    .stat-card-value {
        font-size: 1.25rem;
    }

    .stats-vote-table th,
    .stats-vote-table td {
        padding: 4px 6px;
        font-size: 12px;
    }
}

/* ─── Scroll to top ─────────────────────────────────────── */

.btn-scroll-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s, background 0.15s;
    z-index: 1000;
}

.btn-scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.btn-scroll-top:hover {
    background: var(--primary-dark);
}

/* ============================================================
   ČÚZK integrace – notice boxy
   ============================================================ */
.cuzk-notice {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.5;
}

.cuzk-notice a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
}

.cuzk-notice-warn {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.cuzk-notice-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* ČÚZK autocomplete dropdown */
.cuzk-autocomplete-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    max-height: 240px;
    overflow-y: auto;
    z-index: 100;
}

.cuzk-ac-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cuzk-ac-item:hover,
.cuzk-ac-item.cuzk-ac-active {
    background: var(--gray-100);
}

.cuzk-ac-code {
    font-size: 11px;
    color: var(--gray-500);
    font-family: monospace;
}

.cuzk-ac-empty {
    padding: 12px;
    color: var(--gray-500);
    font-style: italic;
    text-align: center;
    font-size: 13px;
}

/* ============================================================
   KN vlastníci – progress UI
   ============================================================ */
.kn-instrukce ol {
    margin: 8px 0 0 20px;
    line-height: 1.7;
}

.kn-instrukce ol li {
    margin-bottom: 6px;
}

.kn-stats {
    font-size: 14px;
    margin-bottom: 8px;
}

.kn-stat {
    font-weight: 700;
}

.kn-stat-ok {
    color: #16a34a;
}

.kn-stat-skip {
    color: var(--gray-500);
}

.kn-stat-err {
    color: var(--danger);
}

.kn-progress-bar {
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
}

.kn-progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.kn-log {
    max-height: 400px;
    overflow-y: auto;
    margin-top: 12px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    background: #fff;
}

.kn-log-item {
    padding: 6px 12px;
    font-size: 13px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    gap: 8px;
}

.kn-log-item:last-child {
    border-bottom: none;
}

.kn-log-time {
    color: var(--gray-500);
    font-family: monospace;
    font-size: 11px;
    flex-shrink: 0;
}

.kn-log-ok {
    color: #16a34a;
}

.kn-log-preskoceno {
    color: var(--gray-500);
}

.kn-log-chyba {
    color: var(--danger);
    background: #fef2f2;
}

.kn-copy-help {
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 8px 12px;
    margin: 6px 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--gray-700);
}

/* Přílohy */
.prilohy-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    /* padding-bottom: 8px; */
    /* border-bottom: 1px solid var(--gray-200); */
}

.prilohy-title {
    margin: 0;
    padding: 0;
    border: none;
}

.prilohy-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* margin-bottom: 16px; */
}

.priloha-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
}

.priloha-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: var(--gray-200);
    color: var(--gray-700);
}

.priloha-icon-img {
    background: #dbeafe;
    color: #2563eb;
}

.priloha-icon-pdf {
    background: #fee2e2;
    color: #dc2626;
}

.priloha-icon-doc {
    background: #e0e7ff;
    color: #4f46e5;
}

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

.priloha-nazev {
    display: block;
    font-weight: 500;
    color: var(--primary);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.priloha-nazev:hover {
    text-decoration: underline;
}

.priloha-meta {
    display: block;
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 2px;
}

.priloha-actions {
    flex-shrink: 0;
    display: flex;
    gap: 6px;
}

.priloha-form {
    margin-top: 12px;
    padding-top: 12px;
    /* border-top: 1px solid var(--gray-200); */
}

.priloha-form-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.priloha-file-input {
    flex: 1 1 260px;
    min-width: 220px;
    /* padding: 6px;
    border: 1px solid var(--gray-300);
    border-radius: 999px;
    background: #fff; 
    color: var(--gray-700);
    font-size: 14px;*/
    line-height: 1.2;
    /* box-shadow: inset 0 1px 2px rgba(16, 32, 51, 0.04); */
}

.priloha-file-input:hover {
    border-color: rgba(9, 111, 172, 0.28);
}

.priloha-file-input:focus {
    outline: none;
    border-color: rgba(9, 111, 172, 0.35);
    box-shadow: 0 0 0 4px rgba(9, 111, 172, 0.12);
}

.priloha-file-input::file-selector-button {
    margin-right: 12px;
    padding: 10px 14px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: filter 0.2s ease, transform 0.2s ease;
}

.priloha-file-input::file-selector-button:hover {
    filter: brightness(1.04);
    transform: translateY(-1px);
}

.priloha-file-input::file-selector-button:active {
    transform: translateY(0);
}

.priloha-poznamka {
    flex: 1;
    min-width: 120px;
    padding: 6px 10px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 14px;
}

.priloha-msg {
    padding: 8px 12px;
    border-radius: var(--radius);
    margin-bottom: 12px;
    font-size: 14px;
}

.priloha-msg-error {
    background: #fef2f2;
    color: var(--danger);
    border: 1px solid #fecaca;
}

.priloha-msg-success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

@media (max-width: 640px) {
    .priloha-item {
        flex-wrap: wrap;
    }
    .priloha-actions {
        width: 100%;
        justify-content: flex-end;
    }
    .priloha-form-row {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .priloha-file-input {
        flex: none;
        min-width: 0;
        width: 100%;
        line-height: 1.1;
    }

    .priloha-file-input::file-selector-button {
        margin-right: 8px;
        padding: 8px 12px;
    }
}

.modal-open {
    overflow: hidden;
}

.app-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
}

.app-modal.is-open {
    display: block;
}

.app-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
}

.app-modal-dialog {
    position: relative;
    width: min(680px, calc(100vw - 32px));
    margin: 8vh auto 0;
    background: var(--surface-strong);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
    overflow: hidden;
}

.app-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--line);
}

.app-modal-header h3 {
    margin: 0;
    font-size: 1.05rem;
}

.app-modal-close {
    border: 0;
    background: transparent;
    color: var(--gray-500);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.app-modal-body {
    padding: 22px;
}

.app-modal-actions {
    margin-bottom: 14px;
}

.app-modal-actions a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.app-modal-actions a:hover {
    text-decoration: underline;
}

.app-modal-message {
    color: var(--muted);
}

.app-modal-message.is-error {
    color: var(--danger-dark);
}

.app-modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.app-modal-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.app-modal-item-full {
    grid-column: 1 / -1;
}

.app-modal-label {
    color: var(--gray-500);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.app-modal-value {
    color: var(--gray-900);
    font-weight: 600;
    white-space: pre-wrap;
}

.page-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.registry-dropdown {
    position: relative;
}

.registry-dropdown-toggle::after {
    content: "\25BE";
    margin-left: 8px;
    font-size: 12px;
}

.registry-dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 220px;
    padding: 8px;
    border: 1px solid rgba(9, 111, 172, 0.14);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 20px 48px rgba(16, 32, 51, 0.16);
    z-index: 25;
    backdrop-filter: blur(10px);
}

.registry-dropdown-item {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-weight: 600;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.registry-dropdown-item:hover,
.registry-dropdown-item:focus {
    background: var(--primary-soft);
    color: var(--primary);
    outline: none;
}

.registry-dropdown-separator {
    height: 1px;
    margin: 6px 4px;
    background: rgba(9, 111, 172, 0.14);
}

@media (max-width: 640px) {
    .registry-dropdown-menu {
        left: 0;
        right: auto;
        min-width: min(280px, calc(100vw - 40px));
    }
}

/* ----- Vlastní PHP kalendář ----- */
.phpcal-card {
    margin-bottom: 20px;
}

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

.phpcal-title-block {
    flex: 0 0 auto;
    min-width: 0;
}

.phpcal-title-block h3 {
    margin: 0 0 2px;
}

.phpcal-period {
    flex: 1 1 auto;
    margin-left: auto;
    min-width: 0;
    font-family: 'Sora', 'Manrope', sans-serif;
    font-weight: 600;
    color: var(--primary);
    font-size: 1rem;
    text-align: right;
    text-transform: lowercase;
    white-space: nowrap;
}

.phpcal-toolbar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.phpcal-nav,
.phpcal-views {
    display: inline-flex;
    background: var(--gray-100);
    border-radius: 999px;
    padding: 3px;
    gap: 2px;
}

.phpcal-nav-btn,
.phpcal-view-btn {
    border: 0;
    background: transparent;
    color: var(--gray-700);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    line-height: 1;
}

.phpcal-nav-btn:hover,
.phpcal-view-btn:hover {
    background: #fff;
    color: var(--primary);
}

.phpcal-view-btn-active,
.phpcal-view-btn-active:hover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(9, 111, 172, 0.25);
}

.phpcal-legend-wrapper {
    /* margin-top: 32px; */
    padding-top: 18px;
    /* border-top: 1px dashed var(--gray-200); */
}

.phpcal-legend-summary {
    cursor: pointer;
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--gray-100);
    color: var(--gray-700);
    font-size: 0.78rem;
    font-weight: 600;
    user-select: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.phpcal-legend-summary,
.phpcal-legend-summary * {
    cursor: pointer;
}

.phpcal-legend-summary::-webkit-details-marker {
    display: none;
}

.phpcal-legend-summary::before {
    content: '▸';
    font-size: 0.7rem;
    transition: transform 0.15s ease;
    display: inline-block;
}

.phpcal-legend-wrapper[open] .phpcal-legend-summary::before {
    transform: rotate(90deg);
}

.phpcal-legend-summary:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

.phpcal-legend {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--gray-700);
    margin-top: 12px;
}

.phpcal-legend-group {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    align-items: center;
}

.phpcal-legend-label {
    font-weight: 700;
    color: var(--ink);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.7rem;
    min-width: 70px;
}

.phpcal-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.phpcal-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

/* --- Měsíční pohled --- */
.phpcal-grid-month {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 1px;
    background: var(--gray-200);
    border: 1px solid var(--gray-200);
    border-radius: 14px;
    overflow: hidden;
}

.phpcal-grid-month .phpcal-weekday-head {
    background: var(--gray-50);
    color: var(--gray-700);
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 8px 10px;
    text-align: center;
}

.phpcal-day {
    background: #fff;
    min-height: 96px;
    padding: 6px 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
}

.phpcal-day-other {
    background: var(--gray-50);
    color: var(--gray-500);
}

.phpcal-day-other .phpcal-day-num {
    color: var(--gray-500);
}

.phpcal-day-weekend {
    background: color-mix(in srgb, var(--gray-50) 60%, #fff);
}

.phpcal-day-today {
    background: color-mix(in srgb, var(--primary-soft) 70%, #fff);
}

.phpcal-day-today .phpcal-day-num {
    color: var(--primary);
    font-weight: 800;
}

.phpcal-day-num {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--gray-700);
    text-align: right;
    line-height: 1;
    padding: 2px 4px;
}

.phpcal-day-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.phpcal-event {
    display: block;
    color: #fff;
    text-decoration: none;
    padding: 2px 6px;
    border-radius: 5px;
    font-size: 0.74rem;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.phpcal-event:hover {
    filter: brightness(0.92);
    color: #fff;
    text-decoration: none;
}

.phpcal-event-title {
    color: inherit;
}

/* --- Týdenní pohled --- */
.phpcal-grid-week {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 1px;
    background: var(--gray-200);
    border: 1px solid var(--gray-200);
    border-radius: 14px;
    overflow: hidden;
}

.phpcal-week-col {
    background: #fff;
    display: flex;
    flex-direction: column;
    min-height: 220px;
}

.phpcal-week-col.phpcal-day-weekend {
    background: color-mix(in srgb, var(--gray-50) 60%, #fff);
}

.phpcal-week-col.phpcal-day-today {
    background: color-mix(in srgb, var(--primary-soft) 70%, #fff);
}

.phpcal-week-col-head {
    padding: 8px 10px;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.phpcal-week-col.phpcal-day-today .phpcal-week-col-head {
    background: color-mix(in srgb, var(--primary-soft) 80%, #fff);
}

.phpcal-week-col-day {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-500);
}

.phpcal-week-col-date {
    font-family: 'Sora', 'Manrope', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
}

.phpcal-week-col.phpcal-day-today .phpcal-week-col-date {
    color: var(--primary);
}

.phpcal-week-col-events {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.phpcal-week-empty {
    color: var(--gray-300);
    text-align: center;
    font-size: 0.85rem;
    margin-top: 4px;
}

.phpcal-week-col-events .phpcal-event {
    white-space: normal;
    text-overflow: clip;
    padding: 4px 8px;
    font-size: 0.78rem;
}

/* --- Seznam --- */
.phpcal-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.phpcal-list-empty {
    color: var(--gray-500);
    text-align: center;
    padding: 24px 0;
    margin: 0;
}

.phpcal-list-day {
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.phpcal-list-day-today {
    border-color: color-mix(in srgb, var(--primary) 35%, var(--gray-200));
    box-shadow: 0 4px 12px rgba(9, 111, 172, 0.1);
}

.phpcal-list-day-head {
    padding: 8px 14px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.phpcal-list-day-today .phpcal-list-day-head {
    background: color-mix(in srgb, var(--primary-soft) 70%, #fff);
}

.phpcal-list-day-name {
    font-weight: 700;
    color: var(--ink);
}

.phpcal-list-day-date {
    color: var(--gray-700);
    font-size: 0.85rem;
}

.phpcal-list-events {
    display: flex;
    flex-direction: column;
}

.phpcal-list-event {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    text-decoration: none;
    color: var(--ink);
    border-top: 1px solid var(--gray-100);
    transition: background 0.12s ease;
}

.phpcal-list-event:first-child {
    border-top: 0;
}

.phpcal-list-event:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

.phpcal-list-event-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.phpcal-list-event-title {
    font-weight: 600;
}

@media (max-width: 720px) {
    .phpcal-header {
        align-items: center;
        gap: 8px;
    }
    .phpcal-period {
        font-size: 0.92rem;
    }
    .phpcal-toolbar {
        justify-content: space-between;
    }
    .phpcal-day {
        min-height: 64px;
    }
    .phpcal-day-num {
        font-size: 0.72rem;
    }
    .phpcal-event {
        font-size: 0.68rem;
        padding: 1px 4px;
    }
    .phpcal-grid-week {
        grid-template-columns: 1fr;
    }
    .phpcal-week-col {
        min-height: auto;
    }
}

/* Plánky */
.planky-empty {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 24px;
    background: var(--surface-strong);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(16, 32, 51, 0.08);
}

.planky-empty h3 {
    margin-bottom: 8px;
    color: var(--ink);
}

.planky-empty p {
    color: var(--muted);
    max-width: 620px;
}

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

.planky-edit-tools select {
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    padding: 9px 11px;
    min-height: 38px;
    background: #fff;
    color: var(--text);
}

.planky-app {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.planky-floorbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px 14px;
    flex-wrap: wrap;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.planky-floor-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1 1 360px;
    min-width: 0;
}

.planky-floor-tab {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 7px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    color: var(--gray-700);
    background: #fff;
    text-decoration: none;
    font-weight: 700;
}

.planky-floor-filters {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex: 1 1 360px;
    min-width: 280px;
}

.planky-floor-tab:hover,
.planky-floor-tab.active {
    border-color: color-mix(in srgb, var(--primary) 45%, var(--gray-200));
    color: var(--primary);
    background: var(--primary-soft);
}

.planky-editor-panel {
    display: grid;
    grid-template-columns: minmax(280px, 560px);
    gap: 14px;
    align-items: end;
    padding: 14px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.planky-upload-form {
    display: grid;
    grid-template-columns: minmax(140px, 1fr) minmax(90px, 120px) auto;
    gap: 10px;
    align-items: end;
}

.planky-upload-form {
    grid-template-columns: minmax(220px, 1fr) auto;
}

.planky-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 0;
}

.planky-search {
    flex: 1 1 220px;
    max-width: 300px;
}

.planky-edit-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.planky-edit-tools .active {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-soft);
}

.planky-save-state {
    min-width: 110px;
    color: var(--gray-700);
    font-size: 0.88rem;
    font-weight: 700;
}

.planky-save-state.is-error {
    color: var(--danger);
}

.planky-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    align-items: start;
}

.planky-canvas-shell {
    overflow: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #eef3f7;
    box-shadow: 0 16px 44px rgba(16, 32, 51, 0.12);
}

.planky-canvas {
    display: block;
    width: 100%;
    min-width: 720px;
    height: auto;
    background: #f8fafc;
    user-select: none;
    touch-action: pan-x pan-y;
}

.is-editing .planky-canvas {
    touch-action: none;
}

.planky-shape {
    cursor: pointer;
}

.is-editing .planky-shape {
    cursor: move;
}

.planky-shape rect {
    transition: fill-opacity 0.12s ease, stroke-width 0.12s ease, filter 0.12s ease;
}

.planky-shape:hover rect,
.planky-shape.selected rect {
    fill-opacity: 0.58;
}

.planky-shape.selected rect {
    stroke-dasharray: 14 7;
    animation: planky-selected-dash 1s linear infinite;
}

@keyframes planky-selected-dash {
    to {
        stroke-dashoffset: -21;
    }
}

@media (prefers-reduced-motion: reduce) {
    .planky-shape.selected rect {
        animation: none;
    }
}

.planky-shape text {
    pointer-events: none;
    fill: var(--ink);
    font-weight: 800;
    font-size: 19px;
    paint-order: stroke;
    stroke: rgba(255, 255, 255, 0.85);
    stroke-width: 4px;
    stroke-linejoin: round;
}

.planky-shape:hover text,
.planky-shape.selected text,
.planky-shape.is-hover-preview text {
    fill: #07111f;
    stroke: #fff;
    filter: drop-shadow(0 2px 4px rgba(15, 23, 42, 0.42));
}

.planky-shape.is-hover-preview rect {
    fill-opacity: 0.58;
    stroke-width: 4;
}

.planky-entrance-outline text {
    fill: #334155;
    font-size: 11px;
    text-transform: uppercase;
}

.planky-shape.is-filtered {
    opacity: 0.16;
}

.planky-draft-rect {
    fill: rgba(9, 111, 172, 0.16);
    stroke: var(--primary);
    stroke-width: 3;
    stroke-dasharray: 8 6;
}

.planky-side {
    display: grid;
    grid-template-columns: minmax(170px, 240px) minmax(320px, 1fr);
    gap: 14px;
    align-items: start;
}

.is-editing .planky-side {
    grid-template-columns: minmax(170px, 240px) minmax(280px, 1fr) minmax(260px, 360px);
}

.planky-legend,
.planky-detail,
.planky-unmapped {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
}

.planky-unmapped {
    display: none;
}

.is-editing .planky-unmapped {
    display: block;
}

.planky-legend {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
    font-size: 0.86rem;
    color: var(--gray-700);
}

.planky-legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.planky-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.planky-dot-byt { background: #3b82f6; }
.planky-dot-garaz { background: #f59e0b; }
.planky-dot-nebyt { background: #6b7280; }
.planky-dot-spolecny { background: #14b8a6; }

.planky-detail h3,
.planky-unmapped h3 {
    margin-bottom: 10px;
    color: var(--ink);
    font-size: 1rem;
}

.planky-detail-content {
    display: grid;
    grid-template-columns: minmax(220px, 0.85fr) minmax(280px, 1.15fr);
    gap: 18px;
    align-items: start;
}

.planky-detail-list {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 6px 10px;
    margin-bottom: 12px;
    font-size: 0.92rem;
}

.planky-detail-list dt {
    color: var(--muted);
}

.planky-detail-list dd {
    color: var(--ink);
    font-weight: 700;
}

.planky-detail-people {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--text);
}

.planky-detail-people h4 {
    margin: 0 0 2px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.planky-person-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid var(--gray-100);
}

.planky-person-row:last-child {
    border-bottom: 0;
}

.planky-person-name {
    min-width: 0;
    color: var(--ink);
    font-weight: 700;
}

.planky-geometry-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--gray-200);
}

.planky-geometry-form label:first-child {
    grid-column: 1 / -1;
}

.planky-geometry-form label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.planky-geometry-form input {
    width: 100%;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    padding: 7px 8px;
    color: var(--text);
}

.planky-unmapped > div {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 260px;
    overflow: auto;
}

.planky-unmapped button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    background: #fff;
    color: var(--text);
    padding: 8px 10px;
    text-align: left;
}

.planky-unmapped button:not(:disabled):hover {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.planky-unmapped button:disabled {
    opacity: 0.68;
}

.planky-unmapped span {
    color: var(--muted);
    font-size: 0.78rem;
}

@media (max-width: 980px) {
    .planky-side {
        grid-template-columns: 1fr 1fr;
    }
    .is-editing .planky-side {
        grid-template-columns: 1fr 1fr;
    }
    .is-editing .planky-unmapped {
        grid-column: 1 / -1;
    }
    .planky-editor-panel,
    .planky-upload-form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .planky-empty,
    .planky-floorbar {
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
    }
    .planky-empty-actions,
    .planky-toolbar,
    .planky-edit-tools {
        align-items: stretch;
        flex-direction: column;
    }
    .planky-floor-tabs {
        flex: 0 1 auto;
        flex-wrap: nowrap;
        gap: 6px;
        width: 100%;
        overflow-x: auto;
        padding-bottom: 2px;
        -webkit-overflow-scrolling: touch;
    }
    .planky-floor-tab {
        flex: 0 0 auto;
        min-height: 34px;
        padding: 5px 10px;
    }
    .planky-floor-filters {
        flex: 0 1 auto;
        flex-direction: row;
        align-items: stretch;
        gap: 6px;
        width: 100%;
        min-width: 0;
    }
    .planky-floor-filters .table-search {
        flex: 1 1 auto;
        min-width: 0;
    }
    .planky-floor-filters select {
        flex: 0 0 142px;
    }
    .planky-edit-tools select,
    .planky-toolbar .btn,
    .planky-edit-tools .btn {
        width: 100%;
        max-width: none;
    }
    .planky-side {
        grid-template-columns: 1fr;
    }
    .is-editing .planky-side {
        grid-template-columns: 1fr;
    }
    .is-editing .planky-unmapped {
        grid-column: auto;
    }
    .planky-canvas {
        min-width: 620px;
    }
    .planky-legend {
        grid-template-columns: 1fr;
    }
    .planky-detail-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .page-header:not(.settings-card-toggle):has(.btn) {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 8px;
    }

    .page-header:not(.settings-card-toggle):has(.btn) > h2,
    .page-header:not(.settings-card-toggle):has(.btn) > h3,
    .page-header:not(.settings-card-toggle):has(.btn) > div:first-child {
        flex: 1 1 max-content;
        min-width: 0;
        max-width: 100%;
    }

    .page-header:not(.settings-card-toggle):has(.btn) > .page-header-actions,
    .page-header:not(.settings-card-toggle):has(.btn) > div:has(.btn),
    .page-header:not(.settings-card-toggle):has(.btn) > a.btn {
        display: flex;
        flex: 0 0 auto;
        align-items: center;
        justify-content: flex-end;
        flex-wrap: nowrap;
        gap: 8px;
        margin-left: auto;
    }

    .btn[data-mobile-icon] {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 36px;
        width: 36px !important;
        min-width: 36px;
        max-width: 36px !important;
        height: 36px;
        padding: 0;
        font-size: 0;
        line-height: 1;
        white-space: nowrap;
    }

    .btn.btn-sm[data-mobile-icon] {
        flex-basis: 32px;
        width: 32px !important;
        min-width: 32px;
        max-width: 32px !important;
        height: 32px;
    }

    .btn[data-mobile-icon]::after {
        content: attr(data-mobile-icon);
        position: absolute;
        top: 50%;
        left: 50%;
        margin: 0;
        font-size: 1.05rem;
        font-weight: 800;
        line-height: 1;
        transform: translate(-50%, -50%);
    }

    .btn[data-mobile-icon-kind="export"] {
        position: relative;
    }

    .btn[data-mobile-icon-kind="export"]::before {
        content: "";
        position: absolute;
        top: 9px;
        left: 50%;
        width: 0;
        height: 0;
        border-right: 6px solid transparent;
        border-bottom: 8px solid currentColor;
        border-left: 6px solid transparent;
        transform: translateX(-50%);
    }

    .btn[data-mobile-icon-kind="export"]::after {
        content: "";
        position: absolute;
        top: 17px;
        left: 50%;
        width: 3px;
        height: 8px;
        margin: 0;
        border-radius: 999px;
        background: currentColor;
        transform: translateX(-50%);
    }

    .btn.btn-sm[data-mobile-icon]::after {
        font-size: 0.95rem;
    }

    .btn.btn-sm[data-mobile-icon-kind="export"]::after {
        top: 15px;
        width: 3px;
        height: 10px;
    }

    .btn.btn-sm[data-mobile-icon-kind="export"]::before {
        top: 8px;
        border-right-width: 6px;
        border-bottom-width: 8px;
        border-left-width: 6px;
    }
}
