/* =====================================================================
   ADMIN — geteilte Bausteine der Kommandozentrale (monochrom)
   Bewusst global (kein scoped CSS), damit alle Admin-Karten/Modals ohne
   Duplizieren dieselbe Optik teilen. Prefix „ac" = admin-card.
   ===================================================================== */

.acard {
    background: #fff;
    border: 1px solid #e4e4e7;
    border-radius: 16px;
    box-shadow: 0 6px 18px -12px rgba(0, 0, 0, .22);
    padding: 16px 16px 15px;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #16181c;
}

.acard-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 13px;
}
.acard-ic {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #efeff1;
    color: #16181c;
    flex: none;
}
.acard-titles { min-width: 0; flex: 1 1 auto; }
.acard-title {
    display: block;
    font-size: 14.5px;
    font-weight: 800;
    letter-spacing: -.01em;
    line-height: 1.2;
}
.acard-sub {
    display: block;
    font-size: 11.5px;
    color: #80858d;
    font-weight: 500;
    margin-top: 1px;
}
.acard-head-act { flex: none; margin-left: auto; }

/* Metriken-Reihe (große Zahl + Label) */
.ac-metrics {
    display: grid;
    gap: 8px;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
}
.ac-metric {
    background: #f7f7f9;
    border-radius: 12px;
    padding: 11px 12px;
    text-align: center;
}
.ac-metric-num {
    display: block;
    font-family: 'Quicksand', 'Plus Jakarta Sans', sans-serif;
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -.01em;
}
.ac-metric-cap {
    display: block;
    font-size: 10.5px;
    color: #80858d;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-top: 5px;
}
.ac-metric--warn .ac-metric-num { color: #a15c00; }
.ac-metric--danger .ac-metric-num { color: #e2483b; }
.ac-metric--ok .ac-metric-num { color: #16a34a; }

/* Zeilenliste (Sitzungen, Sperren, Geräte …) */
.ac-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ac-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 7px 4px;
    border-top: 1px solid #f0f0f2;
}
.ac-row:first-child { border-top: 0; }
.ac-row-text { min-width: 0; flex: 1 1 auto; }
.ac-row-title {
    display: block;
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ac-row-sub {
    display: block;
    font-size: 11.5px;
    color: #80858d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ac-mono { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace; }

.ac-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #80858d;
    flex: none;
}
.ac-dot--online { background: #16a34a; box-shadow: 0 0 0 3px rgba(22, 163, 74, .16); }
.ac-dot--warn { background: #a15c00; }
.ac-dot--danger { background: #e2483b; }

/* Buttons */
.ac-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid #e4e4e7;
    background: #fff;
    color: #16181c;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background .14s ease, transform .1s ease, border-color .14s ease;
}
@media (hover: hover) {
    .ac-btn:hover {
        background: #efeff1;
    }
}
.ac-btn:active { transform: translateY(1px); }
.ac-btn:disabled { opacity: .5; cursor: default; }
.ac-btn--primary { background: #16181c; color: #fff; border-color: #16181c; }
@media (hover: hover) {
    .ac-btn--primary:hover {
        background: #26282e;
    }
}
.ac-btn--danger { color: #e2483b; border-color: #f3d0cc; }
@media (hover: hover) {
    .ac-btn--danger:hover {
        background: #fbeae8;
    }
}
.ac-btn--sm { height: 32px; padding: 0 11px; font-size: 12px; border-radius: 9px; }
.ac-btn--full { width: 100%; }

.ac-iconbtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    border: 1px solid #e4e4e7;
    background: #fff;
    color: #3c4148;
    cursor: pointer;
    transition: background .14s ease, color .14s ease;
}
@media (hover: hover) {
    .ac-iconbtn:hover {
        background: #efeff1;
        color: #16181c;
    }
}
@media (hover: hover) {
    .ac-iconbtn--danger:hover {
        background: #fbeae8;
        color: #e2483b;
    }
}

/* Toggle-Schalter */
.ac-toggle {
    position: relative;
    width: 46px;
    height: 27px;
    border-radius: 999px;
    border: 0;
    background: #d7d8dc;
    cursor: pointer;
    flex: none;
    transition: background .18s ease;
    padding: 0;
}
.ac-toggle::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 21px;
    height: 21px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .28);
    transition: transform .18s ease;
}
.ac-toggle--on { background: #16181c; }
.ac-toggle--on::after { transform: translateX(19px); }
.ac-toggle--warn.ac-toggle--on { background: #a15c00; }

/* Schalter-Reihe */
.ac-switch {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 2px;
    border-top: 1px solid #f0f0f2;
}
.ac-switch:first-of-type { border-top: 0; }
.ac-switch-text { flex: 1 1 auto; min-width: 0; }
.ac-switch-title { display: block; font-size: 13.5px; font-weight: 700; }
.ac-switch-sub { display: block; font-size: 11.5px; color: #80858d; }

/* Custom Checkbox */
.ac-check-row {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 6px 2px;
    cursor: pointer;
}
.ac-check {
    appearance: none;
    -webkit-appearance: none;
    flex: none;
    width: 22px;
    height: 22px;
    border: 1.5px solid #d0d0d4;
    border-radius: 7px;
    background: #fff;
    cursor: pointer;
    position: relative;
    transition: background .14s ease, border-color .14s ease;
}
@media (hover: hover) {
    .ac-check:hover {
        border-color: #16181c;
    }
}
.ac-check:checked {
    background: #16181c;
    border-color: #16181c;
}
.ac-check:checked::after {
    content: "";
    position: absolute;
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2.2px 2.2px 0;
    transform: rotate(45deg);
}
.ac-check:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(22, 24, 28, .16); }

/* Badge / Chip */
.ac-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    background: #efeff1;
    color: #16181c;
    font-size: 11px;
    font-weight: 700;
}
.ac-chip--ok { background: #e7f7ed; color: #16a34a; }
.ac-chip--warn { background: #fdf2e0; color: #a15c00; }
.ac-chip--danger { background: #fbeae8; color: #e2483b; }

/* Leerzustand */
.ac-empty {
    padding: 18px 12px;
    text-align: center;
    color: #80858d;
    font-size: 12.5px;
}

/* Eingaben */
.ac-input, .ac-select, .ac-textarea {
    width: 100%;
    border: 1px solid #e4e4e7;
    border-radius: 11px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 13.5px;
    color: #16181c;
    background: #fff;
    transition: border-color .14s ease, box-shadow .14s ease;
}
.ac-textarea { resize: vertical; min-height: 66px; }
.ac-input:focus, .ac-select:focus, .ac-textarea:focus {
    outline: none;
    border-color: #16181c;
    box-shadow: 0 0 0 3px rgba(22, 24, 28, .12);
}
.ac-input::placeholder, .ac-textarea::placeholder { color: #80858d; }
.ac-field { display: flex; flex-direction: column; gap: 6px; }
.ac-field-label { font-size: 12px; font-weight: 700; color: #3c4148; }

/* Kleiner Undo-Countdown */
.ac-undo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 11px;
    background: #16181c;
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
}
.ac-undo-spacer { flex: 1 1 auto; }
.ac-undo-btn {
    height: 30px;
    padding: 0 12px;
    border-radius: 8px;
    border: 0;
    background: #fff;
    color: #16181c;
    font-family: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

/* ============ Admin-Modal-Chrome (Prefix „am") ======================== */
.am-overlay {
    position: fixed;
    inset: 0;
    z-index: 2100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(0px, 3vw, 28px);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #16181c;
}
.am-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    background: rgba(22, 24, 28, .38);
    backdrop-filter: blur(3px);
    cursor: pointer;
}
.am-card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(920px, 100%);
    max-height: min(88dvh, 900px);
    background: #f5f5f7;
    border: 1px solid #e4e4e7;
    border-radius: 20px;
    box-shadow: 0 24px 50px -20px rgba(0, 0, 0, .26), 0 6px 14px -10px rgba(0, 0, 0, .12);
    overflow: hidden;
    animation: am-pop .18s ease;
}
.am-card--wide { width: min(1080px, 100%); }
.am-card--slim { width: min(560px, 100%); }
@keyframes am-pop {
    from { transform: translateY(8px) scale(.985); opacity: 0; }
    to { transform: none; opacity: 1; }
}
.am-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    background: #fff;
    border-bottom: 1px solid #e4e4e7;
    flex: none;
}
.am-head-ic {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #16181c;
    color: #fff;
    flex: none;
}
.am-head-text { min-width: 0; flex: 1 1 auto; }
.am-head-kicker {
    display: block;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #80858d;
}
.am-head-title {
    margin: 1px 0 0;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -.01em;
}
.am-close {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid #e4e4e7;
    background: #fff;
    color: #3c4148;
    cursor: pointer;
    transition: background .14s ease;
}
@media (hover: hover) {
    .am-close:hover {
        background: #efeff1;
        color: #16181c;
    }
}
.am-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 18px;
}
.am-foot {
    flex: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: #fff;
    border-top: 1px solid #e4e4e7;
}
.am-foot-spacer { flex: 1 1 auto; }

/* Tab-Leiste in Modals */
.am-tabs {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border-radius: 12px;
    background: #efeff1;
}
.am-tab {
    height: 34px;
    padding: 0 14px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #3c4148;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background .14s ease, color .14s ease;
}
@media (hover: hover) {
    .am-tab:hover {
        color: #16181c;
    }
}
.am-tab--on { background: #fff; color: #16181c; box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }

/* Der Kalender-Datetime-Picker (aus dem Kalender wiederverwendet) sitzt in den Nachrichten-Modals
   nahe am unteren Rand — dort nach OBEN aufklappen, sonst verschwindet er hinter der Fußleiste.
   !important, weil das scoped Picker-CSS in der Quellreihenfolge nach dieser Datei geladen wird. */
.am-body .calendar-dtp-popup {
    top: auto !important;
    bottom: calc(100% + 7px) !important;
}

@media (max-width: 560px) {
    /* Vollflächiges Sheet (schiebt von unten hoch): deckt den Header komplett ab, damit Titel und
       „X" nie von den Header-Buttons überlagert werden; Safe-Area (Notch) im Kopf berücksichtigt. */
    .am-overlay { padding: 0; align-items: stretch; }
    .am-card, .am-card--wide, .am-card--slim {
        width: 100%;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
        align-self: stretch;
    }
    .am-head { padding-top: calc(16px + env(safe-area-inset-top, 0px)); }
}
