:root {
    color-scheme: dark;
    --bg: #070d14;
    --panel: #0e1721;
    --panel-2: #141f2b;
    --panel-3: #192737;
    --border: #28394a;
    --text: #edf4fa;
    --muted: #92a4b5;
    --accent: #ff397c;
    --accent-2: #62a8ff;
    --success: #55d79a;
    --warning: #f3bf5b;
    --danger: #ff6b75;
    --shadow: 0 22px 55px rgba(0, 0, 0, .3);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { min-height: 100vh; background-image: radial-gradient(circle at 80% -10%, rgba(98,168,255,.12), transparent 32%), radial-gradient(circle at 0 100%, rgba(255,57,124,.08), transparent 28%); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 260px minmax(0, 1fr); }
.admin-sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 1.25rem; border-right: 1px solid var(--border); background: rgba(9, 16, 24, .96); backdrop-filter: blur(18px); }
.admin-brand { display: flex; align-items: center; gap: .8rem; padding: .25rem .25rem 1.3rem; border-bottom: 1px solid var(--border); }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: linear-gradient(135deg, var(--accent), #a346ff); font-weight: 900; box-shadow: 0 10px 30px rgba(255,57,124,.23); }
.admin-brand strong, .admin-brand small { display: block; }
.admin-brand small { margin-top: .2rem; color: var(--muted); font-size: .72rem; }
.admin-nav { display: grid; gap: .35rem; margin-top: 1.25rem; }
.admin-nav button { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: .7rem; width: 100%; padding: .8rem .9rem; border: 1px solid transparent; border-radius: 11px; color: var(--muted); background: transparent; text-align: left; font-weight: 750; }
.admin-nav button:hover { color: var(--text); background: rgba(255,255,255,.035); }
.admin-nav button.active { color: var(--text); border-color: #33485d; background: linear-gradient(90deg, rgba(98,168,255,.14), rgba(255,57,124,.06)); }
.admin-nav em { min-width: 24px; padding: .15rem .4rem; border-radius: 99px; background: rgba(255,57,124,.18); color: #ff91ba; font-size: .7rem; font-style: normal; text-align: center; }
.sidebar-footer { margin-top: auto; display: grid; gap: .25rem; padding: 1rem; border: 1px solid var(--border); border-radius: 13px; background: var(--panel); }
.sidebar-footer span { color: var(--muted); font-size: .72rem; }
.sidebar-footer a { margin-top: .55rem; color: #a9ceff; font-size: .8rem; font-weight: 750; }

.admin-main { min-width: 0; padding: 0 1.5rem 2rem; }
.admin-topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 90px; margin-bottom: 1.3rem; padding: 1rem 0; background: linear-gradient(var(--bg) 72%, transparent); }
.admin-topbar h1 { margin: .1rem 0 0; font-size: clamp(1.5rem, 3vw, 2.1rem); }
.eyebrow { margin: 0; color: var(--accent-2); font-size: .7rem; font-weight: 900; letter-spacing: .11em; }
.topbar-actions { display: flex; align-items: center; gap: .65rem; color: var(--muted); font-size: .78rem; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); color: var(--text); font-size: 1.1rem; }
.icon-button:hover { border-color: #48647f; background: var(--panel-2); }
.admin-view { display: none; }
.admin-view.active { display: block; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.stat-card { position: relative; overflow: hidden; min-height: 142px; padding: 1.1rem; border: 1px solid var(--border); border-radius: 16px; background: linear-gradient(150deg, rgba(255,255,255,.035), transparent), var(--panel); box-shadow: 0 16px 38px rgba(0,0,0,.15); }
.stat-card::after { content: ''; position: absolute; right: -35px; bottom: -55px; width: 120px; height: 120px; border-radius: 50%; background: rgba(98,168,255,.09); }
.stat-card span { color: var(--muted); font-size: .8rem; }
.stat-card strong { display: block; margin-top: .55rem; font-size: 2rem; }
.stat-card small { display: block; margin-top: .4rem; color: #b8c7d4; }
.stat-card.warning strong { color: var(--warning); }
.stat-card.success strong { color: var(--success); }
.stat-card.danger strong { color: var(--danger); }

.content-grid { display: grid; gap: 1rem; }
.content-grid.two-columns { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.admin-card { border: 1px solid var(--border); border-radius: 17px; background: rgba(14, 23, 33, .93); box-shadow: var(--shadow); overflow: hidden; }
.admin-card > header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1.1rem 1.2rem; border-bottom: 1px solid var(--border); }
.admin-card h2 { margin: .2rem 0 0; font-size: 1.1rem; }
.muted { color: var(--muted); font-size: .82rem; }
.card-toolbar { align-items: center !important; }
.toolbar-actions { display: flex; align-items: center; gap: .55rem; }
input, select, textarea { width: 100%; border: 1px solid #34495d; border-radius: 10px; background: #0a121b; color: var(--text); padding: .72rem .8rem; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(98,168,255,.12); }
textarea { min-height: 120px; resize: vertical; font-family: inherit; line-height: 1.45; }
textarea.code-field { min-height: 220px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .78rem; }
.primary-button, .secondary-button, .danger-button, .success-button { border: 1px solid transparent; border-radius: 10px; padding: .72rem .9rem; color: white; font-weight: 800; white-space: nowrap; }
.primary-button { background: linear-gradient(135deg, var(--accent), #bd3dff); }
.secondary-button { border-color: #3a5065; background: var(--panel-2); }
.danger-button { background: #8c2934; }
.success-button { background: #18784c; }
button:disabled { opacity: .55; cursor: wait; }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 880px; }
th, td { padding: .85rem 1rem; border-bottom: 1px solid #213140; text-align: left; vertical-align: middle; }
th { position: sticky; top: 0; z-index: 2; background: #101a25; color: #9eb1c2; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; }
td { font-size: .82rem; }
tbody tr:hover { background: rgba(255,255,255,.025); }
.cell-main strong, .cell-main small { display: block; }
.cell-main small { margin-top: .2rem; color: var(--muted); }
.status-pill { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .55rem; border-radius: 99px; background: #243344; color: #cbd8e3; font-size: .7rem; font-weight: 800; }
.status-pill.online, .status-pill.active { background: rgba(85,215,154,.14); color: #7ceaae; }
.status-pill.banned, .status-pill.inactive { background: rgba(255,107,117,.15); color: #ff9ca4; }
.status-pill.pending { background: rgba(243,191,91,.15); color: #ffd57f; }
.table-action { border: 1px solid #3b5268; border-radius: 8px; background: var(--panel-2); color: var(--text); padding: .45rem .65rem; font-weight: 750; }

.summary-list { display: grid; gap: .15rem; padding: .8rem 1.2rem 1.1rem; }
.summary-row { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid #20303e; }
.summary-row:last-child { border-bottom: 0; }
.summary-row span { color: var(--muted); }
.timeline { display: grid; gap: .75rem; padding: 1rem 1.2rem 1.2rem; }
.timeline-item { display: grid; grid-template-columns: 9px 1fr; gap: .7rem; }
.timeline-item i { width: 9px; height: 9px; margin-top: .3rem; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 0 5px rgba(98,168,255,.08); }
.timeline-item strong, .timeline-item small { display: block; }
.timeline-item small { margin-top: .2rem; color: var(--muted); line-height: 1.4; }

.moderation-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 1rem; padding: 1.1rem; }
.moderation-card { overflow: hidden; border: 1px solid var(--border); border-radius: 14px; background: var(--panel-2); }
.moderation-preview { height: 190px; display: grid; place-items: center; background: linear-gradient(135deg, #dbe4eb, #a9b8c5); }
.moderation-preview img { width: 100%; height: 100%; object-fit: contain; }
.moderation-body { padding: 1rem; }
.moderation-body h3 { margin: .45rem 0; }
.moderation-meta { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: .8rem 0; }
.moderation-meta div { padding: .6rem; border-radius: 9px; background: #101923; }
.moderation-meta span, .moderation-meta strong { display: block; }
.moderation-meta span { color: var(--muted); font-size: .67rem; }
.moderation-meta strong { margin-top: .2rem; font-size: .78rem; }
.moderation-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; }
.moderation-actions textarea { grid-column: 1 / -1; min-height: 75px; }
.empty-state { margin: 1rem; padding: 1.4rem; border: 1px dashed #395066; border-radius: 13px; color: var(--muted); text-align: center; }

#admin-dialog { width: min(860px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); padding: 0; border: 1px solid #3a4e61; border-radius: 18px; background: var(--panel); color: var(--text); box-shadow: 0 35px 100px rgba(0,0,0,.55); }
#admin-dialog::backdrop { background: rgba(1,5,9,.72); backdrop-filter: blur(4px); }
.dialog-card > header { position: sticky; top: 0; z-index: 3; display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.2rem; border-bottom: 1px solid var(--border); background: var(--panel); }
.dialog-card h2 { margin: .15rem 0 0; }
#dialog-content { max-height: calc(100vh - 110px); overflow-y: auto; padding: 1.2rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.form-grid label { display: grid; gap: .4rem; color: #c4d0da; font-size: .78rem; font-weight: 700; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .6rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.moderation-zone { display: grid; gap: .75rem; margin-top: 1rem; padding: 1rem; border: 1px solid #4b3540; border-radius: 13px; background: rgba(255,57,124,.045); }
.moderation-zone h3 { margin: 0; }
.inline-grid { display: grid; grid-template-columns: 1fr 210px; gap: .65rem; }

.toast-container { position: fixed; right: 1rem; bottom: 1rem; z-index: 100; display: grid; gap: .55rem; }
.toast { min-width: 280px; max-width: 440px; padding: .85rem 1rem; border: 1px solid #40576b; border-radius: 11px; background: #14202c; box-shadow: var(--shadow); }
.toast.success { border-color: rgba(85,215,154,.45); }
.toast.error { border-color: rgba(255,107,117,.5); }
.is-loading { opacity: .62; pointer-events: none; }

@media (max-width: 1100px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .content-grid.two-columns { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
    .admin-shell { grid-template-columns: 1fr; }
    .admin-sidebar { position: static; width: 100%; height: auto; padding: .8rem; }
    .admin-brand { padding-bottom: .8rem; }
    .admin-nav { display: flex; overflow-x: auto; margin-top: .8rem; }
    .admin-nav button { min-width: max-content; grid-template-columns: auto auto auto; }
    .sidebar-footer { display: none; }
    .admin-main { padding: 0 .8rem 1rem; }
    .admin-topbar { min-height: 75px; }
    .card-toolbar, .toolbar-actions { align-items: stretch !important; flex-direction: column; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .form-grid, .inline-grid { grid-template-columns: 1fr; }
    .form-grid .span-2 { grid-column: auto; }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .moderation-grid { grid-template-columns: 1fr; padding: .7rem; }
    .topbar-actions span { display: none; }
}

/* 1.1.38: Spielerobjekte und Fallakten */
.stats-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.load-more-row { display: flex; justify-content: center; padding: 1rem; border-top: 1px solid var(--border); }
.dialog-tabs { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1rem; padding-bottom: .85rem; border-bottom: 1px solid var(--border); }
.dialog-tabs button { border: 1px solid #3b5268; border-radius: 9px; background: #101923; color: var(--muted); padding: .58rem .75rem; font-weight: 800; }
.dialog-tabs button.active { border-color: var(--accent-2); background: rgba(98,168,255,.13); color: #dcecff; }
.switch-line { display: flex !important; grid-template-columns: auto 1fr; align-items: center; gap: .7rem !important; padding: .8rem; border: 1px solid #34495d; border-radius: 10px; background: #0a121b; }
.switch-line input { width: 20px; height: 20px; margin: 0; }
.safety-note { margin-top: 1rem; padding: .85rem; border: 1px solid rgba(243,191,91,.32); border-radius: 11px; background: rgba(243,191,91,.06); color: #e6d5ad; font-size: .78rem; line-height: 1.5; }
.case-overview-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .65rem; }
.case-overview-grid > div { min-width: 0; padding: .75rem; border: 1px solid var(--border); border-radius: 11px; background: #101923; }
.case-overview-grid span, .case-overview-grid strong { display: block; }
.case-overview-grid span { color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; }
.case-overview-grid strong { margin-top: .3rem; font-size: .84rem; overflow-wrap: anywhere; }
.detail-section { margin-top: 1.15rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.detail-section h3 { margin: 0 0 .75rem; font-size: .95rem; }
.detail-section > p { color: #d2dbe3; line-height: 1.6; white-space: pre-wrap; }
.detail-list { display: grid; gap: .65rem; }
.detail-card { padding: .85rem; border: 1px solid var(--border); border-radius: 11px; background: #101923; }
.detail-card header { display: flex; justify-content: space-between; gap: .75rem; align-items: flex-start; }
.detail-card header span, .detail-card small { color: var(--muted); font-size: .72rem; }
.detail-card p { margin: .55rem 0; color: #d5dee6; line-height: 1.55; white-space: pre-wrap; }
.detail-card pre, .json-panel { max-height: 320px; overflow: auto; margin: .65rem 0 0; padding: .75rem; border: 1px solid #293d50; border-radius: 9px; background: #081019; color: #c8dded; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .72rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.compact-table { min-width: 720px; }
.compact-table th, .compact-table td { padding: .65rem .75rem; }
.empty-state.compact { margin: 0; padding: .8rem; }
.case-timeline { padding: .2rem 0; }
.case-timeline .timeline-item p { margin: .25rem 0; color: #d0d9e1; line-height: 1.5; white-space: pre-wrap; }

@media (max-width: 980px) {
    .case-overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
    .case-overview-grid { grid-template-columns: 1fr; }
}

/* 1.3.5: Administrative Verbandsverwaltung */
.table-note { display: block; max-width: 300px; margin-top: .35rem; color: var(--muted); line-height: 1.35; white-space: normal; }
.alliance-sanction-zone { border-color: rgba(255,107,117,.48); background: rgba(255,107,117,.055); }
.danger-note { border-color: rgba(255,107,117,.5); background: rgba(255,107,117,.08); color: #ffd1d5; }
.compact-timeline { padding: .25rem 0; }

/* 1.3.6: befristete administrative Verbandssanktionen */
.alliance-sanction-card { display: grid; gap: .65rem; padding: .8rem; border: 1px solid rgba(255,107,117,.28); border-radius: 11px; background: rgba(8,16,25,.48); }
.alliance-sanction-card.inactive { border-color: #34495d; opacity: .72; }
.sanction-duration-grid { display: grid; grid-template-columns: minmax(230px, 1fr) minmax(145px, auto); gap: .65rem; align-items: end; }
.compact-switch { min-height: 43px; padding: .65rem .75rem; }
.sanction-status-text { color: #ffc0c6; font-weight: 800; }
.alliance-sanction-card.inactive .sanction-status-text { color: var(--muted); }
@media (max-width: 620px) {
    .sanction-duration-grid { grid-template-columns: 1fr; }
}

.admin-progress{width:150px;max-width:100%;height:.55rem;border-radius:999px;background:rgba(255,255,255,.08);overflow:hidden;margin-bottom:.35rem}.admin-progress>span{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#4d9cff,#74d6a7)}

/* 1.4.6: Professionelles Ticket-System und mobile Adminoptimierung */
.ticket-admin-stats { margin-bottom: 1rem; }
.ticket-admin-toolbar { gap: 1rem; }
.ticket-filter-form { display: grid; grid-template-columns: minmax(210px, 1fr) minmax(170px, auto) minmax(150px, auto) auto; width: min(100%, 850px); }
.ticket-admin-list { display: grid; gap: .75rem; padding: 1rem; }
.admin-ticket-card { display: grid; grid-template-columns: minmax(0, 1.45fr) auto minmax(245px, .8fr) auto; align-items: center; gap: 1rem; padding: .9rem 1rem; border: 1px solid var(--border); border-radius: 13px; background: var(--panel-2); }
.admin-ticket-card.unread { border-color: rgba(243,191,91,.48); box-shadow: inset 3px 0 0 #f3bf5b; }
.admin-ticket-main { min-width: 0; }
.admin-ticket-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: .6rem; }
.admin-ticket-heading > div { min-width: 0; }
.admin-ticket-heading h3 { margin: .18rem 0 .3rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .92rem; }
.admin-ticket-heading i { flex: 0 0 auto; width: 9px; height: 9px; margin-top: .35rem; border-radius: 50%; background: #f3bf5b; box-shadow: 0 0 0 5px rgba(243,191,91,.1); }
.admin-ticket-number { color: var(--accent-2); font-size: .68rem; font-weight: 850; letter-spacing: .055em; }
.admin-ticket-main > p { margin: 0; color: var(--muted); font-size: .72rem; }
.admin-ticket-player { display: flex; align-items: baseline; gap: .45rem; margin-top: .55rem; min-width: 0; }
.admin-ticket-player strong { font-size: .77rem; }
.admin-ticket-player span { overflow: hidden; color: var(--muted); font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.admin-ticket-statuses { display: flex; flex-direction: column; align-items: flex-start; gap: .4rem; }
.ticket-status, .ticket-priority { display: inline-flex; align-items: center; width: max-content; max-width: 100%; padding: .31rem .56rem; border-radius: 99px; font-size: .67rem; font-weight: 850; white-space: nowrap; }
.ticket-status.open { background: rgba(98,168,255,.13); color: #a9d0ff; }
.ticket-status.in_progress { background: rgba(243,191,91,.15); color: #ffd681; }
.ticket-status.closed { background: rgba(141,154,167,.14); color: #c6d0d9; }
.ticket-priority.low { background: rgba(141,154,167,.13); color: #c4ced7; }
.ticket-priority.normal { background: rgba(98,168,255,.12); color: #b5d6ff; }
.ticket-priority.high, .ticket-priority.urgent { background: rgba(255,107,117,.14); color: #ffafb6; }
.admin-ticket-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.admin-ticket-meta span, .admin-ticket-meta strong { display: block; min-width: 0; }
.admin-ticket-meta span { color: var(--muted); font-size: .64rem; }
.admin-ticket-meta strong { margin-top: .23rem; overflow: hidden; color: var(--text); font-size: .74rem; text-overflow: ellipsis; white-space: nowrap; }
.admin-ticket-dialog { display: grid; gap: .9rem; }
.admin-ticket-overview { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding-bottom: .9rem; border-bottom: 1px solid var(--border); }
.admin-ticket-overview-main { min-width: 0; }
.admin-ticket-overview-main > span { color: var(--accent-2); font-size: .7rem; font-weight: 850; letter-spacing: .055em; }
.admin-ticket-overview-main h3 { margin: .22rem 0 .28rem; overflow-wrap: anywhere; }
.admin-ticket-overview-main p { margin: 0; color: var(--muted); font-size: .74rem; }
.admin-ticket-dialog-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .45rem; }
.admin-ticket-key-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; }
.admin-ticket-key-grid > div { min-width: 0; padding: .75rem; border: 1px solid var(--border); border-radius: 11px; background: #101923; }
.admin-ticket-key-grid span, .admin-ticket-key-grid strong, .admin-ticket-key-grid small { display: block; min-width: 0; overflow-wrap: anywhere; }
.admin-ticket-key-grid span { color: var(--muted); font-size: .65rem; text-transform: uppercase; letter-spacing: .045em; }
.admin-ticket-key-grid strong { margin-top: .3rem; font-size: .8rem; }
.admin-ticket-key-grid small { margin-top: .22rem; color: var(--muted); font-size: .68rem; }
.admin-ticket-meta-form { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto; align-items: end; gap: .65rem; padding: .75rem; border: 1px solid var(--border); border-radius: 11px; background: rgba(255,255,255,.018); }
.admin-ticket-meta-form label { display: grid; gap: .35rem; color: var(--muted); font-size: .7rem; font-weight: 750; }
.admin-ticket-locked { align-self: center; color: var(--muted); font-size: .72rem; font-weight: 800; }
.admin-ticket-thread { display: grid; align-content: start; gap: .7rem; min-height: 240px; max-height: 430px; overflow-y: auto; padding: .9rem; border: 1px solid var(--border); border-radius: 12px; background: #081019; }
.admin-ticket-message { width: min(88%, 650px); padding: .75rem .85rem; border: 1px solid var(--border); border-radius: 12px; background: #101923; }
.admin-ticket-message.player { justify-self: start; border-color: rgba(98,168,255,.28); background: rgba(98,168,255,.07); }
.admin-ticket-message.admin { justify-self: end; border-color: rgba(85,215,154,.3); background: rgba(85,215,154,.065); }
.admin-ticket-message.system { width: min(94%, 700px); justify-self: center; padding: .55rem .75rem; border-style: dashed; color: var(--muted); text-align: center; }
.admin-ticket-message header { display: flex; justify-content: space-between; gap: .75rem; margin-bottom: .45rem; }
.admin-ticket-message header strong { font-size: .72rem; }
.admin-ticket-message header time { color: var(--muted); font-size: .64rem; }
.admin-ticket-message p { margin: 0; line-height: 1.55; overflow-wrap: anywhere; }
.admin-ticket-reply-form { display: grid; gap: .65rem; padding-top: .85rem; border-top: 1px solid var(--border); }
.admin-ticket-reply-form label { display: grid; gap: .38rem; color: var(--muted); font-size: .72rem; font-weight: 750; }
.admin-ticket-reply-form > div { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.admin-ticket-reply-form small { color: var(--muted); }
.admin-ticket-closed { display: flex; justify-content: space-between; gap: 1rem; padding: .8rem .9rem; border: 1px solid rgba(98,168,255,.22); border-radius: 11px; background: rgba(98,168,255,.055); }
.admin-ticket-closed span { color: var(--muted); font-size: .72rem; }

@media (max-width: 1180px) {
    .admin-ticket-card { grid-template-columns: minmax(0, 1fr) auto; }
    .admin-ticket-meta { grid-column: 1 / -1; }
    .admin-ticket-card > .table-action { justify-self: end; }
    .ticket-filter-form { grid-template-columns: 1fr 1fr; width: 100%; }
}

@media (max-width: 780px) {
    .admin-sidebar { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--border); box-shadow: 0 8px 24px rgba(0,0,0,.24); }
    .admin-nav { padding-bottom: .2rem; scroll-snap-type: x proximity; scrollbar-width: thin; }
    .admin-nav button { scroll-snap-align: start; min-height: 44px; }
    .admin-topbar { position: sticky; top: 118px; z-index: 15; padding: .65rem 0; background: rgba(9,16,24,.94); backdrop-filter: blur(10px); }
    .ticket-admin-list { padding: .7rem; }
    .admin-ticket-card { grid-template-columns: 1fr; align-items: stretch; gap: .75rem; }
    .admin-ticket-statuses { flex-direction: row; flex-wrap: wrap; }
    .admin-ticket-meta { grid-column: auto; }
    .admin-ticket-card > .table-action { width: 100%; justify-self: stretch; }
    .ticket-filter-form { grid-template-columns: 1fr; }
    .admin-ticket-key-grid, .admin-ticket-meta-form { grid-template-columns: 1fr; }
    .admin-ticket-meta-form button { width: 100%; }
    .admin-ticket-thread { max-height: 360px; }
}

@media (max-width: 520px) {
    .admin-main { padding-inline: .55rem; }
    .admin-topbar { top: 112px; }
    .ticket-admin-stats { grid-template-columns: 1fr 1fr; }
    .admin-ticket-overview { flex-direction: column; }
    .admin-ticket-dialog-badges { justify-content: flex-start; }
    .admin-ticket-meta { grid-template-columns: 1fr; }
    .admin-ticket-message { width: 94%; }
    .admin-ticket-reply-form > div, .admin-ticket-closed { align-items: stretch; flex-direction: column; }
    .admin-ticket-reply-form button { width: 100%; }
    #admin-dialog { width: calc(100vw - .7rem); max-height: calc(100vh - .7rem); border-radius: 14px; }
    #dialog-content { padding: .85rem; }
}

/* Version 1.5.0: getrennte Mitarbeiteranmeldung, Rollen und mobile Administration */
.admin-login-page { display: grid; place-items: center; padding: 1.25rem; }
.admin-login-shell { width: min(980px, 100%); display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr); gap: 1.25rem; align-items: stretch; }
.admin-login-brand, .admin-login-card { border: 1px solid var(--border); border-radius: 20px; background: rgba(14, 23, 33, .95); }
.admin-login-brand { display: flex; gap: 1rem; align-items: flex-start; padding: clamp(1.4rem, 4vw, 2.4rem); }
.admin-login-brand .brand-mark { flex: 0 0 52px; width: 52px; height: 52px; }
.admin-login-brand h1 { margin: .35rem 0 .7rem; font-size: clamp(1.7rem, 4vw, 2.8rem); }
.admin-login-brand p:last-child { margin: 0; color: var(--muted); line-height: 1.7; }
.admin-login-card { padding: clamp(1.2rem, 3vw, 1.7rem); }
.admin-login-card h2 { margin: .25rem 0 .35rem; }
.admin-login-form { display: grid; gap: .85rem; margin-top: 1.15rem; }
.admin-login-form label { display: grid; gap: .4rem; color: #c4d0da; font-size: .82rem; font-weight: 750; }
.admin-login-form .primary-button { min-height: 46px; margin-top: .25rem; }
.admin-login-message { margin-top: .9rem; padding: .75rem .85rem; border: 1px solid rgba(98,168,255,.35); border-radius: 10px; background: rgba(98,168,255,.08); line-height: 1.45; }
.admin-login-message.is-error { border-color: rgba(255,107,117,.48); background: rgba(255,107,117,.09); color: #ffd1d5; }
.admin-login-back { display: inline-block; margin-top: 1rem; color: #a9ceff; font-weight: 750; }
.staff-role-badge { display: inline-flex; width: max-content; margin-top: .25rem; padding: .25rem .5rem; border-radius: 99px; background: rgba(98,168,255,.13); color: #b9d9ff !important; font-size: .68rem !important; font-weight: 850; }
.admin-logout-form { margin-top: .45rem; }
.admin-logout-form button { width: 100%; padding: .58rem .65rem; border: 1px solid #3a5065; border-radius: 9px; background: transparent; color: var(--text); font-weight: 750; }
.danger-text { color: #ff9ca4 !important; }
#station-closure-reason-row { opacity: .72; }
#station-closure-reason-row.is-required { opacity: 1; }

@media (max-width: 780px) {
    .admin-login-page { align-items: start; padding: .7rem; }
    .admin-login-shell { grid-template-columns: 1fr; gap: .7rem; }
    .admin-login-brand { padding: 1rem; }
    .admin-login-card { padding: 1rem; }
    .admin-shell { display: block; }
    .admin-sidebar { position: sticky; top: 0; z-index: 30; max-height: none; }
    .admin-brand { min-width: 0; }
    .admin-brand > div { min-width: 0; }
    .admin-brand strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .admin-nav { gap: .4rem; margin-right: -.8rem; padding-right: .8rem; }
    .admin-nav button { flex: 0 0 auto; min-height: 46px; padding: .7rem .8rem; }
    .admin-main { overflow: hidden; }
    .admin-card { border-radius: 13px; }
    .admin-card > header { flex-direction: column; align-items: stretch; }
    .toolbar-actions > * { width: 100%; }
    .table-wrap { margin: 0; overscroll-behavior-x: contain; }
    th, td { padding: .72rem .75rem; }
    .form-actions { align-items: stretch; flex-direction: column-reverse; }
    .form-actions button { width: 100%; min-height: 44px; }
    .moderation-actions { grid-template-columns: 1fr; }
    .moderation-actions textarea { grid-column: auto; }
}

@media (max-width: 480px) {
    .admin-login-brand .brand-mark { width: 44px; height: 44px; flex-basis: 44px; }
    .admin-login-brand h1 { font-size: 1.55rem; }
    .admin-topbar { gap: .5rem; }
    .admin-topbar h1 { font-size: 1.35rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: .55rem; }
    .stat-card { min-height: 112px; padding: .85rem; }
    .stat-card strong { font-size: 1.55rem; }
    .summary-row { align-items: flex-start; flex-direction: column; gap: .25rem; }
    .moderation-grid { padding: .55rem; }
}
