/* ============================================================
   Avui Studio – Admin-Panel Styles (Redesign)
   assets/style.css
   ============================================================ */

/* ── Variables ── */
:root {
  --primary:           #6e2654;
  --primary-dark:      color-mix(in srgb, var(--primary) 80%, black);
  --primary-light:     color-mix(in srgb, var(--primary) 10%, white);
  --primary-container: color-mix(in srgb, var(--primary) 8%, #f8f4f7);
  --primary-on-container: color-mix(in srgb, var(--primary) 70%, black);
  --accent:            #993371;

  --bg:          #f8f9fa;
  --surface:     #ffffff;
  --surface-container: #f1f3f5;
  --surface-container-low: #f8f9fa;
  --text:        #191c1d;
  --muted:       #6b7280;
  --border:      #e5e7eb;
  --danger:      #DC2626;
  --success:     #16A34A;
  --warning:     #D97706;

  --sidebar-w:   256px;
  --sidebar-gap:  20px;
  --content-ml:  calc(var(--sidebar-w) + var(--sidebar-gap) * 2);
  --radius:      12px;
  --radius-sm:   8px;
  --shadow:      0 1px 4px rgba(0,0,0,0.08);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg:   0 20px 60px rgba(0,0,0,0.3);
  --trans:       180ms ease;

  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.5; font-weight: 400; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; font-size: 0.9375rem; }
img { display: block; max-width: 100%; }
ul { list-style: none; }

/* ── Utility ── */
.hidden { display: none !important; }
.text-muted { color: var(--muted); font-size: 0.875rem; }
.text-center { text-align: center; }
.required { color: var(--danger); }
.caps-label { text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.75rem; font-weight: 600; color: var(--muted); }

/* ── LOGIN ── */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f0e8ed 0%, #f9f4f7 100%);
}
.login-card {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
}
.login-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}
.login-logo-name { font-size: 1.25rem; font-weight: 700; color: var(--primary); }
.login-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.25rem; letter-spacing: -0.02em; }
.login-subtitle { color: var(--muted); margin-bottom: 1.5rem; font-size: 0.9375rem; }
.login-form { display: flex; flex-direction: column; gap: 1rem; }
.login-footer { margin-top: 1.5rem; text-align: center; font-size: 0.875rem; color: var(--muted); }

/* Legal-Footer (Impressum/Datenschutz) wird aus dem Flex-Layout der
   .login-body herausgenommen, damit die Login-Box exakt in der Mitte
   des Viewports bleibt — der Footer pinnt dezent am unteren Rand. */
.login-legal-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 6px;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--muted);
}
.login-legal-footer a {
  color: inherit;
  text-decoration: underline;
  margin: 0 0.5rem;
}

/* ════════════════════════════════════════════════════════════
   DASHBOARD LAYOUT
   ════════════════════════════════════════════════════════════ */

.dashboard-body {
  display: block;
  min-height: 100vh;
  background: var(--bg);
}

/* ── SIDEBAR (dark, floating) ── */
.sidebar {
  position: fixed;
  left: var(--sidebar-gap);
  top: var(--sidebar-gap);
  bottom: var(--sidebar-gap);
  width: var(--sidebar-w);
  background: #171717;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-header {
  padding: 0 20px 16px;
  border-bottom: none;
}
.sidebar-logo-img {
  max-height: 40px;
  width: auto;
}
.sidebar-logo-placeholder {
  height: 64px;
  width: 100%;
  border: 2px dashed #404040;
  border-radius: 12px;
  background: rgba(38,38,38,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #737373;
  font-size: 0.8125rem;
  font-weight: 500;
}
.sidebar-logo-text {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
}

.sidebar-client-badge {
  margin: 12px 20px 0;
  background: rgba(255,255,255,0.08);
  color: #a3a3a3;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-menu-label {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #737373;
  padding: 24px 24px 8px;
}

.sidebar-nav {
  padding: 0 8px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  margin: 0 8px;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 400;
  color: #a3a3a3;
  transition: all var(--trans);
  text-decoration: none;
}
.nav-item .material-symbols-outlined { font-size: 20px; transition: transform var(--trans); }
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; opacity: 0.6; }
.nav-item:hover { color: #ffffff; text-decoration: none; }
.nav-item:hover .material-symbols-outlined { transform: scale(1.1); }
.nav-item.active {
  background: var(--primary);
  color: #ffffff;
  font-weight: 500;
}
.nav-item.active .material-symbols-outlined { transform: scale(1); }

.sidebar-footer {
  padding: 12px 16px;
  margin-top: auto;
  border-top: 1px solid #2a2a2a;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: #a3a3a3;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  transition: color var(--trans);
}
.sidebar-user:hover { color: #ffffff; }
.sidebar-user .material-symbols-outlined { font-size: 18px; }
.btn-logout {
  display: flex;
  padding: 4px;
  color: #a3a3a3;
  border-radius: 4px;
  transition: color var(--trans);
}
.btn-logout:hover { color: var(--danger); text-decoration: none; }
.btn-logout .material-symbols-outlined { font-size: 18px; }
.btn-logout svg { width: 16px; height: 16px; }

/* ── MAIN CONTENT ── */
.main-content {
  margin-left: var(--content-ml);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── TOPBAR (floating, glassmorphism) ── */
.topbar {
  display: flex;
  align-items: normal;
  justify-content: flex-end;
  padding: 24px 32px 0;
  gap: 1rem;
  min-height: 64px;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0 0 20px 0;
}
.topbar-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
}
.topbar-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
}
.topbar-user {
  display: flex;
  flex-direction: column;
}
.topbar-username {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}
.topbar-role {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--muted);
}

.client-switcher { flex-shrink: 0; }
.client-switcher select {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 0.8125rem;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  max-width: 260px;
}

/* ── TAB CONTENT ── */
.tab-content {
  padding: 8px 32px 32px;
  flex: 1;
  min-width: 0;
  width: 100%;
}

