/* SEIDOS card primitives — generic surface for dashboards / home / overviews.
   Uses the same --tb-* tokens as the topbar so light/dark/accent flip together. */

/* ── Page wrapper ─────────────────────────────────────────────────────── */
.page-wrap {
    padding: var(--p4) var(--p4);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 1px 0 rgba(20, 17, 12, 0.02);
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    gap: var(--g4);
}

.page-wrap-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin: 4px 0 18px;
}

.page-wrap-title {
    font-family: 'IBM Plex Sans', system-ui, sans-serif;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text);
    margin: 0;
}

.page-wrap-sub {
    font-size: 12.5px;
    color: var(--text-3);
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    letter-spacing: 0.02em;
}

/* ── Grid ─────────────────────────────────────────────────────────────── */
.card-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.card-grid.cols-2 {
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
}

.card-grid.cols-3 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* Span helpers for individual cards inside a grid. */
.card.span-2 {
    grid-column: span 2;
}

.card.span-full {
    grid-column: 1 / -1;
}

/* ── Card ─────────────────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 1px 0 rgba(20, 17, 12, 0.02);
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.card.is-accent .card-head {
    background: var(--accent-soft);
}

/* Header */
.card-head {
    display: flex;
    align-items: center;
    gap: var(--g3);
    padding: var(--p2) var(--p3);
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}

.card-eyebrow {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-3);
    font-weight: 500;
}

.card-title {
    font-family: 'IBM Plex Sans', system-ui, sans-serif;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-icon {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--rad-2, 6px);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--accent);
    font-size: 13px;
    flex: 0 0 auto;
}

.card-count {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 11.5px;
    color: var(--text-3);
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 2px 8px;
    border-radius: 999px;
    flex: 0 0 auto;
}

.card-actions {
    display: inline-flex;
    gap: 4px;
    flex: 0 0 auto;
}

.card-actions button,
.card-actions a {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-3);
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--rad-2, 6px);
    cursor: pointer;
    text-decoration: none;
    font-size: 12px;
    transition: background 100ms ease, color 100ms ease, border-color 100ms ease;
}

