/**
 * abrechnungssystem.css  v2.0
 * CS Aviation — "Aviation Operations" Design
 *
 * Setzt CSS-Variablen aus reservierungssystem.css voraus.
 * Alle Selektoren sind auf .res-abr- oder .res-abr-wrap/.res-abr-overlay
 * beschränkt — keine Theme-Kollisionen.
 */

/* ══ SCOPED BOX-SIZING ════════════════════════════════════════════════════════ */
.res-abr-wrap *,  .res-abr-wrap *::before,  .res-abr-wrap *::after,
.res-abr-overlay *, .res-abr-overlay *::before, .res-abr-overlay *::after {
    box-sizing: border-box;
}

/* ══ WORDPRESS THEME HARD RESETS ══════════════════════════════════════════════
   Viele Themes setzen: svg { max-width:100% }, h1-h6 { margin/padding/border },
   table td { padding:... }, button { float:... } usw.
   Diese Regeln überschreiben das gezielt innerhalb unserer Komponenten.
   ════════════════════════════════════════════════════════════════════════════════ */

/* SVG darf niemals Theme-Größe erben → Icons explodieren sonst auf 100% */
.res-abr-wrap svg,
.res-abr-overlay svg {
    max-width: none !important;
    max-height: none !important;
    display: inline-block !important;
    vertical-align: middle !important;
}
.res-abr-hicon {
    width: 20px !important;
    height: 20px !important;
    flex-shrink: 0 !important;
}
.res-abr-search-ico {
    width: 15px !important;
    height: 15px !important;
    flex-shrink: 0 !important;
}
.res-abr-btn svg,
.res-abr-btn-edit svg {
    width: 14px !important;
    height: 14px !important;
    flex-shrink: 0 !important;
}
.res-abr-enc-badge svg {
    width: 10px !important;
    height: 10px !important;
    flex-shrink: 0 !important;
}

/* Headings: Theme-Schriftgrößen, Margins, Borders neutralisieren */
.res-abr-card-title {
    font-size: 0.875rem !important;
    font-weight: 900 !important;
    line-height: 1.25 !important;
    margin: 0 0 0.1rem !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    color: #fff !important;
    letter-spacing: 0.025em !important;
    text-transform: uppercase !important;
    background: none !important;
    float: none !important;
    display: block !important;
}
.res-abr-card-sub {
    font-size: 0.78rem !important;
    font-weight: 400 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    color: rgba(255,255,255,0.5) !important;
    background: none !important;
    float: none !important;
    display: block !important;
}

/* Card-Header: flex erzwingen damit Icon + Text nebeneinander bleiben */
.res-abr-card-header {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    justify-content: space-between !important;
}
.res-abr-card-header-left {
    display: flex !important;
    align-items: center !important;
    gap: 0.85rem !important;
    min-width: 0 !important;
}

/* p in Card-Headern: margin-Reset */
.res-abr-card-header p { margin: 0 !important; padding: 0 !important; }

/* Buttons */
.res-abr-btn,
.res-abr-btn-edit,
.res-abr-modal-close {
    font-family: 'Lato', sans-serif !important;
    line-height: 1 !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    float: none !important;
    box-sizing: border-box !important;
}

/* Inputs */
.res-abr-field input,
.res-abr-field select,
.res-abr-field textarea {
    font-family: 'Lato', sans-serif !important;
    font-size: 0.9rem !important;
    line-height: 1.4 !important;
    margin: 0 !important;
    float: none !important;
    display: block !important;
}

/* Tabellen: Theme-Border/Padding neutralisieren */
.res-abr-tbl {
    border-spacing: 0 !important;
    border-collapse: collapse !important;
    width: 100% !important;
}
.res-abr-tbl th,
.res-abr-tbl td {
    border-left: none !important;
    border-right: none !important;
    background-image: none !important;
}