/* ════════════════════════════════════════════════════════════
   GLOBAL COMPONENTS
   ════════════════════════════════════════════════════════════ */

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--trans);
  white-space: nowrap;
  text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { filter: brightness(1.1); text-decoration: none; color: #fff; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-container); text-decoration: none; }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { filter: brightness(0.9); text-decoration: none; color: #fff; }
.btn-full { width: 100%; justify-content: center; }
.btn-sm { padding: 6px 12px; font-size: 0.8125rem; }

/* ── FORMS ── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.form-group label {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}
.form-group input,
.form-group textarea,
.form-group select {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--trans);
  width: 100%;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent);
}
.form-group input[type="radio"]:focus,
.form-group input[type="checkbox"]:focus { box-shadow: none; border-color: initial; }
.form-group input[type="color"] { padding: 4px; height: 44px; cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-stack { display: flex; flex-direction: column; gap: 1.5rem; }
.form-section-title { text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.75rem; font-weight: 600; color: var(--muted); padding-top: 0.5rem; border-top: 1px solid var(--border); }
.form-actions { display: flex; justify-content: flex-end; gap: 0.75rem; padding-top: 0.5rem; }
.field-hint { font-size: 0.8125rem; color: var(--muted); margin-top: 4px; }
.checkbox-label { display: flex; align-items: flex-start; gap: 0.5rem; cursor: pointer; font-size: 0.9375rem; }
.checkbox-label input[type="checkbox"] { width: auto; margin-top: 2px; accent-color: var(--primary); }

/* ── ALERTS ── */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 0.875rem; margin-bottom: 1rem; }
.alert-error   { background: #FEF2F2; color: #991B1B; border: 1px solid #FCA5A5; }
.alert-success { background: #F0FDF4; color: #166534; border: 1px solid #86EFAC; }
.alert-warning { background: #FFFBEB; color: #92400E; border: 1px solid #FCD34D; }
.info-line { font-size: 0.8125rem; color: var(--success); font-weight: 500; margin-bottom: 0.75rem; }

/* ── TOKEN USAGE BAR ── */
.token-usage-bar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 1.25rem; padding: 10px 16px;
  background: var(--surface); border: none;
  border-radius: var(--radius-sm); font-size: 0.8125rem;
  box-shadow: var(--shadow);
}
.token-bar-track { flex: 1; height: 8px; background: var(--surface-container); border-radius: 99px; overflow: hidden; }
.token-bar-fill  { height: 100%; background: var(--primary); border-radius: 99px; transition: width 0.4s ease, background 0.3s ease; width: 0; }
.token-bar-label { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ── CARDS (global) ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

/* ── BADGES ── */
.badge { display: inline-block; padding: 4px 10px; border-radius: 100px; font-size: 0.75rem; font-weight: 600; }
.badge-green { background: #DCFCE7; color: #166534; }
.badge-red   { background: #FEE2E2; color: #991B1B; }
.badge-primary { background: var(--primary-container); color: var(--primary-on-container); }

/* ── TABLES ── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); border: none; width: 100%; min-width: 0; background: var(--surface); box-shadow: var(--shadow); }
.data-table { width: 100%; min-width: 600px; border-collapse: collapse; font-size: 0.875rem; }
.data-table th {
  background: var(--surface-container-low);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 16px 24px;
  text-align: left;
  color: var(--muted);
  border-bottom: 1px solid #f3f4f5;
}
.data-table td { padding: 16px 24px; border-bottom: 1px solid #f3f4f5; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fafbfc; }
.table-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; min-height: 32px; }
.table-actions .btn { padding: 4px 10px; font-size: 0.75rem; font-weight: 500; border-radius: 6px; }

/* ── MODULE HEADER ── */
.module-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.module-header h2 { font-size: 1.625rem; font-weight: 700; letter-spacing: -0.02em; }

/* ── EMPTY STATE ── */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.75rem; padding: 4rem 2rem; text-align: center; color: var(--muted);
}
.empty-state h2 { font-size: 1.125rem; color: var(--text); font-weight: 700; }
.empty-state svg { opacity: 0.4; }

/* ════════════════════════════════════════════════════════════
   FLOW STEPS (Änderungen + KI-Abschnitt)
   ════════════════════════════════════════════════════════════ */

.flow-step { display: none; }
.flow-step.active { display: block; }

.step-header { margin-bottom: 1.5rem; }
.step-badge {
  display: inline-block;
  background: var(--primary-container);
  color: var(--primary-on-container);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.step-header h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 4px; letter-spacing: -0.02em; }
.step-header p  { color: var(--muted); }

.step-actions {
  display: flex; align-items: center; gap: 12px;
  margin-top: 1.5rem; padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

/* ── CHANGES TOKEN (fixed top-right in module) ── */
.module-changes { position: relative; }
.changes-token-fixed {
  position: absolute; top: 0; right: 0;
  display: flex; align-items: center; gap: 12px;
  z-index: 2;
}

/* ── CHANGES BENTO LAYOUT ── */
.changes-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 24px;
  margin-bottom: 24px;
}
.changes-headline { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 2px; }

.changes-bento {
  display: grid; grid-template-columns: 4fr 8fr; gap: 24px;
}
.changes-bento-left { display: flex; flex-direction: column; gap: 24px; }
.changes-bento-right { display: flex; flex-direction: column; gap: 24px; }

@media (max-width: 1024px) {
  .changes-bento { grid-template-columns: 1fr; }
}

/* ── ACTION CARDS ── */
.action-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.action-card {
  background: var(--surface);
  border: none;
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--trans);
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  box-shadow: var(--shadow);
}
.action-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.action-card-icon {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-container);
  border-radius: var(--radius-sm);
  font-size: 1.5rem;
  flex-shrink: 0;
  transition: all var(--trans);
  color: var(--primary);
}
.action-card-icon .material-symbols-outlined { font-size: 24px; }
.action-card:hover .action-card-icon { background: color-mix(in srgb, var(--primary) 15%, white); }
.action-card-label { font-size: 0.9375rem; font-weight: 700; }
.action-card-desc  { font-size: 0.8125rem; color: var(--muted); line-height: 1.4; margin-top: 2px; }

/* ── PAGE CARDS RADIO ── */
.page-cards { display: flex; flex-wrap: wrap; gap: 8px; min-height: 38px; align-items: center; }
.page-cards-loading { font-size: 0.875rem; }
.page-card-radio { cursor: pointer; }
.page-card-radio input { display: none; }
.page-card-radio span {
  display: block;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--trans);
}
.page-card-radio input:checked + span { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }

/* ── RADIO LIST ── */
.radio-list { display: flex; flex-direction: column; gap: 6px; }
.radio-item { display: flex; align-items: center; gap: 6px; font-size: 0.9375rem; cursor: pointer; color: var(--text); }
.radio-item input[type="radio"],
.radio-item input[type="checkbox"] { width: auto; margin: 0; accent-color: var(--primary); cursor: pointer; }

/* ── COMPONENT CHECKBOXES ── */
.component-checkboxes { display: flex; flex-wrap: wrap; gap: 10px; }
.checkbox-item { cursor: pointer; }
.checkbox-item input { display: none; }
.checkbox-item span {
  display: block; padding: 8px 16px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 0.875rem; transition: all var(--trans);
}
.checkbox-item input:checked + span { border-color: var(--primary); background: var(--primary-light); color: var(--primary); font-weight: 600; }

.comp-fields { padding: 16px; background: var(--surface-container-low); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.comp-fields .form-group:not(:last-child) { margin-bottom: 14px; }

/* ── COLOR SWATCHES ── */
.color-swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.color-swatch { display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; }
.color-swatch-box { width: 48px; height: 48px; border-radius: var(--radius-sm); border: 2px solid var(--border); transition: border-color var(--trans); }
.color-swatch.active .color-swatch-box { border-color: var(--primary); border-width: 3px; }
.color-swatch-name { font-size: 0.6875rem; color: var(--muted); text-align: center; max-width: 56px; overflow: hidden; text-overflow: ellipsis; }

.opt-field { padding-left: 16px; border-left: 3px solid var(--border); margin-top: 12px; }
.opt-field .form-group:not(:last-child) { margin-bottom: 12px; }

/* ── LIST ITEMS ── */
.list-item-row { display: flex; gap: 8px; margin-bottom: 8px; }
.list-item-row input { flex: 1; }
.btn-remove-list { background: none; border: none; color: var(--muted); font-size: 1rem; cursor: pointer; padding: 0 4px; }
.btn-remove-list:hover { color: var(--danger); }

/* ── LAYOUT TEMPLATES ── */
.layout-templates { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.layout-card { cursor: pointer; }
.layout-card input { display: none; }
.layout-preview {
  display: flex; align-items: stretch; gap: 6px;
  background: var(--surface-container-low); border: 2px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 10px;
  margin-bottom: 6px; transition: all var(--trans); min-height: 70px;
}
.layout-card input:checked + .layout-preview { border-color: var(--primary); background: var(--primary-light); }
.layout-preview--stacked { flex-direction: column; }
.lp-img  { flex: 1; background: #ccc; border-radius: 4px; min-height: 44px; }
.lp-text { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 5px; }
.lp-text div, .lp-text-center div { height: 6px; background: #ccc; border-radius: 3px; }
.lp-text div:first-child, .lp-text-center div:first-child { height: 9px; }
.lp-text-center { display: flex; flex-direction: column; gap: 5px; flex: 1; justify-content: center; }
.lp-img-full { height: 28px; background: #ccc; border-radius: 4px; }
.layout-card span { font-size: 0.75rem; color: var(--muted); text-align: center; display: block; }

/* ── UPLOAD ZONE ── */
.upload-zone { position: relative; border: 2px dashed var(--border); border-radius: var(--radius); overflow: hidden; transition: border-color var(--trans); }
.upload-zone:hover { border-color: var(--primary); }
.upload-zone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 2; }
.upload-zone-inner { display: flex; flex-direction: column; align-items: center; padding: 2rem 1rem; gap: 8px; color: var(--muted); text-align: center; }
.upload-zone-inner svg { opacity: 0.5; }
.upload-zone-inner p { font-size: 0.9375rem; }
.upload-zone-inner small { font-size: 0.8125rem; }
.upload-preview { display: flex; align-items: center; gap: 1rem; padding: 1rem; background: var(--surface-container-low); }
.upload-preview img { height: 80px; width: auto; border-radius: var(--radius-sm); object-fit: cover; }
.btn-remove-img { background: var(--danger); color: #fff; border: none; border-radius: 50%; width: 24px; height: 24px; font-size: 12px; line-height: 1; cursor: pointer; }

/* ── PREVIEW ── */
.preview-frame-wrap { margin-bottom: 1.5rem; }
.preview-label { text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.75rem; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
#preview-iframe { width: 100%; height: 500px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.confirm-box { background: var(--surface); border: none; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.confirm-box p { margin-bottom: 0; font-weight: 600; }

/* ── LOADING ── */
.loading-state { display: flex; flex-direction: column; align-items: center; padding: 4rem 2rem; gap: 1rem; color: var(--muted); }
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── SUCCESS SCREEN ── */
.success-screen { text-align: center; padding: 4rem 2rem; display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.success-icon { font-size: 3rem; }
.success-screen h2 { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; }
.success-screen p  { color: var(--muted); max-width: 400px; }

/* ── SIDE PANEL ── */
.side-panel {
  position: fixed; top: 0; right: 0;
  width: 480px; max-width: 95vw; height: 100vh;
  background: var(--surface); border-left: none;
  box-shadow: -4px 0 24px rgba(0,0,0,.1);
  overflow-y: auto; z-index: 200;
  display: flex; flex-direction: column;
}
.side-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.side-panel-header h3 { font-size: 1.125rem; font-weight: 700; letter-spacing: -0.02em; }
.btn-close { background: none; border: none; font-size: 1.25rem; color: var(--muted); cursor: pointer; padding: 4px; }
.btn-close:hover { color: var(--text); }
#client-form { padding: 24px; flex: 1; }

/* ── DEPLOY FIELDS ── */
.deploy-fields { display: flex; flex-direction: column; gap: 1rem; }

/* ── UPDATES MODULE ── */
.update-card { background: var(--surface); border: none; border-radius: var(--radius); padding: 24px; margin-bottom: 1rem; box-shadow: var(--shadow); }
.update-card h3 { font-size: 1.0625rem; font-weight: 700; margin-bottom: 8px; letter-spacing: -0.02em; }
.update-version-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.update-version-label { text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.75rem; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.update-version-number { font-size: 1.75rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.update-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.update-status-info    { padding: 12px 16px; background: #EFF6FF; color: #1E40AF; border-radius: var(--radius-sm); margin-top: 1rem; font-size: 0.875rem; white-space: pre-wrap; }
.update-status-success { padding: 12px 16px; background: #F0FDF4; color: #166534; border-radius: var(--radius-sm); margin-top: 1rem; font-size: 0.875rem; white-space: pre-wrap; }

/* ── ACADEMY ── */
.module-academy { max-width: 700px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; }
.academy-hero { text-align: center; padding: 3rem 1rem 2rem; }
.academy-hero-icon { color: var(--primary); margin-bottom: 1rem; }
.academy-hero h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 8px; letter-spacing: -0.02em; }
.academy-hero p { color: var(--muted); font-size: 0.9375rem; line-height: 1.6; max-width: 520px; margin: 0 auto; }
.academy-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 1.5rem; }
.academy-card {
  background: var(--surface); border: none; border-radius: var(--radius);
  padding: 24px; text-align: center; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  opacity: 0.55;
}
.academy-card-icon { color: var(--muted); }
.academy-card h3 { font-size: 0.9375rem; font-weight: 700; color: var(--text); }
.academy-badge { font-size: 0.6875rem; font-weight: 600; color: var(--muted); background: var(--surface-container); border-radius: 100px; padding: 2px 10px; }

/* ── CHANGELOG ── */
.changelog-entry { padding: 12px 0; border-bottom: 1px solid var(--border); }
.changelog-entry:last-child { border-bottom: none; }
.changelog-version { font-weight: 700; font-size: 0.9375rem; margin-bottom: 2px; }
.changelog-date    { font-size: 0.8125rem; color: var(--muted); margin-bottom: 6px; }
.changelog-entry ul { padding-left: 1.25rem; list-style: disc; }
.changelog-entry li { font-size: 0.875rem; color: var(--muted); padding: 2px 0; }

/* ── USER TABLE ── */
.user-row--sub td:first-child { padding-left: 24px; }
.user-indent { color: var(--muted); margin-right: 4px; }
.color-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; margin-left: 4px; border: 1px solid rgba(0,0,0,.1); }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 300;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.modal {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 500px; max-height: 90vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.modal-header h3 { font-size: 1.125rem; font-weight: 700; letter-spacing: -0.02em; }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer { display: flex; justify-content: flex-end; gap: 12px; padding: 16px 24px; border-top: 1px solid var(--border); flex-shrink: 0; }
.modal-form { display: flex; flex-direction: column; gap: 1rem; }

/* ── USER INFO BLOCK ── */
.user-info-block {
  background: var(--surface-container-low); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px; margin-bottom: 20px;
  display: flex; flex-direction: column; gap: 8px;
}
.user-info-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.875rem; }
.user-info-label { color: var(--muted); font-weight: 500; }
.user-info-logo { max-height: 28px; width: auto; border-radius: 4px; }
.user-info-color { display: flex; align-items: center; gap: 6px; }

/* ── COLOR PICKER ROW ── */
.color-picker-row { display: flex; gap: 8px; align-items: center; }
.color-picker-row input[type="color"] { width: 44px; height: 38px; padding: 2px; cursor: pointer; flex-shrink: 0; }
.color-picker-row input[type="text"] { flex: 1; font-family: monospace; }

/* ── LOGO PREVIEW ── */
.logo-preview { margin-top: 8px; }
.logo-preview img { max-height: 40px; width: auto; border-radius: 4px; border: 1px solid var(--border); }

/* ════════════════════════════════════════════════════════════
   DASHBOARD WIDGETS
   ════════════════════════════════════════════════════════════ */

.dash-welcome { margin-bottom: 24px; }
.dash-welcome h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 4px; letter-spacing: -0.02em; }

.dash-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
}
.dash-card {
  background: var(--surface);
  border: none;
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  grid-column: span 4;
}
.dash-card-wide { grid-column: 1 / -1; }
.dash-card-8 { grid-column: span 8; }
.dash-card-4 { grid-column: span 4; }
.dash-card-title {
  text-transform: uppercase; letter-spacing: 0.05em;
  font-size: 0.75rem; font-weight: 600; color: var(--muted);
  margin-bottom: 16px;
}
.dash-card-hint { font-size: 0.75rem; color: var(--muted); margin-top: 12px; }
.dash-card-link { font-size: 0.8125rem; color: var(--primary); font-weight: 500; }

/* Token Budget */
.dash-token-value { font-size: 0.9375rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }

/* Changes Counter */
.dash-card-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  position: relative;
  overflow: hidden;
}
.dash-card-primary::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 160px; height: 160px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
  filter: blur(40px);
}
.dash-card-primary .dash-card-title { color: rgba(255,255,255,0.6); }
.dash-card-primary .dash-stat-number { color: #fff; font-size: 3rem; font-weight: 700; }
.dash-card-primary .dash-stat-label { color: rgba(255,255,255,0.7); }

.dash-stats { display: flex; gap: 2.5rem; }
.dash-stat { display: flex; flex-direction: column; }
.dash-stat-number { font-size: 2rem; font-weight: 700; line-height: 1.1; color: var(--text); letter-spacing: -0.02em; }
.dash-stat-label { font-size: 0.8125rem; color: var(--muted); margin-top: 4px; }

/* Quick Access */
.dash-quick-actions { display: flex; flex-direction: column; gap: 10px; }
.dash-quick-btn {
  display: flex; align-items: center; gap: 14px;
  padding: 16px;
  background: var(--surface);
  border: none;
  border-radius: var(--radius);
  font-size: 0.875rem; font-weight: 600;
  text-decoration: none;
  color: var(--text);
  transition: all var(--trans);
  box-shadow: var(--shadow);
}
.dash-quick-btn:hover { background: var(--primary-light); text-decoration: none; }
.dash-quick-btn .dash-quick-icon {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-container);
  border-radius: var(--radius-sm);
  color: var(--primary);
  flex-shrink: 0;
  transition: all var(--trans);
}
.dash-quick-btn:hover .dash-quick-icon { background: var(--primary); color: #fff; }
.dash-quick-btn svg { flex-shrink: 0; }

/* Website Status */
.dash-status { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 0.9375rem; font-weight: 600; }
.dash-status-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dash-status-online { background: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 20%, transparent); }
.dash-status-offline { background: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 20%, transparent); }
.dash-status-loading { background: var(--border); animation: dash-pulse 1.2s ease-in-out infinite; }
@keyframes dash-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* Activity List */
.dash-list { display: flex; flex-direction: column; }
.dash-list-empty { color: var(--muted); font-size: 0.875rem; padding: 12px 0; }

.dash-activity-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--surface-container); font-size: 0.875rem;
}
.dash-activity-row:last-child { border-bottom: none; }
.dash-activity-date { color: var(--muted); white-space: nowrap; min-width: 100px; font-size: 0.75rem; }
.dash-activity-action { flex: 1; font-weight: 500; }
.dash-activity-tokens {
  background: var(--primary-container);
  color: var(--primary-on-container);
  padding: 4px 8px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Client rows */
.dash-client-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--surface-container); font-size: 0.875rem;
}
.dash-client-row:last-child { border-bottom: none; }
.dash-client-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; border: 1px solid rgba(0,0,0,.1); }
.dash-client-name { flex: 1; font-weight: 600; }
.dash-client-login { color: var(--muted); font-size: 0.75rem; white-space: nowrap; }

