﻿/* ================================================================
   Finance Data Hub – Component Styles
   Tokens, Layout, Sidebar, Topbar, KPI-Cards: siehe shell.css
   Diese Datei enthält nur noch wiederverwendbare Komponenten
   (Tabellen, Forms, Buttons, Toasts, Pagination, Stepper, ...).
   Tokens sind über Aliases in shell.css verfügbar (--bg-primary
   â†’ --bg, --accent-primary â†’ --primary etc.).
   ================================================================ */

/* Universal-Reset für Komponenten (Margins/Paddings) */
.reset-mp { margin: 0; padding: 0; }

/* ================================================================
   Legacy Top-Navbar / Layout / Page-Title / Breadcrumbs entfernt.
   Ersetzt durch Sidebar + Topbar in shell.css.
   Page-Title, Page-Subtitle, Page-Header-Row, .breadcrumbs (legacy
   inline in main-content) werden in shell.css gepflegt.
   ================================================================ */

/* Cards .card / .card-header / .card-title werden in shell.css definiert. */

/* ================================================================
   Legacy Dashboard-Layout (.dashboard-grid, .dashboard-panel*,
   .stats-grid, .stat-card, .stat-icon, .stat-value, .stat-label)
   entfernt. Ersetzt durch Modul-/KPI-Karten in shell.css.
   .filter-dropdown-trigger--sm wird unten bei Filter-Dropdown
   neu definiert.
   ================================================================ */

.filter-dropdown-trigger--sm {
    min-width: 80px;
    padding: 0.35rem 0.5rem;
    font-size: 0.8125rem;
}

/* Tables */
/* ----------------------------------------------------------------
   Result-Toolbar (Stats links, Filter + Page-Size + Pager rechts)
   verwendet in _result_table.html
   ---------------------------------------------------------------- */
.result-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.result-toolbar__stats {
    flex: 1 1 240px;
    min-width: 0;
    font-size: 12.5px;
    color: var(--fg-muted);
}
.result-toolbar__controls {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    justify-content: flex-end;
    min-width: 0;
    max-width: 100%;
}
.result-toolbar__filter {
    flex: 1 1 220px;
    min-width: 140px;
    max-width: 260px;
    height: 30px;
    padding: 4px 10px;
    font-size: 12.5px;
}
.result-toolbar__size {
    flex: 0 0 auto;
    width: 76px;
    height: 30px;
    padding: 4px 8px;
    font-size: 12.5px;
}
.result-toolbar__pager {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12.5px;
    color: var(--fg-muted);
    white-space: nowrap;
}
.result-toolbar__pager-label {
    min-width: 56px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* Auf sehr schmalen Containern: Stats darüber, Controls volle Breite darunter,
   Controls bleiben aber selbst in einer Reihe (nowrap). */
@media (max-width: 720px) {
    .result-toolbar__controls {
        margin-left: 0;
        width: 100%;
        justify-content: space-between;
    }
    .result-toolbar__filter {
        max-width: none;
    }
}

.table-container {
    overflow-x: auto;
    border-radius: 8px;
}

.table-container table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table-container th,
.table-container td {
    padding: 9px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    line-height: 1.4;
}

.table-container thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    color: var(--fg-muted);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding-top: 8px;
    padding-bottom: 8px;
    background: var(--bg-elevated, var(--bg-tertiary));
    box-shadow: 0 1px 0 0 var(--border-color);
}

.table-container tbody tr {
    transition: background-color 0.15s ease;
}

.table-container tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .table-container tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.02);
}

.table-container tbody tr:hover {
    background: var(--bg-tertiary) !important;
}

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

.table-container .price-cell {
    font-weight: 600;
    color: var(--fg);
    font-variant-numeric: tabular-nums;
    font-family: var(--font-mono);
}

/* Aktions-Spalte (Details-Button etc.): rechtsbündig, schmal */
.table-container th.col-actions,
.table-container td.col-actions {
    text-align: right;
    white-space: nowrap;
    width: 1%;
}
.table-container td.col-actions .btn {
    vertical-align: middle;
}

