/* Lykke Data Lake — einheitliches Tabellen-Design */

:root {
    --lykke-table-border: #e9ecef;
    --lykke-table-header-bg: #f8fafc;
    --lykke-table-header-color: #64748b;
    --lykke-table-row-hover: #f8fafc;
    --lykke-brand: #667eea;
    --lykke-brand-dark: #764ba2;
    --lykke-brand-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --lykke-brand-soft: rgba(102, 126, 234, 0.12);
    --lykke-brand-soft-hover: rgba(102, 126, 234, 0.2);
    --lykke-brand-border: rgba(102, 126, 234, 0.35);
    --lykke-table-accent: #667eea;
    --lykke-table-accent-portal: #667eea;
}

/* ── Wrapper ── */
.lykke-table-wrap,
.xp-table-wrap,
.xv-table-wrap,
.zfa-table-wrap,
.zf-preview-table-wrap {
    overflow-x: auto;
    background: #fff;
    border-radius: 8px;
    border: 1px solid var(--lykke-table-border);
}

.lykke-table-wrap--plain {
    border: none;
    background: transparent;
    border-radius: 0;
}

/* ── Basis-Tabelle ── */
.lykke-table,
.xp-table,
.xv-table,
.zfa-table,
.zf-bookings-table,
.zf-preview-table,
.profil-stamm-table,
.modal-timespan-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.lykke-table th,
.xp-table th,
.xv-table th,
.zfa-table th,
.zf-bookings-table th,
.zf-preview-table th {
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: var(--lykke-table-header-color);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 10px 12px 8px;
    border-bottom: 1px solid var(--lykke-table-border);
    background: var(--lykke-table-header-bg);
    vertical-align: bottom;
}

.lykke-table td,
.xp-table td,
.xv-table td,
.zfa-table td,
.zf-bookings-table td,
.zf-preview-table td,
.profil-stamm-table td,
.modal-timespan-table td {
    padding: 12px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: top;
    color: #334155;
}

.lykke-table tbody tr:hover,
.xp-table tbody tr:hover,
.xv-table tbody tr:hover,
.zfa-table tbody tr:hover,
.zf-bookings-table tbody tr:hover,
.zf-preview-table tbody tr:hover {
    background: var(--lykke-table-row-hover);
}

.lykke-table tr:last-child td,
.xp-table tr:last-child td,
.xv-table tr:last-child td,
.zfa-table tr:last-child td,
.zf-bookings-table tr:last-child td,
.zf-preview-table tr:last-child td {
    border-bottom: none;
}

/* ── Akzent-Header (Xentral) ── */
.lykke-table--accent thead tr,
.xp-table thead tr,
.xv-table thead tr {
    background: var(--lykke-brand-gradient);
    color: #fff;
}

.lykke-table--accent th,
.xp-table th,
.xv-table th {
    color: #fff;
    text-transform: none;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: normal;
    background: transparent;
    border-bottom-color: rgba(255, 255, 255, 0.15);
}

.lykke-table--accent tbody tr:hover,
.xp-table tbody tr:hover,
.xv-table tbody tr:hover {
    background: #f5f6fe;
}

/* ── Akzent-Header (Portal) ── */
.lykke-table--accent-portal thead tr {
    background: var(--lykke-table-accent-portal);
    color: #fff;
}

.lykke-table--accent-portal th {
    color: #fff;
    text-transform: none;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: normal;
    background: transparent;
    border-bottom-color: rgba(255, 255, 255, 0.15);
}

.lykke-table--accent-portal tbody tr:hover {
    background: #f5f6fe;
}

/* ── Varianten ── */
.lykke-table--compact th,
.lykke-table--compact td,
.modal-timespan-table th,
.modal-timespan-table td,
.zf-bookings-table th,
.zf-bookings-table td {
    padding: 6px 8px;
    font-size: 12px;
}

.lykke-table--compact th,
.modal-timespan-table th,
.zf-bookings-table th {
    font-size: 11px;
}

.lykke-table--scroll {
    min-width: 720px;
}

.lykke-table--scroll-wide {
    min-width: 1024px;
}

.lykke-table--scroll-admin {
    min-width: 1100px;
}

/* Key-Value (Stammdaten) */
.lykke-table--kv,
.profil-stamm-table {
    font-size: 14px;
}

.lykke-table--kv th,
.profil-stamm-table th {
    width: 38%;
    text-transform: none;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    background: transparent;
    padding: 10px 14px 10px 0;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: top;
}

.lykke-table--kv td,
.profil-stamm-table td {
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}

.lykke-table--kv tr:last-child th,
.lykke-table--kv tr:last-child td,
.profil-stamm-table tr:last-child th,
.profil-stamm-table tr:last-child td {
    border-bottom: none;
}

.lykke-table--kv tbody tr:hover,
.profil-stamm-table tbody tr:hover {
    background: transparent;
}

.lykke-table--kv-borderless th,
.lykke-table--kv-borderless td {
    border-bottom: none;
    padding-top: 8px;
    padding-bottom: 8px;
}

