/* =========================================================================
   URKUNDENHELD.DE — Admin CSS
   ========================================================================= */
:root {
  --hero-red:      #E63946;
  --hero-red-dk:   #C1121F;
  --pow-yellow:    #FFD60A;
  --deep-blue:     #1D3557;
  --ink:           #0A0A0A;
  --ink-soft:      #2A2A2A;
  --cream:         #FAF3E0;
  --paper:         #FFF8E7;
  --sidebar-bg:    #141414;
  --sidebar-fg:    #E8E8E8;
  --sidebar-fg-dim:#8A8A8A;
  --surface:       #FFFFFF;
  --surface-dim:   #F5F2E8;
  --border:        #E0DCCC;
  --text:          #0A0A0A;
  --text-dim:      #4A4A4A;
  --text-faint:    #8A8A8A;
  --success:       #2A9D8F;
  --warn:          #E76F51;
  --danger:        #E63946;
  --shadow-sm:     2px 2px 0 var(--ink);
  --shadow-md:     4px 4px 0 var(--ink);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: 'DM Sans', -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

/* =========================================================================
   LOGIN PAGE
   ========================================================================= */
.login-body {
  background-color: var(--cream);
  background-image: radial-gradient(circle at 1px 1px, rgba(10,10,10,0.15) 1.2px, transparent 0);
  background-size: 14px 14px;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.login-container {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.login-card {
  width: 100%;
  background: var(--surface);
  border: 3px solid var(--ink);
  border-radius: 10px;
  padding: 36px 32px;
  box-shadow: 8px 8px 0 var(--ink);
  transform: rotate(-0.5deg);
}

.login-brand {
  font-family: 'Bangers', cursive;
  font-size: 42px;
  letter-spacing: 0.03em;
  color: var(--hero-red);
  -webkit-text-stroke: 1.5px var(--ink);
  text-shadow: 3px 3px 0 var(--ink);
  line-height: 1;
  transform: rotate(-2deg);
  display: inline-block;
}

.login-brand-tag {
  font-family: 'Bungee', sans-serif;
  font-size: 11px;
  color: var(--deep-blue);
  background: var(--pow-yellow);
  display: inline-block;
  padding: 3px 10px;
  border: 2px solid var(--ink);
  border-radius: 3px;
  margin-top: 8px;
  transform: rotate(1.5deg);
  margin-bottom: 24px;
}

.login-title {
  font-family: 'Bangers', cursive;
  font-size: 28px;
  letter-spacing: 0.03em;
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 20px;
  line-height: 1.5;
}

.login-error {
  background: #fde2e2;
  border: 2px solid var(--danger);
  border-radius: 5px;
  padding: 10px 12px;
  color: var(--danger);
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 16px;
}

.login-form label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink);
  margin-bottom: 6px;
  margin-top: 14px;
}

.login-form label:first-child { margin-top: 0; }

.login-form input[type="password"] {
  width: 100%;
  padding: 11px 14px;
  border: 2.5px solid var(--ink);
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.1s, transform 0.1s;
}

.login-form input[type="password"]:focus {
  outline: none;
  box-shadow: 3px 3px 0 var(--hero-red);
  transform: translate(-0.5px, -0.5px);
}

.login-hint {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 10px;
  line-height: 1.5;
}

.login-btn {
  display: block;
  width: 100%;
  margin-top: 22px;
  padding: 13px;
  background: var(--hero-red);
  color: white;
  border: 3px solid var(--ink);
  border-radius: 8px;
  font-family: 'Bangers', cursive;
  font-size: 20px;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: transform 0.1s, box-shadow 0.1s;
}

.login-btn:hover {
  transform: translate(-2px, -2px) rotate(-0.5deg);
  box-shadow: 6px 6px 0 var(--ink);
  background: var(--hero-red-dk);
}

.login-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}

.login-footnote {
  font-size: 11px;
  color: var(--text-faint);
  text-align: center;
  max-width: 360px;
  line-height: 1.6;
}

.login-footnote code {
  background: var(--pow-yellow);
  padding: 1px 5px;
  border: 1px solid var(--ink);
  border-radius: 3px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--ink);
}

/* =========================================================================
   ADMIN SHELL
   ========================================================================= */
.admin-shell {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
}

