/* Cross-cutting styles that Tailwind utilities don't cover cleanly. */

/* Visible keyboard focus */
:focus-visible {
    outline: 2px solid #00aaff;
    outline-offset: 1px;
}

/* Slim scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Vertical timeline — line runs through the center of each icon */
.timeline {
    --timeline-axis: 0.5625rem; /* horizontal center of icon column (9px) */
    position: relative;
    margin: 0;
    padding: 0 0 0 1.75rem;
    list-style: none;
}

.timeline::before {
    content: "";
    position: absolute;
    left: var(--timeline-axis);
    top: 0.5625rem;
    bottom: 0;
    width: 2px;
    transform: translateX(-50%);
    background: #e2e8f0;
    border-radius: 1px;
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item--empty {
    padding-left: 0;
}

/* Icon sits on the axis; white backing masks the line behind the glyph */
.timeline-dot {
    position: absolute;
    left: calc(-1.75rem + var(--timeline-axis));
    top: 0.0625rem;
    transform: translateX(-50%);
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    padding: 0.125rem 0.0625rem;
}

.timeline-dot svg {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Accounting audit-trail event types (used once transaction detail pages exist) */
.timeline-dot--imported { color: #2563eb; }
.timeline-dot--match_suggested { color: #d97706; }
.timeline-dot--match_confirmed { color: #059669; }
.timeline-dot--match_rejected { color: #dc2626; }
.timeline-dot--invoice_linked { color: #7c3aed; }
.timeline-dot--status_change { color: #64748b; }
.timeline-dot--note { color: #b45309; }
.timeline-dot--default { color: #94a3b8; }

/*
 * List tables — fixed column widths so async filter swaps do not reflow columns.
 * Widths are set on <th> in the first row; table-layout: fixed honors them for all rows.
 */
.crm-table {
    table-layout: fixed;
    width: 100%;
}

/* Transactions: Datum | Gegenpartei | Verwendungszweck | Betrag | Rechnungsbetrag | Prüfen | Status | Beleg | Wer */
.crm-table--transactions th:nth-child(1) { width: 8%; }
.crm-table--transactions th:nth-child(2) { width: 17%; }
.crm-table--transactions th:nth-child(3) { width: 20%; }
.crm-table--transactions th:nth-child(4) { width: 10%; }
.crm-table--transactions th:nth-child(5) { width: 10%; }
.crm-table--transactions th:nth-child(6) { width: 7%; }
.crm-table--transactions th:nth-child(7) { width: 10%; }
.crm-table--transactions th:nth-child(8) { width: 12%; }
.crm-table--transactions th:nth-child(9) { width: 6%; }

/* Rows leaving the current filter after a match decision (app.js) */
.crm-row-leaving {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Imports: Importiert | Datei | Konto | Zeitraum | Endsaldo | Neu / Dupl. */
.crm-table--imports th:nth-child(1) { width: 12%; }
.crm-table--imports th:nth-child(2) { width: 24%; }
.crm-table--imports th:nth-child(3) { width: 16%; }
.crm-table--imports th:nth-child(4) { width: 20%; }
.crm-table--imports th:nth-child(5) { width: 16%; }
.crm-table--imports th:nth-child(6) { width: 12%; }

/* Ellipsis for long single-line cell text inside fixed columns */
.crm-table .crm-cell-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* OneDrive tasks: Erstellt | Aufgabe | Beleg | Buchung | Ablage | Status | Aktionen */
.crm-table--tasks th:nth-child(1) { width: 8%; }
.crm-table--tasks th:nth-child(2) { width: 13%; }
.crm-table--tasks th:nth-child(3) { width: 18%; }
.crm-table--tasks th:nth-child(4) { width: 18%; }
.crm-table--tasks th:nth-child(5) { width: 22%; }
.crm-table--tasks th:nth-child(6) { width: 13%; }
.crm-table--tasks th:nth-child(7) { width: 8%; }
