/* ==========================================================================
   Admin-Bereich – Fanclub Trinkpause Fanshop
   Baut auf den Variablen/Fonts aus css/style.css auf.
   ========================================================================== */

.admin-body { background: var(--off-white); min-height: 100vh; }

/* ---------- Login ---------- */
.admin-login {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 20% 20%, #4a4a4d 0%, var(--anthracite) 45%, #1b1b1c 100%);
}
.login-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 40px 36px;
  width: min(380px, 100%);
  text-align: center;
  box-shadow: var(--shadow-strong);
}
.login-logo { width: 72px; height: 72px; margin: 0 auto 16px; }
.login-card h1 { font-family: var(--font-display); font-size: 1.6rem; margin-bottom: 4px; }
.login-sub { font-size: 0.85rem; margin-bottom: 22px; }
.login-card label {
  display: flex; flex-direction: column; gap: 6px;
  text-align: left; font-size: 0.82rem; font-weight: 600;
  margin-bottom: 16px;
}
.login-card input {
  padding: 11px 12px; border-radius: 8px; border: 1.5px solid var(--grey-line); font-size: 0.95rem;
}
.login-card input:focus { outline: none; border-color: var(--red); }
.login-error {
  background: #fdeaea; color: #b30000; border: 1px solid #f5c2c2;
  border-radius: 8px; padding: 8px 10px; font-size: 0.8rem; margin-bottom: 14px; text-align: left;
}
.back-link { display: inline-block; margin-top: 16px; font-size: 0.8rem; color: var(--text-muted); text-decoration: underline; }
.back-link:hover { color: var(--red); }

/* ---------- Header ---------- */
.admin-header {
  background: var(--anthracite);
  color: var(--white);
  position: sticky; top: 0; z-index: 100;
}
.admin-header-inner {
  max-width: 1300px; margin: 0 auto;
  padding: 14px 24px;
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
}
.admin-header .brand-logo { width: 38px; height: 38px; }
.admin-header .brand-name { color: var(--white); font-size: 1.1rem; }
.admin-header .brand-sub { color: rgba(255,255,255,0.55); }
.admin-tabs { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.tab-btn {
  background: transparent; border: none; color: rgba(255,255,255,0.7);
  padding: 9px 16px; border-radius: 999px; font-weight: 600; font-size: 0.86rem;
  transition: background 200ms, color 200ms;
}
.tab-btn:hover { background: rgba(255,255,255,0.08); color: var(--white); }
.tab-btn.active { background: var(--red); color: var(--white); }
.admin-header-actions { display: flex; gap: 8px; }
.btn-ghost-dark {
  background: rgba(255,255,255,0.1);
  color: var(--white);
  border: 1.5px solid rgba(255,255,255,0.25);
  padding: 9px 18px;
  font-size: 0.82rem;
}
.btn-ghost-dark:hover { background: rgba(255,255,255,0.2); }

/* ---------- Main / Panels ---------- */
.admin-main { max-width: 1300px; margin: 0 auto; padding: 34px 24px 80px; }
.admin-panel { display: none; }
.admin-panel.active { display: block; animation: panel-in 280ms ease; }
@keyframes panel-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.panel-head h2 { font-family: var(--font-heavy); font-size: 1.3rem; margin: 0; }
.panel-hint { margin: 0; font-size: 0.85rem; }

/* ---------- Tabellen ---------- */
.table-wrap {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  overflow-x: auto;
}
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; min-width: 640px; }
.admin-table th {
  text-align: left;
  background: var(--off-white);
  padding: 12px 16px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--grey-line);
}
.admin-table td { padding: 12px 16px; border-bottom: 1px solid var(--grey-line); vertical-align: middle; }
.admin-table tbody tr:hover { background: var(--off-white); }
.admin-table tbody tr:last-child td { border-bottom: none; }
.row-thumb { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; background: var(--off-white); }
.qty-in { color: #1e8e3e; font-weight: 700; }
.qty-out { color: var(--red); font-weight: 700; }
.stock-chip {
  display: inline-block;
  background: var(--off-white);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 0.74rem;
  margin: 1px 2px 1px 0;
  font-weight: 600;
}
.stock-chip.zero { color: var(--red); }
.table-action-btn {
  background: transparent; border: 1.5px solid var(--grey-line);
  border-radius: 8px; padding: 6px 12px; font-size: 0.78rem; font-weight: 600;
  margin-right: 6px; transition: all 160ms;
}
.table-action-btn:hover { border-color: var(--anthracite); }
.table-action-btn.danger:hover { border-color: var(--red); color: var(--red); }

/* ---------- Formulare ---------- */
.movement-form, .settings-form {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 22px 24px;
  display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end;
}
.movement-form label, .settings-form label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 0.8rem; font-weight: 600; color: var(--anthracite);
}
.settings-form { flex-direction: column; align-items: stretch; max-width: 360px; }
.movement-form label.grow { flex: 1; min-width: 200px; }
.movement-form select, .movement-form input, .settings-form input {
  padding: 10px 11px; border-radius: 8px; border: 1.5px solid var(--grey-line); font-size: 0.88rem; font-family: inherit;
}
.movement-form select:focus, .movement-form input:focus, .settings-form input:focus { outline: none; border-color: var(--red); }

