/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --admin-primary: #840732;
  --admin-primary-hover: #6a0628;
  --admin-primary-rgb: 132, 7, 50;
  --admin-primary-faint: rgba(var(--admin-primary-rgb), 0.2);
  --admin-danger: #ef4444;
  --admin-danger-hover: #dc2626;
  --admin-success: #22c55e;
  --admin-bg: #222222;
  --admin-bg-elevated: #313131;
  --admin-card: #313131;
  --admin-card-hover: #3a3a3a;
  --admin-border: #444444;
  --admin-text: #ebebeb;
  --admin-text-muted: #6a6a6a;
  --admin-text-faint: #555555;
  --admin-radius: 3px;
  --admin-shadow: 0 2px 8px rgba(0,0,0,0.3);
  --admin-shadow-heavy: 0 25px 50px rgba(0,0,0,0.5);
  --sidebar-bg: #313131;
  --sidebar-dark: #222222;
  --sidebar-border: #444444;
  --sidebar-text: #8c8c8c;
  --sidebar-text-hover: #ebebeb;
  --sidebar-text-active: #fff;
  --sidebar-text-faint: #666666;
  --sidebar-icon-opacity: 0.5;
  --sidebar-width: 300px;
  --topbar-height: 50px;
  --topbar-bg: #000000;
  --admin-hover-bg: rgba(255,255,255,0.04);
  --admin-subtle-bg: rgba(255,255,255,0.08);
}

/* === Light Theme === */
[data-theme="light"] {
  --admin-bg: #f5f5f7;
  --admin-bg-elevated: #ffffff;
  --admin-card: #ffffff;
  --admin-card-hover: #f0f0f2;
  --admin-border: #d1d1d6;
  --admin-text: #1d1d1f;
  --admin-text-muted: #86868b;
  --admin-text-faint: #aeaeb2;
  --admin-shadow: 0 2px 8px rgba(0,0,0,0.06);
  --admin-shadow-heavy: 0 25px 50px rgba(0,0,0,0.12);
  --sidebar-bg: #f5f5f7;
  --sidebar-dark: #eaeaec;
  --sidebar-border: #d1d1d6;
  --sidebar-text: #86868b;
  --sidebar-text-hover: #1d1d1f;
  --sidebar-text-active: #1d1d1f;
  --sidebar-text-faint: #aeaeb2;
  --sidebar-icon-opacity: 0.6;
  --topbar-bg: #1d1d1f;
  --admin-hover-bg: rgba(0,0,0,0.04);
  --admin-subtle-bg: rgba(0,0,0,0.05);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --admin-bg: #f5f5f7;
    --admin-bg-elevated: #ffffff;
    --admin-card: #ffffff;
    --admin-card-hover: #f0f0f2;
    --admin-border: #d1d1d6;
    --admin-text: #1d1d1f;
    --admin-text-muted: #86868b;
    --admin-text-faint: #aeaeb2;
    --admin-shadow: 0 2px 8px rgba(0,0,0,0.06);
    --admin-shadow-heavy: 0 25px 50px rgba(0,0,0,0.12);
    --sidebar-bg: #f5f5f7;
    --sidebar-dark: #eaeaec;
    --sidebar-border: #d1d1d6;
    --sidebar-text: #86868b;
    --sidebar-text-hover: #1d1d1f;
    --sidebar-text-active: #1d1d1f;
    --sidebar-text-faint: #aeaeb2;
    --sidebar-icon-opacity: 0.6;
    --topbar-bg: #1d1d1f;
    --admin-hover-bg: rgba(0,0,0,0.04);
    --admin-subtle-bg: rgba(0,0,0,0.05);
  }
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--admin-bg);
  color: var(--admin-text);
  line-height: 1.5;
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: var(--topbar-height) 1fr auto;
  grid-template-areas:
    "topbar topbar"
    "sidebar main"
    "sidebar footer";
}

a { color: var(--admin-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* === Login Page Override === */
body.login-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: url('admin-login-background.jpg') center/cover no-repeat fixed;
}

.login-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 400px;
  flex: 1;
  justify-content: center;
}

.login-container {
  background: var(--admin-card);
  padding: 2.5rem;
  border-radius: var(--admin-radius);
  box-shadow: var(--admin-shadow-heavy);
  width: 100%;
  max-width: 400px;
  border: 1px solid var(--admin-border);
}

.login-logo {
  display: block;
  height: 28px;
  width: auto;
  margin-bottom: 1.5rem;
}

.login-footer {
  text-align: center;
  padding: 2rem;
  color: var(--admin-text-faint);
  font-size: 0.75rem;
}

.forgot-password-link {
  color: var(--admin-text-muted);
  font-size: 0.85rem;
  text-decoration: none;
  transition: color 0.2s;
}
.forgot-password-link:hover {
  color: var(--admin-accent);
}

/* === Top Bar === */
.admin-topbar {
  grid-area: topbar;
  display: flex;
  background: var(--topbar-bg);
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  height: var(--topbar-height);
  position: sticky;
  top: 0;
  z-index: 200;
}

.topbar-left {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.topbar-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--admin-text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}

.sidebar-toggle:hover { color: var(--admin-text); }

.topbar-logo {
  display: flex;
  align-items: center;
  text-decoration: none !important;
}

.topbar-logo img {
  height: 18px;
  width: auto;
}

.topbar-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  position: relative;
}

.topbar-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--admin-text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem 0.4rem;
  line-height: 1;
  letter-spacing: 1px;
}

.topbar-menu-btn:hover { color: var(--admin-text); }

.topbar-menu {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* User Dropdown */
.topbar-user-dropdown { position: relative; }

.topbar-user-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--admin-text-muted);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  transition: color 0.15s, background 0.15s;
}

.topbar-user-btn:hover { color: var(--admin-text); background: rgba(255,255,255,0.08); }

.topbar-user-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.dropdown-chevron {
  width: 14px !important;
  height: 14px !important;
  transition: transform 0.2s;
}

.topbar-user-dropdown.open .dropdown-chevron { transform: rotate(180deg); }

.topbar-user-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  min-width: 160px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  z-index: 210;
  padding: 0.35rem 0;
}

.topbar-user-dropdown.open .topbar-user-menu { display: block; }

.topbar-user-menu a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  color: var(--admin-text-muted);
  text-decoration: none !important;
  transition: background 0.12s, color 0.12s;
}

.topbar-user-menu a:hover { background: var(--admin-hover-bg); color: var(--admin-text); }

.topbar-user-menu a svg { width: 16px; height: 16px; flex-shrink: 0; }

/* === Sidebar === */
.admin-sidebar {
  grid-area: sidebar;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  width: var(--sidebar-width);
  position: sticky;
  top: var(--topbar-height);
  height: calc(100vh - var(--topbar-height));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 150;
}