/* Admin: Fehler-Popover in Kunden-Anfragen */
.error-cell-wrap {
    vertical-align: middle;
}
.error-popover {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 0.25rem;
    z-index: 100;
    min-width: 280px;
    max-width: 420px;
    max-height: 320px;
    padding: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.error-popover-title {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}
.error-popover-list {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}
.error-popover-list li {
    padding: 0.4rem 0.75rem;
    font-size: 0.8125rem;
    line-height: 1.4;
    border-bottom: 1px solid var(--border-color);
}
.error-popover-list li:last-child {
    border-bottom: none;
}
.error-popover-item-head {
    display: block;
    font-weight: 600;
    color: var(--accent-error);
    margin-bottom: 0.15rem;
}
.error-popover-item-msg {
    display: block;
    color: var(--text-secondary);
    font-size: 0.75rem;
    word-break: break-word;
}
.error-popover-more {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
}

/* Sparkline (Kursverlauf) */
.sparkline-box {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 10px;
}

.sparkline-svg {
    width: 100%;
    height: 52px;
    display: block;
}

/* Modern pill tabs */
.tabs-row {
    display: flex;
    gap: 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0;
}

.tabs-row .tab-btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.2s ease, border-color 0.2s ease;
    text-decoration: none;
}

.tabs-row .tab-btn:hover {
    color: var(--text-primary);
}

.tabs-row .tab-btn.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

/* Merkliste-Stern (Instrumente-Seite) */
.merkliste-star {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    color: var(--text-muted);
    transition: color 0.2s ease, transform 0.15s ease;
}

.merkliste-star:hover {
    color: var(--accent-warning);
    transform: scale(1.15);
}

.merkliste-star.merkliste-active {
    color: var(--accent-warning);
}

.merkliste-star:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Merkliste-Karten und Chips (Kurse abrufen / Merkliste-Seite) */
.merkliste-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.merkliste-card .merkliste-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.merkliste-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.merkliste-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.8125rem;
    font-family: 'JetBrains Mono', monospace;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
}

.merkliste-chip:hover {
    background: var(--bg-elevated);
    border-color: var(--accent-primary);
}

.merkliste-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.1rem;
    height: 1.1rem;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 50%;
    font-size: 1rem;
    line-height: 1;
}

.merkliste-chip-remove:hover {
    color: var(--accent-error);
    background: rgba(var(--red-rgb), 0.1);
}

.merkliste-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.isin-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    font-family: var(--font-mono);
    transition: color 0.2s ease;
}

.isin-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.price {
    color: var(--accent-primary);
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

.currency {
    color: var(--text-muted);
    margin-left: 0.375rem;
    font-size: 0.875rem;
}

/* Buttons – modern, an die Shell-Optik angelehnt */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border: 1px solid transparent;
    border-radius: var(--radius-ctrl);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    transition: color var(--transition), background var(--transition), border-color var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    color: var(--primary-fg);
    background: var(--primary);
    border-color: var(--primary);
}
.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}
.btn-primary:active:not(:disabled) {
    background: var(--primary);
    filter: brightness(0.92);
}

.btn-secondary {
    color: var(--fg);
    background: var(--bg-card);
    border-color: var(--border-strong);
}
.btn-secondary:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--fg-faint);
}

.btn-ghost {
    color: var(--fg-muted);
    background: transparent;
    border-color: transparent;
}
.btn-ghost:hover:not(:disabled) {
    color: var(--fg);
    background: var(--bg-hover);
}

.btn-danger {
    color: #fff;
    background: var(--red);
    border-color: var(--red);
}
.btn-danger:hover:not(:disabled) {
    filter: brightness(1.06);
}

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

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

.btn-sm {
    padding: 5px 9px;
    font-size: 12px;
    gap: 4px;
}
.btn-xs {
    padding: 2px 6px;
    font-size: 11px;
    gap: 3px;
    border-radius: 4px;
}