/* Token rows */
.dash-token-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--surface-container); font-size: 0.875rem;
}
.dash-token-row:last-child { border-bottom: none; }
.dash-token-row-name { min-width: 120px; font-weight: 600; }
.dash-token-row-bar { flex: 1; height: 6px; background: var(--surface-container); border-radius: 99px; overflow: hidden; }
.dash-token-row-fill { height: 100%; background: var(--primary); border-radius: 99px; transition: width 0.4s ease; }
.dash-token-row-label { color: var(--muted); font-size: 0.75rem; white-space: nowrap; min-width: 60px; text-align: right; font-variant-numeric: tabular-nums; }

/* Error rows */
.dash-error-row {
  padding: 12px 0 12px 12px; border-bottom: 1px solid var(--surface-container);
  border-left: 3px solid var(--danger); margin-bottom: 4px;
}
.dash-error-row:last-child { border-bottom: none; }
.dash-error-info { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 0.8125rem; margin-bottom: 4px; }
.dash-error-date { color: var(--muted); white-space: nowrap; }
.dash-error-client { font-weight: 700; color: var(--text); }
.dash-error-type { color: var(--danger); font-weight: 600; }
.dash-error-msg { font-size: 0.8125rem; color: var(--muted); margin-bottom: 6px; word-break: break-word; }
.dash-error-resolve { font-size: 0.75rem; padding: 4px 8px; }
.dash-no-errors { display: flex; align-items: center; gap: 8px; color: var(--success); font-weight: 600; font-size: 0.9375rem; padding: 8px 0; }