/* ══ DESIGN TOKENS (lokal) ════════════════════════════════════════════════════ */
.res-abr-wrap,
.res-abr-overlay {
    --abr-navy:        #0f2548;
    --abr-navy-mid:    #1a3d7c;   /* = --res-blue */
    --abr-navy-soft:   #2251a3;   /* = --res-blue-mid */
    --abr-sky:         #e8eef8;   /* = --res-blue-light */
    --abr-red:         #c8234a;
    --abr-green:       #1e8c45;
    --abr-amber:       #b45309;

    --abr-surface:     #f4f6fb;
    --abr-card:        #ffffff;
    --abr-border:      #d0d9ea;
    --abr-border-lite: #e6ecf5;
    --abr-text:        #111827;
    --abr-text-sub:    #4b5a72;
    --abr-text-muted:  #8a99b0;

    --abr-radius-sm:   6px;
    --abr-radius:      10px;
    --abr-radius-lg:   14px;

    --abr-header-grad: linear-gradient(135deg, #0f2548 0%, #1a3d7c 60%, #1f4a94 100%);
    --abr-card-shadow: 0 1px 3px rgba(15,37,72,0.07), 0 4px 16px rgba(15,37,72,0.08);
    --abr-modal-shadow: 0 20px 60px rgba(10,20,45,0.35), 0 4px 16px rgba(10,20,45,0.18);

    font-family: 'Lato', system-ui, sans-serif;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--abr-text);
}

/* ══ WRAP ═════════════════════════════════════════════════════════════════════ */
.res-abr-wrap {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-width: 100%;
}

/* ══ CARD ═════════════════════════════════════════════════════════════════════ */
.res-abr-card {
    background: var(--abr-card);
    border: 1px solid var(--abr-border);
    border-radius: var(--abr-radius-lg);
    box-shadow: var(--abr-card-shadow);
    overflow: hidden;
}

/* ── Card Header ────────────────────────────────────────────────────────────── */
.res-abr-card-header {
    background: var(--abr-header-grad);
    padding: 1.1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    /* Subtle texture line at bottom */
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.res-abr-card-header-left {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.res-abr-hicon {
    width: 20px;
    height: 20px;
    color: rgba(255,255,255,0.55);
    flex-shrink: 0;
    margin-top: 1px;
}

.res-abr-card-title {
    margin: 0 0 0.05rem;
    font-size: 0.95rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    line-height: 1.25;
}

.res-abr-card-sub {
    margin: 0;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.5);
    font-weight: 400;
    letter-spacing: 0;
}

/* ── Card Body ──────────────────────────────────────────────────────────────── */
.res-abr-card-body {
    padding: 1.5rem;
}

/* ── Save-Row (Footer inside card-body) ─────────────────────────────────────── */
.res-abr-foot {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding-top: 1.25rem;
    margin-top: 1.25rem;
    border-top: 1px solid var(--abr-border-lite);
}

/* ══ BUTTONS ══════════════════════════════════════════════════════════════════ */

/* Base */
.res-abr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 1.15rem;
    border-radius: var(--abr-radius-sm);
    border: 1.5px solid transparent;
    font-family: 'Lato', sans-serif;
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.025em;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.14s, color 0.14s, border-color 0.14s,
                box-shadow 0.14s, transform 0.1s;
    appearance: none;
    -webkit-appearance: none;
}
.res-abr-btn:active { transform: translateY(1px); }
.res-abr-btn svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

/* Primary — deep navy */
.res-abr-btn--primary {
    background: var(--abr-navy-mid);
    color: #fff;
    border-color: var(--abr-navy-mid);
    box-shadow: 0 1px 4px rgba(15,37,72,0.18), inset 0 1px 0 rgba(255,255,255,0.1);
}
.res-abr-btn--primary:hover {
    background: var(--abr-navy);
    border-color: var(--abr-navy);
    box-shadow: 0 3px 10px rgba(15,37,72,0.28);
}
.res-abr-btn--primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Ghost — white outline (use in navy headers) */
.res-abr-btn--ghost {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.92);
    border-color: rgba(255,255,255,0.28);
    font-size: 0.8rem;
}
.res-abr-btn--ghost:hover {
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.55);
    color: #fff;
}