/* Forms */
.form-group {
    margin-bottom: 14px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    color: var(--fg-muted);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.005em;
}

.form-input {
    width: 100%;
    padding: 7px 11px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-ctrl, 6px);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    line-height: 1.4;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.2);
}

/* Kein heller Ring bei Selects – nur dezente Border */
select.form-input:focus {
    box-shadow: none;
}

.form-input::placeholder {
    color: var(--text-muted);
}

select.form-input {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888888' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px 12px;
    padding-right: 30px;
}
select.form-input:hover {
    border-color: var(--border-strong);
}

/* Native <option>-Liste (Browser-Popup) so weit wie möglich an die Theme
   anpassen. Volles Styling ist nicht möglich (OS-gerendert), aber zusammen
   mit `color-scheme` auf <html> ergibt das ein dezentes Dark-Popup. */
.form-input option,
select option {
    background: var(--bg-card);
    color: var(--fg);
}

/* ----------------------------------------------------------------
   Themed Select – Custom Dropdown statt nativem <select>.
   Wird gebraucht, weil Browser (v.a. Chromium auf Windows) das
   System-Highlight in offenen <option>-Listen nicht stylen lassen.
   Markup:
     <div class="tselect" x-data="tselect(['a','b'], current, label)" ...>
       <button class="tselect__trigger" ...></button>
       <ul class="tselect__menu" x-show="open" ...>
         <li class="tselect__option" ...></li>
       </ul>
     </div>
   ---------------------------------------------------------------- */
.tselect {
    position: relative;
    width: 100%;
}
.tselect__trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 7px 11px;
    padding-right: 30px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-ctrl, 6px);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    line-height: 1.4;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888888' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px 12px;
}
.tselect__trigger:hover {
    border-color: var(--border-strong);
}
.tselect__trigger:focus-visible,
.tselect.is-open .tselect__trigger {
    outline: none;
    border-color: var(--accent-primary);
}
.tselect__menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 50;
    margin: 0;
    padding: 4px;
    list-style: none;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-ctrl, 6px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    max-height: 240px;
    overflow-y: auto;
}
.tselect__option {
    display: block;
    padding: 7px 10px;
    font-size: 13px;
    color: var(--fg);
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    transition: background var(--transition);
}
.tselect__option:hover,
.tselect__option.is-active {
    background: var(--bg-hover);
}
.tselect__option.is-selected {
    color: var(--primary);
    font-weight: 500;
}
.tselect__option.is-selected.is-active,
.tselect__option.is-selected:hover {
    background: var(--primary-soft);
}

/* ----------------------------------------------------------------
   Modal (themed, ersetzt rohes inline-style div als Overlay)
   ---------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.is-open {
    display: flex;
}
.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 22px 24px 20px;
    width: 100%;
    max-width: 480px;
    max-height: 86vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}
.modal-card__title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 18px;
    color: var(--fg);
}
.modal-card__actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Cron-Live-Beschreibung */
.cron-hint {
    margin-top: 6px;
    padding: 7px 10px;
    background: var(--primary-soft);
    border: 1px solid rgba(var(--primary-rgb), 0.25);
    border-radius: 6px;
    font-size: 12px;
    color: var(--fg);
    line-height: 1.4;
}
.cron-hint.is-invalid {
    background: rgba(239, 68, 68, 0.10);
    border-color: rgba(239, 68, 68, 0.35);
    color: var(--accent-error);
}
.cron-hint__label {
    color: var(--fg-muted);
    font-weight: 500;
    margin-right: 4px;
}

/* Custom Filter-Dropdown – dunkles Panel, kein System-Dropdown */
.filter-dropdown-wrap {
    position: relative;
    display: inline-block;
}

.filter-dropdown-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-width: 140px;
    padding: 0.5rem 0.75rem;
    padding-right: 2rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
}

