/* =========================================================
   OMEGA Admin – gleiche Designsprache wie die Website
   (baut auf style.css auf: Variablen, Buttons, Panels, Formulare)
   ========================================================= */

.admin-shell {
  display: grid; grid-template-columns: 272px minmax(0, 1fr); min-height: 100vh; padding-bottom: 0;
}

/* ---------- Seitenleiste ---------- */
.admin-nav {
  position: sticky; top: 0; align-self: start; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px;
  padding: 22px 16px 18px;
  background: linear-gradient(180deg, rgba(18, 14, 36, .92), rgba(8, 6, 16, .96));
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border-right: 1px solid var(--line);
  scrollbar-width: thin; scrollbar-color: rgba(167, 139, 250, .3) transparent;
}
.admin-nav a.admin-brand, .admin-brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 18px; margin-bottom: 6px; border-radius: 0; border-bottom: 1px solid var(--line); background: none; box-shadow: none; }
.admin-brand-mark {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px;
  background: var(--grad); color: #fff; font-family: var(--font-head); font-weight: 800; font-size: 20px;
  box-shadow: var(--glow);
}
.admin-brand-text { display: grid; line-height: 1.15; }
.admin-brand-text strong {
  font-family: var(--font-head); font-weight: 800; letter-spacing: .22em; font-size: 18px;
  background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.admin-brand-text small { color: var(--muted); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; }

.admin-menu { display: flex; flex-direction: column; gap: 3px; }
.admin-group {
  margin: 18px 10px 6px; color: #7d7698; font-size: 10.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
}
.admin-group:first-child { margin-top: 6px; }
.admin-nav a {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 12px; color: var(--muted); font-size: 14.5px; font-weight: 500;
  transition: color .2s, background .2s;
}
.admin-ico {
  flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px;
  background: rgba(255, 255, 255, .05); font-size: 13px; transition: background .2s;
}
.admin-nav a:hover { color: #fff; background: rgba(255, 255, 255, .05); }
.admin-nav a.is-active {
  color: #fff;
  background: linear-gradient(135deg, rgba(139, 92, 246, .30), rgba(217, 70, 239, .14));
  box-shadow: inset 0 0 0 1px rgba(167, 139, 250, .32);
}
.admin-nav a.is-active .admin-ico { background: var(--grad); box-shadow: 0 6px 18px rgba(168, 85, 247, .4); }
.admin-nav a.admin-brand:hover { background: none; }

.admin-nav-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); display: grid; gap: 3px; }
.admin-site-link { color: #d9d4ec; }
.admin-logout:hover { color: #fecaca; background: rgba(239, 68, 68, .12); }
.admin-logout:hover .admin-ico { background: rgba(239, 68, 68, .2); }

/* ---------- Hauptbereich ---------- */
.admin-main { padding: clamp(22px, 3.2vw, 44px); min-width: 0; max-width: 1180px; width: 100%; }
.admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.admin-head h1 { font-size: clamp(1.8rem, 3.4vw, 2.7rem); margin: 6px 0 0; }
.admin-main h2 { font-size: 1.35rem; margin: 0 0 10px; }
.admin-main > p { color: #cfc9e6; max-width: 760px; }
.admin-main .muted { color: var(--muted); }

/* Karten & Formulare */
.admin-main .panel { padding: clamp(18px, 2.4vw, 28px); border-radius: 22px; }
.admin-main .stack-form.panel { gap: 16px; }
.admin-main .stack-form label { font-size: 12.5px; letter-spacing: .02em; }
.admin-main textarea { min-height: 120px; line-height: 1.6; resize: vertical; }
.admin-main input[type="file"] {
  padding: 12px; border-radius: 14px; border: 1px dashed var(--line-strong); background: rgba(255, 255, 255, .03); color: var(--muted);
}
.admin-main input[type="file"]::file-selector-button {
  margin-right: 12px; padding: 8px 16px; border: 0; border-radius: 999px; cursor: pointer; color: #fff; font-weight: 600; background: var(--grad);
}
.admin-main input[type="checkbox"] { width: 18px; height: 18px; accent-color: #a855f7; }
.admin-main .btn { padding: 11px 22px; font-size: 14px; }
.admin-main form > .btn + .btn, .admin-main form > .btn + a.btn { margin-left: 6px; }

/* Dashboard-Kacheln */
.admin-main .card-grid { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)) !important; margin-bottom: 26px; }
.admin-main .cat-card {
  position: relative; overflow: hidden; padding: 24px 24px 20px; border-radius: 22px; text-align: left;
}
.admin-main .cat-card::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%;
  background: radial-gradient(circle, rgba(168, 85, 247, .28), transparent 70%); pointer-events: none;
}
.admin-main .cat-card h3 {
  margin: 0; font-size: clamp(2.2rem, 4vw, 3.1rem); font-weight: 800; line-height: 1;
  background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.admin-main .cat-card p { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.admin-quick { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 24px; }

/* Tabellen */
.table {
  width: 100%; border-collapse: separate; border-spacing: 0; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
}
.table th {
  text-align: left; padding: 13px 16px; color: var(--muted); font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  background: rgba(255, 255, 255, .03); border-bottom: 1px solid var(--line);
}
.table td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: rgba(255, 255, 255, .025); }
.table img { width: 64px; height: 48px; object-fit: cover; border-radius: 10px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Galerie im Admin: normale Kachelgröße, ohne Lightbox-Effekte */
.admin-main .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); grid-auto-rows: 170px; }
.admin-main .gallery-item::after { display: none; }

/* Meldungen */
.admin-main .flash { margin: 0 0 18px; display: flex; align-items: center; gap: 10px; font-weight: 500; }
.admin-main .flash.ok::before { content: "✓"; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(34, 197, 94, .3); font-size: 12px; }
.admin-main .flash.err::before { content: "!"; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(239, 68, 68, .3); font-size: 12px; font-weight: 700; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { position: relative; width: min(430px, 100%); padding: clamp(26px, 5vw, 40px); border-radius: 28px; box-shadow: var(--shadow), 0 0 90px rgba(139, 92, 246, .18); }
.login-card .admin-brand { border: 0; padding: 0 0 6px; margin: 0; }
.login-card h1 { font-size: 2rem; margin: 6px 0 4px; }
.login-card .login-sub { color: var(--muted); margin: 0 0 6px; }
.login-card .btn { width: 100%; padding: 14px; }
.login-card .text-link { color: var(--muted); }
.login-card .text-link:hover { color: #fff; }

/* ---------- Responsiv ---------- */
@media (max-width: 980px) {
  .admin-shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; align-content: start; }
  .admin-nav {
    position: sticky; top: 0; z-index: 300; height: auto; max-height: none; overflow: visible;
    flex-direction: row; align-items: center; gap: 10px; padding: 10px 12px;
    border-right: 0; border-bottom: 1px solid var(--line);
  }
  .admin-nav a.admin-brand { padding: 0; margin: 0; border: 0; flex: none; }
  .admin-brand-text { display: none; }
  .admin-menu {
    flex: 1; min-width: 0; flex-direction: row; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent);
  }
  .admin-menu::-webkit-scrollbar { display: none; }
  .admin-group { display: none; }
  .admin-nav a { flex: none; white-space: nowrap; padding: 8px 12px; font-size: 13.5px; }
  .admin-ico { width: 24px; height: 24px; font-size: 12px; }
  .admin-nav-foot { margin: 0; padding: 0; border: 0; display: flex; flex: none; }
  .admin-nav-foot a { padding: 8px 10px; }
  .admin-nav-foot .admin-site-link { display: none; }
  .admin-main { padding: 22px 14px 40px; }
}
@media (max-width: 560px) {
  .admin-nav-foot .admin-logout { font-size: 0; gap: 0; }
  .table { display: block; overflow-x: auto; }
}

.admin-main .stack-form h2 { margin: 10px 0 0; padding-top: 22px; border-top: 1px solid var(--line); }
.admin-main .stack-form h2:first-child, .admin-main .stack-form > input[type=hidden] + h2 { margin-top: 0; padding-top: 0; border-top: 0; }


/* =========================================================
   BBCode-Editor (Werkzeugleiste, Vorschau, Hilfe)
   ========================================================= */
.bb-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 4px; margin-bottom: 6px; padding: 8px;
  background: rgba(0, 0, 0, .28); border: 1px solid var(--line); border-radius: 12px;
}
.bb-group { display: inline-flex; flex-wrap: wrap; gap: 4px; padding-right: 8px; margin-right: 4px; border-right: 1px solid var(--line); }
.bb-group:last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.bb-group-last { border-right: 0; margin-right: 0; padding-right: 0; }
.bb-btn {
  min-width: 34px; height: 34px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: 600 13px/1 var(--font); color: #e9e4ff; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 9px;
  transition: background .15s, border-color .15s, color .15s;
}
.bb-btn:hover { background: var(--surface-2); border-color: var(--line-strong); color: #fff; }
.bb-btn:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }
.bb-btn[aria-pressed="true"] { background: rgba(139, 92, 246, .3); border-color: var(--purple); color: #fff; }
.bb-btn[disabled] { opacity: .55; cursor: progress; }
.bb-btn b, .bb-btn i, .bb-btn u, .bb-btn s { font-size: 14px; }
.bb-color { width: 34px; height: 34px; padding: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.bb-size { height: 34px; width: auto; padding: 0 8px; font-size: 13px; border-radius: 9px; }
.bb-status { margin-left: auto; font-size: 12px; color: var(--muted); }
.bb-status.err { color: #fca5a5; }
.bb-preview { margin-top: 8px; padding: 18px 20px; max-height: 520px; overflow: auto; background: rgba(0, 0, 0, .25); border: 1px dashed var(--line-strong); border-radius: 12px; }
.bb-preview[hidden] { display: none; }
.bb-preview-label { margin: 0 0 10px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
textarea.bb-dragover { border-color: var(--purple); box-shadow: 0 0 0 4px rgba(167, 139, 250, .25); }

.bb-help-table { width: 100%; border-collapse: collapse; }
.bb-help-table th, .bb-help-table td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.bb-help-table th { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.bb-help-table code { display: block; white-space: pre-wrap; word-break: break-word; padding: 8px 10px; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); border-radius: 8px; color: #e9e4ff; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.bb-help-table .bb-note { display: block; margin-top: 6px; color: var(--muted); font-size: 12.5px; }
.bb-help-table .bb-result { min-width: 200px; }
.bb-help-table .bb-result > :first-child { margin-top: 0; }
.bb-help-table .bb-result > :last-child { margin-bottom: 0; }
.bb-help-table .bb-result-na { color: var(--muted); font-style: italic; }
.bb-help-group { margin: 28px 0 10px; }
.bb-help-wrap { overflow-x: auto; }
@media (max-width: 760px) { .bb-help-table th:nth-child(2), .bb-help-table td:nth-child(2) { min-width: 180px; } }

/* =========================================================
   Sendeplan (Admin)
   ========================================================= */
.sched-admin-status { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; margin-bottom: 22px; }
.sched-admin-status p { margin: 0; line-height: 1.7; min-width: 0; overflow-wrap: anywhere; }
.sched-admin-status code { font-size: 12.5px; color: #e9e4ff; }
.sched-admin-row { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); }
.sched-admin-row:first-of-type { border-top: 0; }
.sched-admin-thumb { width: 72px; height: 72px; border-radius: 14px; overflow: hidden; display: grid; place-items: center; background: linear-gradient(135deg, #5b3aa8, #2a1659); font-size: 2rem; }
.sched-admin-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sched-admin-fields { display: grid; gap: 12px; min-width: 0; }
.sched-admin-fields label, .sched-admin-two > * { min-width: 0; }
.sched-admin-fields input { max-width: 100%; }
.sched-admin-fields input[type="file"] { width: 100%; }
.sched-admin-fields label small { color: var(--muted); font-weight: 400; }
.sched-admin-two { display: grid; grid-template-columns: minmax(0, 160px) minmax(0, 1fr); gap: 12px; }
.sched-admin-checks { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.sched-admin-checks .check { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; font-size: 13.5px; }
.sched-admin-row:last-of-type { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 640px) {
  .sched-admin-row { grid-template-columns: 56px minmax(0, 1fr); gap: 12px; }
  .sched-admin-thumb { width: 56px; height: 56px; font-size: 1.6rem; border-radius: 12px; }
  .sched-admin-two { grid-template-columns: minmax(0, 1fr); }
}

/* =========================================================
   Geräte-Anpassung Admin (Update 2.6)
   ========================================================= */
.admin-shell { grid-template-columns: 272px minmax(0, 1fr); }
@media (max-width: 980px) {
  .admin-shell { grid-template-columns: minmax(0, 1fr); }
}
.admin-nav { min-width: 0; }
.admin-main, .admin-main > *, .admin-main .panel { min-width: 0; max-width: 100%; }
.table td, .table th { overflow-wrap: anywhere; }
.table td.row-actions, .table th.row-actions { overflow-wrap: normal; }
@media (max-width: 1100px) {
  .admin-main .table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
.admin-main small, .admin-main .kicker { font-size: max(12px, .8em); }
.admin-group { font-size: 11.5px; }
@media (pointer: coarse), (max-width: 980px) {
  .admin-main .btn, .admin-nav a { min-height: 44px; display: inline-flex; align-items: center; }
  .admin-nav a.admin-brand { min-height: 0; }
  .admin-main input[type="checkbox"] { width: 22px; height: 22px; }
}
@media (pointer: coarse) {
  .admin-main input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), .admin-main select, .admin-main textarea { font-size: 16px; }
}
.admin-nav > *, .admin-menu > * { flex-shrink: 0; }

.sched-admin-tries { flex-basis: 100%; }
.sched-admin-tries summary { cursor: pointer; color: var(--muted); }
.sched-admin-tries ul { margin: 8px 0 0; padding-left: 18px; }
.sched-admin-tries li { margin: 4px 0; overflow-wrap: anywhere; }
