:root {
    --bg: #f2f6f8;
    --surface: #fff;
    --surface-muted: #f8fafc;
    --border: #e2e8f0;
    --text: #1e293b;
    --muted: #64748b;
    --primary: #1d6fa5;
    --primary-hover: #175a88;
    --primary-light: #e7f2f8;
    --primary-border: #9ec8df;
    --danger: #dc2626;
    --success-bg: #dcfce7;
    --success-text: #166534;
    --error-bg: #fee2e2;
    --error-text: #991b1b;
    --sidebar: #ffffff;
    --sidebar-text: #475569;
    --sidebar-text-active: #0f172a;
    --sidebar-hover: #f1f5f9;
    --sidebar-border: #e2e8f0;
    --radius: 0;
    --field-height: 2.25rem;
    --field-font-size: .875rem;
    --field-focus-ring: 0 0 0 3px rgba(29, 111, 165, .2);
    --dropdown-shadow: 0 8px 24px rgba(15, 23, 42, .12);
    --modal-shadow: 0 24px 48px rgba(15, 23, 42, .2);
}

* { box-sizing: border-box; }

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

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

.app { display: flex; min-height: 100vh; }
.app--stacked { flex-direction: column; }

.sidebar {
    width: 220px;
    background: var(--sidebar);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    padding: 0;
    flex-shrink: 0;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow: hidden;
    border-right: 1px solid var(--sidebar-border);
}

.sidebar-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 1.25rem 0 .5rem;
}

.brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    padding: 0 1.25rem 1.25rem;
    letter-spacing: -.02em;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: .125rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    width: 100%;
    color: var(--sidebar-text);
    padding: .55rem 1.25rem;
    text-decoration: none;
    font-size: .875rem;
    line-height: 1.35;
    transition: background .12s ease, color .12s ease;
}

.sidebar-link:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-active);
    text-decoration: none;
}

.sidebar-link.active {
    background: var(--sidebar-hover);
    color: var(--primary);
    font-weight: 600;
}

.nav-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    opacity: .85;
}

.sidebar-link.active .nav-icon {
    opacity: 1;
    color: var(--primary);
}

.sidebar-footer {
    flex-shrink: 0;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--sidebar-border);
    font-size: .875rem;
    background: var(--sidebar);
}

.user-meta { color: var(--sidebar-text-active); font-weight: 600; }
.user-role { color: var(--muted); margin-bottom: .5rem; font-size: .8125rem; }
.logout { color: var(--muted); font-size: .875rem; text-decoration: none; }
.logout-form { display: inline; margin: 0; padding: 0; border: 0; background: none; }
.logout-form button.logout {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    cursor: pointer;
}
.logout:hover { color: var(--primary); text-decoration: underline; }
.sidebar-credit {
    margin: .75rem 0 0;
    font-size: .75rem;
    color: var(--muted);
}
.sidebar-credit a {
    color: var(--muted);
    text-decoration: none;
}
.sidebar-credit a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem .75rem;
    padding: .85rem 1.25rem;
    background: var(--sidebar);
    color: var(--text);
    width: 100%;
    border-bottom: 1px solid var(--sidebar-border);
}

.brand-inline {
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -.02em;
}
.topbar .logout { color: var(--muted); }
.topbar .logout:hover { color: var(--primary); }
.topbar-nav {
    display: flex;
    align-items: center;
    gap: .5rem;
}
.topbar-link {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: .875rem;
    padding: .4rem .65rem;
    border-radius: 0;
}
.topbar-link:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-active);
    text-decoration: none;
}
.topbar-link .nav-icon {
    width: 1.125rem;
    height: 1.125rem;
}
.topbar-link--active {
    background: var(--sidebar-hover);
    color: var(--primary);
    font-weight: 600;
}

.main--vedouci { max-width: 720px; margin: 0 auto; padding: 1.5rem; }

/* Admin/manager — sidebar (desktop) + topbar (mobil); přepínání v inline <style> v layout.php */
.app--admin-manager .app-workspace {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    max-width: none;
    display: flex;
    flex-direction: column;
}
.app--admin-manager .app-workspace > .main {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none !important;
    margin: 0 !important;
    width: 100% !important;
}
/* Zastaralá třída z předchozích verzí — nesmí zúžit admin desktop */
.app--admin-manager .main--mobile-log {
    max-width: none !important;
    margin: 0 !important;
    width: 100% !important;
}

@media (max-width: 992px) {
    .app--activity-mobile-shell {
        flex-direction: column;
    }
    .app--activity-mobile-shell .sidebar {
        display: none !important;
    }
    .app--activity-mobile-shell .topbar--activity-mobile {
        display: flex !important;
        width: 100%;
        flex-shrink: 0;
    }
    .app--activity-mobile-shell .app-workspace > .main.main--activity-log {
        padding: 0;
        max-width: none;
        width: 100%;
        overflow-x: hidden;
    }
}

.main {
    flex: 1;
    min-width: 0;
    width: 100%;
    padding: 1.5rem 2rem;
}

.main--full {
    max-width: 420px;
    margin: 0 auto;
    padding-top: 4rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-header h1 {
    margin: 0;
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -.02em;
}

.card-title {
    margin: 0;
    font-size: .9375rem;
    font-weight: 600;
}

.card > .card-title,
.card > .reports-section-title {
    margin-bottom: 1rem;
}

.subsection-title {
    margin: 2rem 0 .75rem;
    font-size: 1rem;
    font-weight: 600;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0;
    padding: 1.15rem;
    margin-bottom: 1rem;
    max-width: 100%;
    min-width: 0;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0;
    padding: 1rem 1.25rem;
    min-width: 0;
}

.stat-value {
    font-size: clamp(1.05rem, 2.4vw, 1.75rem);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    line-height: 1.2;
}
.stat-label {
    color: var(--muted);
    font-size: .875rem;
    overflow-wrap: anywhere;
}
.stat--positive .stat-value { color: #166534; }
.stat--negative .stat-value { color: var(--danger); }

.stats--sticky {
    position: sticky;
    top: 0;
    z-index: 30;
    margin: 0 0 1rem;
    padding: .5rem 0 .65rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(15, 23, 42, .06);
    gap: .65rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 7.25rem), 1fr));
}
.stats--sticky .stat {
    padding: .55rem .75rem;
    border-radius: 0;
}
.stats--sticky .stat-value {
    font-size: clamp(.95rem, 1.8vw, 1.125rem);
    font-weight: 700;
    line-height: 1.25;
}
.stats--sticky .stat-label {
    font-size: .7rem;
    line-height: 1.3;
    margin-top: .15rem;
}
.stats--sticky .stat-value a {
    color: inherit;
    text-decoration: none;
}
.stats--sticky .stat-value a:hover { text-decoration: underline; }
.stats--sticky .stat-label a {
    color: var(--primary);
    text-decoration: none;
}
.stats--sticky .stat-label a:hover { text-decoration: underline; }