/* ════════════════════════════════════════════════════════════
   KI-ABSCHNITT TAB
   ════════════════════════════════════════════════════════════ */

.module-ai-section .form-stack { gap: 2rem; }
#ai-preview-iframe { width: 100%; min-height: 600px; height: 600px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }

/* AI Header */
.ai-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 24px;
  margin-bottom: 32px;
}
.ai-headline {
  font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 2px;
}

/* AI Token Compact */
.ai-token-compact {
  display: flex; align-items: center; gap: 12px;
  flex-shrink: 0;
}

/* AI Cards */
.ai-card {
  background: var(--surface); border: none;
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
}
.ai-card-title {
  text-transform: uppercase; letter-spacing: 0.05em;
  font-size: 0.75rem; font-weight: 600; color: var(--muted);
  margin-bottom: 16px;
}

/* AI Bento Grid (12 columns) */
.ai-bento {
  display: grid; grid-template-columns: 4fr 8fr; gap: 24px;
  margin-bottom: 24px;
}
.ai-bento-left { display: flex; flex-direction: column; gap: 24px; }
.ai-bento-right { display: flex; flex-direction: column; gap: 24px; }
.ai-card-prompt { flex: 1; display: flex; flex-direction: column; }
.ai-right-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.ai-card-prompt textarea {
  flex: 1;
  background: var(--surface-container-low);
  border: none;
  border-radius: var(--radius-sm);
  padding: 24px;
  font-size: 0.9375rem;
  line-height: 1.6;
  transition: all var(--trans);
}
.ai-card-prompt textarea:focus {
  background: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent);
  outline: none;
}
.ai-card-prompt textarea::placeholder { color: #a0a0a0; }

/* AI Card Inputs */
.ai-card input[type="text"],
.ai-card textarea,
.ai-card select {
  width: 100%;
  background: var(--surface-container-low);
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.875rem;
  color: var(--text);
}
.ai-card select {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='%236b7280'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.ai-card input[type="text"]:focus,
.ai-card select:focus {
  background-color: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent);
  outline: none;
}

/* AI Page List – inherits .page-cards styles */

/* (ai-bottom-grid removed – content is now inside ai-bento-right) */

/* AI Upload Dropzone */
.ai-card .upload-zone {
  border: 2px dashed #c1c9be;
  background: var(--surface-container-low);
  border-radius: var(--radius);
  transition: all var(--trans);
}
.ai-card .upload-zone:hover { background: var(--surface); border-color: var(--primary); }
.ai-card .upload-zone-inner { padding: 32px; }
.ai-card .upload-zone-inner .material-symbols-outlined {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  border-radius: 50%;
  color: var(--primary);
  margin: 0 auto 12px;
}

/* AI CTA Card */
.ai-cta-card {
  background: var(--primary); color: #fff;
  border-radius: var(--radius); padding: 32px;
  display: flex; flex-direction: column; justify-content: center;
}
.ai-cta-card h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: 8px; }
.ai-cta-card p { font-size: 0.875rem; opacity: 0.8; margin-bottom: 24px; line-height: 1.6; }
.ai-cta-btn {
  background: rgba(255,255,255,0.95); color: var(--primary);
  border: none; border-radius: var(--radius-sm);
  padding: 12px; font-weight: 700; font-size: 0.875rem;
  cursor: pointer; transition: all var(--trans);
  text-transform: uppercase; letter-spacing: 0.03em;
  width: 100%; text-align: center; font-family: inherit;
}
.ai-cta-btn:hover { background: #fff; }

/* AI Trust Badges */
.ai-trust-badges {
  display: flex; justify-content: center; gap: 32px;
  padding: 20px 0; color: var(--muted);
}
.ai-trust-badges span {
  display: flex; align-items: center; gap: 6px;
  text-transform: uppercase; letter-spacing: 0.08em;
  font-size: 0.6875rem; font-weight: 600;
}
.ai-trust-badges .material-symbols-outlined { font-size: 16px; }

@media (max-width: 768px) {
  .ai-bento { grid-template-columns: 1fr; }
  .ai-right-bottom { grid-template-columns: 1fr; }
  .ai-header { flex-direction: column; }
  .ai-trust-badges { flex-direction: column; align-items: center; gap: 12px; }
}

.ai-image-uploads { display: flex; flex-direction: column; gap: 12px; }
.ai-image-thumbnails { display: flex; gap: 12px; flex-wrap: wrap; }

.ai-thumb-wrap { display: flex; flex-direction: column; gap: 6px; width: 100px; }
.ai-thumb-desc {
  width: 100%; font-size: 0.75rem; padding: 4px 6px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
}
.ai-thumb-desc:focus { outline: none; border-color: var(--primary); }

.ai-thumb {
  position: relative; width: 100px; height: 100px;
  border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border);
}
.ai-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ai-thumb-remove {
  position: absolute; top: 4px; right: 4px;
  background: var(--danger); color: #fff; border: none; border-radius: 50%;
  width: 22px; height: 22px; font-size: 11px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.ai-thumb-remove:hover { background: #B91C1C; }

/* ── SIDEBAR SUB-ITEMS (dropdown, WordPress-style) ── */
.nav-sub-items {
  display: flex; flex-direction: column; gap: 2px;
  padding: 4px 0 4px 0;
}
.nav-sub-link {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 16px;
  font-size: 0.8125rem; color: #737373;
  text-decoration: none; border-radius: 9999px;
  margin: 0 8px;
  transition: all var(--trans);
}
.nav-sub-link:hover { color: #fff; text-decoration: none; }
.nav-sub-link .material-symbols-outlined { font-size: 16px; }

/* ── SIDEBAR FLYOUT (Slide-Out für Einstellungen-Unterpunkte) ── */
.nav-item-wrap { position: relative; }
/* position:fixed nötig, weil .sidebar overflow-x:hidden setzt — ein
   absolute-positionierter Flyout würde dort abgeschnitten. Position wird
   via JS gesetzt (sidebarFlyoutInit in app.js). */
.nav-flyout {
  position: fixed;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 6px;
  min-width: 200px;
  z-index: 200;
  /* Initial unsichtbar — visibility-Delay verhindert pointer-events während Fade-Out */
  visibility: hidden;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity .15s ease, transform .15s ease, visibility 0s .15s;
  box-shadow: 0 12px 32px rgba(0,0,0,.4);
}
/* Hover-Bridge: unsichtbarer Streifen links vom Flyout, damit der Cursor
   beim Übergang vom nav-item zum Flyout nicht in eine Lücke fällt. */
.nav-flyout::before {
  content: '';
  position: absolute;
  left: -14px; top: 0; bottom: 0;
  width: 14px;
}
.nav-item-wrap.has-flyout:hover .nav-flyout,
.nav-item-wrap.has-flyout:focus-within .nav-flyout {
  visibility: visible;
  opacity: 1;
  transform: translateX(0);
  transition: opacity .15s ease, transform .15s ease, visibility 0s;
}
.nav-flyout-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px;
  font-size: 0.875rem;
  color: #a3a3a3;
  text-decoration: none;
  border-radius: 8px;
  transition: background .15s, color .15s;
}
.nav-flyout-link:hover {
  background: rgba(255,255,255,.06);
  color: #fff;
  text-decoration: none;
}
.nav-flyout-link .material-symbols-outlined { font-size: 18px; }
/* Touch-Geräte: Flyout per Klick nicht sinnvoll — Default-Navigation auf
   Einstellungen reicht. Hover-States werden auf Touch ohnehin ignoriert. */
@media (hover: none) {
  .nav-flyout { display: none; }
}

/* ── TOOLS ── */
.tools-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; }
.tools-card { display: flex; flex-direction: column; grid-column: span 3; }
.tools-icon-box {
  width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--primary) 10%, white);
  border-radius: var(--radius-sm); color: var(--primary); margin-bottom: 16px;
}
.tools-icon-box .material-symbols-outlined { font-size: 24px; }
.tools-card-title { font-size: 0.9375rem; font-weight: 700; margin-bottom: 6px; }
.tools-card-desc { font-size: 0.8125rem; color: var(--muted); line-height: 1.5; flex: 1; }
.tools-card-footer { margin-top: 20px; }
.tools-result {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.8125rem; font-weight: 500; margin-bottom: 10px; padding: 8px 12px;
  border-radius: var(--radius-sm);
}
.tools-result-ok { background: #f0fdf4; color: #166534; }
.tools-result-err { background: #fef2f2; color: #991b1b; }

@media (max-width: 1024px) { .tools-grid { grid-template-columns: repeat(2, 1fr); } .tools-card { grid-column: span 1; } }
@media (max-width: 768px) { .tools-grid { grid-template-columns: 1fr; } .tools-card { grid-column: span 1; } }

/* ── TICKET STATUS BADGES ── */
.ticket-badge { display: inline-block; padding: 4px 12px; border-radius: 9999px; font-size: 0.75rem; font-weight: 700; white-space: nowrap; }
.ticket-status-open { background: #fef3c7; color: #92400e; }
.ticket-status-progress { background: #dbeafe; color: #1e40af; }
.ticket-status-closed { background: color-mix(in srgb, var(--primary) 10%, white); color: var(--primary); }

/* ── MENU TOGGLE (Mobile) ── */
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 40px; height: 40px;
  flex-shrink: 0;
  color: var(--text);
  cursor: pointer;
  transition: background var(--trans);
}
.menu-toggle:hover { background: var(--surface-container); }
.menu-toggle .material-symbols-outlined { font-size: 22px; }
.menu-toggle svg { width: 20px; height: 20px; }

/* ── SIDEBAR OVERLAY ── */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.4); z-index: 99;
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}

/* ════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════ */

@media (max-width: 1199px) {
  .dash-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-card { grid-column: span 1; }
  .dash-card-8 { grid-column: 1 / -1; }
  .dash-card-4 { grid-column: span 1; }
  .dash-card-wide { grid-column: 1 / -1; }
}

@media (max-width: 1024px) {
  :root { --sidebar-w: 0px; --content-ml: 0px; }

  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    border-radius: 0;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 280px;
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,.15);
  }
  .sidebar-overlay.active { display: block; }

  .main-content { margin-left: 0; }
  .topbar { justify-content: space-between; }
  .menu-toggle {
    display: flex;
    background: var(--surface);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    color: var(--primary);
  }

  .tab-content { padding: 16px; }
  .action-cards { grid-template-columns: repeat(2, 1fr); }
  .sidebar-footer { padding-bottom: max(1rem, calc(0.75rem + env(safe-area-inset-bottom, 0px) + 50px)); }
}