.filter-dropdown-trigger:hover {
    border-color: var(--border-light);
    background: var(--bg-elevated);
}

.filter-dropdown-trigger:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: none;
}

.filter-dropdown-trigger:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.filter-dropdown-trigger::after {
    content: "";
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--text-muted);
    pointer-events: none;
}

.filter-dropdown-wrap {
    position: relative;
}

.filter-dropdown-panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 100%;
    z-index: 50;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    padding: 0.35rem;
    max-height: 280px;
    overflow-y: auto;
}

.filter-dropdown-option {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    text-align: left;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.filter-dropdown-option:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.filter-dropdown-option.active {
    background: rgba(var(--primary-rgb), 0.2);
    color: var(--accent-primary);
}

/* Export-Dropdown (Liste vs. Kurse mit Datumsrange) */
.export-dropdown-panel {
    min-width: 280px;
}

.export-dropdown-option {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    text-align: left;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    text-decoration: none;
}

.export-dropdown-option:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.export-dropdown-option:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.export-dropdown-trigger {
    font-weight: 500;
}

.export-prices-form-wrap {
    border-top: 1px solid var(--border-color);
    margin-top: 0.35rem;
    padding-top: 0.75rem;
}

.export-prices-form .form-input {
    min-width: 0;
}

/* Kurse-Export-Modal: echtes Vollbild-Popup, mittig */
.export-modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    min-width: 100vw;
    min-height: 100vh;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.55);
    overflow-y: auto;
}

.export-modal-box {
    width: 100%;
    max-width: 720px;
    min-width: 320px;
    max-height: calc(100vh - 4rem);
    margin: auto;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
}

.export-modal-list {
    display: block;
    max-height: 360px;
    min-height: 120px;
    overflow-y: auto;
    margin: 0;
    padding: 0;
    list-style: none;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-tertiary);
}

.export-modal-list-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.export-modal-list-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.85rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.12s ease;
    list-style: none;
}

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

.export-modal-list-item:hover {
    background: var(--bg-elevated);
}

.export-modal-list-item input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
    accent-color: var(--accent-primary);
}

.export-modal-list-item .export-modal-isin {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    color: var(--text-primary);
    min-width: 11ch;
}

.export-modal-list-item .export-modal-name {
    font-size: 0.875rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.filter-dropdown-option.active:hover {
    background: rgba(var(--primary-rgb), 0.25);
}

/* Export-Kurse-Tabelle: Stern-Spalte wie Merkliste, optisch wie Instrumente-Tabelle */
.export-kurse-table-wrap thead th:first-child {
    text-transform: none;
}

/* Export-Kurse: dezente Checkboxen (transparent wie Merkliste) – sichtbare Box per ::before, Input unsichtbar darüber */
.export-kurse-table-wrap .export-check-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    cursor: pointer;
    border-radius: 4px;
    position: relative;
}

.export-kurse-table-wrap .export-check {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
}

.export-kurse-table-wrap .export-check-wrap::before {
    content: '';
    display: block;
    width: 1.1rem;
    height: 1.1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: transparent;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
}

.export-kurse-table-wrap .export-check-wrap:hover::before {
    border-color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
}

.export-kurse-table-wrap .export-check-wrap:has(.export-check:checked)::before {
    border-color: var(--accent-primary);
    background: rgba(var(--primary-rgb), 0.2);
    box-shadow: inset 0 0 0 1px rgba(var(--primary-rgb), 0.3);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 10' fill='none' stroke='%23fa6c3d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 5l3 3 7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 0.7rem 0.6rem;
}

.export-kurse-table-wrap .export-check-wrap:has(.export-check:indeterminate)::before {
    border-color: var(--accent-primary);
    background: rgba(var(--primary-rgb), 0.15);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 2' fill='%23fa6c3d'%3E%3Crect x='2' y='0' width='8' height='2' rx='1'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 0.6rem 2px;
}