.card--alerts {
    border-color: #fcd34d;
    background: #fffbeb;
    padding: .75rem 1rem;
}
.card--alerts h2 {
    margin: 0 0 .5rem;
    font-size: .875rem;
    font-weight: 600;
}
.alert-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.alert-item {
    display: flex;
    align-items: stretch;
    gap: 0;
    flex-wrap: nowrap;
    padding: 0;
    overflow: hidden;
    font-size: .8125rem;
    line-height: 1.35;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0;
}
.alert-item > span {
    flex: 1;
    min-width: 0;
    padding: .45rem .65rem;
    display: flex;
    align-items: center;
}
.card--alerts .alert-item .btn-sm {
    flex-shrink: 0;
    align-self: stretch;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    border: none;
    border-left: 1px solid var(--border);
    margin: 0;
    padding: .45rem .85rem;
    font-size: .75rem;
    background: #f8fafc;
}
.card--alerts .alert-item .btn-sm:hover {
    background: #f1f5f9;
}
.card--alerts .alert-item .btn-primary {
    background: var(--primary);
    color: #fff;
    border-left-color: var(--primary-hover);
}
.card--alerts .alert-item .btn-primary:hover {
    background: var(--primary-hover);
    color: #fff;
}
.card--alerts .alert-item .btn-quiet {
    background: #fff7ed;
    color: #9a3412;
    border-left-color: #fdba74;
}
.card--alerts .alert-item .btn-quiet:hover {
    background: #ffedd5;
    color: #7c2d12;
}
.alert-item-actions {
    display: flex;
    flex-shrink: 0;
    align-self: stretch;
}
.alert-item-actions form {
    display: flex;
    margin: 0;
}
.alert-item-actions .btn-sm {
    height: 100%;
}
.shift-no-work-banner {
    margin-top: .75rem;
    background: #fff7ed;
    border-color: #fdba74;
}
.shift-no-work-banner p { margin: 0 0 .35rem; }
.shift-no-work-banner .form-hint { margin: 0; }
.shift-no-work-form {
    margin-top: .75rem;
}
.shift-footer-actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    align-items: center;
}
.alert-item--warn { border-left: 3px solid #f59e0b; }
.alert-item--info { border-left: 3px solid var(--primary); }

.card-header-inline {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.table-total td {
    border-top: 2px solid var(--border);
    background: #f8fafc;
    font-size: .875rem;
}
.text-positive { color: #166534; }
.text-negative { color: var(--danger); }
.actions-cell { white-space: nowrap; }
.actions-cell .btn { margin-left: .25rem; }

.col-mode {
    width: 1%;
    text-align: center;
    padding-left: .5rem;
    padding-right: .5rem;
    white-space: nowrap;
}
.mode-icon { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; }
.mode-icon--shifts { color: var(--primary); }
.mode-icon--activity { color: #7c3aed; }

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    margin-bottom: .75rem;
}
.section-header .section-title { margin: 0; }
.bulk-actions { display: flex; gap: .5rem; }

th.num,
td.num {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0;
}

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

th {
    background: var(--surface-muted);
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--muted);
    line-height: 1.3;
}

td {
    font-size: .875rem;
    line-height: 1.45;
    color: var(--text);
}

/* Textové sloupce se mohou zúžit; čísla ne */
th:not(.num):not(.actions):not(.col-mode),
td:not(.num):not(.actions):not(.col-mode) {
    min-width: 0;
}
td:not(.num):not(.actions):not(.col-mode) {
    overflow-wrap: break-word;
}

tr:last-child td { border-bottom: none; }

.btn {
    display: inline-block;
    padding: .5rem 1rem;
    border-radius: 0;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: .875rem;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.4;
}

.btn:hover { background: var(--surface-muted); text-decoration: none; }

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

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

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

.btn-quiet {
    background: #fff7ed;
    color: #9a3412;
    border-color: #fdba74;
}

.btn-quiet:hover {
    background: #ffedd5;
    color: #7c2d12;
    text-decoration: none;
}

.btn-sm { padding: .3rem .6rem; font-size: .8rem; }

.actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.form-grid {
    display: grid;
    gap: 1rem;
    max-width: 560px;
}

label {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    font-size: .875rem;
    font-weight: 500;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="hidden"]):not([type="file"]):not([type="image"]):not([type="range"]):not([type="color"]),
select,
textarea {
    box-sizing: border-box;
    min-height: var(--field-height);
    padding: var(--field-padding-y, .5rem) var(--field-padding-x, .65rem);
    border: 1px solid var(--border);
    border-radius: 0;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: var(--field-font-size);
    line-height: 1.35;
    transition: border-color .12s ease, box-shadow .12s ease;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="hidden"]):not([type="file"]):not([type="image"]):not([type="range"]):not([type="color"]):focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--field-focus-ring);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="hidden"]):not([type="file"]):not([type="image"]):not([type="range"]):not([type="color"]):disabled,
select:disabled,
textarea:disabled {
    background-color: var(--surface-muted);
    color: var(--muted);
    cursor: not-allowed;
    opacity: .9;
}

select:not([multiple]) {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 2rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m19.5 8.25-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .55rem center;
    background-size: 1rem;
    cursor: pointer;
}

input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"],
input[type="week"] {
    font-variant-numeric: tabular-nums;
    color-scheme: light;
    min-width: 0;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: .55;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover,
input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
    opacity: .85;
}

input[type="number"] {
    font-variant-numeric: tabular-nums;
}

input[type="search"] {
    -webkit-appearance: none;
    appearance: none;
}

textarea { min-height: 80px; resize: vertical; padding-top: .6rem; }

input[type="checkbox"],
input[type="radio"] {
    width: 1rem;
    height: 1rem;
    margin: 0;
    accent-color: var(--primary);
    cursor: pointer;
}

.form-hint { font-size: .8rem; color: var(--muted); font-weight: 400; }

.form-actions {
    display: flex;
    gap: .75rem;
    margin-top: .5rem;
}

.flash {
    padding: .75rem 1rem;
    border-radius: 0;
    margin-bottom: 1rem;
}

.flash--success { background: var(--success-bg); color: var(--success-text); }
.flash--error { background: var(--error-bg); color: var(--error-text); }

.badge {
    display: inline-block;
    padding: .15rem .5rem;
    border-radius: 0;
    font-size: .75rem;
    font-weight: 600;
}

