/* Audit log */
.audit-log-filters__top {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 15px;
    margin-bottom: 12px;
}
.audit-log-filters__search {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.audit-log-filters__search label {
    font-size: 12px;
    font-weight: bold;
    color: #7f8c8d;
    text-transform: uppercase;
    margin: 0;
}
.audit-log-filters__clear-btn {
    flex: 0 0 auto;
    margin-left: auto;
    align-self: flex-end;
}
.audit-log-filters__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px 16px;
    margin-bottom: 16px;
}
.audit-log-filters__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.audit-log-results__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.audit-log-results__count {
    color: var(--color-text-subtle);
    font-size: 14px;
}
.audit-log-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.audit-log-table th,
.audit-log-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--color-border);
    vertical-align: top;
    text-align: left;
    color: var(--color-text-primary);
}
.audit-log-table th {
    background: var(--color-bg-header);
    font-weight: 600;
    color: var(--color-text-table-header);
}
.audit-log-table tbody tr:hover {
    background: var(--color-bg-hover-row);
}
.audit-log-summary {
    max-width: 420px;
    word-break: break-word;
}
.audit-log-role {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 4px;
    background: #e2e8f0;
    color: #475569;
    font-size: 11px;
    text-transform: uppercase;
}
.audit-log-ip {
    font-family: Consolas, monospace;
    font-size: 12px;
    color: var(--color-text-muted);
}
.audit-log-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--color-bg-header);
    color: var(--color-text-secondary);
    font-size: 12px;
    white-space: nowrap;
}
.audit-log-badge--delete,
.audit-log-badge--login_failed,
.audit-log-badge--login_blocked,
.audit-log-badge--storno {
    background: var(--color-alert-error-bg);
    color: var(--color-alert-error-text);
}
.audit-log-badge--create,
.audit-log-badge--login {
    background: var(--color-alert-success-bg);
    color: var(--color-alert-success-text);
}
.audit-log-badge--update,
.audit-log-badge--settings {
    background: var(--color-bulk-bar-bg);
    color: var(--color-bulk-bar-text);
}
.audit-log-badge--export,
.audit-log-badge--send_email,
.audit-log-badge--finalize,
.audit-log-badge--invoice,
.audit-log-badge--bulk_invoice {
    background: var(--color-alert-warning-bg);
    color: var(--color-alert-warning-text);
}
.audit-log-empty {
    color: var(--color-text-muted);
    padding: 12px 0;
}
.audit-log-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}
.audit-log-pagination__link {
    color: var(--color-link);
    text-decoration: none;
    font-weight: 600;
}
.audit-log-pagination__link:hover {
    text-decoration: underline;
}
.audit-log-pagination__info {
    color: var(--color-text-muted);
    font-size: 14px;
}

/* Archiv starého SERVISu */
.container--archiv {
    max-width: 1400px;
}
.archiv-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}
.archiv-nav__link {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 6px;
    border: 1px solid var(--color-border);
    background: var(--color-bg-surface);
    color: var(--color-text-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}
.archiv-nav__link:hover {
    background: var(--color-bg-surface-muted);
    border-color: #cbd5e1;
}
.archiv-nav__link--active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}
.archiv-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}
.archiv-kpi {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 4px 6px -1px var(--color-shadow-sm);
}
.archiv-kpi--link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.archiv-kpi--link:hover {
    border-color: var(--color-bulk-bar-border);
    box-shadow: 0 6px 12px -4px var(--color-shadow-md);
}
.archiv-firma-row--retail td {
    background: var(--color-alert-warning-bg);
}
.archiv-firma-row--retail.mobile-card {
    border-color: var(--color-alert-warning-border);
    background: var(--color-alert-warning-bg);
}
.archiv-kpi__value {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-text-strong);
}
.archiv-kpi__label {
    font-size: 12px;
    color: var(--color-text-subtle);
    margin-top: 4px;
}
.archiv-alert {
    border-color: var(--color-alert-warning-border);
    background: var(--color-alert-warning-bg);
    color: var(--color-alert-warning-text);
}
.archiv-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.archiv-table th,
.archiv-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    vertical-align: top;
    color: var(--color-text-primary);
}
.archiv-table th {
    background: var(--color-bg-surface-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-text-table-header);
}
.archiv-table tbody tr:hover {
    background: var(--color-bg-hover-row);
}
.archiv-cell-truncate {
    max-width: 280px;
}
.archiv-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px 20px;
    margin-bottom: 20px;
}
.archiv-detail-grid div {
    font-size: 14px;
}
.archiv-detail-grid dt {
    color: var(--color-text-subtle);
    font-size: 12px;
    margin-bottom: 4px;
}
.archiv-detail-grid dd {
    margin: 0;
    color: var(--color-text-strong);
}
.archiv-pre {
    white-space: pre-wrap;
    word-break: break-word;
    background: var(--color-bg-surface-muted);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 12px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.45;
    margin: 0 0 16px;
    color: var(--color-text-primary);
}
.archiv-table__action {
    white-space: nowrap;
    text-align: right;
    width: 1%;
}
.archiv-inline-action {
    display: inline-flex;
    margin-left: 8px;
    vertical-align: middle;
}
.archiv-filters {
    margin-bottom: 20px;
}
.archiv-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.archiv-faktura-event-links a {
    font-weight: 600;
}
.archiv-faktura-preview {
    margin-top: 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}