/* ── Zell-Hilfsklassen ── */
.lykke-table-center {
    text-align: center;
}

.lykke-table-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.lykke-table-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.lykke-table-empty {
    padding: 24px;
    text-align: center;
    color: #64748b;
}

.lykke-table-row-warn {
    background-color: #fff3cd;
}

.lykke-table-row-deleted,
.xp-table tbody tr.xp-row-deleted {
    opacity: 0.55;
}

/* ── Aktionen ── */
.lykke-table-actions,
.zfa-actions {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    align-items: center;
    white-space: nowrap;
}

.lykke-table-btn,
.xp-detail-btn,
.xv-detail-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: var(--lykke-brand-soft);
    color: var(--lykke-brand);
    cursor: pointer;
    box-sizing: border-box;
}

.lykke-table-btn:hover,
a.lykke-table-btn:hover,
.xp-detail-btn:hover {
    background: var(--lykke-brand-soft-hover);
}

a.lykke-table-btn.lykke-table-xentral-link {
    text-decoration: none;
}

.lykke-table-xentral-logo {
    display: block;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border-radius: 3px;
}

.lykke-table-btn:focus-visible,
.xp-detail-btn:focus-visible,
.xv-detail-btn:focus-visible {
    outline: 2px solid var(--lykke-table-accent);
    outline-offset: 2px;
}

.lykke-table-actions button,
.zfa-actions button {
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    width: 34px;
    height: 34px;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.lykke-table-actions .material-symbols-outlined,
.zfa-actions .material-symbols-outlined {
    font-size: 18px;
    line-height: 1;
}

/* Text buttons with icon + label (not icon-only 34×34 cells) */
.lykke-table-actions--labeled button,
.lykke-table-actions--labeled a.lykke-table-btn {
    width: auto;
    height: auto;
    min-height: 34px;
    padding: 8px 16px;
}

/* ── Toolbar ── */
.lykke-table-toolbar,
.xp-toolbar,
.zfa-table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

/* Cron „Letzte Ausführung“ sits below the toolbar row — must not affect button alignment */
.lykke-table-toolbar-wrap {
    margin-bottom: 12px;
}

.lykke-table-toolbar-wrap > .lykke-table-toolbar {
    margin-bottom: 0;
}

.lykke-table-toolbar__msg {
    display: none;
}

.lykke-table-toolbar__cron-last-run {
    margin: 4px 0 0;
    font-size: 12px;
    color: #6c757d;
    line-height: 1.3;
    text-align: right;
}

.lykke-table-toolbar__cron-last-run--empty {
    color: #adb5bd;
    font-style: italic;
}

.lykke-table-toolbar__start,
.xp-toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1 1 220px;
    flex-wrap: wrap;
    min-width: 0;
}

.lykke-table-toolbar__search,
.xp-toolbar-search,
.zfa-toolbar-search {
    flex: 1 1 220px;
    min-width: 180px;
    max-width: 520px;
}

.lykke-table-toolbar__search input[type="search"],
.lykke-table-toolbar__search input[type="text"],
input.lykke-table-toolbar__search[type="search"],
input.lykke-table-toolbar__search[type="text"],
.xp-toolbar-search input[type="search"],
.xp-toolbar-search input[type="text"] {
    width: 100%;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
}

.lykke-table-toolbar__search form,
form.lykke-table-toolbar__search {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    width: 100%;
}

form.lykke-table-toolbar__search input[type="search"] {
    flex: 1 1 220px;
    min-width: 180px;
    max-width: 520px;
}

.lykke-table-toolbar__actions,
.xp-toolbar-actions,
.zfa-toolbar-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-left: auto;
}

.lykke-table-toolbar__actions:has(.lykke-table-toolbar__import-col),
.xp-toolbar-actions:has(.lykke-table-toolbar__import-col),
.zfa-toolbar-actions:has(.lykke-table-toolbar__import-col) {
    align-items: center;
}

.lykke-table-toolbar__btn,
.zfa-btn-toolbar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    background: var(--lykke-brand-gradient);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    font-family: inherit;
    line-height: 1.2;
    box-sizing: border-box;
}

.lykke-table-toolbar__btn:hover,
.zfa-btn-toolbar:hover {
    filter: brightness(1.05);
    color: #fff;
}

.lykke-table-toolbar__btn:disabled,
.zfa-btn-toolbar:disabled {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    filter: none;
}

.lykke-table-toolbar__btn .material-symbols-outlined,
.zfa-btn-toolbar .material-symbols-outlined {
    font-size: 20px;
}