.admin-sidebar::-webkit-scrollbar { width: 4px; }
.admin-sidebar::-webkit-scrollbar-track { background: transparent; }
.admin-sidebar::-webkit-scrollbar-thumb { background: var(--sidebar-border); border-radius: 2px; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.sidebar-top { flex: 1; }

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--sidebar-border); border-radius: 2px; }

/* Tenant switcher */
.sidebar-tenant-switch {
  background: var(--sidebar-dark);
  border-bottom: 1px solid var(--sidebar-border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.sidebar-tenant-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 56px;
  padding: 0 16px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background 0.12s;
}

.sidebar-tenant-btn:hover { background: var(--admin-hover-bg); }
.sidebar-tenant-switch.static .sidebar-tenant-btn { cursor: default; }
.sidebar-tenant-switch.static .sidebar-tenant-btn:hover { background: none; }

.sidebar-tenant-btn-text { flex: 1; min-width: 0; }

.sidebar-tenant-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sidebar-text-faint);
  font-family: inherit;
}

.sidebar-tenant-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--sidebar-text-hover);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: inherit;
}

.sidebar-tenant-arrow {
  font-size: 8px;
  color: var(--sidebar-text-faint);
  flex-shrink: 0;
  transition: transform 0.2s;
}

.sidebar-tenant-switch.open .sidebar-tenant-arrow { transform: rotate(180deg); }

.sidebar-tenant-dropdown {
  display: none;
  background: var(--sidebar-dark);
  border-top: 1px solid var(--sidebar-border);
}

.sidebar-tenant-switch.open .sidebar-tenant-dropdown { display: block; }

.sidebar-tenant-option {
  display: flex;
  align-items: center;
  padding: 0 16px;
  height: 36px;
  font-size: 13px;
  color: var(--sidebar-text);
  text-decoration: none !important;
  cursor: pointer;
  border-bottom: 1px solid var(--sidebar-border);
  transition: background 0.12s, color 0.12s;
}

.sidebar-tenant-option:hover { background: var(--admin-hover-bg); color: var(--sidebar-text-hover); }

.sidebar-tenant-option.current { color: var(--sidebar-text-hover); font-weight: 600; }

.sidebar-tenant-option.current::after {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--admin-primary);
  margin-left: auto;
}

/* Sidebar nav items */
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  height: 34px;
  font-size: 13px;
  color: var(--sidebar-text);
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--sidebar-border);
  text-decoration: none !important;
  transition: color 0.12s, background 0.12s;
  cursor: pointer;
  border-right: 2px solid transparent;
}

.sidebar-item:hover { color: var(--sidebar-text-hover); }

.sidebar-item.active {
  color: var(--sidebar-text-active);
  background: var(--admin-primary-faint);
  border-right-color: var(--admin-primary);
}

.sidebar-item .s-icon {
  width: 16px; height: 16px;
  flex-shrink: 0;
}

.sidebar-item:hover .s-icon { filter: brightness(1.6); }
.sidebar-item.active .s-icon { filter: brightness(2.2); }

/* Tool header row */
.sidebar-tool-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 16px;
  height: 34px;
  background: var(--sidebar-dark);
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-tool-logo { height: 14px; flex-shrink: 0; width: auto; }
.tool-logo-inline { height: 16px; width: auto; vertical-align: middle; margin-right: 2px; }

.sidebar-tool-btns {
  margin-left: auto;
  display: flex;
  gap: 5px;
  align-items: center;
}

.sidebar-tool-btn {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 3px;
  padding: 0;
  text-decoration: none !important;
  transition: opacity 0.15s;
  opacity: 0.7;
}

.sidebar-tool-btn:hover { opacity: 1; }
.sidebar-tool-btn svg { width: 18px; height: 18px; }

/* Tool child items */
.sidebar-tool-items .sidebar-item { padding-left: 28px; }

/* Level-2 status toggle (square-dot icon) */
.sidebar-status-toggle {
  margin-left: auto;
  margin-right: -6px;
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--sidebar-text-faint);
  display: flex;
  align-items: center;
  transition: opacity 0.15s;
}
.sidebar-status-toggle svg { width: 18px; height: 18px; }
.sidebar-status-toggle.active { color: #4caf50; }
.sidebar-status-toggle:hover { opacity: 0.8; }

/* Actions wrapper (add + status toggle) on accordion heads */
.sidebar-item-actions {
  margin-left: auto;
  margin-right: -6px;
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.sidebar-item-actions .sidebar-status-toggle {
  margin-left: 0;
  margin-right: 0;
}

/* Add button inside sidebar items */
.sidebar-item-add {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--admin-primary);
  display: flex;
  align-items: center;
  transition: opacity 0.15s;
  opacity: 0.7;
}
.sidebar-item-add svg { width: 18px; height: 18px; }
.sidebar-item-add:hover { opacity: 1; }

/* Sidebar resize handle */
.sidebar-resize-handle {
  position: fixed;
  top: var(--topbar-height);
  left: calc(var(--sidebar-width) - 2px);
  width: 5px;
  height: calc(100vh - var(--topbar-height));
  cursor: col-resize;
  z-index: 160;
  background: transparent;
  transition: background 0.15s;
}
.sidebar-resize-handle:hover {
  background: rgba(var(--admin-primary-rgb), 0.3);
}
.sidebar-resize-handle.active {
  background: rgba(var(--admin-primary-rgb), 0.5);
}

/* Sidebar accordion (shared: Configurator + Trigger) */
.sidebar-accordion {}
.sidebar-accordion-head { position: relative; }
.sidebar-sub-item {
  display: flex;
  align-items: center;
  padding: 0 16px 0 2.8rem;
  height: 34px;
  font-size: 13px;
  color: var(--sidebar-text);
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--sidebar-border);
  text-decoration: none !important;
  transition: color 0.12s, background 0.12s;
  cursor: pointer;
  border-right: 2px solid transparent;
}
.sidebar-sub-item:hover { color: var(--sidebar-text-hover); }
.sidebar-sub-item.active {
  color: var(--sidebar-text-active);
  background: var(--admin-primary-faint);
  border-right-color: var(--admin-primary);
}

/* Repeater rows (configurator model form) */
.repeater-row {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--admin-border);
}
.repeater-row:last-child { border-bottom: none; }
.repeater-row-wrap { flex-wrap: wrap; }
.repeater-remove { align-self: flex-end; width: 38px; height: 38px; padding: 0; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-bottom: 1rem; }
.variant-group-block { border: 1px solid var(--admin-border); border-radius: var(--admin-radius); padding: 1rem; margin-bottom: 1rem; }
.variant-group-header { display: flex; gap: 0.75rem; align-items: flex-end; margin-bottom: 0.75rem; }
.variant-group-header > .btn-danger { width: 38px; height: 38px; padding: 0; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-bottom: 0; }
.variant-options-container { margin-bottom: 0.5rem; }
.color-picker-input { width: 100%; height: 36px; padding: 2px; cursor: pointer; }
.repeater-remove svg,
.variant-group-header > .btn-danger svg,
.actions-cell .btn-small svg { width: 0.9rem; height: 0.9rem; }