/* Danger */
.res-abr-btn--danger {
    background: transparent;
    color: var(--abr-red);
    border-color: rgba(200,35,74,0.4);
}
.res-abr-btn--danger:hover {
    background: var(--abr-red);
    border-color: var(--abr-red);
    color: #fff;
    box-shadow: 0 2px 8px rgba(200,35,74,0.28);
}

/* Inline row Edit-Button */
.res-abr-btn-edit {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.65rem;
    border: 1px solid var(--abr-border);
    border-radius: var(--abr-radius-sm);
    background: var(--abr-card);
    color: var(--abr-text-sub);
    font-family: 'Lato', sans-serif;
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.12s, color 0.12s, border-color 0.12s, box-shadow 0.12s;
    appearance: none;
    -webkit-appearance: none;
}
.res-abr-btn-edit svg {
    width: 11px;
    height: 11px;
}
.res-abr-btn-edit:hover {
    background: var(--abr-navy-mid);
    border-color: var(--abr-navy-mid);
    color: #fff;
    box-shadow: 0 2px 8px rgba(26,61,124,0.22);
}

/* ══ TABELLEN ═════════════════════════════════════════════════════════════════ */

.res-abr-tbl-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--abr-border);
    border-radius: var(--abr-radius);
    /* Scrollbar styling */
    scrollbar-width: thin;
    scrollbar-color: var(--abr-border) transparent;
}
.res-abr-tbl-wrap::-webkit-scrollbar { height: 5px; }
.res-abr-tbl-wrap::-webkit-scrollbar-thumb {
    background: var(--abr-border);
    border-radius: 99px;
}

/* Flush: kein eigener Border (direkt im Card-Body an Kanten) */
.res-abr-tbl-wrap--flush {
    border-left: none;
    border-right: none;
    border-bottom: none;
    border-radius: 0;
}

.res-abr-tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    color: var(--abr-text);
    background: var(--abr-card);
    margin: 0;
}

/* Header-Zeile */
.res-abr-tbl thead tr {
    background: var(--abr-surface);
    border-bottom: 2px solid var(--abr-border);
}
.res-abr-tbl thead th {
    padding: 0.65rem 1.1rem;
    text-align: left;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--abr-text-muted);
    white-space: nowrap;
    vertical-align: middle;
    /* WP-Reset */
    border: none;
    background: transparent;
}

/* Zeilen */
.res-abr-tbl tbody tr {
    border-bottom: 1px solid var(--abr-border-lite);
    transition: background 0.1s;
    position: relative;
}
.res-abr-tbl tbody tr:last-child { border-bottom: none; }

