/* Runde 3 – Team T5: Admin-Cockpit (Kunden, Kundendetail, Gratis-Monate, Promo-Codes).
   Eigene Klassen mit Präfix adm-, damit nichts mit site.css (T6) kollidiert. */

/* inline-size containment: the cockpit never widens the app column (wide table scrolls inside its wrapper) */
.adm { max-width: 1320px; min-width: 0; contain: inline-size; }

.adm-btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; line-height: 1.1; white-space: nowrap; }
.adm-btn--block { width: 100%; white-space: normal; }
.adm-muted { color: var(--white-dim, #a0a0a0); }
.adm-hint { color: var(--white-dim, #a0a0a0); font-size: .85rem; }
.adm-nowrap { white-space: nowrap; }
.adm-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.adm-offscreen { position: fixed; left: -9999px; top: 0; opacity: 0; }
.adm-upper { text-transform: uppercase; }
.adm-upper::placeholder { text-transform: none; }

/* ---- Head ---- */
.adm-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.adm-head__links { display: flex; flex-wrap: wrap; gap: .5rem; }
.adm-title { font-family: var(--font-display, 'Bebas Neue', Impact, sans-serif); font-size: clamp(1.9rem, 4vw, 2.6rem); letter-spacing: .02em; line-height: 1; margin: 0 0 .35rem; overflow-wrap: anywhere; }
.adm-subtitle { color: var(--white-dim, #a0a0a0); margin: 0; }
.adm-back { display: inline-flex; align-items: center; min-height: 44px; color: var(--white-dim, #a0a0a0); text-decoration: none; margin-bottom: .25rem; }
.adm-back:hover, .adm-back:focus-visible { color: var(--accent, #ff6b00); }

/* ---- KPI tiles ---- */
.adm-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin-bottom: .5rem; }
@media (min-width: 576px) { .adm-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .adm-kpis { grid-template-columns: repeat(8, minmax(0, 1fr)); } }
.adm-kpi { display: flex; flex-direction: column; gap: .15rem; padding: .85rem .9rem; min-height: 44px; background: var(--black-light, #111); border: 1px solid var(--gray-dark, #2a2a2a); color: var(--white, #e8e8e8); text-decoration: none; transition: border-color .15s ease; }
.adm-kpi:hover { border-color: var(--gray-light, #666); color: var(--white, #e8e8e8); }
.adm-kpi:focus-visible { outline: 2px solid var(--white, #e8e8e8); outline-offset: 2px; }
.adm-kpi.is-current { border-color: var(--accent, #ff6b00); }
.adm-kpi__value { font-family: var(--font-display, 'Bebas Neue', Impact, sans-serif); font-size: 1.9rem; line-height: 1; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.adm-kpi__label { font-size: .85rem; line-height: 1.25; }
.adm-kpi__sub { font-size: .75rem; color: var(--white-dim, #a0a0a0); line-height: 1.25; }
.adm-kpi--alert .adm-kpi__value { color: #fca5a5; }
.adm-kpi-note { font-size: .85rem; margin: 0 0 1rem; }
.adm-kpi-note a { color: var(--white-dim, #a0a0a0); display: inline-flex; align-items: center; min-height: 44px; }

/* ---- Toolbar / filters ---- */
.adm-toolbar { margin: .75rem 0 .5rem; }
.adm-toolbar__row { display: flex; flex-wrap: wrap; gap: .5rem; }
.adm-search { flex: 1 1 240px; min-height: 44px; font-size: 1rem; }
.adm-toolbar__csv { margin-left: auto; }
.adm-filters { margin-top: .5rem; }
.adm-filters__summary { display: inline-flex; align-items: center; min-height: 44px; cursor: pointer; color: var(--white-dim, #a0a0a0); }
.adm-filters__summary:focus-visible { outline: 2px solid var(--white, #e8e8e8); outline-offset: 2px; }
.adm-filters__grid { display: grid; grid-template-columns: 1fr; gap: .75rem; padding: .75rem 0; }
@media (min-width: 576px) { .adm-filters__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 992px) { .adm-filters__grid { grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end; } }
.adm-filters .form-select, .adm .form-control { min-height: 44px; font-size: 1rem; }
.adm-filters__checks { display: flex; flex-direction: column; gap: .25rem; }
.adm-filters__checks .form-check { min-height: 32px; display: flex; align-items: center; gap: .5rem; }

/* ---- Quick chips ---- */
.adm-quick { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .5rem 0 .25rem; }
.adm-qchip { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; padding: 0 .9rem; border: 1px solid var(--gray, #3a3a3a); border-radius: 999px; color: var(--white, #e8e8e8); text-decoration: none; font-size: .9rem; line-height: 1; }
.adm-qchip:hover { border-color: var(--gray-light, #666); color: var(--white, #e8e8e8); }
.adm-qchip:focus-visible { outline: 2px solid var(--white, #e8e8e8); outline-offset: 2px; }
.adm-qchip.is-active { background: var(--accent, #ff6b00); border-color: var(--accent, #ff6b00); color: #0a0a0a; }
.adm-qchip__count { font-variant-numeric: tabular-nums; padding: .15rem .45rem; border-radius: 999px; background: rgba(255, 255, 255, .08); font-size: .8rem; }
.adm-qchip.is-active .adm-qchip__count { background: rgba(0, 0, 0, .18); }
.adm-reset { display: inline-flex; align-items: center; min-height: 44px; color: var(--white-dim, #a0a0a0); }
.adm-count { color: var(--white-dim, #a0a0a0); font-size: .85rem; margin: .75rem 0 .5rem; }
.adm-empty { padding: 2rem 1rem; border: 1px dashed var(--gray, #3a3a3a); text-align: center; }

/* ---- Chips / badges ---- */
.adm-chip { display: inline-flex; align-items: center; min-height: 24px; padding: .15rem .55rem; border-radius: 999px; font-size: .78rem; line-height: 1.2; white-space: nowrap; border: 1px solid transparent; }
.adm-chip--active { background: rgba(34, 197, 94, .14); color: #86efac; border-color: rgba(34, 197, 94, .35); }
.adm-chip--trial { background: rgba(255, 107, 0, .14); color: #ffb27a; border-color: rgba(255, 107, 0, .4); }
.adm-chip--canceled { background: rgba(245, 158, 11, .12); color: #fcd34d; border-color: rgba(245, 158, 11, .35); }
.adm-chip--pastdue { background: rgba(239, 68, 68, .16); color: #fca5a5; border-color: rgba(239, 68, 68, .45); }
.adm-chip--free, .adm-chip--regopen, .adm-chip--ev { background: rgba(255, 255, 255, .05); color: var(--white-dim, #a0a0a0); border-color: var(--gray, #3a3a3a); }
.adm-badge { display: inline-flex; align-items: center; padding: .1rem .4rem; font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; border-radius: 2px; vertical-align: middle; }
.adm-badge--admin { background: #b91c1c; color: #fff; margin-left: .35rem; }
.adm-plan { font-weight: 700; }
.adm-plan--premium { color: var(--accent-hover, #ff8533); }
.adm-plan--basic { color: var(--cyan, #22d3ee); }
.adm-period { margin-left: .35rem; color: var(--white-dim, #a0a0a0); text-decoration: none; font-size: .8rem; cursor: help; }
.adm-code { color: var(--accent-hover, #ff8533); background: rgba(255, 107, 0, .08); padding: .1rem .35rem; font-size: .85rem; overflow-wrap: anywhere; }
.adm-code--lg { font-size: 1.05rem; }
.adm-gift { display: inline-block; font-size: .85rem; color: #ffb27a; }

/* ---- Table (>= 768 px) ---- */
.adm-table-wrap { display: none; border: 1px solid var(--gray-dark, #2a2a2a); overflow-x: auto; }
.adm-cards { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
@media (min-width: 768px) {
    .adm-table-wrap { display: block; }
    .adm-cards { display: none; }
}
.adm-table { --bs-table-bg: transparent; font-size: .85rem; }
.adm-sub { display: block; color: var(--white-dim, #a0a0a0); font-size: .78rem; white-space: nowrap; }
.adm-table .adm-lastlogin .adm-muted { display: block; font-size: .78rem; white-space: nowrap; }
.adm-table .adm-lastlogin > span:first-child { white-space: nowrap; }
.adm-table thead th, .adm-table th { font-weight: 600; font-size: .78rem; color: var(--white-dim, #a0a0a0); letter-spacing: .02em; text-transform: none; white-space: normal; vertical-align: bottom; line-height: 1.25; border-bottom-color: var(--gray, #3a3a3a); padding: .55rem .4rem; }
.adm-table td { padding: .55rem .4rem; vertical-align: top; border-bottom-color: var(--gray-dark, #2a2a2a); }
.adm-table tbody tr[data-href] { cursor: pointer; }
.adm-table tbody tr[data-href]:hover td { background: rgba(255, 255, 255, .03); }
.adm-table tbody tr:focus-within td { background: rgba(255, 255, 255, .04); }
.adm-table td:first-child { min-width: 10rem; max-width: 17rem; }
.adm-table .adm-mail { word-break: break-word; }
.adm-th-sub { font-weight: 400; }
.adm-table .adm-mail { overflow-wrap: break-word; word-break: normal; }
.adm-name { color: var(--white, #e8e8e8); font-weight: 700; text-decoration: none; }
.adm-name:hover, .adm-name:focus-visible { color: var(--accent, #ff6b00); text-decoration: underline; }
.adm-mail { display: block; color: var(--white-dim, #a0a0a0); font-size: .8rem; overflow-wrap: anywhere; }

/* ---- Cards (< 768 px) ---- */
.adm-card { display: flex; flex-direction: column; gap: .35rem; padding: .9rem 1rem; min-height: 44px; background: var(--black-light, #111); border: 1px solid var(--gray-dark, #2a2a2a); color: var(--white, #e8e8e8); text-decoration: none; }
.adm-card:hover, .adm-card:focus-visible { border-color: var(--gray-light, #666); color: var(--white, #e8e8e8); }
.adm-card:focus-visible { outline: 2px solid var(--white, #e8e8e8); outline-offset: 2px; }
.adm-card__top { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.adm-card__name { font-weight: 700; overflow-wrap: anywhere; }
.adm-card__meta, .adm-card__stats { display: flex; flex-wrap: wrap; gap: .25rem .9rem; font-size: .85rem; }
.adm-card__stats { color: var(--white-dim, #a0a0a0); }
.adm-card__gift { font-size: .85rem; }
.adm-redemptions { list-style: none; padding: 0; display: grid; gap: .5rem; }

.adm-pager { display: flex; align-items: center; justify-content: center; gap: .75rem; margin: 1rem 0; }
.adm-pager__info { color: var(--white-dim, #a0a0a0); font-size: .9rem; }

/* ---- Detail page ---- */
.adm-dhead { display: grid; gap: 1rem; margin-bottom: 1.25rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--gray-dark, #2a2a2a); }
@media (min-width: 992px) { .adm-dhead { grid-template-columns: minmax(0, 1fr) auto; align-items: start; } }
.adm-dhead__mail { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; margin: 0 0 .5rem; }
.adm-dhead__mail a { color: var(--white-dim, #a0a0a0); overflow-wrap: anywhere; }
.adm-dhead__chips { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0 0 .35rem; }
.adm-dhead__since { color: var(--white-dim, #a0a0a0); font-size: .9rem; margin: 0 0 .25rem; }
.adm-next { margin: .5rem 0 0; padding-left: .75rem; border-left: 3px solid var(--accent, #ff6b00); }
.adm-dhead__actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
@media (max-width: 575.98px) {
    .adm-dhead__actions > .btn-primary { flex: 1 1 100%; }
    .adm-dhead__actions > .btn-outline-secondary { flex: 1 1 0; }
}
.adm-more { min-width: 44px; font-size: 1.2rem; }
.adm-copy { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; background: transparent; border: 0; color: var(--white-dim, #a0a0a0); cursor: pointer; }
.adm-copy:hover, .adm-copy:focus-visible { color: var(--accent, #ff6b00); }
.adm-copy:focus-visible { outline: 2px solid var(--white, #e8e8e8); outline-offset: -4px; }
.adm-copy.is-copied { color: var(--success, #22c55e); }

.adm-sections { display: grid; gap: 1rem; }
@media (min-width: 992px) { .adm-sections { grid-template-columns: repeat(2, minmax(0, 1fr)); } .adm-section--wide { grid-column: 1 / -1; } }
.adm-section { padding: 1.1rem 1.15rem; background: var(--black-light, #111); border: 1px solid var(--gray-dark, #2a2a2a); }
.adm-h2 { font-size: 1.05rem; font-weight: 700; letter-spacing: .02em; margin: 0 0 .85rem; }
.adm-h3 { font-size: .95rem; font-weight: 700; margin: 1rem 0 .5rem; }
.adm-dl { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: .45rem 1rem; margin: 0; font-size: .92rem; }
.adm-dl dt { font-weight: 400; color: var(--white-dim, #a0a0a0); }
.adm-dl dd { margin: 0; overflow-wrap: anywhere; }
.adm-dl dd .adm-copy { width: 36px; height: 36px; vertical-align: middle; }
@media (pointer: coarse) { .adm-dl dd .adm-copy { width: 44px; height: 44px; } }
@media (max-width: 420px) { .adm-dl { grid-template-columns: 1fr; gap: .1rem; } .adm-dl dd { margin-bottom: .5rem; } }

.adm-stats { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin: 0 0 .75rem; }
.adm-stats strong { font-variant-numeric: tabular-nums; }
.adm-events, .adm-log, .adm-logins, .adm-checks { list-style: none; padding: 0; margin: 0; }
.adm-event { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) auto; gap: .2rem .75rem; align-items: center; padding: .55rem 0; border-top: 1px solid var(--gray-dark, #2a2a2a); font-size: .9rem; }
.adm-event__date { font-variant-numeric: tabular-nums; color: var(--white-dim, #a0a0a0); }
.adm-event__name { overflow-wrap: anywhere; }
.adm-event__name a { color: var(--white, #e8e8e8); }
.adm-event__mode, .adm-event__guests { color: var(--white-dim, #a0a0a0); font-size: .82rem; }
.adm-event .adm-chip { justify-self: end; }
@media (max-width: 767.98px) {
    .adm-event { grid-template-columns: minmax(0, 1fr) auto; }
    .adm-event__date { grid-column: 1; }
    .adm-event__name { grid-column: 1 / -1; grid-row: 2; }
    .adm-event .adm-chip { grid-column: 2; grid-row: 1; }
    .adm-event__mode { grid-row: 3; }
    .adm-event__guests { grid-row: 3; justify-self: end; }
}
@media (min-width: 768px) { .adm-event { grid-template-columns: 6.5rem minmax(0, 1fr) 11rem 7rem auto; } }

.adm-log__item { display: grid; gap: .1rem; padding: .6rem 0; border-top: 1px solid var(--gray-dark, #2a2a2a); font-size: .9rem; }
.adm-log__what { font-weight: 700; }
.adm-log__effect { color: #ffb27a; }
.adm-log__meta { color: var(--white-dim, #a0a0a0); font-size: .82rem; }
.adm-log__note { font-size: .85rem; font-style: italic; color: var(--white-dim, #a0a0a0); overflow-wrap: anywhere; }

.adm-logins li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: .5rem; padding: .4rem 0; border-top: 1px solid var(--gray-dark, #2a2a2a); font-size: .85rem; }
@media (max-width: 480px) { .adm-logins li { grid-template-columns: 1fr auto; } .adm-logins li > :nth-child(2) { grid-column: 1 / -1; grid-row: 2; color: var(--white-dim, #a0a0a0); } }

.adm-checks li { display: flex; align-items: baseline; gap: .6rem; padding: .35rem 0; color: var(--white-dim, #a0a0a0); }
.adm-checks li.is-on { color: var(--white, #e8e8e8); }
.adm-checks__mark { width: 1rem; text-align: center; }
.adm-checks li.is-on .adm-checks__mark { color: var(--success, #22c55e); }

.adm-danger { border-color: rgba(239, 68, 68, .45); }
.adm-danger .adm-h2 { color: #fca5a5; }
.adm-danger__item { display: grid; gap: .75rem; padding: .85rem 0; border-top: 1px solid var(--gray-dark, #2a2a2a); }
.adm-danger__item:first-of-type { border-top: 0; padding-top: 0; }
@media (min-width: 768px) { .adm-danger__item { grid-template-columns: minmax(0, 1fr) minmax(0, 22rem); align-items: start; } }
.adm-danger .adm-h3 { margin-top: 0; }
.adm-delete { display: grid; gap: .4rem; }

/* ---- Gift panel: side panel (desktop) / bottom sheet (phone) ---- */
.adm-sheet { padding: 0; border: 1px solid var(--gray, #3a3a3a); background: var(--black-lighter, #1a1a1a); color: var(--white, #e8e8e8); width: min(440px, 100vw); max-width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0 0 0 auto; inset: 0 0 0 auto; }
.adm-sheet[open]:not(:modal) { position: fixed; z-index: 1080; box-shadow: var(--shadow-lg, 0 10px 30px rgba(0, 0, 0, .5)); }
.adm-sheet::backdrop { background: rgba(0, 0, 0, .7); }
.adm-sheet__form { display: flex; flex-direction: column; height: 100%; }
.adm-sheet__head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .75rem 1rem .75rem 1.15rem; border-bottom: 1px solid var(--gray-dark, #2a2a2a); }
.adm-sheet__close { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; font-size: 1.6rem; color: var(--white, #e8e8e8); text-decoration: none; }
.adm-sheet__close:focus-visible { outline: 2px solid var(--white, #e8e8e8); outline-offset: -4px; }
.adm-sheet__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 1rem 1.15rem; }
.adm-check { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .15rem .6rem; align-items: start; }
.adm-check .form-check-input { margin: .2rem 0 0; width: 1.25rem; height: 1.25rem; float: none; }
.adm-check .form-check-label { cursor: pointer; }
.adm-check__hint { grid-column: 2; }
.adm-sheet__foot { padding: .85rem 1.15rem calc(.85rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--gray-dark, #2a2a2a); }
body.adm-sheet-open { overflow: hidden; }
@media (max-width: 767.98px) {
    .adm-sheet__form { max-height: 90dvh; }
    .adm-sheet { width: 100vw; height: auto; max-height: 90dvh; inset: auto 0 0 0; margin: auto 0 0 0; border-width: 1px 0 0; border-radius: 12px 12px 0 0; }
    .adm-sheet__head::before { content: ""; position: absolute; left: 50%; top: 6px; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--gray, #3a3a3a); }
    .adm-sheet__head { position: relative; padding-top: 1rem; }
}
@media (prefers-reduced-motion: no-preference) {
    .adm-sheet[open] { animation: adm-slide-in .2s ease-out; }
    @keyframes adm-slide-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
    @media (max-width: 767.98px) { @keyframes adm-slide-in { from { transform: translateY(32px); opacity: 0; } to { transform: none; opacity: 1; } } }
}
.adm-field { margin: 0 0 1rem; border: 0; padding: 0; }
.adm-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--gray, #3a3a3a); }
.adm-seg__opt { display: flex; align-items: center; justify-content: center; min-height: 44px; cursor: pointer; font-weight: 700; color: var(--white-dim, #a0a0a0); }
.adm-seg .btn-check:checked + .adm-seg__opt { background: var(--accent, #ff6b00); color: #0a0a0a; }
.adm-seg .btn-check:focus-visible + .adm-seg__opt { outline: 2px solid var(--white, #e8e8e8); outline-offset: -3px; }
.adm-mchips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .5rem; }
.adm-mchip { min-width: 44px; min-height: 44px; padding: 0 .8rem; border: 1px solid var(--gray, #3a3a3a); border-radius: 999px; background: transparent; color: var(--white, #e8e8e8); font-variant-numeric: tabular-nums; cursor: pointer; }
.adm-mchip:hover { border-color: var(--gray-light, #666); }
.adm-mchip:focus-visible { outline: 2px solid var(--white, #e8e8e8); outline-offset: 2px; }
.adm-mchip.is-active { background: var(--accent, #ff6b00); border-color: var(--accent, #ff6b00); color: #0a0a0a; font-weight: 700; }
.adm-months-input { max-width: 8rem; }
.adm-effect { margin: .5rem 0 0; padding: .75rem .9rem; border-left: 3px solid var(--success, #22c55e); background: rgba(34, 197, 94, .07); }
.adm-effect.is-blocked { border-left-color: var(--error, #ef4444); background: rgba(239, 68, 68, .08); }

/* ---- Promo codes ---- */
.adm-promos { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
@media (min-width: 1100px) { .adm-promos { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.adm-promo { padding: 1rem 1.1rem; background: var(--black-light, #111); border: 1px solid var(--gray-dark, #2a2a2a); display: grid; gap: .6rem; }
.adm-promo.is-inactive { opacity: .7; }
.adm-promo__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }
.adm-promo__desc { margin: 0; color: var(--white-dim, #a0a0a0); }
.adm-promo__facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin: 0; }
.adm-promo__facts dt { font-weight: 400; color: var(--white-dim, #a0a0a0); font-size: .8rem; }
.adm-promo__facts dd { margin: 0; }
.adm-promo__facts a { display: inline-flex; align-items: center; min-height: 44px; color: var(--white, #e8e8e8); text-decoration: underline; }
@media (max-width: 420px) { .adm-promo__facts { grid-template-columns: 1fr 1fr; } }
.adm-promo__link { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .25rem .5rem; align-items: center; }
.adm-promo__linklabel { grid-column: 1 / -1; font-size: .8rem; color: var(--white-dim, #a0a0a0); }
.adm-promo__url { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-promo__actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.adm-form { max-width: 720px; }
.adm-form__actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.adm-logincount::before { content: "· "; }
.adm-table .adm-logincount::before { content: none; }