.form-message {
  margin-top: 14px; padding: 10px 14px; border-radius: 8px; font-size: 0.85rem;
}
.form-message.success { background: #e6f6ea; color: #1e8e3e; border: 1px solid #b9e6c4; }
.form-message.error { background: #fdeaea; color: #b30000; border: 1px solid #f5c2c2; }

.field-label { font-size: 0.82rem; font-weight: 700; margin: 4px 0 8px; }
.field-hint { font-size: 0.76rem; color: var(--text-muted); margin: 6px 0 0; }
.size-stock-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 6px; }
.size-stock-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 0.76rem; font-weight: 700; }
.size-stock-grid input { padding: 8px; border-radius: 8px; border: 1.5px solid var(--grey-line); width: 100%; }

@media (max-width: 700px) {
  .admin-header-inner { flex-direction: column; align-items: flex-start; }
  .admin-tabs { width: 100%; }
  .size-stock-grid { grid-template-columns: repeat(2, 1fr); }
  .movement-form { flex-direction: column; align-items: stretch; }
}

/* ---------- Stammdaten-Unternavigation ---------- */
.stammdaten-subnav {
  background: var(--off-white);
  border-bottom: 1px solid var(--grey-line);
  padding: 10px 24px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.subnav-pill {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--white);
  border: 1.5px solid var(--grey-line);
  text-decoration: none;
  transition: all 160ms;
}
.subnav-pill:hover { border-color: var(--red); color: var(--red); }
.subnav-pill.active { background: var(--red); border-color: var(--red); color: var(--white); }

/* ---------- Ausklappbares Kopfzeilen-Menü ---------- */
.admin-header-actions { position: relative; margin-left: auto; }
.nav-menu-toggle {
  background: rgba(255,255,255,0.1);
  color: var(--white);
  border: 1.5px solid rgba(255,255,255,0.25);
  padding: 9px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-menu-toggle:hover { background: rgba(255,255,255,0.2); }
.nav-menu-dropdown {
  display: none;
  flex-direction: column;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--white);
  border-radius: 10px;
  box-shadow: var(--shadow-strong);
  min-width: 190px;
  padding: 8px;
  z-index: 200;
}
.nav-menu-dropdown.open { display: flex; }
.nav-menu-dropdown a, .nav-menu-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--anthracite);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-menu-dropdown a:hover, .nav-menu-dropdown button:hover { background: var(--off-white); }
.nav-menu-divider { border: none; border-top: 1px solid var(--grey-line); margin: 6px 2px; }

/* ---------- Formular-Abschnitte (nicht überladenes Layout) ---------- */
.modal-wide { max-width: 640px; width: 100%; }
.form-section {
  border-top: 1px solid var(--grey-line);
  padding-top: 18px;
  margin-top: 18px;
}
.form-section:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }
.form-section-title {
  font-family: var(--font-heavy);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 14px;
}

/* ---------- Bildauswahl-Feld im Formular ---------- */
.image-picker-field { display: flex; flex-direction: column; gap: 8px; }
.image-picker-label { font-size: 0.8rem; font-weight: 600; color: var(--anthracite); }
.image-picker-preview {
  width: 100%;
  height: 88px;
  border-radius: 10px;
  border: 1.5px dashed var(--grey-line);
  background: var(--off-white);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.image-picker-preview img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.image-picker-preview span { font-size: 0.76rem; color: var(--text-muted); }

/* ---------- Bildauswahl-Galerie (Modal) ---------- */
.image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.image-gallery-item {
  border: 1.5px solid var(--grey-line);
  border-radius: 10px;
  padding: 10px;
  background: var(--off-white);
  cursor: pointer;
  transition: border-color 160ms, transform 160ms;
  text-align: center;
}
.image-gallery-item:hover { border-color: var(--red); transform: translateY(-2px); }
.image-gallery-item img { width: 100%; height: 64px; object-fit: contain; margin-bottom: 6px; }
.image-gallery-item span { display: block; font-size: 0.68rem; color: var(--text-muted); word-break: break-word; }
.image-picker-manual { margin-top: 10px; font-size: 0.85rem; }
.image-picker-manual summary { cursor: pointer; color: var(--text-muted); font-size: 0.8rem; }
.image-picker-manual label { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; font-size: 0.8rem; font-weight: 600; }
.image-picker-manual input { padding: 9px 10px; border-radius: 8px; border: 1.5px solid var(--grey-line); font-family: inherit; }

/* ---------- Mengenrabatt-Stufen (Kärtchen-Darstellung) ---------- */
.bulk-tier-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--off-white);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.bulk-tier-badge {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--red);
  color: var(--white);
  font-weight: 700;
  font-size: 0.86rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bulk-tier-fields {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
}
.bulk-tier-fields label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.bulk-tier-fields input {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1.5px solid var(--grey-line);
  font-family: inherit;
  font-size: 0.88rem;
  width: 100px;
}
.bulk-tier-connector {
  font-size: 0.78rem;
  color: var(--text-muted);
  padding-bottom: 9px;
  white-space: nowrap;
}
@media (max-width: 520px) {
  .bulk-tier-row { flex-wrap: wrap; }
  .bulk-tier-fields { width: 100%; }
  .bulk-tier-fields input { width: 100%; }
}

.image-upload-box {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 18px;
  border: 1.5px dashed var(--grey-line);
  border-radius: 10px;
  background: var(--off-white);
  margin-bottom: 8px;
}
.image-upload-box .btn { cursor: pointer; }
.image-gallery-divider {
  text-align: center;
  font-size: 0.76rem;
  color: var(--text-muted);
  margin: 18px 0 12px;
  position: relative;
}