.card-actions button:hover,
.card-actions a:hover {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

/* Body */
.card-body {
    padding: 14px 18px;
    flex: 1 1 auto;
    color: var(--text-2);
    font-size: 13px;
    line-height: 1.5;
}

.card-body.is-list {
    padding: 6px 0;
}

/* Footer */
.card-foot {
    padding: 10px 18px;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
    font-size: 11.5px;
    color: var(--text-3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

/* ── Lists inside cards ────────────────────────────────────────────────── */
.list-view {
    list-style: none;
    padding: 0;
    margin: 0;
}

.list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
    transition: background 100ms ease;
    cursor: pointer;
}

.list-item:last-child {
    border-bottom: 0;
}

.list-item:hover {
    background: var(--surface-2);
    color: var(--text);
    text-decoration: none;
}

.list-bullet {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--accent);
    flex: 0 0 auto;
    opacity: 0.7;
}

.list-bullet.is-muted {
    opacity: 0.6;
}

.list-bullet.is-faint {
    opacity: 0.4;
}

/* Urgency-coloured bullets (Todo list) */
.list-bullet--u0 {
    background: var(--text-3, #888);
}

.list-bullet--u1 {
    background: var(--accent, #0d6efd);
}

.list-bullet--u2 {
    background: #e0a800;
}

.list-bullet--u3 {
    background: #fd7e14;
}

.list-bullet--u4 {
    background: var(--error, #c0392b);
}

/* Inline 8x8 bullet variant used inside tree rows */
.list-bullet--tree {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
    opacity: 1;
}

.list-main {
    flex: 1 1 auto;
    min-width: 0;
}

.list-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.list-sub {
    font-size: 11.5px;
    color: var(--text-3);
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    margin-top: 1px;
}

.list-meta {
    font-size: 11px;
    color: var(--text-3);
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    flex: 0 0 auto;
}

/* Empty state */
.empty-state {
    padding: 28px 18px;
    text-align: center;
    color: var(--text-3);
    font-size: 12.5px;
}

.empty-state i {
    display: block;
    font-size: 22px;
    color: var(--text-3);
    opacity: 0.5;
    margin-bottom: 8px;
}

/* ── Stat tile (mini card) ────────────────────────────────────────────── */
.stat-tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--rad-3, 8px);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.stat-tile-label {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-3);
}

.stat-tile-value {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 22px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.01em;
}

.stat-tile-delta {
    font-size: 11px;
    color: var(--accent);
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
}

.stat-tile-delta.is-down {
    color: var(--error, #c0392b);
}

/* ── page-wrap utility classes (spacing on existing card sections) ─────── */
.card-mb {
    margin-bottom: 16px;
}

.card-mt {
    margin-top: 16px;
}


/* ── icon-btn: 32x32 framed button used in page-head action rows ──── */
.page-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.icon-btn.is-disabled {
    color: var(--text-3, #888);
    opacity: 0.5;
}

.icon-btn--pill {
    width: auto;
    padding: 6px 12px;
    font-size: 13px;
    gap: 6px;
    cursor: pointer;
}


.inline-form {
    display: inline;
}


/* ── Day timeline (Mein Tag page) ─────────────────────────────────────── */
.timeline-hours {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-3, #888);
    margin-bottom: 6px;
    padding: 0 1px;
}

.timeline {
    position: relative;
    height: 40px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    cursor: crosshair;
}

.timeline-grid {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--border);
    pointer-events: none;
    left: var(--tl-x, 0%);
}

.timeline-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--text-3, #888);
    pointer-events: none;
}

.timeline-block,
.mein-tag-block {
    position: absolute;
    top: 3px;
    bottom: 3px;
    background: var(--accent, #0d6efd);
    opacity: 0.85;
    border-radius: 3px;
    min-width: 3px;
    pointer-events: auto;
    cursor: default;
    left: var(--tl-x, 0%);
    width: var(--tl-w, 0%);
}

.timeline-legend {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-3, #888);
}

.timeline-legend .is-accent {
    color: var(--accent, #0d6efd);
}

.timeline-legend i {
    margin-right: 3px;
}


/* ── Week bar chart (Mein Tag page) ───────────────────────────────────── */
.week-chart {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    align-items: end;
    height: 140px;
}

.week-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.week-bar-wrap {
    flex: 1;
    display: flex;
    align-items: flex-end;
    width: 100%;
    max-width: 48px;
}

.week-bar {
    width: 100%;
    height: var(--wk-h, 0%);
    background: var(--text-3, #888);
    opacity: 0.55;
    border-radius: 4px 4px 0 0;
    transition: opacity 0.15s ease;
}

.week-day.is-selected .week-bar {
    background: var(--accent, #0d6efd);
    opacity: 1;
}

.week-label {
    margin-top: 6px;
    font-size: 11.5px;
    color: var(--text-3, #888);
}

.week-day.is-selected .week-label {
    font-weight: 600;
    color: var(--text);
}

.week-minutes {
    font-size: 10.5px;
    color: var(--text-3, #888);
    font-family: 'IBM Plex Mono', monospace;
}


/* ── Utilities ─────────────────────────────────────────────────────────── */
.ml-auto {
    margin-left: auto;
}

.link-plain {
    color: inherit;
    text-decoration: none;
}

.link-btn {
    background: none;
    border: 0;
    color: var(--text-3, #888);
    cursor: pointer;
    font: inherit;
}

.inline-select {
    background: transparent;
    border: 0;
    font: inherit;
    color: var(--text);
}


/* ── Card-foot modifiers ─────────────────────────────────────────────── */
.card-foot.is-center {
    justify-content: center;
}

.card-foot.is-wrap {
    flex-wrap: wrap;
    gap: 8px;
}

.card-foot.is-gapped {
    gap: 10px;
}


/* ── Todo details page (show) ────────────────────────────────────────── */
.detail-desc {
    margin: 0 0 14px;
    color: var(--text-2, inherit);
    white-space: pre-wrap;
}

.detail-grid {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 8px 18px;
    margin: 0;
    font-size: 13px;
}

.detail-grid dt {
    color: var(--text-3, #888);
}

.detail-grid dd {
    margin: 0;
}

.detail-grid dd.is-muted {
    color: var(--text-3, #888);
    font-size: 12px;
}


/* ── Form primitives (Todo edit page) ────────────────────────────────── */






textarea.form-input {
    resize: vertical;
}

.fieldset-block {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: var(--p2);
}

.fieldset-block>legend {
    font-size: 12px;
    color: var(--text-3, #888);
    padding: 0 6px;
}

.fieldset-help {
    margin: 0 0 8px;
    font-size: 12px;
    color: var(--text-3, #888);
}

.fieldset-chips {
    margin-bottom: 8px;
}


/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn-action-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 14px;
    background: var(--accent);
    color: #fff;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: filter 120ms;
    white-space: nowrap;
}

.btn-action-primary:hover {
    filter: brightness(0.92);
    color: #fff;
}

.btn-plain {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 14px;
    background: transparent;
    color: var(--text-2);
    border: 1px solid transparent;
    border-radius: var(--radius);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 120ms, color 120ms, border-color 120ms;
    white-space: nowrap;
}

.btn-plain:hover {
    background: var(--surface-2);
    border-color: var(--border);
    color: var(--text);
}

.fieldset-chips .btn-plain[data-active="true"] {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-text, #fff);
}

.icon-btn--danger {
    background: transparent;
    color: var(--error, #c0392b);
}

/* Bootstrap-compatible orange utility for urgency-3 badge */
.bg-orange {
    background-color: #fd7e14;
}

/* ── Invoice / Rechnung table column widths ─────────────────────────── */
/* Used in RechnungTemplate, aufwand views — structural, not reusable utilities */
.rech-col-sm {
    width: 30em;
}

.rech-col-main {
    width: 50em;
}

.rech-col-time {
    width: 10em;
}

.rech-col-actions {
    width: 20em;
}

/* ── Legacy work/task table — date cells ─────────────────────────────── */
.td-date {
    color: var(--info, #0d6efd);
    width: 18rem;
}

/* ── Legacy work/task table — comment row ────────────────────────────── */
.td-comment {
    white-space: pre-wrap;
}

/* ── Max-width constraint for billing-rate input column ──────────────── */
.td-rate-col {
    max-width: 150px;
}

/* ── Legacy data tables — hierarchy row colors ───────────────────────── */
/* Consistent pattern: customer=red/bolder, project=black/bold, task=default */
.td-customer {
    color: var(--error, #c0392b);
    font-weight: 900;
}

.td-project {
    color: var(--text);
    font-weight: 700;
}

.td-blue {
    color: var(--info, #0d6efd);
}

/* ── mitarbeiter/show — work log entry rows ──────────────────────────── */
.ma-row-date {
    font-size: larger;
}

.ma-row-proj {
    font-size: large;
}

.ma-row-divider {
    border-bottom: 1px solid var(--border);
}

/* ── form-error — validation/error banner ───────────────────────────────── */
.form-error {
    padding: var(--p2) var(--p3);
    border: 1px solid var(--error);
    border-radius: var(--rad-2);
    background: var(--error-light);
    color: var(--error-dark);
    font-size: var(--font-s);
    margin-bottom: var(--p4);
}

.form-error ul {
    margin: var(--p1) 0 0 var(--p4);
    padding: 0;
}

.form-error li {
    margin: calc(var(--p1) / 2) 0;
}

/* ── form-section — grouped block inside a form ─────────────────────────── */
.form-section {
    margin-bottom: var(--m6);
}

.form-section>h5 {
    font-size: var(--font-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-3);
    margin: 0 0 var(--m3);
    padding-bottom: var(--p2);
    border-bottom: 1px solid var(--border);
}

/* ── form-row-2 — two-column form row ───────────────────────────────────── */
.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--g3);
}

/* ── form-checkbox — checkbox + label row ───────────────────────────────── */
.form-checkbox {
    display: flex;
    align-items: center;
    gap: var(--g2);
    font-size: var(--font-sm);
    color: var(--text);
    cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
    width: var(--p4);
    height: var(--p4);
    cursor: pointer;
}

/* ── group-header — customer name heading in grouped list ───────────────── */
.group-header {
    font-size: var(--font-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-3);
    padding: var(--p3) var(--p4) var(--p2);
    border-top: 1px solid var(--border);
    margin-top: var(--m2);
}
