/* ==========================================================================
   Komponenten – Bausteine aller Module (Konzept „Knotenpunkt“).
   Vor einer neuen Klasse im Modul prüfen, ob es hier schon etwas gibt (/styleguide).
   ========================================================================== */

/* --- Karte ------------------------------------------------------------------ */
.card {
    background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.card-pad { padding: var(--space-6); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: 1.1rem var(--space-6); border-bottom: 1px solid var(--border); }
a.card { color: inherit; transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease), border-color var(--duration); }
a.card:hover { color: inherit; transform: translateY(-2px); box-shadow: var(--shadow); border-color: rgba(1, 138, 184, .25); }

/* --- Buttons ------------------------------------------------------------- */
.btn {
    position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
    height: 42px; padding: 0 1.05rem; border-radius: 12px; border: 1px solid var(--border-strong);
    background: var(--surface); color: var(--text); font: inherit; font-weight: 700; font-size: .9rem; letter-spacing: -.005em;
    cursor: pointer; white-space: nowrap; box-shadow: var(--shadow-xs); text-decoration: none;
    transition: background var(--duration), border-color var(--duration), box-shadow var(--duration) var(--ease), transform .06s, color var(--duration);
}
.btn:hover { background: var(--surface-2); border-color: #b8c4d3; color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--focus-ring); }
.btn-primary {
    color: #fff; border-color: transparent;
    background: linear-gradient(180deg, #2466b4 0%, var(--navy) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 1px 2px rgba(11, 20, 36, .25), 0 8px 18px -10px rgba(24, 78, 153, .9);
}
.btn-primary:hover {
    color: #fff; border-color: transparent;
    background: linear-gradient(180deg, #2b74c6 0%, #1c58a8 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), var(--shadow-glow);
}
/* Auf dunklem Grund (Hero, Seitenleiste) */
.btn-glow {
    color: var(--ink); border-color: transparent; background: #fff;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .5), 0 10px 30px -10px rgba(74, 182, 206, .9);
}
.btn-glow:hover { background: #eef9fc; color: var(--ink); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); border-color: transparent; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; box-shadow: 0 8px 18px -10px var(--danger); }
.btn-danger:hover { background: #b0151f; border-color: #b0151f; color: #fff; }
.btn-danger-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.btn-lg { height: 50px; padding: 0 1.45rem; font-size: 1rem; border-radius: 14px; }
.btn-sm { height: 34px; padding: 0 .75rem; font-size: .82rem; border-radius: 10px; }
.btn-icon { width: 36px; padding: 0; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.link-btn { border: 0; background: none; padding: 0; font: inherit; color: var(--link); cursor: pointer; font-weight: 700; font-size: .88rem; display: inline-flex; align-items: center; gap: .35rem; }
.link-btn:hover { color: var(--navy); }
.link-btn.muted { color: var(--muted); }

/* --- Formulare ---------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.field > span, .label { font-size: .8rem; font-weight: 700; color: var(--text-2); }
.label .opt, .field .opt { font-weight: 500; color: var(--muted); }
.input, .select {
    width: 100%; height: var(--control-h); padding: 0 .85rem; border: 1px solid var(--border-control); border-radius: 12px;
    background: var(--surface); color: var(--text); font: inherit; font-size: var(--text-base); font-weight: 600;
    box-shadow: var(--shadow-xs); transition: border-color var(--duration), box-shadow var(--duration);
}
textarea.input { height: auto; min-height: 96px; padding: .65rem .85rem; resize: vertical; }
.input::placeholder { color: var(--placeholder); font-weight: 500; }
.input:hover, .select:hover { border-color: var(--text-2); }
.input:focus, .select:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 4px var(--focus-ring); }
.input-xl { height: 58px; font-size: 1.2rem; font-weight: 700; padding: 0 1.1rem; border-radius: 16px; letter-spacing: -.01em; }
.input.has-error, .has-error .input { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(207, 30, 41, .12); }
.error-text { color: var(--danger); font-size: .8rem; font-weight: 600; }
.hint { color: var(--muted); font-size: .8rem; }
.input-group { position: relative; display: flex; align-items: center; }
.input-group .input { padding-right: 2.6rem; }
.input-group .suffix { position: absolute; right: .85rem; color: var(--muted); font-size: var(--text-sm); font-weight: 600; pointer-events: none; }
.input-group .prefix-icon { position: absolute; left: var(--space-3); color: var(--faint); pointer-events: none; }
.input-group .prefix-icon + .input { padding-left: 2.35rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4) 1.1rem; }
.form-grid .full { grid-column: 1 / -1; }
.form-subhead { margin: var(--space-6) 0 var(--space-3); font-size: .8rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); }
.form-subhead .muted { text-transform: none; letter-spacing: 0; font-weight: 600; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

.form-section { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: var(--space-8); }
.form-section .intro h2 { font-size: 1rem; }
.form-section .intro p { color: var(--muted); font-size: .88rem; margin-top: .35rem; }
.form-section + .form-section { border-top: 1px solid var(--border); padding-top: var(--space-8); margin-top: var(--space-8); }
@media (max-width: 760px) { .form-section { grid-template-columns: 1fr; gap: var(--space-4); } }

/* Schalter */
.switch { display: inline-flex; align-items: center; gap: .65rem; cursor: pointer; user-select: none; font-weight: 600; font-size: .9rem; color: var(--text-2); }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 40px; height: 24px; border-radius: var(--radius-pill); background: var(--faint); position: relative; transition: background var(--duration); flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(15, 27, 45, .25); transition: transform var(--duration) var(--ease); }
.switch input:checked + .track { background: var(--gradient-brand); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 4px var(--focus-ring); }

/* Umschalter mit 2–3 Optionen */
.seg-toggle { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--hairline); }
.seg-toggle button {
    border: 0; background: transparent; font: inherit; font-size: .78rem; font-weight: 700; color: var(--muted);
    height: 30px; padding: 0 .7rem; border-radius: 9px; cursor: pointer; transition: all var(--duration);
}
.seg-toggle button:hover { color: var(--text); }
.seg-toggle button.active { background: var(--surface); color: var(--navy); box-shadow: var(--shadow-sm); }

/* Zähler (− 0 +) */
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--border-control); border-radius: 12px; background: var(--surface); height: var(--control-h); box-shadow: var(--shadow-xs); }
.stepper button { width: 36px; height: 100%; border: 0; background: none; cursor: pointer; color: var(--text-2); font-size: 1.1rem; font-weight: 700; }
.stepper button:hover { color: var(--cyan); }
.stepper output { min-width: 1.6rem; text-align: center; font-weight: 800; }

/* --- Chips (Schnellauswahl) und Pills (Status) --------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip {
    display: inline-flex; align-items: center; gap: .4rem; height: 32px; padding: 0 .8rem;
    border-radius: var(--radius-pill); border: 1px solid var(--border); background: var(--surface);
    font: inherit; font-size: .82rem; font-weight: 650; color: var(--text-2); cursor: pointer;
    box-shadow: var(--shadow-xs); transition: all var(--duration) var(--ease);
}
.chip:hover { border-color: rgba(1, 138, 184, .45); color: var(--link); background: var(--cyan-100); }
.chip.active { border-color: transparent; color: #fff; background: var(--gradient-brand-strong); box-shadow: 0 6px 14px -8px rgba(1, 138, 184, .9); }
.chip-sm { height: 26px; padding: 0 .6rem; font-size: .75rem; }
.pill { display: inline-flex; align-items: center; gap: .4rem; padding: .2rem .65rem; border-radius: var(--radius-pill); font-size: .76rem; font-weight: 750; white-space: nowrap; }
/* Status-Knoten vor dem Text */
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent); }
.pill .i { display: none; }
.pill-neutral { background: var(--surface-3); color: var(--muted); }
.pill-success { background: var(--success-soft); color: var(--success); }
.pill-warning { background: var(--warning-soft); color: var(--warning); }
.pill-primary { background: var(--cyan-100); color: var(--link); }