.admin-sidebar {
  background: var(--sidebar-bg);
  color: var(--sidebar-fg);
  border-right: 3px solid var(--ink);
  padding: 22px 0 12px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.admin-brand {
  padding: 0 20px 20px;
  border-bottom: 1px solid #2a2a2a;
}

.admin-brand-logo {
  font-family: 'Bangers', cursive;
  font-size: 26px;
  letter-spacing: 0.04em;
  color: var(--pow-yellow);
  -webkit-text-stroke: 1px var(--ink);
  line-height: 1;
}

.admin-brand-sub {
  font-family: 'Bungee', sans-serif;
  font-size: 10px;
  color: var(--sidebar-fg-dim);
  margin-top: 4px;
  letter-spacing: 0.15em;
}

.admin-nav {
  padding: 16px 12px;
  flex: 1;
  overflow-y: auto;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 2px;
  border-radius: 6px;
  color: var(--sidebar-fg);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.1s, color 0.1s;
  border: 2px solid transparent;
}

.admin-nav-item:hover {
  background: #252525;
  color: white;
}

.admin-nav-item.active {
  background: var(--hero-red);
  color: white;
  border-color: var(--ink);
  box-shadow: 3px 3px 0 var(--pow-yellow);
  transform: translate(-1.5px, -1.5px);
}

.admin-nav-icon {
  width: 20px;
  display: inline-flex;
  justify-content: center;
  font-family: 'Bangers', cursive;
  font-size: 16px;
}

.admin-sidebar-footer {
  padding: 14px 20px 6px;
  border-top: 1px solid #2a2a2a;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-link-out {
  color: var(--sidebar-fg-dim);
  font-size: 11px;
  text-decoration: none;
  font-weight: 500;
  padding: 4px 0;
  transition: color 0.1s;
}

.admin-link-out:hover { color: var(--pow-yellow); }
.admin-link-danger:hover { color: var(--hero-red); }

/* =========================================================================
   MAIN AREA
   ========================================================================= */
.admin-main {
  background: var(--cream);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.admin-topbar {
  background: var(--surface);
  border-bottom: 3px solid var(--ink);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.admin-page-title {
  font-family: 'Bangers', cursive;
  font-size: 28px;
  letter-spacing: 0.03em;
  color: var(--ink);
  line-height: 1;
  padding-top: 3px;
}

.admin-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
}

.admin-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(0.85); }
}

.admin-content {
  padding: 28px 32px;
  flex: 1;
}

/* =========================================================================
   SECTION — shared
   ========================================================================= */
.section { display: none; }
.section.active { display: block; }

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 22px;
  gap: 20px;
  flex-wrap: wrap;
}

.section-lead {
  max-width: 620px;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.6;
}

.section-lead b { color: var(--text); }

/* =========================================================================
   CARDS / GRID
   ========================================================================= */
.card {
  background: var(--surface);
  border: 2.5px solid var(--ink);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  padding: 22px;
}

.card + .card { margin-top: 18px; }

.card-title {
  font-family: 'Bangers', cursive;
  font-size: 20px;
  margin-bottom: 6px;
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 14px;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }

/* =========================================================================
   BUTTONS
   ========================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border: 2.5px solid var(--ink);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s, background 0.1s;
  box-shadow: var(--shadow-sm);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  text-decoration: none;
}

.btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--ink);
}

.btn:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--ink);
}

.btn-primary { background: var(--hero-red); color: white; }
.btn-primary:hover { background: var(--hero-red-dk); }
.btn-yellow  { background: var(--pow-yellow); }
.btn-ghost   { background: transparent; box-shadow: none; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-dim); border-color: var(--ink); box-shadow: var(--shadow-sm); }
.btn-danger  { color: var(--danger); }
.btn-danger:hover { background: #fde2e2; }

.btn-sm { padding: 6px 11px; font-size: 11px; }
.btn-icon { padding: 7px; width: 34px; height: 34px; }

/* =========================================================================
   FORMS
   ========================================================================= */
.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-row label,
.form-row > .label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink);
}

.form-row input[type=text],
.form-row input[type=email],
.form-row input[type=number],
.form-row input[type=url],
.form-row textarea,
.form-row select {
  padding: 9px 12px;
  border: 2px solid var(--ink);
  border-radius: 5px;
  font-family: inherit;
  font-size: 13px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.1s, transform 0.1s;
  width: 100%;
}