.badge--active { background: #dcfce7; color: #166534; }
.badge--planned { background: #e0e7ff; color: #3730a3; }
.badge--closed { background: #f1f5f9; color: #475569; }
.badge--inactive { background: #fee2e2; color: #991b1b; }

.empty { color: var(--muted); padding: 2rem; text-align: center; }

.login-box h1 { margin-top: 0; }
.login-error { color: var(--danger); margin-bottom: 1rem; }

.checkbox-list { display: flex; flex-direction: column; gap: .5rem; margin-top: .5rem; }
.checkbox-inline { flex-direction: row !important; align-items: center; gap: .5rem; font-weight: 400; }
.checkbox-inline input { width: auto; }
fieldset.checkbox-group { border: 1px solid var(--border); border-radius: 0; padding: 1rem; margin: 0; }
fieldset.checkbox-group legend { font-weight: 600; padding: 0 .25rem; }

@media (max-width: 768px) {
    .app { flex-direction: column; }
    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        max-height: none;
    }
    .sidebar-body { overflow: visible; }
    .main { padding: 1rem; }
    .settings-notifications-form { grid-template-columns: 1fr; }
    .users-form-layout { grid-template-columns: 1fr; }
    .clients-form-layout { grid-template-columns: 1fr; }
    .project-form-layout { grid-template-columns: 1fr; }
}

/* Vedoucí — mobilní docházka (legacy) */
.attendance-mobile { width: 100%; max-width: none; margin: 0; }
.attendance-mobile--wide { max-width: 720px; }

/* Zápis směny */
.shift-page { width: 100%; max-width: none; }
.shift-page--mobile { width: 100%; max-width: none; margin: 0; }

@media (min-width: 641px) {
    .shift-page--mobile .shift-main,
    .shift-page--mobile .shift-form {
        width: 100%;
    }
    .shift-page--mobile .shift-toolbar,
    .shift-page--mobile .shift-workers-card,
    .shift-page--mobile .shift-extras,
    .shift-page--mobile .shift-add-worker,
    .shift-page--mobile > .card,
    .shift-page--mobile .shift-footer {
        width: 100%;
        box-sizing: border-box;
    }
}

/* Vedoucí — mobil, celá šířka bez bočního odsazení */
@media (max-width: 640px) {
    .main--vedouci {
        padding: 0;
        max-width: none;
        width: 100%;
        overflow-x: hidden;
    }

    .main--vedouci .flash {
        margin: 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .app--stacked .topbar {
        padding: .65rem 1rem;
    }
    .app--stacked .topbar-nav {
        flex: 1 1 100%;
        order: 3;
        padding-top: .35rem;
        border-top: 1px solid var(--sidebar-border);
    }
    .app--stacked .topbar-nav a {
        margin-right: 0;
        font-size: .875rem;
    }

    .main--vedouci .page-header {
        margin: 0;
        padding: 1rem 1rem .75rem;
    }

    .main--vedouci .attendance-mobile > .form-hint,
    .main--vedouci .attendance-mobile > h2,
    .main--mobile-log .attendance-mobile > .form-hint,
    .main--mobile-log .attendance-mobile > h2 {
        margin-left: 0;
        margin-right: 0;
        padding: 0 1rem;
    }

    .main--vedouci .project-cards,
    .main--mobile-log .project-cards {
        gap: 0;
    }

    .main--vedouci .card,
    .main--vedouci .project-card,
    .main--mobile-log .card,
    .main--mobile-log .project-card {
        border-left: none;
        border-right: none;
        border-radius: 0;
        margin-bottom: 0;
    }
    .main--vedouci .project-card + .project-card,
    .main--vedouci .card + .card,
    .main--mobile-log .project-card + .project-card,
    .main--mobile-log .card + .card {
        border-top: none;
    }

    .project-card {
        padding: 1rem;
    }
    .project-card-title {
        word-break: break-word;
    }

    .shift-page--mobile .shift-layout {
        gap: 0;
    }

    .shift-page--mobile .shift-header,
    .shift-page--mobile .shift-toolbar,
    .shift-page--mobile .shift-workers-card,
    .shift-page--mobile .shift-extras,
    .shift-page--mobile .shift-add-worker,
    .shift-page--mobile > .card {
        margin-bottom: 0;
        border-left: none;
        border-right: none;
        border-radius: 0;
    }

    .shift-page--mobile .shift-header {
        padding: 1rem;
    }
    .shift-page--mobile .shift-header-top {
        flex-direction: column;
        align-items: stretch;
        gap: .75rem;
    }
    .shift-page--mobile .shift-header-info {
        min-width: 0;
    }
    .shift-page--mobile .shift-title {
        font-size: 1.15rem;
        word-break: break-word;
    }
    .shift-page--mobile .shift-stats {
        width: 100%;
        justify-content: flex-start;
        gap: 1rem;
    }
    .shift-page--mobile .shift-stat-value {
        font-size: 1.125rem;
    }
    .shift-page--mobile .shift-stat {
        flex: 1 1 0;
        min-width: 0;
    }
    .shift-page--mobile .shift-header-bottom {
        flex-direction: column;
        align-items: stretch;
        gap: .65rem;
    }
    .shift-page--mobile .shift-date-nav {
        width: 100%;
        justify-content: space-between;
        gap: .35rem;
    }
    .shift-page--mobile .shift-date-jump {
        flex: 1;
        min-width: 0;
    }
    .shift-page--mobile .shift-date-jump input[type="date"] {
        width: 100%;
        min-width: 0;
        max-width: none;
    }

    .shift-page--mobile .shift-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: .65rem;
        padding: .75rem 1rem;
        border-top: none;
    }
    .shift-page--mobile .shift-toolbar-times {
        width: 100%;
        justify-content: space-between;
    }
    .shift-page--mobile .shift-toolbar-times input {
        flex: 1;
        min-width: 0;
        width: auto;
    }
    .shift-page--mobile .shift-toolbar .btn {
        width: 100%;
        text-align: center;
    }

    .shift-page--mobile .shift-workers-card .section-header {
        flex-direction: column;
        align-items: stretch;
        gap: .5rem;
        padding: .85rem 1rem;
    }
    .shift-page--mobile .bulk-actions {
        justify-content: flex-start;
    }

    .shift-page--mobile .shift-worker {
        padding: .75rem 1rem;
    }
    .shift-page--mobile .shift-worker-check {
        align-items: flex-start;
    }
    .shift-page--mobile .shift-worker-name {
        line-height: 1.35;
        word-break: break-word;
    }
    .shift-page--mobile .shift-worker-times {
        width: 100%;
    }
    .shift-page--mobile .shift-worker-times input {
        flex: 1;
        min-width: 0;
        width: auto;
    }

    .shift-page--mobile .shift-extras {
        padding: 1rem;
        border-top: none;
    }

    .shift-page--mobile .shift-footer {
        flex-direction: column;
        align-items: stretch;
        gap: .65rem;
        margin: 0;
        width: 100%;
        padding: .85rem 1rem calc(.85rem + env(safe-area-inset-bottom, 0px));
        border-left: none;
        border-right: none;
        border-radius: 0;
    }
    .shift-page--mobile .shift-save {
        width: 100%;
        text-align: center;
    }

    .shift-page--mobile .shift-add-worker {
        padding: 1rem;
        border-top: none;
    }

    .shift-page--mobile .shift-audit {
        padding: 0 1rem 1rem;
        margin: 0;
    }
}

.shift-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    align-items: start;
}
@media (min-width: 1100px) {
    .shift-layout {
        grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
    }
    .shift-layout:not(:has(.shift-costs)),
    .shift-page--mobile .shift-layout {
        grid-template-columns: 1fr;
    }
    .shift-costs {
        position: sticky;
        top: 1rem;
    }
}
.shift-main { min-width: 0; }

.shift-costs { padding: 1.15rem; }
.shift-costs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem .75rem;
    flex-wrap: wrap;
    margin-bottom: .75rem;
}
.shift-costs-header .section-title { margin: 0; }
.shift-costs-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}
.shift-costs .hub-costs-grid--stacked {
    grid-template-columns: 1fr;
    gap: .75rem;
}
.shift-costs .hub-cost-card--flat {
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
}
.shift-costs-hub-link {
    display: inline-block;
    margin-top: .75rem;
    font-size: .8125rem;
    color: var(--muted);
    text-decoration: none;
}
.shift-costs-hub-link:hover {
    color: var(--primary);
    text-decoration: none;
}

.shift-cost-block { margin-bottom: 1.25rem; }
.shift-cost-block:last-of-type { margin-bottom: .75rem; }
.shift-cost-heading {
    margin: 0 0 .65rem;
    font-size: .875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
}
.shift-cost-form {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: .75rem;
}
.shift-cost-form select,
.shift-cost-form input[type="text"],
.shift-cost-form input[type="number"] {
    flex: 1 1 7rem;
    min-width: 0;
}
.shift-cost-form input[type="number"] { flex: 0 1 5.5rem; }
.shift-cost-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.shift-cost-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: .5rem;
    padding: .5rem .65rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 0;
    font-size: .875rem;
}
.shift-cost-empty { margin: 0 0 .5rem; }

.shift-header {
    padding: 1.15rem;
    margin-bottom: .75rem;
}
.shift-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem 1.5rem;
    flex-wrap: wrap;
    margin-bottom: .85rem;
}
.shift-back {
    display: inline-block;
    font-size: .8125rem;
    color: var(--muted);
    margin-bottom: .35rem;
    text-decoration: none;
}
.shift-back:hover { color: var(--primary); text-decoration: none; }
.shift-title {
    margin: 0 0 .25rem;
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.25;
}
.shift-meta { margin: 0; color: var(--muted); font-size: .875rem; line-height: 1.45; }
.shift-stats {
    display: flex;
    gap: .5rem;
    flex-shrink: 0;
}
.shift-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 4.25rem;
    padding: .45rem .7rem;
    border: 1px solid var(--border);
    background: var(--surface-muted);
}
.shift-stat-value {
    display: block;
    font-size: 1.125rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    color: var(--text);
}
.shift-stat-label {
    font-size: .65rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-top: .15rem;
}
.shift-header-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem 1rem;
    flex-wrap: wrap;
    padding-top: .75rem;
    border-top: 1px solid var(--border);
}
.shift-date-nav {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
}
.shift-date-jump { margin: 0; }
.shift-date-jump input[type="date"] { width: 10.5rem; }
.shift-date-label { font-weight: 600; font-size: .9375rem; }