@media (max-width: 767px) {
    .lykke-table-toolbar,
    .xp-toolbar,
    .zfa-table-toolbar,
    .lykke-table-toolbar-wrap {
        margin-bottom: 6px;
    }

    .lykke-table-toolbar__start,
    .xp-toolbar-left {
        flex: 1 1 100%;
        width: 100%;
    }

    .lykke-table-toolbar__search,
    .xp-toolbar-search,
    .zfa-toolbar-search,
    form.lykke-table-toolbar__search {
        flex: 1 1 100%;
        max-width: none;
    }

    form.lykke-table-toolbar__search input[type="search"],
    form.lykke-table-toolbar__search input[type="text"] {
        max-width: none;
    }

    .lykke-table-toolbar__actions,
    .xp-toolbar-actions,
    .zfa-toolbar-actions {
        flex: 1 1 100%;
        width: 100%;
        margin-left: 0;
        justify-content: flex-start;
    }

    .lykke-table-toolbar__cron-last-run {
        text-align: left;
    }
}

/* ── Status filter (Toolbar-Dialog) ── */
.lykke-table-status-filter-btn {
    position: relative;
    flex: 0 0 auto;
}

.lykke-table-status-filter-btn__label {
    font-weight: 600;
}

.lykke-table-status-filter-btn__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 2px;
    border-radius: 999px;
    background: var(--lykke-brand, #667eea);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.lykke-table-status-filter-dialog {
    max-width: 420px;
}

.lykke-table-status-filter-fieldset {
    margin: 0;
    padding: 0;
    border: 0;
}

.lykke-table-status-filter-legend {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 0;
    margin-bottom: 10px;
}

.lykke-table-status-filter-legend__label {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

.lykke-table-status-filter-toggle-all {
    flex-shrink: 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--lykke-brand, #667eea);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
    text-align: right;
}

.lykke-table-status-filter-toggle-all:hover {
    text-decoration: underline;
}

.lykke-table-status-filter-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lykke-table-status-filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    cursor: pointer;
    user-select: none;
}

.lykke-table-status-filter-option:hover {
    border-color: #cbd5e1;
    background: #f1f5f9;
}

.lykke-table-status-filter-option input[type="checkbox"] {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin: 0;
}

.lykke-table-status-filter-option__label {
    flex: 1;
    font-size: 14px;
    color: #334155;
}

/* ── Pagination ── */
.lykke-pagination,
.zfa-pagination {
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 14px;
    color: #64748b;
}

.lykke-pagination__summary,
.zfa-pagination-summary {
    color: #64748b;
    font-size: 14px;
}

.lykke-pagination__btns,
.zfa-pagination-btns {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.lykke-pagination a,
.lykke-pagination__btn {
    padding: 8px 14px;
    background: var(--lykke-brand-gradient);
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.lykke-pagination a:hover {
    filter: brightness(1.05);
    color: #fff;
}

.lykke-pagination__btn:disabled,
.lykke-pagination__btn.is-disabled,
.lykke-pagination span.is-disabled,
.zfa-pagination-btns button:disabled {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: #e9ecef;
    color: #6c757d;
    border-radius: 8px;
    font-size: 14px;
    cursor: not-allowed;
    border: none;
    font-weight: 600;
}

.lykke-pagination__info {
    color: #666;
    font-size: 14px;
}

/* ── Marken-Chips ── */
.lykke-chip,
.zfa-type-xentral,
.zf-tag,
.zf-tag-me {
    background: var(--lykke-brand-gradient);
    color: #fff;
    border-color: transparent;
}

.zf-tag-extra {
    background: var(--lykke-brand-soft);
    color: var(--lykke-brand);
    border: 1px solid var(--lykke-brand-border);
}

.zf-tag-extra .zf-tag-remove {
    background: var(--lykke-brand-soft-hover);
    color: var(--lykke-brand);
}

.zf-tag-extra .zf-tag-remove:hover {
    background: rgba(102, 126, 234, 0.28);
}

/* ── Checkboxen / Switches ── */
.zfa-form-box input[type="checkbox"],
.zf-card input[type="checkbox"] {
    accent-color: var(--lykke-brand);
}

.zf-switch input:checked + .zf-switch__track,
.xp-switch input:checked + .xp-switch__track {
    background: var(--lykke-brand-gradient);
}

.zf-switch input:focus-visible + .zf-switch__track,
.xp-switch input:focus-visible + .xp-switch__track {
    outline: 2px solid var(--lykke-brand-border);
    outline-offset: 2px;
}

/* ── Primäre Aktions-Buttons (Dialoge / Formulare) ── */
.zfa-btn-add,
.zf-btn-submit {
    background: var(--lykke-brand-gradient);
    color: #fff;
    border: none;
}

.zfa-btn-add:hover,
.zf-btn-submit:hover {
    filter: brightness(1.05);
}

@keyframes zf-submit-bg-flow {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 300% 50%;
    }
}

.zf-btn-submit.zf-btn-submit--loading,
.zf-btn-submit.zf-btn-submit--loading:hover,
.zf-btn-submit.zf-btn-submit--loading:disabled {
    pointer-events: none;
    cursor: wait;
    opacity: 1;
    filter: none;
    color: #fff;
    background: linear-gradient(
        90deg,
        #667eea 0%,
        #764ba2 20%,
        #ed64a6 40%,
        #48bb78 60%,
        #667eea 80%,
        #764ba2 100%
    );
    background-size: 300% 100%;
    animation: zf-submit-bg-flow 1.4s linear infinite;
}