/* Zebra */
.res-abr-tbl tbody tr:nth-child(even) { background: #fafbfd; }
.res-abr-tbl tbody tr:nth-child(odd)  { background: var(--abr-card); }

/* Hover: farbiger Linker Rand + helles Blau */
.res-abr-tbl tbody tr:hover { background: #eef3fc; }
.res-abr-tbl tbody tr:hover td:first-child {
    box-shadow: inset 3px 0 0 var(--abr-navy-mid);
}

.res-abr-tbl tbody td {
    padding: 0.7rem 1.1rem;
    vertical-align: middle;
    /* WP-Reset */
    border: none;
    background: transparent;
}

/* Spezifische Zell-Stile */
.res-abr-tbl-actions {
    text-align: right;
    white-space: nowrap;
    width: 1%;
}
.res-abr-dim   { color: var(--abr-text-sub); }
.res-abr-mono  {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.82rem;
    letter-spacing: 0.05em;
}
.res-abr-mail {
    color: var(--abr-navy-soft);
    text-decoration: none;
    font-weight: 600;
}
.res-abr-mail:hover { text-decoration: underline; }

/* Registrierung / ICAO Code */
.res-abr-reg,
.res-abr-icao {
    display: inline-flex;
    align-items: center;
    font-family: 'Lato', monospace;
    font-weight: 900;
    font-size: 0.82rem;
    letter-spacing: 0.1em;
    color: var(--abr-navy-mid);
    background: var(--abr-sky);
    padding: 0.18rem 0.55rem;
    border-radius: 4px;
    border: 1px solid rgba(26,61,124,0.15);
}

/* Benutzeranzahl-Footer */
.res-abr-user-count {
    padding: 0.5rem 1.1rem;
    font-size: 0.75rem;
    color: var(--abr-text-muted);
    text-align: right;
    background: var(--abr-surface);
    border-top: 1px solid var(--abr-border-lite);
    letter-spacing: 0.02em;
}

/* ── Preis-Input in Flugzeug-Tabelle ────────────────────────────────────────── */
.res-abr-price-cell {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.res-fp-input {
    width: 115px;
    padding: 0.38rem 0.6rem;
    border: 1.5px solid var(--abr-border);
    border-radius: var(--abr-radius-sm);
    background: var(--abr-surface);
    color: var(--abr-text);
    font-family: 'Lato', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
    -webkit-appearance: auto;
    appearance: auto; /* Spinner für number beibehalten */
}
.res-fp-input:focus {
    outline: none;
    border-color: var(--abr-navy-mid);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(26,61,124,0.12);
}

.res-abr-unit {
    font-size: 0.78rem;
    color: var(--abr-text-muted);
    white-space: nowrap;
    font-weight: 600;
}

/* ── Badges ─────────────────────────────────────────────────────────────────── */
.res-abr-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: capitalize;
    white-space: nowrap;
}

/* Rollen */
.res-abr-badge--administrator { background: rgba(15,37,72,0.09);   color: var(--abr-navy); border: 1px solid rgba(15,37,72,0.15); }
.res-abr-badge--editor        { background: rgba(30,140,69,0.1);   color: #15683a;          border: 1px solid rgba(30,140,69,0.2); }
.res-abr-badge--author        { background: rgba(180,83,9,0.1);    color: var(--abr-amber); border: 1px solid rgba(180,83,9,0.2); }
.res-abr-badge--contributor   { background: rgba(75,90,114,0.08);  color: var(--abr-text-sub); border: 1px solid rgba(75,90,114,0.15); }
.res-abr-badge--subscriber    { background: var(--abr-surface);    color: var(--abr-text-muted); border: 1px solid var(--abr-border); }

/* Flugtypen */
.res-abr-badge--schulflug  { background: rgba(26,61,124,0.08); color: var(--abr-navy-mid); border: 1px solid rgba(26,61,124,0.18); }
.res-abr-badge--privatflug { background: rgba(30,140,69,0.08); color: var(--abr-green);    border: 1px solid rgba(30,140,69,0.2); }

/* Steuersatz-Chip */
.res-abr-steuer {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    background: var(--abr-sky);
    color: var(--abr-navy-mid);
    border: 1px solid rgba(26,61,124,0.12);
    letter-spacing: 0.02em;
}

/* ── Feedback-Meldung ───────────────────────────────────────────────────────── */
.res-abr-msg {
    font-family: 'Lato', sans-serif;
    font-size: 0.84rem;
    font-weight: 700;
    display: none;
    letter-spacing: 0.01em;
}
.res-abr-msg--ok  { color: var(--abr-green); }
.res-abr-msg--err { color: var(--abr-red); }

/* ── Lade- / Leer- / Fehler-Placeholder ────────────────────────────────────── */
.res-abr-loading {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--abr-text-muted);
    font-size: 0.875rem;
    padding: 0.25rem 0;
}

.res-abr-spinner {
    display: inline-block;
    width: 15px;
    height: 15px;
    border: 2px solid var(--abr-border);
    border-top-color: var(--abr-navy-mid);
    border-radius: 50%;
    animation: resAbrSpin 0.7s linear infinite;
    flex-shrink: 0;
}
@keyframes resAbrSpin { to { transform: rotate(360deg); } }

.res-abr-empty {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1rem 1.1rem;
    margin: 0.5rem 0;
    background: var(--abr-surface);
    border: 1.5px dashed var(--abr-border);
    border-radius: var(--abr-radius-sm);
    color: var(--abr-text-muted);
    font-size: 0.84rem;
    font-style: italic;
}
.res-abr-empty::before {
    content: '—';
    font-style: normal;
    font-weight: 700;
    opacity: 0.4;
    flex-shrink: 0;
}

.res-abr-err-txt {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1.1rem;
    margin: 0.5rem 0;
    background: rgba(200,35,74,0.05);
    border: 1px solid rgba(200,35,74,0.2);
    border-radius: var(--abr-radius-sm);
    color: var(--abr-red);
    font-size: 0.84rem;
    font-weight: 600;
}

/* ══ SUCHFELD (im Card-Header) ════════════════════════════════════════════════ */
.res-abr-search-box {
    position: relative;
    display: flex;
    align-items: center;
}
.res-abr-search-ico {
    position: absolute;
    left: 0.7rem;
    width: 14px;
    height: 14px;
    color: rgba(255,255,255,0.45);
    pointer-events: none;
}
.res-abr-search-box input[type="search"] {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 7px;
    color: #fff;
    padding: 0.44rem 1rem 0.44rem 2.2rem;
    font-size: 0.84rem;
    font-family: 'Lato', sans-serif;
    width: 255px;
    max-width: 100%;
    transition: background 0.16s, border-color 0.16s;
    appearance: none;
    -webkit-appearance: none;
    box-shadow: none;
}
.res-abr-search-box input::placeholder { color: rgba(255,255,255,0.38); }
.res-abr-search-box input:focus {
    outline: none;
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.5);
}
.res-abr-search-box input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: rgba(255,255,255,0.4) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E") center/10px no-repeat;
    border-radius: 50%;
    cursor: pointer;
}