.shift-toolbar {
    display: flex;
    align-items: center;
    gap: .65rem .75rem;
    flex-wrap: wrap;
    padding: .65rem 1rem;
    margin-bottom: .75rem;
    background: var(--surface-muted);
    border: 1px solid var(--border);
}
.shift-toolbar-label {
    font-size: .7rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.shift-toolbar-times {
    display: flex;
    align-items: center;
    gap: .35rem;
}
.shift-toolbar-times input { width: 6.5rem; }

.shift-workers-card { padding: 0; overflow: hidden; }
.shift-workers-card .section-header {
    padding: .85rem 1.15rem;
    margin: 0;
    border-bottom: 1px solid var(--border);
    background: var(--surface-muted);
}
.shift-workers-card .section-title { margin: 0; }

.shift-worker-list { display: flex; flex-direction: column; }
.shift-worker {
    display: grid;
    grid-template-columns: 1fr;
    gap: .6rem;
    padding: .75rem 1.15rem;
    border-bottom: 1px solid var(--border);
    border-left: 3px solid transparent;
    transition: background .12s ease, opacity .12s ease;
}
.shift-worker:last-child { border-bottom: none; }
.shift-worker--present {
    background: #f0fdf4;
    border-left-color: #86efac;
}
.shift-worker--leader.shift-worker--present {
    background: var(--primary-light);
    border-left-color: var(--primary);
}
.shift-worker--absent { opacity: .65; }
.shift-worker-check {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: .65rem;
    cursor: pointer;
    font-weight: 600;
    margin: 0;
}
.shift-worker-check input { width: 1.125rem; height: 1.125rem; flex-shrink: 0; }
.shift-worker-name {
    font-size: .9375rem;
    line-height: 1.35;
}
.shift-worker-times {
    display: flex;
    align-items: center;
    gap: .35rem;
}
.shift-worker-times input {
    width: 6.5rem;
    font-variant-numeric: tabular-nums;
}
.shift-worker-times input:disabled { opacity: .5; }
.shift-worker-note { margin: 0; font-weight: 400; }
.shift-worker-note input { width: 100%; }

@media (min-width: 720px) {
    .shift-worker {
        grid-template-columns: minmax(180px, 1.2fr) auto minmax(160px, 1fr);
        align-items: center;
        gap: 1rem;
    }
    .shift-worker-times,
    .shift-worker-note { padding-left: 0; }
}

.shift-extras {
    display: grid;
    gap: .85rem;
    margin-bottom: .75rem;
    padding: 1rem 1.15rem;
}
.shift-day-note textarea { min-height: 4rem; }
.shift-audit {
    margin: 0 0 .75rem;
    padding: 0 .15rem;
    font-size: .8125rem;
}

.shift-footer {
    position: sticky;
    bottom: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: .85rem 1.15rem;
    margin-top: .75rem;
    background: rgba(242, 246, 248, .96);
    border: 1px solid var(--border);
    border-radius: 0;
    backdrop-filter: blur(6px);
    box-shadow: 0 -4px 12px rgba(15, 23, 42, .06);
}
.shift-footer-summary { font-size: .875rem; color: var(--muted); }
.shift-footer-summary strong { color: var(--text); font-variant-numeric: tabular-nums; }
.shift-save { padding: .55rem 1.35rem; font-weight: 600; }

.shift-add-worker .section-title { margin-top: 0; }

.attendance-mobile .page-header h1 { font-size: 1.25rem; }
.attendance-date { font-size: 1.1rem; font-weight: 600; }
.attendance-meta { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .75rem; }
.date-nav--compact { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.date-jump input[type="date"] { width: 10.5rem; }
.section-title { margin: 0 0 .85rem; font-size: .9375rem; font-weight: 600; }
.worker-checklist { display: flex; flex-direction: column; gap: .75rem; }
.worker-row { border-bottom: 1px solid var(--border); padding-bottom: .75rem; }
.worker-row:last-child { border-bottom: none; padding-bottom: 0; }
.worker-row-main {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
@media (min-width: 520px) {
    .worker-row-main {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}
.worker-check {
    flex-direction: row !important;
    align-items: center;
    gap: .75rem;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    min-width: 0;
}
.worker-check input { width: 1.35rem; height: 1.35rem; flex-shrink: 0; }
.worker-name { flex: 1; }
.worker-time-fields {
    display: flex;
    align-items: center;
    gap: .35rem;
}
.worker-time-fields input { width: 6.5rem; font-variant-numeric: tabular-nums; }
.time-sep { color: var(--muted); }
.worker-note { margin-top: .5rem; font-size: .875rem; font-weight: 500; }
.worker-note input { width: 100%; margin-top: .25rem; }
.worker-search-form { display: flex; gap: .5rem; margin-bottom: .75rem; }
.worker-search-form input[type="search"] { flex: 1; }
.worker-search-results { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0);
    border: 0;
}
.time-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.time-row input {
    font-variant-numeric: tabular-nums;
}
.btn-block {
    display: block;
    width: 100%;
    padding: 1rem;
    font-size: 1.05rem;
    text-align: center;
    margin-top: 1rem;
}
.project-cards { display: flex; flex-direction: column; gap: .75rem; }
.project-card {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: box-shadow .15s;
}
.project-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); text-decoration: none; }
.project-card-title { font-weight: 700; font-size: 1.05rem; margin-bottom: .25rem; }
.project-card-meta { color: var(--muted); font-size: .875rem; margin-bottom: .5rem; }

/* Activity Log */
.date-nav {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.date-nav-label { font-weight: 600; flex: 1; min-width: 140px; }
.date-nav-total { color: var(--muted); font-size: .875rem; margin-left: auto; }
.activity-form { max-width: 560px; }
.activity-timeline { display: flex; flex-direction: column; gap: .75rem; }

/* Activity log — desktop / mobil oddělené (mobil: mobile-activity.css) */
.activity-log-page { width: 100%; }
.mobile-activity-log { display: none; }
.activity-log-desktop { display: block; width: 100%; }

.activity-entry {
    display: grid;
    grid-template-columns: 1fr;
    gap: .75rem;
}
@media (min-width: 640px) {
    .activity-entry {
        grid-template-columns: 120px 1fr auto;
        align-items: start;
    }
}
.activity-entry-time { font-weight: 700; font-variant-numeric: tabular-nums; }
.activity-hours {
    display: block;
    font-size: .8rem;
    color: var(--muted);
    font-weight: 500;
}
.activity-entry-project { margin-bottom: .25rem; }
.activity-entry-note { color: var(--muted); font-size: .875rem; }
.activity-entry-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.report-filters .filter-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 1rem;
}
.report-tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.export-bar .actions { margin-top: .75rem; }

.reports-page { max-width: none; }
.reports-page-header {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
}
.reports-period { margin: .25rem 0 0; color: var(--muted); font-size: .9375rem; }

.reports-export-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem .65rem;
    padding: .5rem .75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0;
}
.reports-export-label {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
}
.reports-export-actions { display: flex; flex-wrap: wrap; gap: .35rem; }
.reports-export-hint { font-size: .75rem; color: var(--muted); }