@media (max-width: 768px) {
  .dash-grid { grid-template-columns: 1fr; }
  .dash-card, .dash-card-8, .dash-card-4 { grid-column: 1; }
  .dash-stats { gap: 1.5rem; }

  .action-cards { grid-template-columns: 1fr 1fr; gap: 12px; }
  .action-card { padding: 16px; }
  .layout-templates { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }

  .side-panel { width: 100%; border-left: none; border-radius: 0; }
  .module-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .module-header .btn { width: 100%; justify-content: center; }

  .data-table { min-width: 500px; }
  .data-table th, .data-table td { padding: 8px 10px; font-size: 0.8125rem; }
  .table-wrap::after { content: '\2190 swipe \2192'; display: block; text-align: center; font-size: 0.6875rem; color: var(--muted); padding: 6px 0; }

  .ai-thumb { width: 80px; height: 80px; }
  .step-header h2 { font-size: 1.25rem; }
  .step-actions { flex-direction: column; }
  .step-actions .btn { width: 100%; justify-content: center; }
  .academy-grid { grid-template-columns: 1fr 1fr; }
  .topbar { padding: 8px 16px; }

  .changes-token-fixed {
    position: static;
    margin-bottom: 12px;
  }
}

@media (max-width: 380px) {
  .action-cards { grid-template-columns: 1fr; }
}