.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
  outline: none;
  box-shadow: 3px 3px 0 var(--hero-red);
  transform: translate(-0.5px, -0.5px);
}

.form-row textarea {
  min-height: 100px;
  resize: vertical;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 1.6;
}

.form-row input[type=color] {
  width: 46px;
  height: 34px;
  padding: 2px;
  cursor: pointer;
}

.form-row-inline { flex-direction: row; align-items: center; gap: 12px; }
.form-row-inline label { margin-bottom: 0; min-width: 130px; }

.form-hint {
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.5;
}

.form-row.split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-row.split-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; }

/* Toggle switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #ccc;
  border: 2px solid var(--ink);
  border-radius: 22px;
  transition: background 0.15s;
}

.toggle-slider::before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 1px;
  bottom: 1px;
  background: white;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  transition: transform 0.15s;
}

.toggle input:checked + .toggle-slider { background: var(--success); }
.toggle input:checked + .toggle-slider::before { transform: translateX(16px); }

/* =========================================================================
   TABLES
   ========================================================================= */
.tbl {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 2.5px solid var(--ink);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.tbl thead th {
  background: var(--ink);
  color: var(--pow-yellow);
  font-family: 'Bungee', sans-serif;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 11px 14px;
  text-align: left;
}

.tbl tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  vertical-align: middle;
}

.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: var(--surface-dim); }

.tbl td.actions {
  text-align: right;
  white-space: nowrap;
}

.tbl td.actions .btn { margin-left: 4px; }

.tbl .muted { color: var(--text-faint); font-size: 12px; }

.tbl .pill {
  display: inline-block;
  padding: 2px 8px;
  background: var(--surface-dim);
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--ink);
}

.tbl .badge-active {
  display: inline-block;
  padding: 2px 9px;
  background: var(--success);
  color: white;
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  font-family: 'Bungee', sans-serif;
  font-size: 9px;
  letter-spacing: 0.05em;
}

.tbl .badge-inactive {
  display: inline-block;
  padding: 2px 9px;
  background: #ddd;
  color: var(--ink-soft);
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  font-family: 'Bungee', sans-serif;
  font-size: 9px;
  letter-spacing: 0.05em;
}

.tbl .color-chip {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  vertical-align: middle;
  margin-right: 6px;
}

.tbl .icon-cell {
  font-size: 18px;
  width: 30px;
}

.tbl-empty {
  padding: 40px;
  text-align: center;
  color: var(--text-faint);
  font-family: 'Bangers', cursive;
  font-size: 22px;
  letter-spacing: 0.03em;
}

/* =========================================================================
   STYLE CARDS (for AI styles)
   ========================================================================= */
.style-card-admin {
  background: var(--surface);
  border: 2.5px solid var(--ink);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.15s;
}

.style-card-admin:hover {
  transform: translate(-2px, -2px) rotate(-0.3deg);
  box-shadow: 6px 6px 0 var(--ink);
}

.style-card-admin.inactive { opacity: 0.55; }

.style-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.style-card-icon {
  width: 44px;
  height: 44px;
  background: var(--pow-yellow);
  border: 2.5px solid var(--ink);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.style-card-title {
  font-family: 'Bangers', cursive;
  font-size: 19px;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.style-card-id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-faint);
  margin-top: 2px;
}

.style-card-desc {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
  min-height: 34px;
}

.style-card-prompt {
  background: var(--surface-dim);
  border: 1px solid var(--border);
  border-left: 3px solid var(--hero-red);
  padding: 8px 10px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.5;
  max-height: 68px;
  overflow: hidden;
  position: relative;
}

.style-card-prompt::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 20px;
  background: linear-gradient(to bottom, transparent, var(--surface-dim));
}

.style-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.style-card-actions {
  display: flex;
  gap: 6px;
}

/* =========================================================================
   MODAL
   ========================================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10,10,10,0.6);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  animation: fadeIn 0.15s ease;
}

.modal-backdrop.show { display: flex; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: var(--surface);
  border: 3px solid var(--ink);
  border-radius: 10px;
  box-shadow: 10px 10px 0 var(--ink);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px 32px;
  animation: slideIn 0.2s ease;
}

@keyframes slideIn {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-title {
  font-family: 'Bangers', cursive;
  font-size: 26px;
  letter-spacing: 0.03em;
  margin-bottom: 6px;
  color: var(--hero-red);
  -webkit-text-stroke: 1px var(--ink);
}

.modal-subtitle {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 18px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 2px dashed var(--border);
}

/* =========================================================================
   TOAST
   ========================================================================= */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--ink);
  color: white;
  border: 2.5px solid var(--ink);
  border-radius: 8px;
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 6px 6px 0 var(--success);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s, transform 0.2s;
  z-index: 200;
  max-width: 360px;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error { box-shadow: 6px 6px 0 var(--danger); }