.reports-controls {
    display: flex;
    flex-direction: column;
    gap: .85rem;
    margin-bottom: 1.25rem;
    padding: .85rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0;
}
.reports-controls-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem 1.25rem;
}
.reports-controls-dates {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: .5rem .75rem;
}
.reports-field {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    margin: 0;
    font-size: .875rem;
    font-weight: 500;
}
.reports-field--inline {
    flex-direction: row;
    align-items: center;
    gap: .45rem;
}
.reports-field--inline .reports-field-label { margin-bottom: 0; white-space: nowrap; }
.reports-field--inline input[type="date"] {
    width: 10.5rem;
}
.reports-field--entity {
    max-width: 28rem;
}
.reports-field--entity select { width: 100%; }
.reports-field--checkbox {
    align-self: end;
    margin-bottom: .15rem;
    font-size: .875rem;
    color: var(--text);
}
.reports-field-label {
    color: var(--muted);
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.reports-presets {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    align-items: center;
}
.reports-preset {
    padding: .3rem .65rem;
    border-radius: 0;
    border: 1px solid var(--border);
    background: #f8fafc;
    color: var(--text);
    text-decoration: none;
    font-size: .8rem;
    white-space: nowrap;
}
.reports-preset:hover { text-decoration: none; border-color: var(--primary); color: var(--primary); }
.reports-preset--active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.reports-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}
.reports-tab {
    padding: .4rem .8rem;
    border-radius: 0;
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted);
    text-decoration: none;
    font-size: .875rem;
    font-weight: 500;
}
.reports-tab:hover { text-decoration: none; color: var(--primary); background: #f1f5f9; }
.reports-tab--active {
    background: var(--primary-light);
    border-color: var(--primary-border);
    color: var(--primary);
}

.reports-stats {
    margin-bottom: 1rem;
}
.reports-stats.stats--sticky {
    margin-top: 0;
}
.reports-detail-header { margin-bottom: 1rem; }
.reports-detail-top {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}
.reports-back {
    display: inline-block;
    margin-bottom: .35rem;
    font-size: .875rem;
    color: var(--muted);
}
.reports-back:hover { color: var(--primary); }
.reports-detail-title {
    margin: 0 0 .35rem;
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -.01em;
}
.reports-detail-meta { margin: 0; color: var(--muted); font-size: .9375rem; display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.reports-section-title { margin: 0; font-size: .9375rem; font-weight: 600; }
.reports-table-card .reports-section-title { margin-bottom: 1rem; }
.reports-table-card { padding: 1rem 1.25rem 1.25rem; margin-bottom: 0; }
.reports-table-card .card-header-inline { margin-bottom: 1rem; }
.reports-detail-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: start;
}
@media (min-width: 960px) {
    .reports-detail-grid--count-1 { grid-template-columns: 1fr; max-width: 28rem; }
    .reports-detail-grid--count-2 { grid-template-columns: 1fr 1fr; }
    .reports-detail-grid--count-3 { grid-template-columns: 1fr 1fr 1fr; }
}
.reports-detail-grid .reports-table-card {
    min-width: 0;
    height: 100%;
}
.reports-detail-grid .table-scroll,
.reports-detail-grid .reports-table {
    font-size: .875rem;
}
.reports-detail-grid .reports-section-title {
    margin-bottom: .75rem;
    font-size: .9375rem;
}
.reports-table { width: 100%; border-collapse: collapse; }
.reports-table th,
.reports-table td { padding: .55rem .65rem; border-bottom: 1px solid var(--border); text-align: left; }
.reports-table th.num,
.reports-table td.num {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.reports-table thead th {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--muted);
    font-weight: 600;
    background: #f8fafc;
    line-height: 1.25;
}
.reports-table thead th.num {
    white-space: normal;
    max-width: 6.5rem;
    hyphens: auto;
}
.reports-table tbody tr:last-child td { border-bottom: none; }
.reports-row-link { cursor: pointer; }
.reports-row-link:hover { background: #f8fafc; }
.reports-empty {
    color: var(--muted);
    text-align: center;
    padding: 2rem 1rem;
    font-size: .9375rem;
}
.reports-team-cell { font-size: .875rem; line-height: 1.35; }
.reports-team-leader {
    display: block;
    font-size: .8rem;
    color: var(--muted);
    font-weight: 400;
}
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    max-width: 100%;
    min-width: 0;
}
.table-scroll > table {
    width: max(100%, max-content);
    max-width: none;
}

/* Karty se přímou tabulkou — scroll uvnitř, ne mimo viewport */
.card:has(> table),
.users-table-card {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}
.users-table-card > table,
.card:has(> table) > table {
    width: max(100%, max-content);
    max-width: none;
}

.reports-person-card-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem 1.5rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.reports-person-card-intro { min-width: 0; }
.reports-person-card-intro .reports-detail-title { margin: 0; }
.reports-person-card-intro .reports-detail-meta { margin: .35rem 0 0; }
.reports-person-totals {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: 0;
}
.reports-person-total {
    margin: 0;
    padding: .5rem .85rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 0;
    text-align: right;
}
.reports-person-total dt {
    margin: 0;
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
}
.reports-person-total dd {
    margin: .15rem 0 0;
    font-size: clamp(1rem, 2vw, 1.05rem);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.reports-empty--inset {
    margin: 0;
    padding: 1.5rem 0 .25rem;
    text-align: center;
}

.reports-expand-col { width: 2rem; padding-right: 0; color: var(--muted); }
.reports-expand-icon {
    display: inline-block;
    transition: transform .15s ease;
    font-size: .75rem;
}
.reports-expand-row {
    cursor: pointer;
}
.reports-expand-row:hover { background: #f8fafc; }
.reports-expand-row--open .reports-expand-icon { transform: rotate(90deg); }
.reports-expand-detail > td {
    padding: 0 1rem 1rem 2.5rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
}
.reports-person-days {
    margin: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0;
    overflow: hidden;
}
.reports-person-days th,
.reports-person-days td { font-size: .875rem; }
.reports-team-projects {
    margin: 0;
    background: #f8fafc;
    border-radius: 0;
}
.reports-team-projects > thead th {
    font-size: .75rem;
    color: var(--muted);
}
.reports-team-member--idle { color: var(--muted); }
.reports-team-member--idle a { color: var(--muted); }
.reports-team-person {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    flex-wrap: wrap;
}
.reports-team-outside {
    font-size: .7rem;
    font-weight: 600;
    vertical-align: middle;
}
.reports-time-range { font-variant-numeric: tabular-nums; white-space: nowrap; }
.reports-note-cell {
    max-width: 14rem;
    font-size: .8125rem;
    color: var(--muted);
    word-break: break-word;
}


@media (max-width: 720px) {
    .reports-export-bar { width: 100%; }
    .reports-controls-row { flex-direction: column; align-items: stretch; }
    .audit-filters-right { margin-left: 0; width: 100%; }
    .reports-controls-dates { flex-direction: column; align-items: stretch; }
    .reports-field--inline { flex-direction: column; align-items: stretch; }
    .reports-field--inline input[type="date"] { width: 100%; }
    .reports-field--entity { max-width: none; }
}

.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1rem;
}
.filter-tab {
    padding: .4rem .85rem;
    border-radius: 0;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    font-size: .875rem;
}
.filter-tab:hover { text-decoration: none; border-color: var(--primary); }
.filter-tab--active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.list-search {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    align-items: center;
}
.list-search input[type="search"] { flex: 1; min-width: 200px; }

.live-search { position: relative; }
.live-search-input {
    width: 100%;
}
.live-search-dropdown {
    position: absolute;
    z-index: 200;
    left: 0;
    right: 0;
    top: calc(100% + .35rem);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0;
    box-shadow: var(--dropdown-shadow);
    max-height: 280px;
    overflow: auto;
}
.live-search-list {
    list-style: none;
    margin: 0;
    padding: .25rem 0;
}
.live-search-item {
    display: block;
    padding: .5rem .75rem;
    color: var(--text);
    text-decoration: none;
    font-size: var(--field-font-size);
    line-height: 1.35;
}
.live-search-item:hover,
.live-search-item:focus {
    background: var(--sidebar-hover);
    color: var(--text);
    text-decoration: none;
}
.live-search-empty {
    margin: 0;
    padding: .65rem .75rem;
    color: var(--muted);
    font-size: var(--field-font-size);
}

.activity-project-modal,
.app-modal {
    border: 1px solid var(--border);
    border-radius: 0;
    padding: 0;
    margin: auto;
    width: min(28rem, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    overflow: hidden;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--modal-shadow);
}
.activity-project-modal::backdrop,
.app-modal::backdrop {
    background: rgba(15, 23, 42, .5);
    backdrop-filter: blur(2px);
}
.activity-project-modal-form,
.app-modal-form {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 2rem);
}
.activity-project-modal-header,
.app-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .85rem 1.15rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
}
.activity-project-modal-header h2,
.app-modal-header h2 {
    margin: 0;
    font-size: .9375rem;
    font-weight: 600;
    letter-spacing: -.01em;
}
.activity-project-modal-close,
.app-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 1px solid transparent;
    border-radius: 0;
    background: transparent;
    font-size: 1.35rem;
    line-height: 1;
    color: var(--muted);
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}
.activity-project-modal-close:hover,
.app-modal-close:hover {
    color: var(--text);
    border-color: var(--border);
    background: var(--surface-muted);
}
.activity-project-modal-body,
.app-modal-body {
    display: flex;
    flex-direction: column;
    gap: .85rem;
    padding: 1.15rem;
    overflow-y: auto;
    flex: 1 1 auto;
}
.activity-project-modal-body label,
.app-modal-body label {
    gap: .3rem;
}
.activity-project-modal-footer,
.app-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
    padding: .85rem 1.15rem;
    border-top: 1px solid var(--border);
    background: var(--surface-muted);
    flex-shrink: 0;
}
.activity-project-modal-error { color: var(--danger); margin: 0; }
.pagination {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 1rem;
}
.member-chips {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}
.member-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .35rem .65rem;
    background: #f1f5f9;
    border: 1px solid var(--border);
    border-radius: 0;
    font-size: .875rem;
}
.member-chip-remove {
    color: var(--muted);
    text-decoration: none;
    font-weight: 700;
    line-height: 1;
    padding: 0 .15rem;
}
.member-chip-remove:hover { color: var(--danger); text-decoration: none; }
.team-members-block { margin: .5rem 0; }