.export-kurse-table-wrap .export-check:focus-visible {
    opacity: 1;
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
    width: calc(100% + 4px);
    height: calc(100% + 4px);
    left: -2px;
    top: -2px;
}

[data-theme="light"] .export-kurse-table-wrap .export-check-wrap:hover::before {
    background: rgba(0, 0, 0, 0.04);
}

/* Seite Kurse exportieren */
.export-kurse-list {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-tertiary);
    max-height: 400px;
    overflow-y: auto;
}

.export-kurse-list-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.export-kurse-list-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.12s ease;
}

.export-kurse-list-row:last-child {
    border-bottom: none;
}

.export-kurse-list-row:hover {
    background: var(--bg-elevated);
}

/* API-Test-Seite */
.api-test-table {
    width: 100%;
    border-collapse: collapse;
}
.api-test-table th,
.api-test-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
.api-test-table th {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 600;
}
.api-test-row.api-test-running td {
    background: rgba(var(--primary-rgb), 0.06);
}
.api-test-method {
    display: inline-block;
    min-width: 2.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-primary);
    margin-right: 0.5rem;
}
.api-test-url {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    word-break: break-all;
}
.api-test-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}
.api-test-badge-ok {
    background: rgba(var(--green-rgb), 0.2);
    color: var(--accent-success);
}
.api-test-badge-fail {
    background: rgba(var(--red-rgb), 0.2);
    color: var(--accent-error);
}
.api-test-badge-running {
    background: rgba(var(--primary-rgb), 0.2);
    color: var(--accent-primary);
}
.api-test-spinner {
    display: inline-block;
    animation: api-test-spin 0.8s linear infinite;
    color: var(--accent-primary);
}
@keyframes api-test-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.api-test-detail-row td {
    vertical-align: top;
    border-bottom: 1px solid var(--border-color);
}

.api-test-result-box {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-primary);
    border-radius: 8px;
    padding: 1rem;
}

.api-test-result-pre {
    margin: 0;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 6px;
    white-space: pre-wrap;
    word-break: break-all;
    color: var(--text-secondary);
    max-height: 320px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8125rem;
    line-height: 1.4;
}

.export-kurse-list-row .export-kurse-cb {
    width: 1.1rem;
    height: 1.1rem;
    cursor: pointer;
    accent-color: var(--accent-primary);
}

/* Stilisierte Checkbox (z. B. Wechselkurse „Alle Währungen") */
.form-check-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    cursor: pointer;
    border-radius: 6px;
    position: relative;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.form-check-wrap input[type="checkbox"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
}

.form-check-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 1.5px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-tertiary);
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.form-check-wrap:hover::before {
    border-color: var(--border-light);
    background: var(--bg-elevated);
}

.form-check-wrap:has(input:checked)::before {
    border-color: var(--accent-primary);
    background: rgba(var(--primary-rgb), 0.2);
    box-shadow: inset 0 0 0 1px rgba(var(--primary-rgb), 0.3);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 10' fill='none' stroke='%23fa6c3d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 5l3 3 7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 0.75rem 0.65rem;
}

.form-check-wrap input:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.form-check-label {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    cursor: pointer;
    margin-bottom: 0;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-secondary);
    /* Line-height exakt auf die Checkbox-Höhe (1.25rem) ziehen, damit der
       Text-Span keine größere Line-Box bekommt und beide Children
       geometrisch UND optisch auf einer Linie sitzen. */
    line-height: 1.25rem;
}
.form-check-label > * {
    line-height: inherit;
}

/* ----------------------------------------------------------------
   Inline-Forms (mehrere Form-Gruppen nebeneinander).
   Jede Gruppe ist gleich hoch (Label oben + Control unten),
   damit Inputs, Buttons und Checkbox-Reihen vertikal exakt
   auf einer Linie sitzen.
   ---------------------------------------------------------------- */
.api-key-form,
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-start;
}