/* Sidebar bottom */
.sidebar-bottom {
  padding: 0;
  background: var(--sidebar-dark);
  position: sticky;
  bottom: 0;
  z-index: 10;
}
.sidebar-bottom .sidebar-item {
  border-bottom: none;
  border-top: 1px solid var(--sidebar-border);
  background: var(--sidebar-dark);
}

/* Sidebar copyright */
.sidebar-copyright {
  padding: 0.75rem 16px;
  font-size: 10px;
  color: var(--sidebar-text-faint);
  text-align: center;
  border-top: 1px solid var(--sidebar-border);
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 140;
}

/* === Main Content === */
.admin-main {
  grid-area: main;
  padding: 2rem 2rem;
  width: 100%;
  min-width: 0;
}

/* === Footer === */
.admin-footer {
  grid-area: footer;
  text-align: center;
  padding: 2rem;
  color: var(--admin-text-faint);
  font-size: 0.75rem;
}

/* === Page Header === */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.page-header h2, .page-header h3 { font-weight: 600; }

.header-actions { display: flex; gap: 0.5rem; align-items: center; }

/* Active checkbox in page header */
.header-active-toggle { margin: 0 !important; }
.header-active-toggle input[type="checkbox"] {
  width: 38px !important;
  height: 38px !important;
  border-color: var(--admin-primary) !important;
}
.header-active-toggle input[type="checkbox"]:checked {
  background: var(--admin-primary) !important;
  border-color: var(--admin-primary) !important;
}
.header-active-toggle input[type="checkbox"]:checked::after {
  left: 13px !important;
  top: 6px !important;
  width: 8px !important;
  height: 16px !important;
  border-color: #fff !important;
  border-width: 0 3px 3px 0 !important;
}

.page-header > div:first-child {
  font-size: 0.9rem;
  color: var(--admin-text-muted);
}
.breadcrumb { color: var(--admin-text-muted); font-size: inherit; }
.breadcrumb:hover { color: var(--admin-primary); }

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid transparent;
  border-radius: 3px;
  cursor: pointer;
  text-decoration: none !important;
  transition: all 0.15s;
  font-family: inherit;
  line-height: 1.4;
}

.btn-primary { background: var(--admin-primary); color: #fff; }
.btn-primary:hover { background: var(--admin-primary-hover); }

.btn-secondary {
  background: var(--admin-card);
  color: var(--admin-text);
  border-color: var(--admin-border);
}
.btn-secondary:hover { background: var(--admin-card-hover); }

.btn-danger { background: color-mix(in srgb, var(--admin-primary) 70%, #000); color: #fff; }
.btn-danger:hover { background: color-mix(in srgb, var(--admin-primary) 55%, #000); }

.btn-block { display: block; width: 100%; justify-content: center; }

.btn-small { padding: 0.3rem 0.6rem; font-size: 0.8rem; }

.inline-form { display: inline; }

/* === Cards === */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none !important;
  color: var(--admin-text);
  transition: box-shadow 0.15s, border-color 0.15s;
}

.card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  border-color: var(--admin-primary);
}

.card-logo img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 3px;
}

.card-logo-placeholder {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--admin-primary-rgb), 0.12);
  border-radius: 3px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--admin-primary);
}

.card-body h3 { font-size: 1rem; font-weight: 600; }

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  background: var(--admin-subtle-bg);
  border-radius: 3px;
  font-size: 0.75rem;
  color: var(--admin-text-muted);
  margin-top: 0.25rem;
}

/* === Detail === */
.detail-grid { margin-bottom: 1.5rem; }

.detail-card {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  padding: 1.5rem;
}

.detail-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.detail-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 3px;
}

.detail-meta { color: var(--admin-text-muted); font-size: 0.9rem; }
.detail-meta p { margin-bottom: 0.25rem; }

.detail-branding {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 3px;
  display: inline-block;
  border: 1px solid var(--admin-border);
}

.text-muted { color: var(--admin-text-muted); font-size: 0.85rem; }

/* === Table === */
.table-wrap { overflow-x: auto; }

.admin-table {
  width: 100%;
  /* border-collapse: collapse; */
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  overflow: hidden;
}

.admin-table th, .admin-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--admin-border);
}

.admin-table th {
  background: var(--admin-bg-elevated);
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--admin-text-muted);
}

.admin-table tr:last-child td { border-bottom: none; }
.admin-table th:last-child, .admin-table td:last-child { text-align: right; }

.actions-cell { display: flex; gap: 0.4rem; flex-wrap: nowrap; white-space: nowrap; }