.nav-section {
    display: block;
    padding: .85rem 1.25rem .35rem;
    font-size: .68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
}
.sidebar-main,
.sidebar-settings {
    display: flex;
    flex-direction: column;
    gap: .25rem;
}
.settings-breadcrumb {
    margin: 0 0 1rem;
    font-size: .875rem;
}
.settings-breadcrumb a { color: var(--muted); }
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}
.settings-card {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    padding: 1.25rem;
    text-decoration: none;
    color: inherit;
    transition: border-color .15s, box-shadow .15s;
}
.settings-card:hover {
    text-decoration: none;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(37, 99, 235, .12);
}
.settings-subnav {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1.25rem;
}
.settings-subnav-link {
    padding: .4rem .85rem;
    border-radius: 0;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    text-decoration: none;
    font-size: .875rem;
}
.settings-subnav-link:hover { border-color: var(--primary); text-decoration: none; }
.settings-subnav-link--active {
    background: var(--primary-light);
    border-color: var(--primary-border);
    color: var(--primary-hover);
    font-weight: 600;
}
.settings-status {
    margin-bottom: 1rem;
    padding: 1rem 1.25rem;
}
.settings-status--ok {
    border-left: 4px solid #16a34a;
    background: #f0fdf4;
}
.settings-status--warn {
    border-left: 4px solid #f59e0b;
    background: #fffbeb;
}
.settings-status p { margin: .35rem 0 0; color: var(--muted); }
.settings-organization-options {
    display: grid;
    gap: .75rem;
    margin-bottom: 1rem;
}
.settings-organization-option {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
    padding: 1rem 1.25rem;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: border-color .15s, box-shadow .15s;
}
.settings-organization-option:hover { border-color: var(--primary-border); }
.settings-organization-option--active {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary-border);
}
.settings-organization-option input { margin-top: .2rem; }
.settings-organization-option-body { display: grid; gap: .25rem; }
.settings-notifications-table { width: 100%; }
.settings-notifications-table td,
.settings-notifications-table th { vertical-align: top; }
.settings-notifications-default { color: var(--muted); font-size: .875rem; white-space: nowrap; }
.settings-notifications-input { width: 100%; min-width: 0; }
.settings-notifications-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
}
.settings-notifications-form > .form-actions { grid-column: 1 / -1; }
.settings-notifications-help {
    margin-bottom: 1rem;
    padding: 1rem 1.25rem;
}
.settings-notifications-help-list {
    margin: 0;
    padding-left: 1.2rem;
    color: var(--muted);
    font-size: .875rem;
    line-height: 1.55;
}
.settings-notifications-help-list li + li { margin-top: .35rem; }
.settings-notification-card {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    height: 100%;
    margin: 0;
}
.settings-notification-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    flex-wrap: wrap;
}
.settings-notification-audience { font-size: .7rem; font-weight: 600; }
.settings-notification-desc {
    margin: 0;
    font-size: .875rem;
    color: var(--muted);
    line-height: 1.45;
}
.settings-notification-toggle { font-size: 1rem; }
.settings-notification-admins {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    padding: .65rem .75rem;
    border: 1px solid var(--border);
    border-radius: 0;
    background: #f8fafc;
}
.settings-notification-admins--disabled {
    opacity: .55;
}
.settings-notification-email {
    color: var(--muted);
    font-size: .8125rem;
}
.settings-notification-custom {
    margin-top: .15rem;
    font-size: .875rem;
}
.settings-notification-custom input { margin-top: .35rem; }