.form-group--inline {
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
    /* Control selbst ist flex, damit Label-Spacer korrekt greift */
}
.form-group--inline > .form-label {
    /* Label-Spacer: gleiche Höhe wie ein echtes Label, auch wenn nbsp drin */
    min-height: 1em;
    margin-bottom: 6px;
}

/* Eine Reihe Checkboxen, die wie ein Control im Form-Group fungiert.
   Höhe entspricht dem .form-input (32px), damit sie vertikal mit Inputs
   und Buttons auf einer Linie liegt. */
.form-check-row {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    height: 32px;
}

.form-check-label:hover {
    color: var(--text-primary);
}

.export-kurse-isin {
    flex: 0 0 12ch;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.export-kurse-name {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* File Upload */
.file-upload {
    border: 2px dashed var(--border-color);
    border-radius: 14px;
    padding: 4rem 2.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.25s ease, background 0.25s ease, transform 0.2s ease;
    background: var(--bg-tertiary);
}

.file-upload:hover {
    border-color: var(--accent-primary);
    background: rgba(var(--primary-rgb), 0.06);
    transform: translateY(-2px);
}

.file-upload.dragover {
    border-color: var(--accent-primary);
    background: rgba(var(--primary-rgb), 0.12);
    border-style: solid;
}

.file-upload-icon {
    font-size: 4rem;
    margin-bottom: 1.25rem;
    opacity: 0.85;
    transition: transform 0.2s ease;
}

.file-upload:hover .file-upload-icon {
    transform: scale(1.05);
}

/* Progress */
.progress-container {
    margin-top: 2rem;
}

.progress-bar {
    height: 10px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 8px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(var(--primary-rgb), 0.3);
}

.progress-text {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Badges – kompakte Status-Pills im Shell-Design */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.5;
    border: 1px solid transparent;
    font-family: var(--font-mono);
}

.badge-success {
    background: rgba(var(--accent-success-rgb), 0.14);
    color: var(--accent-success);
    border-color: rgba(var(--accent-success-rgb), 0.28);
}
.badge-warning {
    background: rgba(var(--accent-warning-rgb), 0.16);
    color: var(--accent-warning);
    border-color: rgba(var(--accent-warning-rgb), 0.32);
}
.badge-error {
    background: rgba(var(--red-rgb), 0.14);
    color: var(--accent-error);
    border-color: rgba(var(--red-rgb), 0.28);
}
.badge-muted {
    background: var(--bg-hover);
    color: var(--fg-muted);
    border-color: var(--border);
}

/* Search */
.search-box {
    position: relative;
    max-width: 400px;
}

.search-box::before {
    content: '';
    position: absolute;
    left: 0.85rem;
    top: 50%;
    width: 16px;
    height: 16px;
    transform: translateY(-50%);
    pointer-events: none;
    background: var(--fg-faint);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat center / contain;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat center / contain;
}

.search-box input {
    padding-left: 2.5rem;
}

/* Pagination */
.pagination {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    height: 30px;
    min-width: 30px;
    padding: 0 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--fg);
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.pagination a:hover {
    background: var(--bg-hover);
    border-color: var(--border-strong);
}

.pagination a.active {
    background: var(--primary);
    color: var(--primary-fg);
    border-color: var(--primary);
}

.pagination span {
    color: var(--fg-muted);
    background: transparent;
    border-color: transparent;
    cursor: default;
}

.pagination-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
}

.pagination-info {
    color: var(--fg-muted);
    font-size: 12.5px;
}

.pagination-go {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.pagination-go .form-input {
    margin-bottom: 0;
    height: 30px;
    width: 64px;
    padding: 4px 8px;
    font-size: 12.5px;
}
.pagination-go .btn {
    height: 30px;
    padding: 0 12px;
    font-size: 12.5px;
}

/* Sortierbare Tabellenköpfe */
.th-sort {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.th-sort:hover {
    color: var(--accent-primary);
}
.th-sort-active {
    color: var(--accent-primary);
    font-weight: 600;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Loading */
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline-block;
}

/* HTMX loading overlay for Instrumente-Suche */
.htmx-loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    background: var(--bg-secondary);
    opacity: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
    border-radius: inherit;
}

.htmx-loading-overlay.htmx-request {
    opacity: 0.85;
    pointer-events: auto;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Toast container */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 420px;
    pointer-events: none;
}

.toast {
    padding: 0.875rem 1.25rem;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    pointer-events: auto;
    animation: toast-in 0.25s ease;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.toast.toast-error {
    border-color: var(--accent-error);
    background: rgba(var(--red-rgb), 0.1);
    color: var(--accent-error);
}

.toast.toast-success {
    border-color: var(--accent-success);
    background: rgba(var(--green-rgb), 0.1);
    color: var(--accent-success);
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Instrument-Detail: 2 Spalten, unter 768px 1 Spalte */
.instrument-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        padding: 1rem 1.5rem;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .nav-area-wrap {
        order: 3;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .nav-area-tabs {
        justify-content: stretch;
    }

    .nav-area-tab {
        flex: 1;
        text-align: center;
        padding: 0.6rem 0.5rem;
        font-size: 0.8125rem;
    }

    .nav-links {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .nav-links a {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        grid-template-areas: "panel-left" "panel-right";
    }

    .dashboard-panel__inner {
        padding: 1rem 1.25rem;
    }

    .main-content--dashboard {
        padding-left: 1rem;
        padding-right: 1rem;
    }

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

    .main-content {
        padding: 1.5rem 1rem;
    }

    .card {
        padding: 1.5rem;
    }

    .toast-container {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }

    .instrument-detail-grid {
        grid-template-columns: 1fr;
    }

    .table-container {
        -webkit-overflow-scrolling: touch;
        margin-left: -0.25rem;
        margin-right: -0.25rem;
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }

    .table-container table {
        min-width: 560px;
    }

    .col-hide-mobile {
        display: none !important;
    }
}

/* Smooth transitions for theme switching */
* {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* Exclude certain elements from transition */
.progress-fill,
.spinner,
svg {
    transition: none;
}

/* Toggle Switch (Admin-Settings) */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 2.5rem;
    height: 1.375rem;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-switch .toggle-track {
    position: absolute;
    inset: 0;
    background: var(--bg-tertiary);
    border: 1.5px solid var(--border-color);
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.toggle-switch .toggle-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 1rem;
    height: 1rem;
    background: var(--text-muted);
    border-radius: 50%;
    transition: transform 0.2s, background 0.2s;
}

.toggle-switch input:checked + .toggle-track {
    background: rgba(var(--primary-rgb), 0.2);
    border-color: var(--accent-primary);
}

.toggle-switch input:checked + .toggle-track::after {
    transform: translateX(1.125rem);
    background: var(--accent-primary);
}

.toggle-switch:hover .toggle-track {
    border-color: var(--border-light);
}

.toggle-switch input:focus-visible + .toggle-track {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Settings label row */
.settings-toggle-label {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    cursor: pointer;
    padding: 0.375rem 0;
    user-select: none;
}

.settings-toggle-label span {
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* Provider card checkbox (bigger, styled) */
.provider-check {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.provider-check input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
}

.provider-check::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 1.5px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-tertiary);
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.provider-check:hover::before {
    border-color: var(--border-light);
    background: var(--bg-elevated);
}

.provider-check:has(input:checked)::before {
    border-color: var(--accent-primary);
    background: rgba(var(--primary-rgb), 0.2);
    box-shadow: inset 0 0 0 1px rgba(var(--primary-rgb), 0.3);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 10' fill='none' stroke='%23fa6c3d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 5l3 3 7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 0.75rem 0.65rem;
}

/* ============================================
   Pipeline Stepper  (pl-*)
   ============================================ */

/* â”€â”€ Stepper-Leiste: horizontale Kreise + Linien â”€â”€ */
.pl-stepper {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    margin: 0 auto 1.25rem;
    max-width: 640px;
}

.pl-step-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1 1 0;
    position: relative;
    min-width: 0;
}

/* Verbindungslinie zwischen Kreisen */
.pl-line {
    position: absolute;
    top: 18px;
    right: 50%;
    width: 100%;
    height: 2px;
    background: var(--border-primary, #333);
    z-index: 0;
}
.pl-line.done {
    background: var(--accent-success, #22c55e);
}

/* Kreis */
.pl-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    border: 2px solid var(--border-primary, #444);
    background: var(--bg-tertiary, #1a1a2e);
    color: var(--text-muted, #888);
    z-index: 1;
    position: relative;
    transition: all .25s ease;
}

.pl-circle.completed {
    background: var(--accent-success, #22c55e);
    border-color: var(--accent-success, #22c55e);
    color: #fff;
}
.pl-circle.running {
    background: var(--accent-primary, #2563eb);
    border-color: var(--accent-primary, #2563eb);
    color: #fff;
    box-shadow: 0 0 0 0 rgba(var(--primary-rgb),.45);
    animation: pl-pulse 1.6s ease-in-out infinite;
}
.pl-circle.skipped {
    opacity: .45;
}

@keyframes pl-pulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(var(--primary-rgb),.45); }
    50%     { box-shadow: 0 0 0 7px rgba(var(--primary-rgb),0); }
}

.pl-dot-pulse {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #fff;
    animation: pl-blink .9s ease-in-out infinite alternate;
}
@keyframes pl-blink {
    0%   { opacity: .35; }
    100% { opacity: 1; }
}

.pl-label {
    margin-top: 5px;
    font-size: .72rem;
    color: var(--text-muted, #999);
    text-align: center;
    line-height: 1.15;
    white-space: nowrap;
}
.pl-dur {
    font-size: .65rem;
    color: var(--text-disabled, #666);
    font-family: 'JetBrains Mono', monospace;
}

/* â”€â”€ Detail-Card der aktiven Phase â”€â”€ */
.pl-card {
    background: var(--bg-secondary, #161b22);
    border: 1px solid var(--border-primary, #30363d);
    border-radius: 12px;
    padding: 1.1rem 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,.2);
}
.pl-card-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: .6rem;
    color: var(--text-primary, #e6edf3);
}

/* KPI-Kacheln: immer nebeneinander */
.pl-kpis {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    margin-top: .6rem;
}
.pl-kpi {
    flex: 1 1 80px;
    min-width: 70px;
    background: var(--bg-tertiary, #0d1117);
    border-radius: 8px;
    padding: .55rem .5rem;
    text-align: center;
}
.pl-kpi-val {
    font-size: 1.15rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1.3;
}
.pl-kpi-val.green { color: var(--accent-success, #22c55e); }
.pl-kpi-val.amber { color: var(--accent-warning, #f59e0b); }
.pl-kpi-val.dim   { color: var(--text-secondary, #8b949e); }
.pl-kpi-lbl {
    font-size: .68rem;
    color: var(--text-muted, #777);
    margin-top: 1px;
}

/* â”€â”€ History (abgeschlossene Phasen) â”€â”€ */
.pl-hist {
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,.06);
    padding: .3rem 0;
}
.pl-hist:hover { background: rgba(255,255,255,.03); border-radius: 6px; }
.pl-hist-row {
    display: flex;
    align-items: center;
    gap: .45rem;
    font-size: .85rem;
}
.pl-hist-icon { flex-shrink: 0; font-size: .95rem; }
.pl-hist-name { color: var(--text-secondary, #ccc); }
.pl-hist-dur  {
    margin-left: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: .78rem;
    color: var(--text-muted, #777);
}
.pl-hist-chev { font-size: .6rem; color: var(--text-muted); }
.pl-hist-detail {
    padding: .3rem 0 .3rem 1.4rem;
    font-size: .8rem;
    color: var(--text-secondary, #aaa);
}