.status-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 500;
}
.status-active { background: rgba(34,197,94,0.15); color: #4ade80; }
.status-inactive { background: rgba(239,68,68,0.15); color: #f87171; }

/* === Forms === */
.admin-form {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  padding: 1.5rem;
}

.form-group { margin-bottom: 1rem; }

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
  color: var(--admin-text);
  opacity: 0.6;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="url"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  height: 38px;
  font-size: 0.9rem;
  border: 1px solid var(--admin-border);
  border-radius: 3px;
  font-family: inherit;
  background: var(--admin-bg);
  color: var(--admin-text);
  transition: border-color 0.15s;
}

.form-group textarea {
  height: auto;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px rgba(var(--admin-primary-rgb), 0.15);
}

.form-group select option {
  background: var(--admin-card);
  color: var(--admin-text);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

/* Thematic grouping outline (test) */
.tab-content .form-section {
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.color-input {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.color-input input[type="color"] {
  width: 40px;
  height: 36px;
  border: 1px solid var(--admin-border);
  border-radius: 3px;
  cursor: pointer;
  padding: 2px;
  background: var(--admin-bg);
}

.color-input input[type="text"] { flex: 1; }

.color-input-hex {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.color-input-hex input[type="color"] {
  width: 48px;
  height: 48px;
  border: 1px solid var(--admin-border);
  border-radius: 3px;
  cursor: pointer;
  padding: 2px;
  background: var(--admin-bg);
  flex-shrink: 0;
}

.color-input-hex input[type="text"] {
  flex: 1;
  font-family: monospace;
  letter-spacing: 0.05em;
}

/* Scale input row (Transform tab) */
.scale-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.scale-field {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 1;
}

.scale-field .scale-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--admin-text-muted);
  min-width: 14px;
  text-align: center;
}

.scale-field input[type="number"] {
  width: 100%;
  padding: 0.5rem 0.5rem;
  font-size: 0.9rem;
  border: 1px solid var(--admin-border);
  border-radius: 3px;
  font-family: inherit;
  background: var(--admin-bg);
  color: var(--admin-text);
  transition: border-color 0.15s;
  -moz-appearance: textfield;
}

.scale-field input[type="number"]::-webkit-inner-spin-button,
.scale-field input[type="number"]::-webkit-outer-spin-button {
  opacity: 1;
}

.scale-field input[type="number"]:focus {
  outline: none;
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px rgba(var(--admin-primary-rgb), 0.15);
}

.scale-link-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border: 1px solid var(--admin-border);
  border-radius: 3px;
  background: var(--admin-bg);
  color: var(--admin-text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.scale-link-btn:hover {
  color: var(--admin-text);
  border-color: var(--admin-text-muted);
}

.scale-link-btn.active {
  color: var(--admin-primary);
  border-color: var(--admin-primary);
  background: rgba(var(--admin-primary-rgb), 0.08);
}

.checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: 400 !important;
}

.checkbox-label input[type="checkbox"],
.repeater-row input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--admin-border);
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  display: block;
  box-sizing: border-box;
}
.repeater-row input[type="checkbox"] {
  width: 38px;
  height: 38px;
}
.checkbox-label input[type="checkbox"]:checked,
.repeater-row input[type="checkbox"]:checked {
  background: var(--admin-bg);
  border-color: var(--admin-border);
}
.checkbox-label input[type="checkbox"]:checked::after,
.repeater-row input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 7px;
  top: 3px;
  width: 5px;
  height: 10px;
  border: solid var(--admin-text);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.repeater-row input[type="checkbox"]:checked::after {
  left: 13px;
  top: 6px;
  width: 8px;
  height: 16px;
  border-width: 0 3px 3px 0;
}

.form-hint {
  font-size: 0.85rem;
  color: var(--admin-text-muted);
  margin-bottom: 1rem;
}
.tooltip-wrap {
  display: inline-block;
  position: relative;
  cursor: help;
  font-size: 0.95em;
  color: var(--admin-text-muted);
  margin-left: 4px;
}
.tooltip-wrap:hover { color: var(--admin-primary); }
.tooltip-text {
  display: none;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  background: #000000;
  opacity: 1;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.4;
  padding: 8px 12px;
  border-radius: 6px;
  width: 300px;
  white-space: normal;
  z-index: 10000;
  pointer-events: none;
}
.tooltip-wrap:hover .tooltip-text { display: block; }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--admin-border);
}

/* === Tabs === */
.tabs-wrap {
  position: relative;
  margin: -1.5rem -1.5rem 0 -1.5rem;
}

.tabs-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 32px;
  background: linear-gradient(to right, transparent, #181818);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.tabs-wrap.has-overflow::after { opacity: 1; }

.tabs {
  display: flex;
  gap: 0.35rem;
  padding: 1.5rem 1.5rem 0 1.5rem;
  background: #181818;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar { display: none; }

.tab {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  border: none;
  background: rgba(255,255,255,0.06);
  border-radius: 3px 3px 0 0;
  cursor: pointer;
  color: var(--admin-text-muted);
  white-space: nowrap;
  font-family: inherit;
  transition: color 0.15s, background 0.15s;
}

.tab:hover { color: var(--admin-text); background: rgba(255,255,255,0.06); }
.tab.active { color: var(--admin-primary); background: var(--admin-card); }
.tab.tab-highlight { border-top: 3px solid rgba(var(--admin-primary-rgb), 0.5); display: inline-flex; align-items: center; gap: 0.35rem; }
.tab.tab-highlight.active { border-top-color: var(--admin-primary); }
.tab.tab-highlight svg { width: 14px; height: 14px; }

.tab-content { display: none; padding-top: 1.5rem; }
.tab-content.active { display: block; }
.tab-content h4 { font-size: 0.85rem; font-weight: 500; text-transform: uppercase; opacity: 0.4; padding-bottom: 15px; }

/* === Alerts === */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 3px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.alert-error { background: rgba(239,68,68,0.12); color: #f87171; border: 1px solid rgba(239,68,68,0.25); }

.empty-state {
  text-align: center;
  padding: 0.2rem 0 1.5rem 0;
  color: var(--admin-text-muted);
}

/* === Upload === */
.upload-area {
  border: 2px dashed var(--admin-border);
  border-radius: var(--admin-radius);
  padding: 1.5rem;
  text-align: center;
  transition: border-color 0.15s;
  margin-bottom: 25px;
}

.upload-area.dragover { border-color: var(--admin-primary); background: rgba(var(--admin-primary-rgb), 0.05); }

.upload-area .upload-preview {
  max-width: 120px;
  max-height: 80px;
  margin-bottom: 0.5rem;
  border-radius: 3px;
}

.upload-hint { font-size: 0.8rem; color: var(--admin-text-muted); margin-top: 0.5rem; transition: all 0.2s ease; }
.upload-hint.upload-error { background: #dc2626; color: #fff; padding: 0.5rem 1rem; border-radius: 6px; font-weight: 600; }

/* Upload progress bar */
.upload-progress {
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.upload-progress-track {
  flex: 1;
  height: 6px;
  background: var(--admin-border);
  border-radius: 3px;
  overflow: hidden;
}

.upload-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--admin-primary);
  border-radius: 3px;
  transition: width 0.15s ease;
}

.upload-progress-text {
  font-size: 0.8rem;
  color: var(--admin-text-muted);
  white-space: nowrap;
  min-width: 60px;
}

.file-input {
  display: block;
  margin: 0 auto;
  font-size: 0.85rem;
  color: var(--admin-text-muted);
}

.asset-list {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.asset-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.6rem;
  background: var(--admin-subtle-bg);
  border-radius: 3px;
  font-size: 0.8rem;
  color: var(--admin-text-muted);
}

.asset-chip button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--admin-danger);
  font-size: 1rem;
  line-height: 1;
  padding: 0;
}

/* === Media Picker Input === */
.media-picker-input {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.media-picker-input input[type="text"] {
  flex: 1;
}

.media-picker-btn {
  white-space: nowrap;
  flex-shrink: 0;
}

/* === Media Toolbar === */
.media-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin-bottom: 25px;
}

.media-search-input {
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  border: 1px solid var(--admin-border);
  border-radius: 3px;
  font-family: inherit;
  background: var(--admin-bg);
  color: var(--admin-text);
  width: 250px;
}

.media-search-input:focus {
  outline: none;
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px rgba(var(--admin-primary-rgb), 0.15);
}

.media-tag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* === Tag Chips === */
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
}