/* --- Rückmeldungen ---------------------------------------------------------- */
.toast {
    position: fixed; right: var(--space-6); bottom: var(--space-6); z-index: 90; display: flex; align-items: center; gap: .7rem;
    padding: .9rem 1.15rem; border-radius: 16px; color: #fff; font-weight: 650;
    background: rgba(11, 20, 36, .92); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, .08); box-shadow: var(--shadow-lg);
    animation: toast-in .35s var(--ease), toast-out .4s ease 4.5s forwards;
}
.toast .i { color: #5fd6b0; }
.toast.error .i { color: #ff9aa1; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(12px); visibility: hidden; } }

.callout { display: flex; gap: .9rem; padding: 1.05rem 1.2rem; border-radius: var(--radius); border: 1px solid transparent; align-items: flex-start; }
.callout > .i { flex: none; width: 34px; height: 34px; padding: 7px; border-radius: 11px; margin-top: -.1rem; background: rgba(255, 255, 255, .7); }
.callout strong { font-weight: 750; }
.callout-warning { background: var(--warning-soft); border-color: var(--warning-border); color: #6a3407; }
.callout-warning > .i { color: var(--warning-accent); }
.callout-success { background: var(--success-soft); border-color: var(--success-border); color: #064e36; }
.callout-success > .i { color: var(--success); }
.callout-info { background: linear-gradient(120deg, #e8f0fb 0%, #e2f3f8 100%); border-color: #cde3f0; color: var(--navy-800); }
.callout-info > .i { color: var(--cyan); }
.callout ul { margin: .4rem 0 0; padding-left: 1.1rem; }
.callout li { margin: .15rem 0; }
.callout .actions { margin-top: .7rem; }

.warn-list { padding: .85rem .95rem; border-radius: var(--radius); background: var(--warning-soft); color: #6a3407; font-size: .82rem; }
.warn-list strong { display: flex; align-items: center; gap: .4rem; color: var(--warning); margin-bottom: .3rem; }
.warn-list ul { margin: 0; padding-left: 1.1rem; }
.ok-note { display: flex; align-items: center; gap: .45rem; color: var(--success); font-size: var(--text-sm); font-weight: 700; }

.error-message { white-space: pre-wrap; font-size: .8rem; background: var(--surface-2); border: 1px solid var(--border); padding: .9rem; border-radius: 12px; overflow-x: auto; }

/* --- Hero: dunkle Bühne mit Aurora und Weltkugel-Bögen ---------------------- */
.hero {
    position: relative; overflow: hidden; isolation: isolate; border-radius: var(--radius-xl);
    padding: 2.4rem 2.5rem 2.2rem; color: #c9d4e4; background: var(--gradient-ink); box-shadow: var(--shadow-lg);
}
.hero::before { /* Aurora */
    content: ""; position: absolute; z-index: -1; width: 520px; height: 520px; right: -140px; top: -260px; border-radius: 50%;
    background: radial-gradient(circle, rgba(74, 182, 206, .55) 0%, rgba(55, 139, 185, .25) 40%, transparent 70%); filter: blur(10px);
}
.hero::after { /* Bögen der Weltkugel */
    content: ""; position: absolute; z-index: -1; width: 360px; height: 360px; right: 4%; top: 50%; transform: translateY(-50%);
    background: url("../brand/globe-white.png") center / contain no-repeat; opacity: .09;
}
.hero .eyebrow-label { color: var(--cyan-400); }
.hero h1 { color: #fff; font-size: var(--text-2xl); margin-top: .5rem; letter-spacing: -.035em; }
.hero p { color: #a9b8cc; margin-top: .6rem; max-width: 54ch; font-size: 1rem; }
.hero .actions { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-top: 1.6rem; }
.hero .btn:not(.btn-glow) { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .14); color: #e4ebf5; box-shadow: none; }
.hero .btn:not(.btn-glow):hover { background: rgba(255, 255, 255, .12); color: #fff; }
.hero-art { display: none; }
@media (max-width: 760px) { .hero { padding: 1.8rem 1.5rem; } .hero::after { opacity: .08; right: -30%; } .hero h1 { font-size: 1.9rem; } }

/* --- Kennzahlen ----------------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); margin: var(--space-6) 0 var(--space-8); }
.stat { padding: var(--space-5) var(--space-6); position: relative; overflow: hidden; }
.stat .label { display: flex; align-items: center; gap: .45rem; color: var(--muted); font-weight: 650; font-size: .84rem; }
.stat .label .i { color: var(--accent, var(--cyan)); }
.stat .value { font-size: 1.85rem; font-weight: 800; letter-spacing: -.035em; margin-top: .3rem; line-height: 1.1; }
@media (max-width: 760px) { .stats { grid-template-columns: 1fr; } }

/* --- Kacheln (Startseite: ein Tool je Kachel) ----------------------------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: var(--space-5); }
.tile {
    display: flex; flex-direction: column; gap: var(--space-5); padding: var(--space-6); position: relative; overflow: hidden;
    transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease), border-color var(--duration);
}
.tile::before { /* Akzent-Schein in der Ecke */
    content: ""; position: absolute; width: 220px; height: 220px; right: -90px; top: -110px; border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--accent, var(--cyan)) 22%, transparent) 0%, transparent 70%);
    opacity: .7; transition: opacity var(--duration);
}
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent, var(--cyan)) 30%, transparent); }
.tile:hover::before { opacity: 1; }
.tile-head { display: flex; align-items: flex-start; gap: 1rem; position: relative; }
.tile-icon {
    width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; flex: none;
    background: linear-gradient(140deg, var(--accent, var(--cyan)) 0%, color-mix(in srgb, var(--accent, var(--cyan)) 70%, #0b1424) 100%);
    color: #fff; box-shadow: 0 10px 20px -10px var(--accent, var(--cyan));
}
.tile-icon .i { width: 1.45em; height: 1.45em; }
.tile h3 { font-size: 1.1rem; font-weight: 800; }
.tile h3 a { color: var(--text); }
.tile h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.tile p { color: var(--muted); font-size: .88rem; margin-top: .25rem; }
.tile-stats { display: flex; gap: var(--space-8); flex-wrap: wrap; position: relative; }
.tile-stats .value { font-size: 1.45rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; }
.tile-stats .label { font-size: .76rem; color: var(--muted); font-weight: 600; }
.tile-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-top: auto; padding-top: var(--space-4); border-top: 1px dashed var(--border); position: relative; }
.tile-foot .btn { position: relative; z-index: 1; }
.tile-placeholder { border: 1.5px dashed var(--border-strong); background: transparent; box-shadow: none; justify-content: center; }
.tile-placeholder::before { display: none; }
.tile-placeholder:hover { transform: none; box-shadow: none; border-color: var(--border-strong); }
.tile-placeholder .tile-icon { background: var(--surface-3); color: var(--faint); box-shadow: none; }

/* --- Liste ------------------------------------------------------------------------- */
.list { display: grid; gap: var(--space-3); }
.list-row { display: grid; grid-template-columns: 50px minmax(0, 1fr) auto auto; gap: 1.1rem; align-items: center; padding: var(--space-4) var(--space-5); }
.list-icon { width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; background: var(--accent-soft, var(--cyan-100)); color: var(--accent, var(--cyan)); }
.list-row .title { font-weight: 750; }
.list-row .amount { font-size: 1.2rem; font-weight: 800; letter-spacing: -.02em; text-align: right; }
@media (max-width: 640px) { .list-row { grid-template-columns: 44px minmax(0, 1fr) auto; } .list-row .pill { display: none; } .list-icon { width: 44px; height: 44px; } }

/* --- Leerer Zustand -------------------------------------------------------------- */
.empty { text-align: center; padding: var(--space-12) var(--space-6); position: relative; overflow: hidden; }
.empty .art { width: 170px; margin: 0 auto var(--space-5); display: block; }
.empty h3 { font-size: var(--text-lg); font-weight: 800; }
.empty p { color: var(--muted); margin: .4rem auto var(--space-5); max-width: 42ch; }

/* --- Datums-Badge ------------------------------------------------------------------ */
.date-badge { width: 64px; border-radius: 16px; overflow: hidden; text-align: center; background: var(--surface); border: 1px solid var(--hairline); box-shadow: var(--shadow-xs); }
.date-badge .m { background: var(--gradient-brand-strong); color: #fff; font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; padding: .2rem 0; }
.date-badge .d { font-size: 1.45rem; font-weight: 800; line-height: 1.2; padding-top: .2rem; letter-spacing: -.03em; }
.date-badge .w { font-size: .7rem; font-weight: 650; color: var(--muted); padding-bottom: .35rem; }

/* --- Hinzufügen ------------------------------------------------------------------------ */
.add-card {
    display: flex; align-items: center; justify-content: center; gap: .6rem; padding: 1.15rem; width: 100%;
    border: 1.5px dashed var(--border-strong); border-radius: var(--radius-lg); color: var(--text-2);
    font-weight: 700; background: transparent; transition: all var(--duration) var(--ease);
}
.add-card:hover { border-color: var(--cyan); color: var(--link); background: var(--cyan-100); }

/* --- Zusammenfassung ("Kassenzettel") ------------------------------------------ */
.ledger { padding: var(--space-6); position: relative; overflow: hidden; }
.ledger::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--gradient-brand); }
.ledger h2 { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-4); }
.ledger h2 .i { color: var(--cyan); }
.ledger-row { display: flex; justify-content: space-between; gap: var(--space-4); padding: .5rem 0; font-size: .92rem; color: var(--text-2); font-weight: 600; }
.ledger-row .l { display: inline-flex; align-items: center; gap: .6rem; }
.ledger-row .l .i { color: var(--faint); }
.ledger-row.zero { color: var(--muted); }
.ledger-row .amount { color: var(--text); font-weight: 750; }
.ledger-row.zero .amount { color: var(--muted); font-weight: 600; }
.ledger-sep { border: 0; border-top: 1.5px dashed var(--border); margin: .7rem 0; }
.ledger-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: .35rem; }
.ledger-total .l { font-weight: 700; color: var(--text-2); }
.ledger-total .amount { font-size: 2.1rem; font-weight: 800; letter-spacing: -.04em; color: var(--navy); }
.ledger-total .amount small { font-size: 1rem; font-weight: 700; color: var(--muted); margin-left: .2rem; }
.ledger .actions { display: grid; gap: var(--space-2); margin-top: var(--space-5); }
.ledger .warn-list, .ledger .ok-note { margin-top: var(--space-4); }

/* --- Schritte: Knoten auf einer Linie ----------------------------------------------- */
.step { padding: var(--space-6) var(--space-6) 1.6rem; scroll-margin-top: var(--space-4); position: relative; }
.step + .step { margin-top: var(--space-4); }
.step-head { display: flex; align-items: center; gap: var(--space-3); margin-bottom: 1.15rem; }
.step-num {
    width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none;
    background: var(--surface); color: var(--navy); font-weight: 800; font-size: .8rem;
    border: 2px solid color-mix(in srgb, var(--cyan) 45%, transparent); box-shadow: 0 0 0 4px var(--cyan-100);
}
.step-num.done { background: var(--gradient-brand-strong); color: #fff; border-color: transparent; box-shadow: 0 0 0 4px var(--cyan-100), 0 6px 14px -6px rgba(1, 138, 184, .8); }
.step-head h2 { font-size: var(--text-lg); font-weight: 800; }
.step-head .aside { margin-left: auto; display: flex; align-items: center; gap: var(--space-3); font-weight: 700; }
.step-sub { color: var(--muted); font-size: .88rem; margin: -.65rem 0 var(--space-4) 2.75rem; }

/* --- Auswahlkarten ------------------------------------------------------------------ */
.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
@media (max-width: 640px) { .choice-grid { grid-template-columns: 1fr; } }
.choice {
    display: flex; flex-direction: column; align-items: flex-start; gap: .4rem; padding: 1.05rem 1.1rem; text-align: left;
    border: 1px solid var(--border); border-radius: 16px; background: var(--surface); cursor: pointer; font: inherit; color: var(--text);
    box-shadow: var(--shadow-xs); transition: all var(--duration) var(--ease);
}
.choice:hover { border-color: rgba(1, 138, 184, .5); background: var(--cyan-100); transform: translateY(-2px); box-shadow: var(--shadow); }
.choice .i { color: var(--cyan); }
.choice strong { font-size: .94rem; font-weight: 750; }
.choice small { color: var(--muted); font-size: .8rem; }

/* --- Unterkarte --------------------------------------------------------------------- */
.sub-card { border: 1px solid var(--hairline); border-radius: 16px; background: var(--surface-2); padding: var(--space-4) var(--space-5); }
.sub-card + .sub-card { margin-top: var(--space-3); }
.sub-card-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .9rem; font-weight: 750; }
.sub-card-head .i { color: var(--cyan); }
.sub-card-head .spacer { margin-left: auto; }

/* --- Dateianhang -------------------------------------------------------------------- */
.attach { display: inline-flex; align-items: center; }
.attach-add {
    display: inline-flex; align-items: center; gap: .45rem; height: var(--control-h); padding: 0 .9rem; border-radius: 12px;
    border: 1.5px dashed var(--border-control); color: var(--text-2); background: var(--surface); cursor: pointer; font: inherit; font-size: .86rem; font-weight: 700;
    transition: all var(--duration) var(--ease);
}
.attach-add:hover, .attach.dragover .attach-add { border-color: var(--cyan); color: var(--link); background: var(--cyan-100); }
.attach-add.missing { border-color: var(--warning-accent); color: var(--warning); background: var(--warning-soft); }
.attach-chip {
    display: inline-flex; align-items: center; gap: .45rem; height: var(--control-h); padding: 0 .4rem 0 .75rem; border-radius: 12px;
    background: var(--success-soft); color: var(--success); border: 1px solid var(--success-border); font-size: var(--text-sm); font-weight: 700; max-width: 240px;
}
.attach-chip a { color: inherit; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-chip button { border: 0; background: none; color: inherit; cursor: pointer; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; }
.attach-chip button:hover { background: rgba(11, 138, 94, .12); }

/* --- Avatar ----------------------------------------------------------------------------- */
.avatar {
    width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none;
    background: var(--surface-3); color: var(--text-2); font-weight: 800; font-size: .78rem; letter-spacing: .02em;
}

/* --- Benutzer & Rollen ------------------------------------------------------ */
.role-legend { display: flex; flex-wrap: wrap; gap: .35rem 1.25rem; margin: -.75rem 0 1.25rem; font-size: .84rem; color: var(--muted); }
.role-legend strong { color: var(--text-2); }
.user-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; gap: .5rem 1rem; align-items: center; padding: .85rem 1.1rem; transition: opacity var(--duration); }
.user-row .avatar { width: 44px; height: 44px; background: var(--gradient-brand-strong); color: #fff; font-size: .85rem; }
.user-row.inactive { opacity: .6; }
.user-row.inactive .avatar { background: var(--surface-3); color: var(--muted); }
.user-row.saving { opacity: .75; }
.user-info { display: grid; min-width: 0; }
.user-info strong { display: flex; align-items: center; gap: .4rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-info small { font-size: .8rem; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-info small.muted { color: var(--muted); }
.user-roles { justify-content: flex-end; }
.user-roles .chip[disabled] { cursor: not-allowed; opacity: .85; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check:has(input:checked) { border-color: transparent; color: #fff; background: var(--gradient-brand-strong); }
@media (max-width: 640px) {
    .user-row { grid-template-columns: 44px minmax(0, 1fr) auto; }
    .user-roles { grid-column: 1 / -1; justify-content: flex-start; }
}