.archiv-faktura-preview__frame {
    display: block;
    width: 100%;
    min-height: 720px;
    border: 0;
    background: #fff;
}

/* Přehledy a statistiky */
.container--statistics {
    max-width: 1400px;
}
.stats-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.stats-kpi {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 18px 16px;
    box-shadow: 0 4px 6px -1px var(--color-shadow-sm);
    text-align: center;
}
.stats-kpi__value {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-text-strong);
    line-height: 1.2;
    margin-bottom: 6px;
}
.stats-kpi__label {
    font-size: 12px;
    color: var(--color-text-subtle);
    line-height: 1.35;
}
.stats-section {
    margin-bottom: 20px;
}
.stats-section--alerts {
    border-color: var(--color-alert-warning-border);
    background: var(--color-alert-warning-bg);
    color: var(--color-alert-warning-text);
}
.stats-type-bars {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
}
.stats-type-row__label {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
    color: var(--color-text-table-header);
    margin-bottom: 6px;
}
.stats-type-row__label strong {
    color: var(--color-text-strong);
    white-space: nowrap;
}
.stats-type-row__track {
    height: 10px;
    background: var(--color-border);
    border-radius: 999px;
    overflow: hidden;
}
.stats-type-row__fill {
    height: 100%;
    border-radius: 999px;
    min-width: 2px;
}
.stats-bar--onsite { background: #22c55e; }
.stats-bar--remote { background: #3b82f6; }
.stats-bar--express { background: #f97316; }
.stats-bar--absence-1 { background: #14b8a6; }
.stats-bar--absence-2 { background: #8b5cf6; }
.stats-bar--absence-3 { background: #64748b; }
.stats-bar--absence-4 { background: #ec4899; }
.stats-bar--absence-5 { background: #eab308; }
.stats-section--absence {
    border-top: 3px solid #14b8a6;
}
.stats-kpi-grid--compact {
    margin-bottom: 16px;
}
.stats-subheading {
    margin: 18px 0 10px;
    font-size: 15px;
    color: var(--color-text-heading);
}
.stats-two-col--absence {
    margin-top: 8px;
    margin-bottom: 0;
}
.stats-absence-types-cell {
    font-size: 12px;
    line-height: 1.45;
    color: var(--color-text-secondary);
}
.stats-table--absence-entitlements th,
.stats-table--absence-entitlements td {
    font-size: 13px;
}
.stats-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    padding-top: 8px;
    border-top: 1px solid var(--color-border);
}
.stats-detail-grid div {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: var(--color-text-subtle);
}
.stats-detail-grid strong {
    color: var(--color-text-strong);
    font-size: 15px;
}
.stats-two-col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}
.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.stats-table th,
.stats-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    vertical-align: middle;
    color: var(--color-text-primary);
}
.stats-table th {
    background: var(--color-bg-surface-muted);
    color: var(--color-text-table-header);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.stats-table tbody tr:hover {
    background: var(--color-bg-hover-row);
}
.stats-table--clients {
    font-size: 13px;
}
.stats-limit-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.stats-limit--ok {
    background: var(--color-alert-success-bg);
    color: var(--color-alert-success-text);
}
.stats-limit--warning {
    background: var(--color-alert-warning-bg);
    color: var(--color-alert-warning-text);
}
.stats-limit--over {
    background: var(--color-alert-error-bg);
    color: var(--color-alert-error-text);
}
.stats-limit--none {
    background: var(--color-bg-header);
    color: var(--color-text-subtle);
}
.stats-empty {
    color: var(--color-text-subtle);
    margin: 0;
}

/* Filtry – sjednocení vstupů ve filtračních sekcích */
.filter-panel input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="hidden"]),
.filter-panel select,
.filter-panel textarea,
.filter-section-card input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="hidden"]),
.filter-section-card select,
.filter-section-card textarea,
.search-action-row-flex input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="hidden"]) {
    background-color: var(--color-bg-input);
    color: var(--color-text-primary);
    border-color: var(--color-border-input);
}