/* ──────────────────────────────────────────────────────────
   Blog-Modul
────────────────────────────────────────────────────────── */
.module-blog { width: 100%; }

/* STATE 1 – Aktivierung */
.blog-activate-wrap { display:flex; justify-content:center; padding:2rem 1rem; }
.blog-activate-card {
  max-width: 640px; width: 100%; padding: 2.5rem; text-align: center;
  border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); border: none;
}
.blog-activate-icon {
  width: 72px; height: 72px; margin: 0 auto 1.5rem; border-radius: 50%;
  background: color-mix(in srgb, var(--primary) 12%, white);
  display: flex; align-items: center; justify-content: center;
}
.blog-activate-icon .material-symbols-outlined { font-size: 36px; color: var(--primary); }
.blog-activate-headline { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 0.75rem; }
.blog-activate-lead { color: var(--muted); line-height: 1.65; margin-bottom: 1.5rem; }
.blog-activate-lead code { background: var(--surface-container); padding: 2px 6px; border-radius: 4px; font-size: 0.85em; }
.blog-activate-bullets { list-style: none; padding: 0; margin: 0 0 1.5rem; text-align: left; }
.blog-activate-bullets li {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0;
  border-bottom: 1px solid var(--border); font-size: 0.9375rem;
}
.blog-activate-bullets li:last-child { border-bottom: none; }
.blog-activate-bullets .material-symbols-outlined { font-size: 20px; color: var(--primary); }
.blog-activate-bullets code { background: var(--surface-container); padding: 1px 5px; border-radius: 3px; font-size: 0.85em; }
.blog-activate-info { margin-bottom: 1.5rem; text-align: left; }
.blog-activate-btn { padding: 0.875rem 1.75rem; font-size: 1rem; font-weight: 600; }
.blog-activate-btn:disabled { opacity: 0.6; cursor: wait; }

/* STATE 2 – Sub-Tabs */
.blog-subtabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
.blog-subtab {
  display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.625rem 1rem;
  background: transparent; border: none; border-bottom: 2px solid transparent;
  cursor: pointer; font: inherit; font-weight: 500; color: var(--muted);
  margin-bottom: -1px; transition: all 0.15s;
}
.blog-subtab:hover { color: var(--text); }
.blog-subtab.active { color: var(--primary); border-bottom-color: var(--primary); }
.blog-subtab .material-symbols-outlined { font-size: 18px; }
.blog-subpane { display: none; }
.blog-subpane.active { display: block; }

/* Caps-Style-Labels (Re-use für blog-Tabellen, Editor-Sections) */
.blog-caps-label {
  text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.75rem;
  font-weight: 600; color: var(--muted); margin-bottom: 0.5rem;
}

/* Status-Badges */
.blog-badge { display:inline-block; padding: 2px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: 600; }
.blog-badge-draft     { background: #F3F4F6; color: #4B5563; }
.blog-badge-scheduled { background: #FEF3C7; color: #92400E; }
.blog-badge-published { background: #D1FAE5; color: #065F46; }

/* Beiträge-Tabelle */
.blog-posts-toolbar { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.blog-posts-toolbar input, .blog-posts-toolbar select {
  padding: 12px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  height: 44px;
  transition: border-color var(--trans), box-shadow var(--trans);
}
.blog-posts-toolbar input::placeholder { color: var(--muted); font-weight: 400; }
.blog-posts-toolbar input:focus, .blog-posts-toolbar select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent);
}
.blog-posts-toolbar select { padding-right: 2.25rem; cursor: pointer; }
.blog-posts-toolbar .grow { flex: 1; min-width: 200px; }

/* Klickbarer Titel-Link in Listen-Tabellen (Posts + Kategorien) */
.blog-row-title {
  font-weight: 600; color: var(--text); text-decoration: none;
  cursor: pointer; transition: color var(--trans);
}
.blog-row-title:hover { color: var(--primary); text-decoration: underline; }
.blog-posts-table { width: 100%; border-collapse: collapse; }
.blog-posts-table th { text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); }
.blog-posts-table td { padding: 0.75rem; border-bottom: 1px solid var(--border); vertical-align: middle; font-size: 0.9375rem; }
.blog-posts-table tr:hover { background: var(--surface-container); }
.blog-thumb { width: 56px; height: 36px; object-fit: cover; border-radius: 4px; background: #f3f4f6; display:inline-block; }
.blog-row-actions { display: flex; gap: 0.5rem; }
.blog-row-actions button { background: transparent; border: 1px solid var(--border); padding: 4px 8px; border-radius: 4px; cursor: pointer; font-size: 0.8125rem; color: var(--muted); }
.blog-row-actions button:hover { color: var(--text); border-color: var(--text); }

/* Kategorien-Tabelle (kompakter) */
.blog-cat-table { width: 100%; border-collapse: collapse; }
.blog-cat-table th, .blog-cat-table td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); font-size: 0.9375rem; }
.blog-cat-table th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }

/* Editor */
.blog-editor-grid { display: grid; grid-template-columns: 1fr 320px; gap: 1.5rem; align-items: start; }
@media (max-width: 980px) { .blog-editor-grid { grid-template-columns: 1fr; } }
.blog-editor-side .card { margin-bottom: 1rem; }
.blog-editor-section { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); padding: 1.5rem; margin-bottom: 1rem; }
.blog-editor-section h3 { font-size: 1.0625rem; font-weight: 700; margin-bottom: 1rem; letter-spacing: -0.02em; }
.blog-editor-section.collapsible summary {
  cursor: pointer; font-size: 1.0625rem; font-weight: 700;
  padding: 0.25rem 0; list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
}
.blog-editor-section.collapsible summary::-webkit-details-marker { display: none; }
.blog-editor-section.collapsible summary::after {
  content: "+";
  font-size: 1.5rem; font-weight: 400; line-height: 1;
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 50%;
  color: var(--muted);
  transition: transform 0.2s, color var(--trans), border-color var(--trans);
}
.blog-editor-section.collapsible:hover summary::after { color: var(--primary); border-color: var(--primary); }
.blog-editor-section.collapsible[open] summary::after { content: "−"; transform: rotate(180deg); }
.blog-editor-section.collapsible[open] { padding-bottom: 1.5rem; }
.blog-editor-section.collapsible > *:not(summary) { margin-top: 1rem; }

/* SEO Google SERP Preview */
.blog-serp {
  font-family: arial, sans-serif; max-width: 600px; padding: 1rem 1.25rem;
  background: #fff; border: 1px solid #dadce0; border-radius: 8px;
}
.blog-serp__url { font-size: 14px; color: #202124; line-height: 1.3; margin-bottom: 2px; }
.blog-serp__url-domain { color: #202124; }
.blog-serp__url-path { color: #4d5156; }
.blog-serp__title { font-size: 20px; line-height: 1.3; color: #1a0dab; margin: 4px 0; cursor: default; font-weight: 400; }
.blog-serp__desc { font-size: 14px; line-height: 1.58; color: #4d5156; }
.blog-serp__skeleton { color: var(--muted); font-style: italic; }

/* FAQ entries */
.blog-faq-entry {
  display: grid; grid-template-columns: 1fr auto;
  gap: 0.6rem; margin-bottom: 0.85rem; align-items: stretch;
  padding: 0.85rem; background: var(--surface-container); border-radius: var(--radius-sm);
}
.blog-faq-entry textarea {
  font-family: inherit; font-size: 0.9375rem;
  min-height: 52px; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  resize: vertical; transition: border-color var(--trans), box-shadow var(--trans);
}
.blog-faq-entry textarea:nth-of-type(1) { grid-column: 1 / 2; min-height: 44px; font-weight: 500; }
.blog-faq-entry textarea:nth-of-type(2) { grid-column: 1 / 2; min-height: 70px; }
.blog-faq-entry textarea::placeholder { color: var(--muted); }
.blog-faq-entry textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent);
}
.blog-faq-entry .blog-faq-remove {
  grid-column: 2 / 3; grid-row: 1 / 3;
  align-self: start;
  width: 32px; height: 32px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--surface); border-radius: 50%;
  cursor: pointer; color: var(--muted);
  transition: all var(--trans); font-size: 0.875rem;
}
.blog-faq-entry .blog-faq-remove:hover { color: var(--danger); border-color: var(--danger); }

/* Einheitliches Styling für Sidebar-Card-Inputs (Autor, Alt-Text, Datetime) */
.blog-editor-side .card input[type="text"],
.blog-editor-side .card input[type="datetime-local"],
.blog-editor-side .card input[type="number"] {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font: inherit; font-size: 0.9375rem;
  transition: border-color var(--trans), box-shadow var(--trans);
}
.blog-editor-side .card input::placeholder { color: var(--muted); }
.blog-editor-side .card input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent);
}

/* Editor: WYSIWYG */
/* Fallback bevor TinyMCE die Textarea ersetzt — vermeidet Layout-Sprung */
.blog-wysiwyg { width: 100%; min-height: 500px; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: inherit; }
/* TinyMCE-Container an die App-Optik angleichen */
.tox.tox-tinymce { border: 1px solid var(--border) !important; border-radius: var(--radius-sm) !important; }
.tox .tox-toolbar, .tox .tox-toolbar__overflow, .tox .tox-toolbar__primary { background: var(--surface-container) !important; }
.tox-statusbar { display: none !important; }

/* Inline-Editor-Bereich (ersetzt die Beitragsliste, wenn ein Beitrag bearbeitet wird) */
.blog-editor-pane { width: 100%; }
.blog-editor-pane .blog-editor-topbar {
  background: var(--bg); padding: 0 0 1rem;
  border-bottom: 1px solid var(--border); margin-bottom: 1.25rem;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.blog-editor-pane h2 { font-size: 1.625rem; font-weight: 700; letter-spacing: -0.02em; margin-top: 0.5rem; }
.blog-editor-modal-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.blog-editor-back {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); text-decoration: none;
  font-size: 0.8125rem; font-weight: 600;
  transition: all var(--trans);
}
.blog-editor-back:hover { background: var(--surface-container); color: var(--primary); border-color: var(--primary); text-decoration: none; }
.blog-editor-back .material-symbols-outlined { font-size: 18px; }