/* ══ OVERLAY ══════════════════════════════════════════════════════════════════ */
.res-abr-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(8,16,36,0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}
.res-abr-overlay[hidden] { display: none !important; }

/* ══ MODAL ════════════════════════════════════════════════════════════════════ */
.res-abr-modal {
    background: var(--abr-card);
    border-radius: var(--abr-radius-lg);
    box-shadow: var(--abr-modal-shadow);
    width: 100%;
    max-width: 520px;
    max-height: 92dvh;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: resAbrIn 0.22s cubic-bezier(0.34,1.42,0.64,1);
}
@keyframes resAbrIn {
    from { opacity: 0; transform: scale(0.94) translateY(-8px); }
    to   { opacity: 1; transform: none; }
}

.res-abr-modal--wide { max-width: 680px; }

/* Modal Header */
.res-abr-modal-header {
    background: var(--abr-header-grad);
    padding: 0.95rem 1.35rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}
.res-abr-modal-header > span {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.res-abr-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    color: rgba(255,255,255,0.75);
    font-size: 0.85rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.14s, color 0.14s;
    flex-shrink: 0;
    appearance: none;
    -webkit-appearance: none;
}
.res-abr-modal-close:hover {
    background: rgba(255,255,255,0.22);
    color: #fff;
}

/* Modal Body */
.res-abr-modal-body {
    padding: 1.5rem 1.5rem 1.25rem;
    overflow-y: auto;
    flex: 1 1 auto;
    /* Scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--abr-border) transparent;
}
.res-abr-modal-body::-webkit-scrollbar { width: 4px; }
.res-abr-modal-body::-webkit-scrollbar-thumb {
    background: var(--abr-border);
    border-radius: 99px;
}

/* Modal Footer */
.res-abr-modal-foot {
    padding: 1rem 1.5rem;
    background: var(--abr-surface);
    border-top: 1px solid var(--abr-border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* ══ FORMULAR ═════════════════════════════════════════════════════════════════ */

/* Sektions-Label (Trennlinie mit Akzent-Bar links) */
.res-abr-section-lbl {
    margin: 1.5rem 0 1rem;
    padding-left: 0.75rem;
    border-left: 3px solid var(--abr-navy-mid);
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.11em;
    color: var(--abr-navy-mid);
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
    line-height: 1.4;
}
.res-abr-section-lbl:first-child { margin-top: 0; }

/* Feld-Container */
.res-abr-field {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    margin-bottom: 1rem;
}
.res-abr-field:last-child { margin-bottom: 0; }

/* Zweipaltige Zeile */
.res-abr-field-row {
    display: flex;
    gap: 0.85rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.res-abr-field-row:last-child { margin-bottom: 0; }
.res-abr-field-row .res-abr-field { flex: 1 1 130px; margin-bottom: 0; }
.res-abr-field-row .res-abr-field--xs   { flex: 0 0 88px; }
.res-abr-field-row .res-abr-field--grow { flex: 2 1 160px; }
.res-abr-field-row .res-abr-field--lg   { flex: 3 1 200px; }

/* Labels */
.res-abr-field label {
    font-size: 0.71rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--abr-text-sub);
    display: block;
    margin: 0;
    padding: 0;
    float: none;
    width: auto;
}

/* Alle Inputs */
.res-abr-field input[type="text"],
.res-abr-field input[type="email"],
.res-abr-field input[type="tel"],
.res-abr-field input[type="number"],
.res-abr-field input[type="date"],
.res-abr-field input[type="search"],
.res-abr-field select,
.res-abr-field textarea {
    width: 100%;
    padding: 0.52rem 0.8rem;
    border: 1.5px solid var(--abr-border);
    border-radius: var(--abr-radius-sm);
    background: var(--abr-surface);
    color: var(--abr-text);
    font-family: 'Lato', sans-serif;
    font-size: 0.9rem;
    font-weight: 400;
    line-height: 1.4;
    transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
    appearance: none;
    -webkit-appearance: none;
    box-shadow: none;
    margin: 0;
}
.res-abr-field input:focus,
.res-abr-field select:focus,
.res-abr-field textarea:focus {
    outline: none;
    border-color: var(--abr-navy-mid);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(26,61,124,0.11);
}

/* Select: Eigener Pfeil */
.res-abr-field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238a99b0' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.1rem;
}

.res-abr-field textarea { resize: vertical; min-height: 66px; }

/* Readonly */
.res-abr-readonly {
    background: var(--abr-sky) !important;
    color: var(--abr-text-sub) !important;
    cursor: default !important;
    border-color: var(--abr-border-lite) !important;
}
.res-abr-readonly:focus { box-shadow: none !important; }

/* Input-Group (Zahl + Addon) */
.res-abr-input-grp {
    display: flex;
    border: 1.5px solid var(--abr-border);
    border-radius: var(--abr-radius-sm);
    overflow: hidden;
    background: var(--abr-surface);
    transition: border-color 0.16s, box-shadow 0.16s;
}
.res-abr-input-grp:focus-within {
    border-color: var(--abr-navy-mid);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(26,61,124,0.11);
}
.res-abr-input-grp input {
    flex: 1 1 auto;
    min-width: 0;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0.52rem 0.8rem;
    font-family: 'Lato', sans-serif;
    font-size: 0.9rem;
    color: var(--abr-text);
    appearance: auto; /* number spinner */
}
.res-abr-input-grp input:focus { outline: none; }
.res-abr-addon {
    display: flex;
    align-items: center;
    padding: 0 0.85rem;
    background: var(--abr-sky);
    color: var(--abr-text-sub);
    font-size: 0.82rem;
    font-weight: 700;
    border-left: 1.5px solid var(--abr-border);
    user-select: none;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

/* Pflichtfeld-Stern */
.res-abr-req { color: var(--abr-red); margin-left: 0.1em; font-weight: 700; }

/* Hint-Text */
.res-abr-hint {
    font-size: 0.75rem;
    color: var(--abr-text-muted);
    line-height: 1.45;
    margin-top: 0.05rem;
}

/* Verschlüsselung-Badge */
.res-abr-enc-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0.03em;
    color: var(--abr-green);
    background: rgba(30,140,69,0.09);
    border: 1px solid rgba(30,140,69,0.22);
    border-radius: 99px;
    padding: 0.15rem 0.55rem;
}
.res-abr-enc-badge svg { width: 10px; height: 10px; }

/* ══ ZUGANGS-SPERRE ═══════════════════════════════════════════════════════════ */
.res-abr-access-denied {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    padding: 4rem 2rem;
    text-align: center;
    color: var(--abr-text-muted);
    background: var(--abr-surface);
    border: 1.5px dashed var(--abr-border);
    border-radius: var(--abr-radius-lg);
    font-family: 'Lato', sans-serif;
}
.res-abr-access-icon { font-size: 2.75rem; line-height: 1; }
.res-abr-access-denied p { margin: 0; font-size: 0.95rem; }

/* ══ RESPONSIVE ═══════════════════════════════════════════════════════════════ */

@media (max-width: 720px) {
    .res-abr-card-header {
        padding: 0.9rem 1.1rem;
        gap: 0.6rem;
    }
    .res-abr-card-body { padding: 1.1rem; }
    .res-abr-foot { padding-top: 1rem; margin-top: 1rem; }

    /* Suchfeld full-width */
    .res-abr-card-header { flex-direction: column; align-items: flex-start; }
    .res-abr-search-box { width: 100%; }
    .res-abr-search-box input[type="search"] { width: 100%; }

    /* Tabelle */
    .res-abr-tbl thead th,
    .res-abr-tbl tbody td { padding: 0.55rem 0.7rem; font-size: 0.82rem; }

    /* Spalten in Benutzer-Tabelle ausblenden */
    .res-abr-user-tbl th:nth-child(6),
    .res-abr-user-tbl td:nth-child(6),
    .res-abr-user-tbl th:nth-child(7),
    .res-abr-user-tbl td:nth-child(7) { display: none; }

    /* Modal als Bottom-Sheet */
    .res-abr-overlay {
        align-items: flex-end;
        padding: 0;
    }
    .res-abr-modal {
        max-width: 100%;
        max-height: 94dvh;
        max-height: 94vh;
        border-radius: var(--abr-radius-lg) var(--abr-radius-lg) 0 0;
    }
    @keyframes resAbrIn {
        from { opacity: 0; transform: translateY(24px); }
        to   { opacity: 1; transform: none; }
    }

    /* Modal-Buttons full-width */
    .res-abr-modal-foot {
        flex-direction: column-reverse;
        align-items: stretch;
    }
    .res-abr-modal-foot .res-abr-btn { width: 100%; justify-content: center; }

    /* Formular-Grid */
    .res-abr-field-row { flex-direction: column; gap: 1rem; }
    .res-abr-field-row .res-abr-field--xs,
    .res-abr-field-row .res-abr-field--grow,
    .res-abr-field-row .res-abr-field--lg { flex: 1 1 auto; }

    /* Footer-Buttons */
    .res-abr-foot { flex-direction: column; align-items: stretch; }
    .res-abr-foot .res-abr-btn { width: 100%; justify-content: center; }
}

@media (max-width: 420px) {
    .res-abr-modal-body { padding: 1.1rem; }
    .res-abr-tbl thead th,
    .res-abr-tbl tbody td { padding: 0.5rem; font-size: 0.8rem; }
}