.tag-chip:hover { opacity: 0.8; }

.tag-chip.active {
  box-shadow: 0 0 0 2px var(--admin-primary);
}

.tag-chip-filetype { background: rgba(59,130,246,0.15); color: #60a5fa; }
.tag-chip-custom { background: rgba(234,179,8,0.15); color: #facc15; }

.tag-chip .tag-remove {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  padding: 0;
  color: inherit;
  opacity: 0.6;
}

.tag-chip .tag-remove:hover { opacity: 1; }

/* === Media Grid === */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.media-card {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  overflow: hidden;
  transition: box-shadow 0.15s, border-color 0.15s;
  display: flex;
  flex-direction: column;
}

.media-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  border-color: var(--admin-primary);
}

.media-card-thumb {
  width: 100%;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--admin-bg-elevated);
  overflow: hidden;
}

.media-card-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.media-card-thumb .media-icon {
  font-size: 2.5rem;
  color: var(--admin-text-faint);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* GLB 3D + Video thumbnails */
.glb-thumb, .video-thumb {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.glb-thumb-loading, .video-thumb-loading {
  width: 48px;
  height: 48px;
  animation: thumbPulse 1.2s ease-in-out infinite;
}
@keyframes thumbPulse {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.5; }
}

.media-card-body {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.media-card-filename {
  font-size: 0.85rem;
  font-weight: 500;
  word-break: break-all;
  margin-bottom: 0.25rem;
}

.media-card-size {
  font-size: 0.75rem;
  color: var(--admin-text-muted);
  margin-bottom: 0.5rem;
}

.media-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.5rem;
}

.media-card-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: auto;
  padding-top: 0.5rem;
}

.media-card-actions-row {
  display: flex;
  gap: 0.35rem;
}

.media-card-actions-row .btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.35rem 0.4rem;
  font-size: 0.78rem;
  white-space: nowrap;
}

/* === Modal Overlay === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-dialog {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  padding: 1.5rem;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--admin-shadow-heavy);
}

.modal-dialog h3 {
  margin-bottom: 1rem;
  font-weight: 600;
}

.modal-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  border: 1px solid var(--admin-border);
  border-radius: 3px;
  font-family: inherit;
  background: var(--admin-bg);
  color: var(--admin-text);
}

.modal-input:focus {
  outline: none;
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px rgba(var(--admin-primary-rgb), 0.15);
}

.modal-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* === Loading Overlay === */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  gap: 1rem;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: loadingSpin 0.8s linear infinite;
}

.loading-text {
  color: #fff;
  font-size: 14px;
  font-weight: 500;
}

@keyframes loadingSpin {
  to { transform: rotate(360deg); }
}

/* === Media Picker Modal (large) === */
.picker-modal-dialog {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  padding: 1.5rem;
  width: 100%;
  max-width: 800px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--admin-shadow-heavy);
}

.picker-modal-dialog h3 {
  margin-bottom: 1rem;
  font-weight: 600;
}

.picker-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

.picker-toolbar input[type="text"] {
  padding: 0.4rem 0.7rem;
  font-size: 0.85rem;
  border: 1px solid var(--admin-border);
  border-radius: 3px;
  font-family: inherit;
  width: 200px;
  background: var(--admin-bg);
  color: var(--admin-text);
}

.picker-toolbar input[type="text"]:focus {
  outline: none;
  border-color: var(--admin-primary);
}

.picker-grid-wrap {
  flex: 1;
  overflow-y: auto;
  min-height: 200px;
}

.picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.picker-card {
  background: var(--admin-bg-elevated);
  border: 2px solid var(--admin-border);
  border-radius: 3px;
  padding: 0.5rem;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.picker-card:hover {
  border-color: var(--admin-primary);
  box-shadow: 0 2px 8px rgba(var(--admin-primary-rgb), 0.2);
}

.picker-card-thumb {
  width: 100%;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.4rem;
  overflow: hidden;
}

.picker-card-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.picker-card-thumb .media-icon {
  font-size: 1.5rem;
  color: var(--admin-text-muted);
  font-weight: 700;
  text-transform: uppercase;
}

.picker-card-name {
  font-size: 0.75rem;
  word-break: break-all;
  color: var(--admin-text-muted);
}

.picker-upload-area {
  border: 2px dashed var(--admin-border);
  border-radius: 3px;
  padding: 0.75rem;
  text-align: center;
  margin-bottom: 1rem;
  transition: border-color 0.15s;
}

.picker-upload-area.dragover {
  border-color: var(--admin-primary);
  background: rgba(var(--admin-primary-rgb), 0.05);
}

.picker-upload-area .file-input {
  display: block;
  margin: 0 auto;
  font-size: 0.8rem;
}

.picker-upload-area .upload-hint {
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

/* === Stats Dashboard === */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  padding: 1.25rem;
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--admin-primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--admin-text-muted);
  margin-top: 0.25rem;
}

.stats-section {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.stats-section h4 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--admin-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Bar chart (pure CSS) */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 120px;
  padding-top: 0.5rem;
}

.bar-chart .bar {
  flex: 1;
  min-width: 4px;
  background: var(--admin-primary);
  border-radius: 2px 2px 0 0;
  position: relative;
  transition: opacity 0.15s;
  cursor: default;
}

.bar-chart .bar:hover { opacity: 0.8; }

.bar-chart .bar .bar-tooltip {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--admin-bg-elevated);
  border: 1px solid var(--admin-border);
  border-radius: 3px;
  padding: 0.25rem 0.5rem;
  font-size: 0.7rem;
  white-space: nowrap;
  z-index: 10;
  pointer-events: none;
}

.bar-chart .bar:hover .bar-tooltip { display: block; }

/* Device distribution bar */
.device-bar {
  display: flex;
  height: 32px;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.device-bar .device-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 500;
  color: #fff;
  min-width: 30px;
  transition: flex 0.3s;
}