/* ════════════════════════════════════════════════════════════
   Bild-Platzhalter während IONOS-Deploy (~1 Min.)
   Wird sowohl im CMS-Editor als auch im Customer-Render verwendet.
   .img-loading bleibt im DOM, bis das <img> erfolgreich lädt — dann
   fügt JS .is-ready hinzu und der Spinner verschwindet.
════════════════════════════════════════════════════════════ */
.img-loading {
  position: relative;
  display: block;
  width: 100%;
  margin: 1rem 0;
  background: linear-gradient(120deg, #eef1f4 0%, #e2e6eb 50%, #eef1f4 100%);
  background-size: 200% 100%;
  animation: img-loading-shimmer 1.6s ease-in-out infinite;
  border-radius: 8px;
  overflow: hidden;
  min-height: 120px;
}
.img-loading > img { display: block; width: 100%; height: auto; opacity: 0; transition: opacity 0.25s; }
.img-loading.is-ready { background: transparent; animation: none; min-height: 0; }
.img-loading.is-ready > img { opacity: 1; }
.img-loading.is-ready .img-placeholder { display: none; }
.img-placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.5rem; padding: 1rem;
  color: #475569; font-size: 0.875rem; text-align: center;
  pointer-events: none;
}
.img-placeholder .spinner {
  width: 28px; height: 28px;
  border: 3px solid rgba(15, 23, 42, 0.12);
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes img-loading-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Featured-Image-Platzhalter im Editor (gleiche Optik, kompakter) */
.fi-loading { aspect-ratio: 16 / 9; }

/* Publish-Wait-Banner über dem Editor (Publish-Gating Client-Side) */
.blog-publish-wait {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.875rem 1rem; margin: 0 0 1rem;
  background: #fff7ed; border: 1px solid #fdba74; border-radius: 8px;
  color: #9a3412; font-size: 0.875rem;
}
.blog-publish-wait .spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(154, 52, 18, 0.2);
  border-top-color: #c2410c;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
.blog-publish-wait button { margin-left: auto; }


/* ════════════════════════════════════════════════════════════
   SETTINGS – Sub-Tabs (generisch, wiederverwendbar)
   .subtabs / .subtab / .subpane folgen demselben Stil wie
   .blog-subtabs, sind aber nicht ans Blog-Modul gebunden.
════════════════════════════════════════════════════════════ */
.subtabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
.subtab {
  display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.625rem 1rem;
  background: transparent; border: none; border-bottom: 2px solid transparent;
  cursor: pointer; font: inherit; font-weight: 500; color: var(--muted);
  margin-bottom: -1px; transition: all 0.15s;
}
.subtab:hover { color: var(--text); }
.subtab.active { color: var(--primary); border-bottom-color: var(--primary); }
.subtab .material-symbols-outlined { font-size: 18px; }
.subpane { display: none; }
.subpane.active { display: block; }


/* ════════════════════════════════════════════════════════════
   MENU-MANAGER (Einstellungen → Menü)
════════════════════════════════════════════════════════════ */
.menu-toolbar { padding: 1rem 1.25rem; margin-bottom: 1rem; }
.menu-toolbar-label {
  display: block; font-size: 0.8125rem; font-weight: 600; margin-bottom: 0.35rem;
}
.menu-toolbar-row {
  display: flex; gap: 0.5rem; align-items: stretch; flex-wrap: wrap;
}
.menu-toolbar-select {
  flex: 1 1 240px; min-width: 240px;
  padding: 0 0.75rem; border: 1px solid var(--border);
  border-radius: 6px; background: var(--surface); font: inherit; color: var(--text);
  height: 40px; line-height: 40px;
}
.menu-toolbar-btn {
  height: 40px;
  padding: 0 1rem;
  display: inline-flex; align-items: center; justify-content: center;
  white-space: nowrap;
}
#menu-select-hint { display: block; margin-top: 0.4rem; }

/* Einzeilige Checkbox-Zeile (für "In neuem Tab öffnen") */
.menu-checkbox-row {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.8125rem; font-weight: 500; cursor: pointer;
  margin-bottom: 0.75rem;
}
.menu-checkbox-row input[type="checkbox"] {
  width: 16px; height: 16px; margin: 0; flex-shrink: 0;
}

.menu-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(320px, 1.4fr);
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 900px) { .menu-grid { grid-template-columns: 1fr; } }

.menu-card { padding: 1rem 1.25rem; margin-bottom: 1rem; }
.menu-card-title {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.9375rem; font-weight: 700; margin: 0 0 0.5rem 0;
}
.menu-card-title .material-symbols-outlined { font-size: 20px; color: var(--primary); }

/* Linke Spalte – Quell-Liste (Seiten) */
.menu-source-list {
  display: flex; flex-direction: column; gap: 0.35rem;
  max-height: 380px; overflow-y: auto;
}
.menu-source-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  font-size: 0.875rem;
}
.menu-source-item:hover { background: var(--surface-container); border-color: var(--primary); }
.menu-source-item .material-symbols-outlined { font-size: 18px; color: var(--muted); }
.menu-source-item .menu-source-item-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.menu-source-item .menu-source-add {
  margin-left: auto; padding: 0.2rem 0.55rem; font-size: 0.75rem;
  border: 1px solid var(--border); border-radius: 4px; background: var(--surface-container);
  color: var(--muted);
}
.menu-source-item:hover .menu-source-add { color: var(--primary); border-color: var(--primary); }

/* Rechte Spalte – Aktive Menüpunkte */
.menu-items-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 0.4rem;
  min-height: 80px;
}
.menu-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); font-size: 0.875rem;
  transition: margin-left 0.15s ease;
}
/* Untermenüpunkte (depth >= 1) sind eingerückt + farblich abgesetzt */
.menu-item[data-depth="1"] {
  margin-left: 32px;
  border-left: 3px solid var(--primary);
  background: var(--surface-container);
}
.menu-item-indent {
  display: inline-flex; gap: 1px; flex-shrink: 0;
}
.menu-item-indent button {
  border: none; background: transparent; cursor: pointer;
  padding: 2px; border-radius: 3px; color: var(--muted);
  display: inline-flex; align-items: center;
}
.menu-item-indent button:hover:not(:disabled) { background: var(--surface-container); color: var(--text); }
.menu-item-indent button:disabled { opacity: 0.3; cursor: not-allowed; }
.menu-item-indent .material-symbols-outlined { font-size: 16px; }
.menu-item-handle {
  cursor: grab; color: var(--muted); display: inline-flex;
}
.menu-item-handle:active { cursor: grabbing; }
.menu-item-handle .material-symbols-outlined { font-size: 18px; }
.menu-item-label { font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item-url   { color: var(--muted); font-size: 0.75rem; flex-shrink: 0; max-width: 35%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item-type-badge {
  font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 1px 6px; border-radius: 3px; background: var(--surface-container);
  color: var(--muted); font-weight: 600; flex-shrink: 0;
}
.menu-item-type-page     { background: rgba(110, 38, 84, 0.08); color: var(--primary); }
.menu-item-type-external { background: #ecfeff; color: #155e75; }
.menu-item-type-custom   { background: #f5f3ff; color: #6d28d9; }

.menu-item-actions {
  display: inline-flex; gap: 0.15rem; flex-shrink: 0;
}
.menu-item-actions button {
  border: none; background: transparent; cursor: pointer;
  padding: 4px; border-radius: 4px; color: var(--muted);
  display: inline-flex; align-items: center;
}
.menu-item-actions button:hover { background: var(--surface-container); color: var(--text); }
.menu-item-actions button.danger:hover { color: #b91c1c; }
.menu-item-actions .material-symbols-outlined { font-size: 18px; }

/* Sortable.js ghost / drag states */
.menu-item.sortable-ghost { opacity: 0.4; }
.menu-item.sortable-chosen { background: var(--surface-container); }
.menu-item.sortable-drag { box-shadow: 0 4px 16px rgba(0,0,0,0.12); }

.menu-empty-state {
  padding: 1rem 0.5rem; text-align: center; font-size: 0.875rem;
  border: 1px dashed var(--border); border-radius: 6px; background: var(--surface-container);
}