.toast.warn { box-shadow: 6px 6px 0 var(--warn); }

/* =========================================================================
   STATS (Dashboard)
   ========================================================================= */
.stat-card {
  background: var(--surface);
  border: 2.5px solid var(--ink);
  border-radius: 8px;
  padding: 18px 20px;
  box-shadow: var(--shadow-md);
  transition: transform 0.15s;
}

.stat-card:hover {
  transform: translate(-1.5px, -1.5px) rotate(-0.5deg);
  box-shadow: 5px 5px 0 var(--ink);
}

.stat-label {
  font-family: 'Bungee', sans-serif;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  text-transform: uppercase;
}

.stat-value {
  font-family: 'Bangers', cursive;
  font-size: 42px;
  line-height: 1;
  color: var(--hero-red);
  -webkit-text-stroke: 1px var(--ink);
  margin-top: 6px;
}

.stat-sub {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 6px;
}

/* =========================================================================
   LOADING
   ========================================================================= */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  color: var(--text-faint);
  font-family: 'Bangers', cursive;
  font-size: 22px;
  letter-spacing: 0.03em;
}

/* =========================================================================
   HELPERS
   ========================================================================= */
.hint {
  background: var(--pow-yellow);
  border-left: 3px solid var(--ink);
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin-top: 12px;
}

.hint b { color: var(--ink); }

code {
  background: var(--surface-dim);
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 3px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--hero-red);
}

.mono { font-family: 'JetBrains Mono', monospace; font-size: 12px; }
.muted { color: var(--text-faint); }
.small { font-size: 11px; }

@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; height: auto; }
  .grid-3 { grid-template-columns: 1fr; }
}

/* =========================================================================
   KATEGORIEN & TEMPLATES
   ========================================================================= */

.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  padding: 14px;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  background: var(--cream);
  border: 2px solid var(--ink);
  border-radius: 6px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.1s;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  box-shadow: 2px 2px 0 var(--ink);
}

.filter-chip:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--ink);
  background: var(--pow-yellow);
}

.filter-chip.active {
  background: var(--hero-red);
  color: white;
  transform: translate(-1.5px, -1.5px);
  box-shadow: 4px 4px 0 var(--ink);
}

.filter-chip-icon { font-size: 14px; }

.filter-chip-count {
  display: inline-block;
  min-width: 22px;
  padding: 1px 6px;
  background: var(--ink);
  color: white;
  font-size: 10px;
  border-radius: 10px;
  text-align: center;
  font-family: 'Bungee', sans-serif;
  font-weight: 400;
}

.filter-chip.active .filter-chip-count {
  background: white;
  color: var(--hero-red);
}

.category-group {
  margin-bottom: 32px;
}

.category-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px dashed var(--border);
}

.category-group-icon {
  font-size: 24px;
  width: 42px;
  height: 42px;
  background: var(--pow-yellow);
  border: 2.5px solid var(--ink);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.category-group-title {
  font-family: 'Bangers', cursive;
  font-size: 24px;
  letter-spacing: 0.02em;
  color: var(--ink);
  flex: 1;
}

.category-group-meta {
  font-size: 11px;
  color: var(--text-faint);
  font-family: 'Bungee', sans-serif;
}

.template-card-admin {
  background: var(--surface);
  border: 2.5px solid var(--ink);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.15s;
}

.template-card-admin:hover {
  transform: translate(-2px, -2px) rotate(-0.3deg);
  box-shadow: 6px 6px 0 var(--ink);
}

.template-card-admin.inactive { opacity: 0.55; }

.template-card-admin-preview {
  background: var(--cream);
  border: 1.5px solid var(--ink);
  border-radius: 5px;
  padding: 14px 10px;
  text-align: center;
  font-family: 'Playfair Display', serif;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
}

.template-card-admin-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.template-card-admin-subtitle {
  font-size: 11px;
  color: var(--text-dim);
  font-style: italic;
}

.template-card-admin-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.template-card-admin-name {
  font-family: 'Bangers', cursive;
  font-size: 18px;
  line-height: 1.1;
  flex: 1;
}

.template-card-admin-id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-faint);
  margin-top: 2px;
}