.device-bar .device-mobile { background: #3b82f6; }
.device-bar .device-tablet { background: #8b5cf6; }
.device-bar .device-desktop { background: #06b6d4; }

.device-legend {
  display: flex;
  gap: 1.5rem;
  font-size: 0.8rem;
  color: var(--admin-text-muted);
}

.device-legend span::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 0.4rem;
  vertical-align: middle;
}

.device-legend .leg-mobile::before { background: #3b82f6; }
.device-legend .leg-tablet::before { background: #8b5cf6; }
.device-legend .leg-desktop::before { background: #06b6d4; }

/* Referrer mini table */
.referrer-table {
  width: 100%;
  font-size: 0.85rem;
}

.referrer-table td {
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--admin-border);
}

.referrer-table tr:last-child td { border-bottom: none; }

.referrer-table .ref-url {
  color: var(--admin-text-muted);
  word-break: break-all;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.referrer-table .ref-count {
  text-align: right;
  font-weight: 600;
  white-space: nowrap;
}

/* Share link inline form */
.share-create-form {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
}

.share-create-form .form-group {
  margin-bottom: 0;
}

.share-create-form .form-group label {
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
}

.share-create-form input[type="text"],
.share-create-form input[type="number"] {
  padding: 0.45rem 0.7rem;
  font-size: 0.85rem;
  border: 1px solid var(--admin-border);
  border-radius: 3px;
  background: var(--admin-bg);
  color: var(--admin-text);
  font-family: inherit;
}

.share-create-form input:focus {
  outline: none;
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px rgba(var(--admin-primary-rgb), 0.15);
}

/* Copy button */
.btn-copy {
  background: none;
  border: 1px solid var(--admin-border);
  color: var(--admin-text-muted);
  border-radius: 3px;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.btn-copy:hover { border-color: var(--admin-primary); color: var(--admin-primary); }
.btn-copy.copied { border-color: var(--admin-success); color: var(--admin-success); }

/* Toggle switch */
.toggle-switch {
  position: relative;
  width: 36px;
  height: 20px;
  display: inline-block;
  vertical-align: middle;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--admin-border);
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--admin-success);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(16px);
}

/* Short URL display */
.short-url {
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--admin-primary);
  word-break: break-all;
}

/* Stats panel */
.stats-panel {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--admin-border);
}

/* === Role Badges === */
.role-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 500;
}

.role-super-admin {
  background: rgba(234,179,8,0.15);
  color: #facc15;
}

.role-tenant-user {
  background: rgba(59,130,246,0.15);
  color: #60a5fa;
}

.role-reader {
  background: rgba(72,187,120,0.15);
  color: #48bb78;
}

/* === Tenant Checkbox List === */
.tenant-checkbox-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--admin-bg);
  border: 1px solid var(--admin-border);
  border-radius: 3px;
  max-height: 300px;
  overflow-y: auto;
}

.tenant-checkbox {
  font-size: 0.9rem !important;
}

/* === Theme Toggle Button === */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s;
}

.theme-toggle:hover { opacity: 0.8; }

.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .theme-icon-dark,
.theme-toggle .theme-icon-light {
  display: none;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--admin-text-muted);
}

/* Global theme-icon visibility (tool logos etc.) */
[data-theme="dark"] .theme-icon-light,
:root:not([data-theme="light"]) .theme-icon-light { display: none; }
[data-theme="light"] .theme-icon-dark { display: none; }
[data-theme="light"] .theme-icon-light { display: block; }

/* Theme toggle button (flex for icon + text) */
[data-theme="dark"] .theme-toggle .theme-icon-dark { display: flex; }
:root:not([data-theme="light"]):not([data-theme="dark"]) .theme-toggle .theme-icon-dark { display: flex; }
[data-theme="light"] .theme-toggle .theme-icon-light { display: flex; }

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-icon-dark { display: none; }
  :root:not([data-theme="dark"]) .theme-icon-light { display: block; }
  :root:not([data-theme="dark"]) .theme-toggle .theme-icon-light { display: flex; }
}

/* Tool header uses theme-aware sidebar vars */