.filter-control:focus-visible {
    outline: none;
    border-color: var(--color-link);
    box-shadow: 0 0 0 3px var(--color-focus-ring-shadow);
}

/* Logo – světlý / tmavý motiv */
.app-logo-wrap {
    display: inline-flex;
    align-items: center;
    line-height: 0;
    flex-shrink: 0;
}
.app-logo__img--dark {
    display: none;
}
[data-theme="dark"] .app-logo__img--light {
    display: none;
}
[data-theme="dark"] .app-logo__img--dark {
    display: block;
}
.login-header .app-logo-wrap {
    display: block;
    margin: 0 auto 15px auto;
}
.login-page-wrapper .app-logo__img--light {
    display: block;
    margin: 0 auto;
}
.login-page-wrapper .app-logo__img--dark {
    display: none;
    margin: 0 auto;
}
[data-theme="dark"] .login-page-wrapper .app-logo__img--light {
    display: none;
}
[data-theme="dark"] .login-page-wrapper .app-logo__img--dark {
    display: block;
}
@media print {
    .app-logo__img--dark {
        display: none !important;
    }
    .app-logo__img--light {
        display: block !important;
    }
}

/* =======================================================================
   Přepínač světlý / tmavý motiv
   ======================================================================= */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-bg-surface-muted);
    color: var(--color-text-heading);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    flex-shrink: 0;
}
.theme-toggle:hover {
    background: var(--color-bg-hover-row);
    border-color: var(--color-border-table-strong);
}
.theme-toggle--floating {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 10000;
    box-shadow: 0 2px 8px var(--color-shadow-sm);
}
.theme-toggle__icon--dark {
    display: none;
}
[data-theme="dark"] .theme-toggle__icon--light {
    display: none;
}
[data-theme="dark"] .theme-toggle__icon--dark {
    display: inline;
}

/* Tmavý motiv – doplňkové přepsání prvků se zachovanými pevnými barvami */
[data-theme="dark"] .header-back-link {
    color: var(--color-link);
}
[data-theme="dark"] .header-brand a:hover,
[data-theme="dark"] .header-brand .header-back-link:hover {
    color: var(--color-link-hover);
}
[data-theme="dark"] .header-profile-link {
    color: var(--color-text-primary);
}
[data-theme="dark"] .audit-log-role {
    background: var(--color-bg-header);
    color: var(--color-text-subtle);
}
[data-theme="dark"] .audit-log-ip {
    color: var(--color-text-muted);
}
[data-theme="dark"] .mobile-card-list__toolbar {
    background: var(--color-bg-surface-alt);
    border-color: var(--color-border);
    color: var(--color-text-primary);
}
[data-theme="dark"] .mobile-card__actions {
    background: var(--color-bg-surface-muted);
    border-top-color: var(--color-border);
}
[data-theme="dark"] .toggle-form-section,
[data-theme="dark"] .form-section {
    background: var(--color-bg-surface);
    border-color: var(--color-border);
}
[data-theme="dark"] .form-section-title {
    color: var(--color-text-heading);
    border-bottom-color: var(--color-border);
}
[data-theme="dark"] td,
[data-theme="dark"] th {
    color: inherit;
}
[data-theme="dark"] select option {
    background: var(--color-bg-surface);
    color: var(--color-text-primary);
}