.users-summary { margin: 0 0 1rem; }
.users-table-card { padding: 0; overflow-x: auto; overflow-y: visible; }
.users-table-card .users-table { margin: 0; }
.users-team-cell { font-size: .875rem; }
.users-form-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
}
.users-form-layout .section-title { margin-top: 0; }
.users-form-actions { margin-top: 1rem; }
.users-teams-card { margin-top: 1rem; }
.users-led-teams {
    margin: 0;
    padding-left: 1.2rem;
    line-height: 1.6;
}
.users-danger-card { margin-top: 1rem; border-color: #fecaca; }
.users-danger-card .section-title { margin-top: 0; color: #991b1b; }
.users-danger-action {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
    margin-bottom: .75rem;
}
.users-danger-action:last-child { margin-bottom: 0; }
.audit-filters { margin-bottom: 1rem; }
.audit-filters-entity select { min-width: 12rem; }
.audit-filters-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
    margin-left: auto;
}
.audit-table .audit-time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.audit-table .audit-detail { color: var(--muted); font-size: .875rem; }
.clients-form-layout {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
}
.clients-form-layout .section-title { margin-top: 0; }
.clients-form-grid { max-width: none; }
.clients-form-actions { margin-top: 1rem; }
.project-form-layout {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
}
.project-form-layout .section-title { margin-top: 0; }
.project-form-grid { max-width: none; }
.project-form-actions { margin-top: 1rem; }
.projects-table tbody + tbody tr:first-child td,
.projects-table tbody + tbody tr:first-child th { border-top: 1px solid var(--border); }
.projects-teams-cell { white-space: nowrap; }
.projects-teams-toggle {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    color: var(--primary);
    font-weight: 500;
}
.projects-expand-icon {
    display: inline-block;
    transition: transform .15s ease;
    font-size: .75rem;
    color: var(--muted);
}
.projects-expand-row { cursor: pointer; }
.projects-expand-row:hover { background: #f8fafc; }
.projects-expand-row--open .projects-expand-icon { transform: rotate(90deg); }
.projects-expand-detail > td {
    padding: 0 1rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
}
.projects-teams-detail {
    width: 100%;
    max-width: 36rem;
    margin: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0;
    border-collapse: collapse;
    overflow: hidden;
}
.projects-teams-detail th,
.projects-teams-detail td { font-size: .875rem; }
.clients-table a { text-decoration: none; }
.clients-table a:hover { text-decoration: underline; }
.project-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--border);
}
.project-tab {
    padding: .45rem .9rem;
    border-radius: 0;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    font-size: .875rem;
    font-weight: 500;
}
.project-tab:hover { text-decoration: none; border-color: var(--primary); color: var(--primary); }
.project-tab--active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.project-tab--muted {
    border-color: transparent;
    background: transparent;
    color: var(--muted);
    font-weight: 400;
}
.project-tab--muted:hover { background: #f1f5f9; color: var(--primary); }

.hours-day { padding: 0; overflow: hidden; }
.hours-day--nested { margin-bottom: 1rem; }
.hours-day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: .85rem 1.25rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
}
.hours-day-title {
    margin: 0;
    font-size: .95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.hours-day-total {
    font-size: .875rem;
    font-weight: 600;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}
.hours-day-empty { padding: 1rem 1.25rem; margin: 0; }
.hours-day-footer { padding: .75rem 1.25rem; border-top: 1px solid var(--border); }

.hours-entry {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: .85rem 1.25rem;
    border-bottom: 1px solid var(--border);
}
.hours-entry--cols {
    display: grid;
    grid-template-columns:
        2.25rem
        minmax(7rem, 1.05fr)
        minmax(6rem, .9fr)
        minmax(9rem, 1.2fr)
        minmax(8rem, 1.15fr)
        4.25rem
        auto;
    gap: .5rem .85rem;
    align-items: start;
    padding: .7rem 1rem;
}
.hours-entry-cell { min-width: 0; font-size: .875rem; }
.hours-entry-cell--mode {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: .1rem;
}
.hours-entry-cell--title {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    line-height: 1.35;
}
.hours-entry-cell--title strong { font-weight: 600; }
.hours-entry-cell--detail {
    color: var(--text);
    line-height: 1.4;
}
.hours-entry-cell--workers .hours-worker-list {
    margin: 0;
    padding-left: 1rem;
}
.hours-entry-cell--note .hours-entry-note {
    margin: 0;
    line-height: 1.4;
    font-size: .8rem;
}
.hours-entry-cell--duration {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.hours-entry-cell--actions {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
}
.hours-entry:last-child { border-bottom: none; }
.hours-entry--missing { background: #fffbeb; }
.hours-entry-main {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
    min-width: 0;
    flex: 1;
}
.hours-entry-body { min-width: 0; flex: 1; }
.hours-entry-title {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem .65rem;
    align-items: baseline;
    margin-bottom: .25rem;
}
.hours-entry-meta { color: var(--muted); font-size: .875rem; font-weight: 400; }
.hours-entry-detail { font-size: .875rem; }
.hours-entry-aside {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .5rem;
    flex-shrink: 0;
}
.hours-entry-duration {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    font-size: .875rem;
    white-space: nowrap;
}
.hours-worker-list {
    margin: .35rem 0 0;
    padding-left: 1.1rem;
    color: var(--muted);
    font-size: .8rem;
}
@media (max-width: 960px) {
    .hours-entry--cols {
        grid-template-columns: 2.25rem 1fr auto;
        grid-template-areas:
            "mode title actions"
            "mode detail duration"
            "mode workers workers"
            "mode note note";
    }
    .hours-entry-cell--mode { grid-area: mode; }
    .hours-entry-cell--title { grid-area: title; }
    .hours-entry-cell--detail { grid-area: detail; }
    .hours-entry-cell--workers { grid-area: workers; }
    .hours-entry-cell--note { grid-area: note; }
    .hours-entry-cell--duration {
        grid-area: duration;
        text-align: right;
        align-self: center;
    }
    .hours-entry-cell--actions { grid-area: actions; }
}
.hours-worker-list--block {
    padding: 0 1.25rem .75rem;
    list-style: none;
    margin: 0;
}
.hours-worker-list--block li {
    padding: .35rem 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: .875rem;
    color: var(--text);
}
.hours-worker-list--block li:last-child { border-bottom: none; }

.hours-menubar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .65rem;
    padding: .75rem 1rem;
    margin-bottom: 0;
}
.activity-menubar-sticky {
    position: sticky;
    top: 0;
    z-index: 30;
    margin: 0 0 1rem;
    padding: .5rem 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(15, 23, 42, .06);
}
.activity-menubar-sticky .hours-menubar {
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}
.hours-menubar-mode {
    flex: 0 0 auto;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.hours-menubar-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-left: auto;
    flex-wrap: wrap;
}
.hours-menubar label { margin: 0; font-weight: 400; }
.hours-menubar input[type="text"],
.hours-menubar input[type="date"],
.hours-menubar input[type="time"],
.hours-menubar select {
    min-height: var(--field-height);
}
.hours-menubar-note {
    flex: 1 1 200px;
    min-width: 160px;
}
.hours-menubar-note input { width: 100%; }
.hours-menubar-project {
    flex: 0 1 7.5rem;
    min-width: 0;
    max-width: 7.5rem;
}
.hours-menubar-project select {
    width: 100%;
    max-width: 100%;
}
.hours-menubar-datetime {
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    gap: .45rem;
    flex: 0 0 auto;
}
.hours-menubar-date {
    display: inline-flex;
    flex-shrink: 0;
}
.hours-menubar-date input { width: 8.5rem; }
.hours-menubar-time {
    display: flex;
    align-items: center;
    gap: .25rem;
    flex-shrink: 0;
}
.hours-menubar-time input { width: 5.25rem; }
.hours-menubar-sep { color: var(--muted); }
.hours-menubar-weekend {
    flex-direction: row !important;
    align-items: center;
    gap: .35rem;
    font-size: .8rem;
    white-space: nowrap;
    flex: 0 0 auto;
}
.hours-menubar-weekend input { width: auto; }
.hours-menubar-submit,
.hours-menubar-cancel {
    flex-shrink: 0;
}
.hours-menubar-submit {
    padding: .55rem 1.25rem;
    font-weight: 600;
}

/* Desktop — jeden řádek (stránka Hodiny + Můj log na široké obrazovce) */
@media (min-width: 769px) {
    .hours-menubar--toolbar {
        display: grid;
        grid-template-columns: minmax(12rem, 1.15fr) minmax(8rem, 2fr) max-content max-content max-content;
        align-items: center;
        column-gap: .65rem;
        row-gap: .5rem;
    }
    .hours-menubar--toolbar .hours-menubar-mode {
        grid-column: 1 / -1;
    }
    .hours-menubar--toolbar .hours-menubar-project {
        max-width: none;
        width: auto;
        min-width: 12rem;
    }
    .hours-menubar--toolbar .hours-menubar-note {
        min-width: 0;
    }
    .hours-menubar--toolbar .hours-menubar-datetime {
        min-width: max-content;
        white-space: nowrap;
    }
    .hours-menubar--toolbar .hours-menubar-actions {
        margin-left: 0;
        justify-self: end;
    }
}

.report-filter-bar {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    padding: .85rem 1rem;
    margin-bottom: 1rem;
}
.report-filter-bar-section {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: flex-end;
}
.report-filter-bar-entities {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: .65rem .75rem;
    align-items: end;
}
.report-filter-field {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    margin: 0;
    min-width: 0;
}
.report-filter-field select {
    width: 100%;
}
.report-filter-label {
    color: var(--muted);
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.report-filter-apply {
    align-self: end;
    white-space: nowrap;
}
.report-filter-clear {
    align-self: end;
    white-space: nowrap;
}
.report-filter-bar-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem 1rem;
    padding-top: .75rem;
    border-top: 1px solid var(--border);
}
.report-view-tabs {
    display: flex;
    gap: .25rem;
    background: #f1f5f9;
    padding: .2rem;
    border-radius: 0;
}
.report-view-tab {
    padding: .35rem .85rem;
    border-radius: 0;
    font-size: .875rem;
    font-weight: 500;
    color: var(--muted);
    text-decoration: none;
}
.report-view-tab:hover {
    color: var(--text);
    text-decoration: none;
}
.report-view-tab--active {
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
}
.reports-items-card { margin-top: 0; }
.reports-items-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}
.reports-items-totals {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem 1.25rem;
    margin: 0;
}
.reports-items-totals > div {
    min-width: 0;
}
.reports-items-totals dt {
    font-size: .7rem;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0;
}
.reports-items-totals dd {
    margin: .15rem 0 0;
    font-size: clamp(1rem, 2vw, 1.1rem);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.reports-items-table {
    table-layout: auto;
    width: max(100%, max-content);
}
.reports-items-table .col-item { width: auto; min-width: 10rem; }
.reports-items-table .col-project { width: auto; min-width: 7rem; }
.reports-items-table .col-time,
.reports-items-table .col-date,
.reports-items-table .col-incost,
.reports-items-table .col-hours,
.reports-items-table .col-amount,
.reports-items-table .col-actions {
    width: 1%;
    white-space: nowrap;
}
.reports-items-table th,
.reports-items-table td {
    vertical-align: top;
    padding: .55rem .5rem;
}
.reports-items-table thead th {
    vertical-align: bottom;
    white-space: nowrap;
}
.reports-items-table .reports-time-range,
.reports-items-table td.num,
.reports-items-table th.num {
    white-space: nowrap;
}
.reports-items-table td.actions {
    display: table-cell;
    white-space: nowrap;
    text-align: right;
    vertical-align: top;
}
.reports-items-table td.actions .btn {
    display: inline-flex;
    align-items: center;
    margin-left: .25rem;
}
.reports-items-table td.actions .btn:first-child {
    margin-left: 0;
}
.reports-inline-forms {
    display: none;
}
.reports-td-item,
.reports-td-project {
    min-width: 0;
}
.reports-project-name {
    display: block;
    font-size: .875rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
}
.reports-person-name {
    margin-top: .2rem;
    font-size: .8125rem;
    color: var(--text);
}
.reports-item-note {
    margin-top: .35rem;
    font-size: .8125rem;
    font-weight: 400;
    line-height: 1.4;
    color: var(--text);
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.reports-items-table .reports-time-range {
    font-variant-numeric: tabular-nums;
}
.reports-inline-note {
    display: block;
    width: 100%;
    margin-top: .35rem;
    min-height: 2.1rem;
    height: 2.1rem;
    max-height: 10rem;
    overflow-x: hidden;
    overflow-y: hidden;
    resize: vertical;
    font: inherit;
    font-size: .8125rem;
    font-weight: 400;
    line-height: 1.35;
    padding: .35rem .5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    box-sizing: border-box;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.reports-inline-times {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: .25rem;
}
.reports-inline-times .time-sep {
    display: none;
}
.reports-inline-times input[type="time"] {
    width: 100%;
    max-width: 7.5rem;
    font: inherit;
    font-size: .8125rem;
    font-variant-numeric: tabular-nums;
    padding: .3rem .35rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    box-sizing: border-box;
}
.reports-td-date {
    white-space: nowrap;
    font-size: .8125rem;
    line-height: 1.35;
}
.reports-td-incost {
    text-align: center;
}
.reports-in-cost-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}
.reports-in-cost-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
}
.reports-in-cost-track {
    position: relative;
    width: 2.5rem;
    height: 1.35rem;
    border-radius: 999px;
    background: #cbd5e1;
    transition: background .15s ease;
    flex-shrink: 0;
}
.reports-in-cost-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 1.05rem;
    height: 1.05rem;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .2);
    transition: transform .15s ease;
}
.reports-in-cost-toggle input[type="checkbox"]:checked + .reports-in-cost-track {
    background: var(--primary, #1d6fa5);
}
.reports-in-cost-toggle input[type="checkbox"]:checked + .reports-in-cost-track::after {
    transform: translateX(1.15rem);
}
.reports-in-cost-toggle input[type="checkbox"]:focus-visible + .reports-in-cost-track {
    outline: 2px solid var(--primary, #1d6fa5);
    outline-offset: 2px;
}
.reports-inline-select {
    width: 100%;
    max-width: 5rem;
    font: inherit;
    font-size: .8125rem;
    padding: .3rem .35rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
}
.reports-td-hours,
.reports-td-amount {
    font-variant-numeric: tabular-nums;
    font-size: .875rem;
}
.reports-item-row--out-of-cost {
    background: #fff7ed;
}
.reports-item-row--out-of-cost[data-amount-kind="cost"] .reports-td-amount {
    color: var(--muted);
    text-decoration: line-through;
}
.reports-item-row--saving {
    opacity: .72;
}
.reports-item-row--saved {
    outline: 1px solid rgba(29, 111, 165, .35);
    outline-offset: -1px;
}
.reports-item-row--error {
    background: #fef2f2;
}
@media (min-width: 1100px) {
    .reports-inline-times {
        flex-direction: row;
        align-items: center;
        gap: .2rem;
    }
    .reports-inline-times .time-sep {
        display: inline;
    }
    .reports-inline-times input[type="time"] {
        width: 6.75rem;
    }
}
@media (max-width: 900px) {
    .report-filter-bar-footer { flex-direction: column; align-items: stretch; }
    .report-filter-clear { width: 100%; text-align: center; }
}

/* Hub — jedna scroll stránka */
.hub-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: .75rem;
}
.hub-toolbar { display: flex; gap: .5rem; flex-wrap: wrap; }
.hub-banner { margin-bottom: 1rem; }
.hub-section {
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card, #fff);
}
.hub-section-summary {
    padding: .85rem 1rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.hub-section-summary::-webkit-details-marker { display: none; }
.hub-section-summary::before {
    content: '▸ ';
    display: inline-block;
    transition: transform .15s;
}
.hub-section[open] > .hub-section-summary::before { transform: rotate(90deg); }
.hub-section-body { padding: 0 1rem 1rem; }
.hub-section-body > .card:first-child { margin-top: 0; }

/* Project hub */
.project-hub { width: 100%; max-width: none; }

.hub-page-header {
    align-items: flex-start;
    gap: 1rem;
}
.hub-page-header-main { min-width: 0; flex: 1; }
.hub-page-header h1 {
    margin-bottom: .35rem;
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -.02em;
}
.hub-page-meta {
    margin: 0;
    font-size: .875rem;
    color: var(--muted);
    line-height: 1.45;
}
.hub-page-meta strong { color: var(--text); }

.hub-period-form.card {
    padding: .65rem 1rem;
    margin-bottom: .65rem;
}
.hub-period-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .65rem 1rem;
    width: 100%;
}

.hub-period-field {
    display: block;
}
.hub-period-field input[type="date"] {
    width: 10.5rem;
}

.hub-summary { margin-bottom: .75rem; }
.stats--hub {
    margin-bottom: 0;
    gap: .65rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 7.5rem), 1fr));
}
.stats--hub .stat {
    padding: .65rem .85rem;
}
.stats--hub .stat-value {
    font-size: clamp(1rem, 1.8vw, 1.125rem);
    line-height: 1.25;
}
.stats--hub .stat-label {
    font-size: .7rem;
    margin-top: .15rem;
}
.hub-breakdown {
    margin-top: .65rem;
    padding-top: .65rem;
    border-top: 1px solid var(--border);
}
.hub-breakdown-title {
    display: block;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--muted);
    margin-bottom: .5rem;
}
.stats--hub-breakdown {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 5.5rem), 1fr));
}
.hub-shift-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: .75rem;
}