.template-card-admin-desc {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
  min-height: 32px;
}

.template-card-admin-stats {
  display: flex;
  gap: 6px;
  font-size: 10px;
  font-family: 'Bungee', sans-serif;
  color: var(--text-faint);
  letter-spacing: 0.05em;
}

.template-card-admin-stats .pill {
  padding: 2px 7px;
}

.badge-inline {
  display: inline-block;
  padding: 2px 7px;
  background: var(--hero-red);
  color: white;
  font-family: 'Bangers', cursive;
  font-size: 10px;
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  letter-spacing: 0.04em;
}

.templates-grid-inner {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.tbl .category-marker {
  display: inline-block;
  width: 5px;
  height: 24px;
  border-radius: 3px;
  vertical-align: middle;
  margin-right: 2px;
}

/* =========================================================================
   WARTUNGSMODUS
   ========================================================================= */

.maintenance-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  background: linear-gradient(135deg, #FFF8E7, #FFF3CD);
  border: 3px solid var(--ink);
  border-radius: 10px;
  box-shadow: 5px 5px 0 var(--ink);
  margin-bottom: 24px;
  transition: all 0.2s;
}

.maintenance-card.maintenance-active {
  background: linear-gradient(135deg, #FEE2E2, #FECACA);
  animation: maintenanceActivePulse 2s ease-in-out infinite;
}

@keyframes maintenanceActivePulse {
  0%, 100% { box-shadow: 5px 5px 0 var(--ink); }
  50%      { box-shadow: 5px 5px 0 var(--ink), 0 0 0 4px rgba(230, 57, 70, 0.15); }
}

.maintenance-card-icon {
  font-size: 38px;
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  flex-shrink: 0;
  transition: transform 0.3s;
}

.maintenance-card.maintenance-active .maintenance-card-icon {
  animation: wrenchWiggle 1.8s ease-in-out infinite;
}

@keyframes wrenchWiggle {
  0%, 100% { transform: rotate(0deg); }
  30%      { transform: rotate(-12deg); }
  60%      { transform: rotate(8deg); }
}

.maintenance-card-body {
  flex: 1;
  min-width: 0;
}

.maintenance-card-title {
  font-family: 'Bangers', cursive;
  font-size: 22px;
  letter-spacing: 0.02em;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 4px;
}

.maintenance-card.maintenance-active .maintenance-card-title {
  color: var(--hero-red);
}

.maintenance-card-sub {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.4;
}

.maintenance-card.maintenance-active .maintenance-card-sub {
  color: #991B1B;
  font-weight: 600;
}

/* Big switch (iOS-style) für Dashboard */
.switch-big {
  position: relative;
  display: inline-block;
  width: 68px;
  height: 36px;
  flex-shrink: 0;
}

.switch-big input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  inset: 0;
  background: var(--text-faint);
  border: 2.5px solid var(--ink);
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.25s;
}

.switch-slider::before {
  content: '';
  position: absolute;
  height: 24px;
  width: 24px;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 50%;
  transition: transform 0.25s, background 0.25s;
}

.switch-big input:checked + .switch-slider {
  background: var(--hero-red);
}

.switch-big input:checked + .switch-slider::before {
  transform: translate(32px, -50%);
  background: var(--pow-yellow);
}

/* Inline-Switch für Settings-Formular */
.switch-inline {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.switch-inline input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-inline > span {
  position: absolute;
  inset: 0;
  background: var(--text-faint);
  border: 2px solid var(--ink);
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.switch-inline > span::before {
  content: '';
  position: absolute;
  height: 16px;
  width: 16px;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--surface);
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  transition: transform 0.2s;
}

.switch-inline input:checked + span {
  background: var(--hero-red);
}
.switch-inline input:checked + span::before {
  transform: translate(21px, -50%);
  background: var(--pow-yellow);
}

/* Banner im Admin bei aktiver Wartung */
.admin-maintenance-banner {
  background: linear-gradient(90deg, var(--hero-red), var(--hero-red-dark));
  color: white;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  border-bottom: 2px solid var(--ink);
}

.admin-maintenance-banner::before {
  content: '🔧';
  font-size: 16px;
}