/* === Light-Mode Color Overrides === */
[data-theme="light"] .status-active { color: #16a34a; }
[data-theme="light"] .status-inactive { color: #dc2626; }
[data-theme="light"] .role-super-admin { color: #a16207; }
[data-theme="light"] .role-tenant-user { color: #2563eb; }
[data-theme="light"] .role-reader { color: #2f855a; }
[data-theme="light"] .tag-chip-filetype { color: #2563eb; }
[data-theme="light"] .tag-chip-custom { color: #a16207; }
[data-theme="light"] .card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
[data-theme="light"] .media-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
[data-theme="light"] .alert-error { color: #dc2626; }
[data-theme="light"] .tabs { background: #e0e0e2; }
[data-theme="light"] .tabs-wrap::after { background: linear-gradient(to right, transparent, #e0e0e2); }
[data-theme="light"] .tab:hover { background: rgba(0,0,0,0.06); }

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .status-active { color: #16a34a; }
  :root:not([data-theme="dark"]) .status-inactive { color: #dc2626; }
  :root:not([data-theme="dark"]) .role-super-admin { color: #a16207; }
  :root:not([data-theme="dark"]) .role-tenant-user { color: #2563eb; }
  :root:not([data-theme="dark"]) .role-reader { color: #2f855a; }
  :root:not([data-theme="dark"]) .tag-chip-filetype { color: #2563eb; }
  :root:not([data-theme="dark"]) .tag-chip-custom { color: #a16207; }
  :root:not([data-theme="dark"]) .card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
  :root:not([data-theme="dark"]) .media-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
  :root:not([data-theme="dark"]) .alert-error { color: #dc2626; }
  :root:not([data-theme="dark"]) .tabs { background: #e0e0e2; }
  :root:not([data-theme="dark"]) .tabs-wrap::after { background: linear-gradient(to right, transparent, #e0e0e2); }
  :root:not([data-theme="dark"]) .tab:hover { background: rgba(0,0,0,0.06); }
}

/* === Responsive === */
@media (max-width: 768px) {
  body {
    grid-template-columns: 1fr;
    grid-template-rows: var(--topbar-height) 1fr auto;
    grid-template-areas:
      "topbar"
      "main"
      "footer";
  }

  .sidebar-toggle { display: flex; font-size: 1.6rem; padding: 0.35rem; }
  .sidebar-resize-handle { display: none; }

  .topbar-menu-btn { display: flex; align-items: center; justify-content: center; }

  .topbar-menu {
    display: none;
    position: absolute;
    top: calc(var(--topbar-height) - 8px);
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    padding: 0.5rem 0;
    min-width: 180px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    z-index: 210;
  }

  .topbar-menu.open { display: flex; }

  .topbar-menu .help-btn,
  .topbar-menu .theme-toggle,
  .topbar-menu .topbar-user-dropdown {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 0.6rem;
    font-size: 0.85rem;
    color: var(--admin-text-muted);
    border: none;
    border-radius: 0;
    background: none;
    cursor: pointer;
    text-decoration: none;
  }

  .topbar-menu .help-btn {
    width: 100%;
    height: auto;
    padding: 0.55rem 1rem;
    justify-content: flex-start;
    font-weight: 500;
  }

  .topbar-menu .theme-toggle { padding: 0.55rem 1rem; justify-content: flex-start; }

  .topbar-menu .topbar-user-dropdown {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-menu .topbar-user-btn {
    padding: 0.55rem 1rem;
    color: var(--admin-text-muted);
    font-size: 0.85rem;
  }

  .topbar-menu .topbar-user-menu {
    position: static;
    display: block;
    border: none;
    box-shadow: none;
    padding: 0;
    min-width: 0;
    border-radius: 0;
    background: none;
  }

  .topbar-menu .topbar-user-menu a {
    padding: 0.55rem 1rem 0.55rem 2.5rem;
  }

  .topbar-menu .topbar-user-menu a:last-child {
    border-top: 1px solid var(--admin-border);
    margin-top: 0.25rem;
    padding-top: 0.65rem;
  }

  .topbar-menu .dropdown-chevron { display: none; }

  .admin-sidebar {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    height: auto;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 150;
  }

  .admin-sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.open {
    display: block;
  }

  .admin-main { padding: 1.5rem 1rem; }

  .page-header { flex-direction: column; align-items: flex-start; }
  .form-row { grid-template-columns: 1fr; }
  .tabs-wrap { margin: -1.5rem -1rem 0 -1rem; }
  .tabs { gap: 0.25rem; padding: 1.5rem 1rem 0 1rem; }
  .tab { padding: 0.5rem 0.6rem; font-size: 0.8rem; flex-shrink: 0; }
  .media-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .picker-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .media-toolbar { flex-direction: column; align-items: stretch; }
  .media-search-input { width: 100%; }
  .picker-modal-dialog { max-width: 100%; max-height: 90vh; }
}

/* Hide hamburger on desktop */
@media (min-width: 769px) {
  .sidebar-toggle { display: none; }
}

/* === Help Panel === */
.help-btn {
  background: none;
  border: none;
  color: #8c8c8c;
  width: 24px; height: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  padding: 0;
}
.help-btn svg { width: 18px; height: 18px; }

.help-btn:hover { color: #fff; border-color: rgba(255,255,255,0.5); }

.help-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 290;
}

.help-overlay.open { display: block; }

.help-panel {
  position: fixed;
  top: var(--topbar-height);
  right: 0;
  bottom: 0;
  width: 380px;
  background: var(--admin-card);
  border-left: 1px solid var(--admin-border);
  z-index: 300;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(0,0,0,0.15);
}

.help-panel.open { transform: translateX(0); }

.help-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--admin-border);
  flex-shrink: 0;
}

.help-panel-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--admin-text);
}

.help-panel-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--admin-text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0 0.25rem;
  transition: color 0.15s;
}

.help-panel-close:hover { color: var(--admin-text); }

.help-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
}

.help-panel-body::-webkit-scrollbar { width: 4px; }
.help-panel-body::-webkit-scrollbar-track { background: transparent; }
.help-panel-body::-webkit-scrollbar-thumb { background: var(--admin-border); border-radius: 2px; }

.help-topic-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--admin-text);
  margin-bottom: 0.75rem;
}

.help-intro {
  font-size: 0.85rem;
  color: var(--admin-text-muted);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.help-intro p { margin-bottom: 0.5rem; }
.help-intro p:last-child { margin-bottom: 0; }

/* Help sections (accordion) */
.help-section {
  border: 1px solid var(--admin-border);
  border-radius: 3px;
  margin-bottom: 0.5rem;
  overflow: hidden;
}

.help-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: var(--admin-bg-elevated);
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--admin-text);
  font-family: inherit;
  text-align: left;
  transition: background 0.12s;
}

.help-section-toggle:hover { background: var(--admin-card-hover); }

.help-section-arrow {
  font-size: 0.55rem;
  color: var(--admin-text-faint);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.help-section.open .help-section-arrow { transform: rotate(180deg); }

.help-section-content {
  display: none;
  padding: 0.75rem 0.85rem;
  font-size: 0.83rem;
  color: var(--admin-text-muted);
  line-height: 1.65;
  border-top: 1px solid var(--admin-border);
}

.help-section.open .help-section-content { display: block; }

.help-section-content p { margin-bottom: 0.5rem; }
.help-section-content p:last-child { margin-bottom: 0; }

.help-section-content ul {
  margin: 0.35rem 0 0.5rem 1.25rem;
  list-style: disc;
}

.help-section-content li { margin-bottom: 0.25rem; }

.help-section-content strong { color: var(--admin-text); }

.help-section-content .help-img {
  display: block;
  width: 100%;
  border-radius: 3px;
  border: 1px solid var(--admin-border);
  margin: 0.5rem 0;
}

/* All topics list */
.help-topic-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  font-size: 0.85rem;
  color: var(--admin-text-muted);
  text-decoration: none !important;
  border-radius: 3px;
  transition: background 0.12s, color 0.12s;
  margin-bottom: 0.2rem;
}

.help-topic-link:hover { background: var(--admin-hover-bg); color: var(--admin-text); }

.help-topic-link.current { color: var(--admin-text); font-weight: 500; }

.help-topic-current-badge {
  font-size: 0.7rem;
  color: var(--admin-primary);
  background: var(--admin-primary-faint);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-weight: 500;
}

/* Footer */
.help-panel-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--admin-border);
  flex-shrink: 0;
}

.help-footer-btn {
  width: 100%;
  padding: 0.5rem;
  background: var(--admin-bg);
  border: 1px solid var(--admin-border);
  border-radius: 3px;
  color: var(--admin-text-muted);
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}

.help-footer-btn:hover { color: var(--admin-text); border-color: var(--admin-text-muted); }

.help-footer-tour-btn {
  background: var(--admin-primary-faint);
  color: var(--admin-primary);
  border-color: transparent;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.help-footer-tour-btn:hover { color: var(--admin-primary); border-color: var(--admin-primary); }

/* Responsive */
@media (max-width: 768px) {
  .help-panel { width: 100%; }
}

/* =============================================
   CONFIGURATOR INSPECTOR PANEL
   ============================================= */
.cfg-mockup-container {
  cursor: default;
}

.cfg-editor-row {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
}

.cfg-inspector {
  width: 0;
  min-width: 0;
  background: rgba(15, 15, 25, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 0 12px 12px 0;
  margin-left: 0;
  transition: width 0.25s ease, margin-left 0.25s ease, opacity 0.2s ease;
  display: flex;
  flex-direction: column;
  color: #ccc;
  font-size: 11px;
  overflow: hidden;
  opacity: 0;
}

.cfg-inspector.open {
  width: 280px;
  margin-left: 8px;
  opacity: 1;
  align-self: stretch;
}

.cfg-inspector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.cfg-inspector-close-btn {
  background: none;
  border: none;
  color: #888;
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.cfg-inspector-close-btn:hover { color: #fff; }

.cfg-inspector-body {
  flex: 1;
  overflow-y: auto;
  padding: 6px 10px 10px;
}

.cfg-inspector-body::-webkit-scrollbar { width: 3px; }
.cfg-inspector-body::-webkit-scrollbar-track { background: transparent; }
.cfg-inspector-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

.cfg-inspector-section {
  margin-bottom: 8px;
}

.cfg-inspector-section-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.4);
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 6px;
}

/* Mini fields */
.mini-field {
  margin-bottom: 6px;
}

.mini-field-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
}

.mini-field-inline .mini-input {
  width: 60px;
  text-align: right;
}

.mini-label {
  font-size: 10px;
  color: rgba(255,255,255,0.5);
  display: block;
  margin-bottom: 2px;
}

.mini-field-inline .mini-label {
  margin-bottom: 0;
  flex: 1;
}

.mini-input {
  width: 100%;
  height: 26px;
  padding: 2px 6px;
  font-size: 11px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 3px;
  background: rgba(0,0,0,0.3);
  color: #ddd;
  font-family: inherit;
}

.mini-input:focus {
  outline: none;
  border-color: #4a9eff;
}

.mini-input-hex {
  font-family: monospace;
  letter-spacing: 0.04em;
}

.mini-color-wrap {
  display: flex;
  gap: 4px;
  align-items: center;
}

.mini-color {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 3px;
  cursor: pointer;
  padding: 1px;
  background: rgba(0,0,0,0.3);
  flex-shrink: 0;
}

.mini-color-wrap .mini-input-hex {
  flex: 1;
}

.mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

/* Inspector two-column layout */
.cfg-inspector-columns {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.cfg-inspector-col {
  flex: 1;
  min-width: 0;
}

.cfg-inspector-col .mini-color-wrap .mini-input-hex {
  width: 50px;
  flex: 1;
}

/* Mockup Selection */
.mockup-selectable {
  transition: outline 0.15s;
}
.mockup-selectable:hover {
  outline: 1px dashed rgba(100, 150, 255, 0.4);
  outline-offset: -1px;
}
.mockup-selected {
  outline: 2px dashed #4a9eff !important;
  outline-offset: -2px;
}

/* === Login logo === */
.login-logo {
  height: 34px;
  width: auto;
  margin-bottom: 1.75rem;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.45));
}

/* === Consume / Browse view === */
.browse-header {
  margin-bottom: 1.25rem;
}
.browse-header h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.browse-search {
  margin-bottom: 1.75rem;
}
.browse-search-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.browse-search-input {
  position: relative;
  flex: 1 1 320px;
}
.browse-search-icon {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.05rem;
  height: 1.05rem;
  color: var(--admin-text-muted);
  pointer-events: none;
}
.browse-search-input input {
  width: 100%;
  padding: 0.7rem 0.9rem 0.7rem 2.5rem;
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  color: var(--admin-text);
  font-size: 0.95rem;
}
.browse-search-input input:focus {
  outline: none;
  border-color: var(--admin-primary);
}
.browse-search-select {
  flex: 0 1 200px;
  padding: 0.7rem 0.9rem;
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  color: var(--admin-text);
  font-size: 0.95rem;
}
.browse-active-tag {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--admin-text-muted);
}
.browse-clear {
  font-size: 0.85rem;
}

.browse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}
.browse-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  padding: 1.25rem;
  text-decoration: none !important;
  color: var(--admin-text);
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s;
}
.browse-card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
  border-color: var(--admin-primary);
  transform: translateY(-2px);
}
.browse-card-bereich {
  align-self: flex-start;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--admin-primary);
}
.browse-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
}
.browse-card-excerpt {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--admin-text-muted);
  margin: 0;
}
.browse-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: auto;
  padding-top: 0.3rem;
  font-size: 0.8rem;
  color: var(--admin-text-muted);
}
.browse-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.browse-card-meta i {
  width: 0.9rem;
  height: 0.9rem;
}
.browse-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.browse-empty {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--admin-text-muted);
}
.browse-empty i {
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.5;
}
.browse-empty p {
  margin-bottom: 1rem;
}

/* === Article (read) typography === */
.article-title {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.5rem;
}
.article-lead {
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  padding-left: 1rem;
  border-left: 3px solid var(--admin-primary);
}

/* === Rendered Markdown === */
.markdown-body {
  line-height: 1.75;
  word-break: break-word;
}
.markdown-body > *:first-child { margin-top: 0; }
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  font-weight: 700;
  line-height: 1.3;
  margin: 1.6rem 0 0.6rem;
}
.markdown-body h1 { font-size: 1.5rem; }
.markdown-body h2 { font-size: 1.3rem; }
.markdown-body h3 { font-size: 1.12rem; }
.markdown-body h4 { font-size: 1rem; }
.markdown-body p { margin: 0 0 1rem; }
.markdown-body ul,
.markdown-body ol {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
}
.markdown-body li { margin-bottom: 0.35rem; }
.markdown-body a {
  color: var(--admin-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.markdown-body blockquote {
  margin: 0 0 1rem;
  padding: 0.5rem 1rem;
  border-left: 3px solid var(--admin-border);
  color: var(--admin-text-muted);
}
.markdown-body blockquote p { margin: 0; }
.markdown-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
  background: var(--admin-primary-faint);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
}
.markdown-body pre {
  background: var(--admin-bg-elevated);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  padding: 1rem;
  overflow-x: auto;
  margin: 0 0 1rem;
}
.markdown-body pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
}
.markdown-body hr {
  border: none;
  border-top: 1px solid var(--admin-border);
  margin: 1.5rem 0;
}

/* === Sicherheitslevel === */
.level-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  background: var(--admin-primary-faint);
  color: var(--admin-primary);
  border: 1px solid rgba(var(--admin-primary-rgb), 0.35);
  white-space: nowrap;
}
.level-chip i { width: 0.8rem; height: 0.8rem; }

.level-hint {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--admin-primary-faint);
  border: 1px solid rgba(var(--admin-primary-rgb), 0.4);
  color: var(--admin-text);
  padding: 0.7rem 1rem;
  border-radius: var(--admin-radius);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}
.level-hint i { width: 1rem; height: 1rem; color: var(--admin-primary); flex-shrink: 0; }

.settings-section {
  border-top: 1px solid var(--admin-border);
  margin-top: 1.75rem;
  padding-top: 1.5rem;
}
.settings-section-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.seclevel-list { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.4rem; }
.seclevel-row { display: flex; align-items: center; gap: 0.6rem; }
.seclevel-rank {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.72rem;
  color: var(--admin-text-muted);
  min-width: 4.5rem;
}
.seclevel-row input { flex: 1; max-width: 300px; }
.seclevel-remove { flex-shrink: 0; line-height: 1; padding: 0.2rem 0.55rem; font-size: 1rem; }