.hub-person-badge { margin-left: .25rem; font-size: .7rem; vertical-align: middle; }
.hub-teams-line { margin: .35rem 0 0; font-size: .8rem; }
.hub-period-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem 1rem;
    padding: .75rem 1rem;
    margin-bottom: .75rem;
}
.hub-period-presets { display: flex; flex-wrap: wrap; gap: .35rem; }
.hub-period-preset {
    padding: .3rem .65rem;
    font-size: .8rem;
    border: 1px solid var(--border);
    border-radius: 0;
    text-decoration: none;
    color: inherit;
    background: var(--surface);
}
.hub-period-preset:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.hub-period-preset--active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.hub-period-dates {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}

.hub-banner--compact { padding: 0; margin-bottom: 0; }
.hub-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .25rem .35rem;
    font-size: .875rem;
}
.hub-meta-sep { color: var(--muted); }
.hub-stats-inline {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-top: .65rem;
}
.hub-stat-pill {
    display: inline-flex;
    align-items: baseline;
    gap: .3rem;
    padding: .3rem .6rem;
    border: 1px solid var(--border);
    border-radius: 0;
    background: #f8fafc;
    font-size: .8125rem;
}
.hub-stat-pill-value {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.hub-stat-pill-label { color: var(--muted); font-size: .75rem; }
.hub-stat-pill--positive { border-color: #bbf7d0; background: #f0fdf4; }
.hub-stat-pill--positive .hub-stat-pill-value { color: #166534; }
.hub-stat-pill--negative { border-color: #fecaca; background: #fef2f2; }
.hub-stat-pill--negative .hub-stat-pill-value { color: var(--danger); }
.hub-stat-pill--muted { background: var(--surface); }

.hub-costs-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
}
.hub-cost-card {
    padding: .75rem;
    margin-bottom: 0;
}
.hub-cost-title { margin: 0 0 .65rem; font-size: .9rem; font-weight: 600; }
.hub-cost-empty { margin: .5rem 0 0; }
.hub-cost-table-wrap {
    margin-top: .25rem;
    max-height: 16rem;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 0;
}
.hub-cost-table {
    width: 100%;
    margin: 0;
    font-size: .8125rem;
    border-collapse: collapse;
}
.hub-cost-table th,
.hub-cost-table td {
    padding: .35rem .5rem;
    border-bottom: 1px solid var(--border);
    font-size: .8125rem;
    line-height: 1.4;
}
.hub-cost-table th { background: #f8fafc; font-size: .75rem; position: sticky; top: 0; }
.hub-cost-table tr:last-child td { border-bottom: none; }
.hub-cost-table .num { text-align: right; white-space: nowrap; }
.hub-cost-table form { margin: 0; }
.hub-cost-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .35rem;
    white-space: nowrap;
}
.hub-cost-note {
    color: var(--muted);
    font-size: .8rem;
    max-width: 12rem;
}

@media (max-width: 900px) {
    .hub-costs-grid { grid-template-columns: 1fr; }
    .stats--hub-breakdown {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 5.5rem), 1fr));
    }
}
.project-hub .hours-day { margin-bottom: .75rem; }
.project-hub .hours-day.card { padding: 0; overflow: hidden; }
.project-hub .hours-day-header { padding: .75rem 1rem; }

/* Řádkové menu v seznamech */
.row-menu { position: relative; display: inline-block; }
.row-menu-trigger { list-style: none; cursor: pointer; min-width: 2rem; text-align: center; }
.row-menu-trigger::-webkit-details-marker { display: none; }
td.actions,
th.actions {
    position: relative;
    overflow: visible;
    white-space: nowrap;
    width: 1%;
}
table:has(.row-menu[open]) { overflow: visible; }
.row-menu-popover {
    position: absolute;
    right: 0;
    top: calc(100% + .25rem);
    z-index: 200;
    min-width: 9rem;
    padding: .25rem 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0;
    box-shadow: var(--dropdown-shadow);
}
.row-menu:not([open]) .row-menu-popover { display: none; }
.row-menu-popover a,
.row-menu-popover button {
    display: block;
    width: 100%;
    padding: .5rem .75rem;
    text-align: left;
    background: none;
    border: none;
    font-size: var(--field-font-size);
    line-height: 1.35;
    color: var(--text);
    cursor: pointer;
    text-decoration: none;
}
.row-menu-popover a:hover,
.row-menu-popover button:hover {
    background: var(--sidebar-hover);
    text-decoration: none;
}
.row-menu-popover form { margin: 0; }
.row-menu-danger { color: #b91c1c; }

/* Hustší tabulky na užších obrazovkách — méně paddingu, scroll místo lámání čísel */
@media (max-width: 1100px) {
    th, td {
        padding: .55rem .65rem;
    }
    .reports-table th,
    .reports-table td {
        padding: .45rem .5rem;
    }
}
