/* ==========================================================================
   Komponenten: Buttons, Cards, Badges, Formulare, Tabellen, Alerts, Modals,
   Dropdowns, Accordion, Tabs, Pagination, Timeline
   ========================================================================== */

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  padding: 0.8rem 1.4rem; border-radius: var(--radius-md); font-weight: 600; font-size: var(--text-sm);
  line-height: 1.2; border: 1.5px solid transparent; white-space: nowrap; text-decoration: none; cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.btn .icon { width: 1.1em; height: 1.1em; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; pointer-events: none; }
.btn-primary { background: var(--color-primary); color: #fff; box-shadow: 0 6px 16px rgba(29, 137, 228, 0.24); }
.btn-primary:hover { background: var(--color-primary-hover); color: #fff; box-shadow: var(--shadow-primary); }
.btn-secondary { background: var(--color-secondary); color: #fff; }
.btn-secondary:hover { background: var(--navy-700); color: #fff; }
.btn-outline { background: transparent; color: var(--color-text); border-color: var(--color-border-strong); }
.btn-outline:hover { border-color: var(--color-text); color: var(--color-text); background: var(--color-bg-soft); }
.btn-outline-primary { background: transparent; color: var(--color-primary); border-color: var(--color-primary); }
.btn-outline-primary:hover { background: var(--color-primary); color: #fff; }
.btn-light { background: #fff; color: var(--color-text); }
.btn-light:hover { background: var(--color-bg-soft); color: var(--color-text); }
.btn-ghost { background: transparent; color: var(--color-text); }
.btn-ghost:hover { background: var(--color-bg-muted); color: var(--color-text); }
.btn-on-dark { background: rgba(255, 255, 255, 0.1); color: #fff; border-color: rgba(255, 255, 255, 0.22); }
.btn-on-dark:hover { background: rgba(255, 255, 255, 0.18); color: #fff; }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }
.btn-success { background: var(--color-success); color: #fff; }
.btn-success:hover { background: #15803d; color: #fff; }
.btn-lg { padding: 1rem 1.75rem; font-size: var(--text-base); border-radius: var(--radius-lg); }
.btn-xl { padding: 1.15rem 2.1rem; font-size: var(--text-md); border-radius: var(--radius-lg); }
.btn-sm { padding: 0.5rem 0.9rem; font-size: var(--text-xs); border-radius: var(--radius-sm); }
.btn-block { width: 100%; }
.btn-icon { padding: 0.55rem; border-radius: var(--radius-md); }
.btn-icon .icon { width: 1.25em; height: 1.25em; }
.btn-group { display: inline-flex; flex-wrap: wrap; gap: var(--space-3); }
.link-arrow { display: inline-flex; align-items: center; gap: var(--space-2); font-weight: 600; color: var(--color-primary); }
.link-arrow .icon { transition: transform var(--dur-fast) var(--ease); }
.link-arrow:hover .icon { transform: translateX(3px); }
.link-muted { color: var(--color-text-muted); text-decoration: underline; text-underline-offset: 3px; }
.link-muted:hover { color: var(--color-text); }

/* ---------- Cards ---------- */
.card { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-body { padding: clamp(1.25rem, 2.5vw, 1.75rem); }
.card-header { padding: 1rem 1.5rem; border-bottom: 1px solid var(--color-border); display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }
.card-header h2, .card-header h3, .card-header h4 { margin: 0; font-size: var(--text-lg); }
.card-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--color-border); background: var(--color-bg-soft); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.card-hover { transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--blue-100); }
.card-dark { background: var(--navy-700); border-color: var(--color-border-dark); color: #fff; }
.card-dark h3, .card-dark h4 { color: #fff; }
.card-dark p { color: var(--color-text-on-dark-muted); }
.card-soft { background: var(--color-bg-soft); border-color: transparent; box-shadow: none; }
.card-flat { box-shadow: none; }
.card-accent { border-top: 4px solid var(--color-primary); }

/* ---------- Icon boxes ---------- */
.icon-box { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: var(--radius-md); background: var(--blue-50); color: var(--color-primary); flex-shrink: 0; }
.icon-box .icon { width: 26px; height: 26px; }
.icon-box-lg { width: 64px; height: 64px; border-radius: var(--radius-lg); }
.icon-box-lg .icon { width: 30px; height: 30px; }
.icon-box-dark { background: rgba(255, 255, 255, 0.08); color: var(--blue-300); }
.icon-box-primary { background: var(--color-primary); color: #fff; }
.icon-box-round { border-radius: 50%; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 0.35em; padding: 0.3em 0.7em; border-radius: var(--radius-pill); font-size: var(--text-xs); font-weight: 600; line-height: 1.2; white-space: nowrap; }
.badge-neutral { background: var(--color-bg-muted); color: var(--color-text-muted); }
.badge-info { background: var(--blue-50); color: var(--blue-700); }
.badge-primary { background: var(--color-primary); color: #fff; }
.badge-new { background: var(--color-primary); color: #fff; }
.badge-success { background: var(--color-success-soft); color: #15803d; }
.badge-warning { background: var(--color-warning-soft); color: #b45309; }
.badge-danger { background: var(--color-danger-soft); color: #b91c1c; }
.badge-dark { background: var(--navy-700); color: #fff; }
.badge-outline { background: transparent; border: 1px solid var(--color-border-strong); color: var(--color-text-muted); }
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill { display: inline-flex; align-items: center; gap: 0.4em; padding: 0.45em 0.9em; border-radius: var(--radius-pill); background: var(--color-bg-soft); border: 1px solid var(--color-border); font-size: var(--text-sm); font-weight: 500; color: var(--color-text); }
.pill .icon { color: var(--color-primary); }
.pill-dark { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.12); color: #fff; }
.pill-dark .icon { color: var(--blue-300); }
.count-badge { display: inline-flex; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--color-danger); color: #fff; font-size: 11px; font-weight: 600; align-items: center; justify-content: center; }

/* ---------- Forms ---------- */
.form-grid { display: grid; gap: var(--space-4) var(--space-5); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .span-2, .form-grid .full { grid-column: 1 / -1; }
@media (max-width: 720px) { .form-grid, .form-grid-3 { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; }
.field label, .field .label { font-size: var(--text-sm); font-weight: 600; color: var(--color-text); }
.field .hint { font-size: var(--text-xs); color: var(--color-text-muted); }
.req::after { content: " *"; color: var(--color-danger); }
.input, .select, .textarea,
input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="number"], input[type="url"], input[type="search"], input[type="date"], input[type="time"], select, textarea {
  width: 100%; padding: 0.75rem 0.95rem; border: 1.5px solid var(--color-border-strong); border-radius: var(--radius-md); background: #fff; color: var(--color-text);
  font-size: var(--text-base); line-height: 1.4; transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease); min-height: 48px;
}
textarea { min-height: 120px; resize: vertical; }
select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235b6675' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.9rem center; padding-right: 2.5rem; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 4px rgba(29, 137, 228, 0.15); }
input::placeholder, textarea::placeholder { color: var(--color-text-light); }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; accent-color: var(--color-primary); margin: 0; flex-shrink: 0; cursor: pointer; }
input[type="date"], input[type="time"] { font-variant-numeric: tabular-nums; }
.input-lg { min-height: 56px; font-size: var(--text-md); }
.field.has-error input, .field.has-error select, .field.has-error textarea, .input.is-invalid { border-color: var(--color-danger); box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1); }
.field-error { margin: 0; font-size: var(--text-xs); color: var(--color-danger); font-weight: 500; }
.check { display: flex; align-items: flex-start; gap: 0.7rem; font-size: var(--text-sm); cursor: pointer; line-height: 1.5; }
.check input { margin-top: 3px; }
.check a { text-decoration: underline; text-underline-offset: 2px; }
.check-group { display: flex; flex-direction: column; gap: 0.5rem; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-3); }
.choice { position: relative; display: flex; align-items: center; gap: 0.75rem; padding: 0.85rem 1rem; border: 1.5px solid var(--color-border-strong); border-radius: var(--radius-md); background: #fff; cursor: pointer; font-size: var(--text-sm); font-weight: 500; transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease); }
.choice:hover { border-color: var(--blue-300); }
.choice:has(input:checked) { border-color: var(--color-primary); background: var(--blue-50); box-shadow: 0 0 0 3px rgba(29, 137, 228, 0.12); }
.choice:has(input:focus-visible) { box-shadow: 0 0 0 4px rgba(29, 137, 228, 0.2); }
.segmented { display: inline-flex; flex-wrap: wrap; gap: 0.5rem; }
.segmented label { position: relative; padding: 0.75rem 1.1rem; border: 1.5px solid var(--color-border-strong); border-radius: var(--radius-md); cursor: pointer; font-weight: 600; font-size: var(--text-sm); background: #fff; transition: all var(--dur-fast) var(--ease); display: inline-flex; align-items: center; gap: 0.5rem; }
.segmented label:has(input:checked) { border-color: var(--color-primary); background: var(--color-primary); color: #fff; }
.segmented label:has(input:focus-visible) { box-shadow: 0 0 0 4px rgba(29, 137, 228, 0.25); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented .seg-warning:has(input:checked) { background: var(--color-warning); border-color: var(--color-warning); }
.segmented .seg-danger:has(input:checked) { background: var(--color-danger); border-color: var(--color-danger); }
.segmented .seg-success:has(input:checked) { background: var(--color-success); border-color: var(--color-success); }
.input-group { display: flex; align-items: stretch; }
.input-group > input { border-radius: var(--radius-md) 0 0 var(--radius-md); }
.input-group > .btn { border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.input-icon { position: relative; }
.input-icon .icon { position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%); color: var(--color-text-light); pointer-events: none; }
.input-icon input { padding-left: 2.6rem; }
.form-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; margin-top: var(--space-6); }
.form-section { padding: var(--space-6) 0; border-top: 1px solid var(--color-border); }
.form-section:first-child { border-top: 0; padding-top: 0; }
.form-section-title { font-size: var(--text-lg); font-weight: 600; margin-bottom: var(--space-1); }
.form-section-text { font-size: var(--text-sm); color: var(--color-text-muted); margin-bottom: var(--space-5); }
.honeypot { position: absolute !important; left: -9999px !important; top: -9999px !important; height: 0; width: 0; overflow: hidden; }
.toggle { display: inline-flex; align-items: center; gap: 0.75rem; cursor: pointer; font-weight: 500; font-size: var(--text-sm); }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle .track { width: 44px; height: 26px; border-radius: 13px; background: var(--color-border-strong); position: relative; transition: background var(--dur-fast) var(--ease); flex-shrink: 0; }
.toggle .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform var(--dur-fast) var(--ease); }
.toggle input:checked + .track { background: var(--color-primary); }
.toggle input:checked + .track::after { transform: translateX(18px); }
.toggle input:focus-visible + .track { box-shadow: 0 0 0 4px rgba(29, 137, 228, 0.25); }
.toggle input:disabled + .track { opacity: 0.5; }

/* ---------- Alerts / Flash ---------- */
.alert { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.95rem 1.1rem; border-radius: var(--radius-md); border: 1px solid; font-size: var(--text-sm); line-height: 1.5; }
.alert .icon { margin-top: 1px; }
.alert-success { background: var(--color-success-soft); border-color: #bde5c8; color: #14532d; }
.alert-error, .alert-danger { background: var(--color-danger-soft); border-color: #f5c2c2; color: #7f1d1d; }
.alert-warning { background: var(--color-warning-soft); border-color: #f8dba5; color: #78350f; }
.alert-info { background: var(--color-info-soft); border-color: var(--blue-100); color: var(--blue-700); }
.alert strong { font-weight: 600; }
.alert-dismiss { margin-left: auto; opacity: 0.6; }
.alert-dismiss:hover { opacity: 1; }
.flash-stack { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: var(--space-6); }
.toast-region { position: fixed; right: 16px; bottom: 16px; z-index: var(--z-toast); display: flex; flex-direction: column; gap: 0.5rem; max-width: min(400px, calc(100vw - 32px)); }
.toast { background: var(--navy-800); color: #fff; padding: 0.8rem 1rem; border-radius: var(--radius-md); box-shadow: var(--shadow-lg); font-size: var(--text-sm); animation: toast-in var(--dur) var(--ease); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Notice box (e.g. Kundenanweisungen) ---------- */
.notice { padding: 1rem 1.25rem; border-radius: var(--radius-md); border-left: 4px solid var(--color-primary); background: var(--blue-50); }
.notice-warning { border-left-color: var(--color-warning); background: var(--color-warning-soft); }
.notice-danger { border-left-color: var(--color-danger); background: var(--color-danger-soft); }
.notice-title { font-weight: 600; font-size: var(--text-sm); margin-bottom: 0.35rem; display: flex; align-items: center; gap: 0.5rem; }
.notice-instructions { font-size: var(--text-md); font-weight: 500; white-space: pre-line; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: #fff; }
.table { width: 100%; font-size: var(--text-sm); }
.table th, .table td { padding: 0.85rem 1rem; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--color-border); }
.table th { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-text-muted); font-weight: 600; background: var(--color-bg-soft); white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--color-bg-soft); }
.table tr.is-unread td { background: rgba(29, 137, 228, 0.05); }
.table tr.is-unread td:first-child { box-shadow: inset 3px 0 0 var(--color-primary); }
.table td.actions { text-align: right; white-space: nowrap; }
.table .row-link { color: inherit; font-weight: 600; }
.table .row-link:hover { color: var(--color-primary); }
.table-compact th, .table-compact td { padding: 0.6rem 0.8rem; }
.table-plain { border: 0; }
.table-plain th { background: transparent; }
@media (max-width: 860px) {
  .table-responsive { border: 0; background: transparent; overflow: visible; }
  .table-responsive .table, .table-responsive tbody, .table-responsive tr, .table-responsive td { display: block; width: 100%; }
  .table-responsive thead { display: none; }
  .table-responsive tr { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-lg); margin-bottom: 0.85rem; padding: 0.5rem 0; box-shadow: var(--shadow-xs); }
  .table-responsive tr.is-unread { border-color: var(--blue-300); }
  .table-responsive tr.is-unread td:first-child { box-shadow: none; }
  .table-responsive td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: 0.45rem 1rem; }
  .table-responsive td::before { content: attr(data-label); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-text-muted); font-weight: 600; flex-shrink: 0; }
  .table-responsive td.actions { justify-content: flex-end; }
  .table-responsive td.actions::before { display: none; }
  .table-responsive td[data-label=""]::before { display: none; }
}

/* ---------- Definition lists ---------- */
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.6rem 1.5rem; font-size: var(--text-sm); }
.dl dt { color: var(--color-text-muted); font-weight: 500; }
.dl dd { margin: 0; font-weight: 500; word-break: break-word; }
@media (max-width: 560px) { .dl { grid-template-columns: 1fr; gap: 0.25rem; } .dl dd { margin-bottom: 0.6rem; } }
.kv { display: flex; flex-direction: column; gap: 0.15rem; }
.kv .k { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-text-muted); font-weight: 600; }
.kv .v { font-weight: 500; }

/* ---------- Accordion (details based) ---------- */
.accordion { display: flex; flex-direction: column; gap: 0.75rem; }
.accordion details { border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: #fff; overflow: hidden; transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease); }
.accordion details[open] { border-color: var(--blue-100); box-shadow: var(--shadow-sm); }
.accordion summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.35rem; font-weight: 600; font-size: var(--text-md); }
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary .icon { color: var(--color-primary); transition: transform var(--dur) var(--ease); flex-shrink: 0; }
.accordion details[open] summary .icon { transform: rotate(180deg); }
.accordion .accordion-body { padding: 0 1.35rem 1.25rem; color: var(--color-text-muted); line-height: var(--leading-relaxed); }
.section-dark .accordion details { background: rgba(255, 255, 255, 0.04); border-color: rgba(255, 255, 255, 0.1); }
.section-dark .accordion summary { color: #fff; }
.section-dark .accordion .accordion-body { color: var(--color-text-on-dark-muted); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--color-border); margin-bottom: var(--space-6); overflow-x: auto; }
.tabs button, .tabs a { padding: 0.75rem 1rem; font-weight: 600; font-size: var(--text-sm); color: var(--color-text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.is-active, .tabs a.is-active { color: var(--color-primary); border-bottom-color: var(--color-primary); }
.tab-panel[hidden] { display: none; }

/* ---------- Dropdown ---------- */
.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); padding: 0.5rem; z-index: var(--z-dropdown); opacity: 0; visibility: hidden; transform: translateY(-6px); transition: all var(--dur-fast) var(--ease); }
.dropdown.is-open .dropdown-menu { opacity: 1; visibility: visible; transform: none; }
.dropdown-menu a, .dropdown-menu button { display: flex; align-items: center; gap: 0.6rem; width: 100%; padding: 0.6rem 0.75rem; border-radius: var(--radius-sm); font-size: var(--text-sm); color: var(--color-text); text-align: left; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--color-bg-soft); color: var(--color-text); }
.dropdown-menu .divider { border-top: 1px solid var(--color-border); margin: 0.4rem 0; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: var(--z-modal); display: none; align-items: center; justify-content: center; padding: 1rem; }
.modal.is-open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(10, 17, 28, 0.6); backdrop-filter: blur(3px); }
.modal-dialog { position: relative; width: 100%; max-width: 640px; max-height: calc(100vh - 2rem); overflow: auto; background: #fff; border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); animation: modal-in var(--dur) var(--ease); }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--color-border); }
.modal-header h2 { margin: 0; font-size: var(--text-xl); }
.modal-body { padding: 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--color-border); display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: flex-end; background: var(--color-bg-soft); border-radius: 0 0 var(--radius-xl) var(--radius-xl); }
body.modal-open { overflow: hidden; }

/* ---------- Pagination ---------- */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: var(--space-6); font-size: var(--text-sm); color: var(--color-text-muted); }
.pagination-links { display: flex; gap: 0.35rem; }
.pagination-links a, .pagination-links span { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px; padding: 0 0.6rem; border-radius: var(--radius-sm); border: 1px solid var(--color-border); color: var(--color-text); font-weight: 500; }
.pagination-links a:hover { border-color: var(--color-primary); color: var(--color-primary); }
.pagination-links .is-current { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.pagination-links .disabled { opacity: 0.4; pointer-events: none; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; position: relative; padding-left: 1.75rem; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--color-border); }
.timeline li { position: relative; padding-bottom: 1.1rem; font-size: var(--text-sm); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -1.75rem; top: 5px; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--color-primary); }
.timeline li.is-internal::before { border-color: var(--color-text-light); }
.timeline .time { color: var(--color-text-muted); font-size: var(--text-xs); display: block; margin-bottom: 0.15rem; font-variant-numeric: tabular-nums; }
.timeline .who { font-weight: 600; }

/* ---------- Avatar ---------- */
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--color-primary); color: #fff; font-weight: 600; font-size: var(--text-xs); flex-shrink: 0; letter-spacing: 0.02em; }
.avatar-lg { width: 48px; height: 48px; font-size: var(--text-sm); }
.avatar-muted { background: var(--navy-600); }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: clamp(2rem, 5vw, 3.5rem) 1.5rem; color: var(--color-text-muted); border: 1px dashed var(--color-border-strong); border-radius: var(--radius-lg); background: var(--color-bg-soft); }
.empty .icon-box { margin: 0 auto 1rem; }
.empty h3 { font-size: var(--text-lg); margin-bottom: 0.35rem; }

/* ---------- Progress / meter ---------- */
.meter { height: 8px; border-radius: 4px; background: var(--color-bg-muted); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--color-primary); border-radius: 4px; }

/* ---------- Breadcrumb ---------- */
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; font-size: var(--text-sm); color: var(--color-text-muted); margin-bottom: var(--space-4); }
.breadcrumb a { color: var(--color-text-muted); }
.breadcrumb a:hover { color: var(--color-primary); }
.breadcrumb .icon { width: 1em; height: 1em; opacity: 0.6; }
.breadcrumb-dark, .breadcrumb-dark a { color: var(--color-text-on-dark-muted); }
