/* ============================================================
   IIPN Admin — Design System
   ============================================================ */

/* CSS Variables — dark mode default */
:root {
  --admin-bg:            #0F172A;
  --admin-surface:       #1E293B;
  --admin-surface-2:     #0F172A;
  --admin-border:        rgba(255, 255, 255, 0.06);
  --admin-primary:       #7C3AED;
  --admin-primary-light: #A78BFA;
  --admin-success:       #10B981;
  --admin-warning:       #F97316;
  --admin-danger:        #EF4444;
  --admin-info:          #3B82F6;
  --admin-text:          #F1F5F9;
  --admin-muted:         #64748B;
  --admin-subtle:        #334155;
  --sidebar-width:       220px;
  --sidebar-collapsed:   48px;
  --topbar-height:       56px;

  /* Chrome = sidebar + topbar + sidebar-footer (shared "app frame" kleur) */
  --admin-chrome:         #1E293B;
  --admin-chrome-text:    #F1F5F9;
  --admin-chrome-muted:   #94A3B8;
  --admin-chrome-border:  rgba(255, 255, 255, 0.08);
  --admin-chrome-hover:   rgba(255, 255, 255, 0.06);
  --admin-tab-inactive:   #94A3B8;
}

/* Light mode override — sidebar/topbar/footer lopen mee met light theme */
[data-mode="light"] {
  --admin-bg:       #F8FAFC;
  --admin-surface:  #FFFFFF;
  --admin-surface-2:#F1F5F9;
  --admin-border:   #E2E8F0;
  --admin-text:     #0F172A;
  --admin-muted:    #64748B;
  --admin-subtle:   #CBD5E1;

  /* Chrome: iets lichter dan surface-2, maar niet wit — geeft "app frame" gevoel */
  --admin-chrome:         #E2E8F0;
  --admin-chrome-text:    #0F172A;
  --admin-chrome-muted:   #475569;
  --admin-chrome-border:  #CBD5E1;
  --admin-chrome-hover:   rgba(15, 23, 42, 0.06);
  --admin-tab-inactive:   #475569;
}

/* ─── Base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Fira Sans', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  background: var(--admin-bg);
  color: var(--admin-text);
  margin: 0;
}

h1, h2, h3, h4, h5, h6, .font-mono, .kpi-value {
  font-family: 'Fira Code', monospace;
}

a { color: var(--admin-primary-light); }

/* ─── Layout ────────────────────────────────────────────────── */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--admin-bg);
}

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

/* ─── Sidebar ───────────────────────────────────────────────── */
.admin-sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--admin-chrome);
  border-right: 1px solid var(--admin-chrome-border);
  display: flex;
  flex-direction: column;
  transition: width 200ms ease;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-collapsed .admin-sidebar { width: var(--sidebar-collapsed); }

.sidebar-logo-area {
  padding: 16px 12px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--admin-chrome-border);
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-logo-area img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  flex-shrink: 0;
  object-fit: contain;
  background: var(--admin-chrome-hover);
}

.sidebar-logo-text {
  font-family: 'Fira Code', monospace;
  font-weight: 700;
  font-size: 14px;
  color: var(--admin-chrome-text);
}

.sidebar-collapsed .sidebar-logo-text { display: none; }

.sidebar-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--admin-chrome-muted);
  padding: 12px 12px 4px;
  white-space: nowrap;
  overflow: hidden;
  display: block;
}

.sidebar-collapsed .sidebar-section-label { opacity: 0; }

/* Collapsible group toggle button */
button.sidebar-group-toggle {
  background: none;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  color: inherit;
}
button.sidebar-group-toggle:hover { color: var(--admin-chrome-text); }
.group-chevron { transition: transform 0.2s; flex-shrink: 0; opacity: 0.6; }
.sidebar-group.collapsed .group-chevron { transform: rotate(-90deg); }
.sidebar-group.collapsed .sidebar-group-items { display: none; }
.sidebar-group-items { display: block; }

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  color: var(--admin-chrome-muted);
  text-decoration: none;
  border-radius: 6px;
  margin: 2px 8px;
  font-size: 13px;
  font-weight: 500;
  transition: background 150ms, color 150ms;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
}

.sidebar-nav-item:hover  { background: var(--admin-chrome-hover); color: var(--admin-chrome-text); }
.sidebar-nav-item.active { background: rgba(124,58,237,0.2);       color: #A78BFA; }
[data-mode="light"] .sidebar-nav-item.active { background: rgba(124,58,237,0.14); color: #6D28D9; }

.sidebar-nav-item svg    { flex-shrink: 0; width: 16px; height: 16px; }
.sidebar-nav-item .nav-label { flex: 1; }
.sidebar-collapsed .sidebar-nav-item .nav-label { opacity: 0; width: 0; }

.sidebar-badge {
  background: var(--admin-warning);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 9px;
  min-width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-collapsed .sidebar-badge { display: none; }

.sidebar-footer {
  margin-top: auto;
  padding: 14px 14px 16px;
  border-top: 1px solid var(--admin-chrome-border);
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  overflow: hidden;
  position: sticky;
  bottom: 0;
  background: var(--admin-chrome);
  z-index: 1;
}

.admin-sidebar nav { padding-bottom: 12px; }

.sidebar-footer-avatar {
  width: 28px;
  height: 28px;
  background: var(--admin-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-footer-text { flex: 1; overflow: hidden; line-height: 1.4; }
.sidebar-footer-text a:hover { color: var(--admin-chrome-text) !important; }
.sidebar-collapsed .sidebar-footer-text { display: none; }

/* ─── Topbar ────────────────────────────────────────────────── */
.admin-topbar {
  height: var(--topbar-height);
  background: var(--admin-chrome);
  border-bottom: 1px solid var(--admin-chrome-border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}
/* Topbar select (reseller filter): leest op chrome in beide modes */
.admin-topbar-select { color: var(--admin-chrome-text); background: transparent; }
.admin-topbar-select option {
  background: var(--admin-chrome);
  color: var(--admin-chrome-text);
}

.sidebar-toggle-btn,
.mode-toggle-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--admin-chrome-hover);
  border: 1px solid var(--admin-chrome-border);
  color: var(--admin-chrome-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 150ms;
  flex-shrink: 0;
}

.sidebar-toggle-btn:hover,
.mode-toggle-btn:hover {
  background: var(--admin-chrome-hover);
  color: var(--admin-chrome-text);
  filter: brightness(1.1);
}

.admin-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--admin-chrome-muted);
}

.admin-breadcrumb a          { color: var(--admin-chrome-muted); text-decoration: none; }
.admin-breadcrumb a:hover    { color: var(--admin-chrome-text); }
.admin-breadcrumb .current   { color: var(--admin-chrome-text); }

/* ─── Einstein / admin tabs ─────────────────────────────────── */
.admin-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--admin-border);
  flex-wrap: wrap;
}
.admin-tab {
  padding: 10px 20px;
  text-decoration: none;
  color: var(--admin-tab-inactive);
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s;
}
.admin-tab:hover { color: var(--admin-text); }
.admin-tab.active {
  color: var(--admin-primary-light);
  border-bottom-color: var(--admin-primary-light);
}
[data-mode="light"] .admin-tab.active {
  color: var(--admin-primary);
  border-bottom-color: var(--admin-primary);
}

/* ─── Page header ───────────────────────────────────────────── */
.admin-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.admin-page-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--admin-text);
  margin: 0;
  font-family: 'Fira Code', monospace;
}

/* ─── KPI cards ─────────────────────────────────────────────── */
.kpi-card {
  background: var(--admin-surface);
  border-radius: 10px;
  padding: 20px;
  border-top: 3px solid var(--admin-primary);
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  color: var(--admin-text);
  font-family: 'Fira Code', monospace;
}

.kpi-label {
  font-size: 12px;
  color: var(--admin-muted);
  margin-top: 4px;
}

/* ─── Data table ─────────────────────────────────────────────── */
.admin-table-wrapper {
  background: var(--admin-surface);
  border-radius: 10px;
  overflow: hidden;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table thead th {
  background: var(--admin-surface-2);
  color: var(--admin-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 14px;
  border-bottom: 1px solid var(--admin-border);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.admin-table thead th:hover  { color: var(--admin-text); }

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

.admin-table tbody tr:last-child td  { border-bottom: none; }
.admin-table tbody tr:hover td       { background: rgba(255,255,255,0.02); }

/* ─── Filter bar ─────────────────────────────────────────────── */
.admin-filterbar {
  background: var(--admin-surface);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ─── Status badges ──────────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
}

.status-badge-success { background: rgba(16,185,129,0.15);  color: #10B981; }
.status-badge-warning { background: rgba(249,115,22,0.15);  color: #F97316; }
.status-badge-danger  { background: rgba(239,68,68,0.15);   color: #EF4444; }
.status-badge-muted   { background: rgba(100,116,139,0.15); color: #64748B; }

/* ─── Buttons ────────────────────────────────────────────────── */
.btn-admin-primary {
  background: var(--admin-primary);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 150ms;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Fira Sans', sans-serif;
}
.btn-admin-primary:hover { background: #6D28D9; color: white; }

.btn-admin-secondary {
  background: transparent;
  color: var(--admin-primary-light);
  border: 1px solid var(--admin-primary);
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 150ms;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Fira Sans', sans-serif;
}
.btn-admin-secondary:hover { background: rgba(124,58,237,0.1); color: var(--admin-primary-light); }

.btn-admin-danger {
  background: var(--admin-danger);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 150ms;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Fira Sans', sans-serif;
}
.btn-admin-danger:hover { background: #DC2626; color: white; }

.btn-icon {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--admin-border);
  background: transparent;
  color: var(--admin-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 150ms;
  text-decoration: none;
}
.btn-icon:hover             { border-color: var(--admin-primary); color: var(--admin-primary-light); }
.btn-icon.danger:hover      { border-color: var(--admin-danger);  color: var(--admin-danger); }

/* ─── Form controls ──────────────────────────────────────────── */
.admin-input {
  background: var(--admin-surface-2);
  border: 1px solid var(--admin-border);
  color: var(--admin-text);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-family: 'Fira Sans', sans-serif;
  transition: border-color 150ms;
}
.admin-input:focus       { outline: none; border-color: var(--admin-primary); }
.admin-input::placeholder { color: var(--admin-muted); }

select.admin-input { cursor: pointer; }

.admin-label {
  font-size: 12px;
  color: var(--admin-muted);
  display: block;
  margin-bottom: 4px;
  font-weight: 500;
}

/* ─── Pagination ─────────────────────────────────────────────── */
.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-top: 1px solid var(--admin-border);
  font-size: 12px;
  color: var(--admin-muted);
}

.pagination-pages { display: flex; gap: 4px; }

.pagination-pages a,
.pagination-pages span {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 12px;
  text-decoration: none;
  color: var(--admin-muted);
  border: 1px solid transparent;
}
.pagination-pages a:hover { background: rgba(255,255,255,0.05); color: var(--admin-text); }
.pagination-pages .active { background: var(--admin-primary); color: white; border-color: var(--admin-primary); }

/* ─── Bulk action bar ────────────────────────────────────────── */
.bulk-bar {
  display: none;
  background: var(--admin-primary);
  color: white;
  padding: 10px 16px;
  border-radius: 8px 8px 0 0;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
.bulk-bar.visible { display: flex; }

/* ─── Card / surface ─────────────────────────────────────────── */
.admin-card {
  background: var(--admin-surface);
  border-radius: 10px;
  border: 1px solid var(--admin-border);
  padding: 20px;
}

/* ─── Impersonation Banner ──────────────────────────────────────────────────── */
.impersonation-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #1c1917;
  font-size: 13px;
  font-weight: 500;
  padding: 0 20px;
  height: 40px;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.impersonation-banner-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}
.impersonation-exit-btn {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,0,0,.12);
  border: 1px solid rgba(0,0,0,.18);
  color: #1c1917;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s;
}
.impersonation-exit-btn:hover {
  background: rgba(0,0,0,.22);
}

/* Offset all fixed elements when impersonating */
body.impersonating .admin-topbar {
  top: 40px;
}
body.impersonating .admin-sidebar {
  top: 40px;
  height: calc(100vh - 40px);
}
body.impersonating .admin-main {
  padding-top: 40px;
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  body { font-size: 16px; }
  .admin-content { padding: 16px; }
  .admin-table-wrapper { overflow-x: auto; }
}
/* ============================================================
   IIPN Admin — Role Preset Selector
   Extends admin.css. Uses existing CSS variables only.
   Append this block to css/admin.css or load separately.
   ============================================================ */

.role-preset-card {
  padding: 0;
  overflow: visible;   /* tooltips may escape the card */
}

.role-preset-header {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--admin-border);
}

.role-preset-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  font-family: 'Fira Code', monospace;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--admin-text);
}

.role-preset-title > i {
  color: var(--admin-primary-light);
  font-size: 14px;
}

.role-preset-sub {
  font-weight: 400;
  font-family: 'Fira Sans', sans-serif;
  color: var(--admin-muted);
  font-size: 12px;
  margin-left: 6px;
}

/* ─── Grid ───────────────────────────────────────────────────── */
.role-preset-grid {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 1200px) {
  .role-preset-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .role-preset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .role-preset-grid { grid-template-columns: 1fr; }
}

/* ─── Card item ──────────────────────────────────────────────── */
.role-preset-card-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 14px 14px 14px;
  text-align: left;
  background: var(--admin-surface-2);
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  cursor: pointer;
  color: var(--admin-text);
  font-family: 'Fira Sans', sans-serif;
  transition: border-color 150ms ease,
              background 150ms ease,
              transform 120ms ease,
              box-shadow 150ms ease;
  overflow: visible;
}

.role-preset-card-item::before {
  /* subtle accent strip on the left edge, matches kpi-card's top-border vibe */
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: transparent;
  border-radius: 10px 0 0 10px;
  transition: background 150ms ease;
}

.role-preset-card-item:hover {
  border-color: var(--admin-primary);
  background: var(--admin-surface);
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.12);
  transform: translateY(-1px);
}
.role-preset-card-item:hover::before {
  background: var(--admin-primary);
}

.role-preset-card-item:focus-visible {
  outline: none;
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.35);
}

/* ─── Active state ───────────────────────────────────────────── */
.role-preset-card-item.is-active {
  border-color: var(--admin-primary);
  background: linear-gradient(135deg,
              rgba(124, 58, 237, 0.12) 0%,
              rgba(124, 58, 237, 0.04) 100%);
  box-shadow: 0 0 0 1px var(--admin-primary) inset,
              0 6px 20px rgba(124, 58, 237, 0.15);
}
.role-preset-card-item.is-active::before {
  background: var(--admin-primary);
}
.role-preset-card-item.is-active .role-preset-icon {
  background: rgba(124, 58, 237, 0.22);
  color: var(--admin-primary-light);
}
.role-preset-card-item.is-active .role-preset-check {
  opacity: 1;
  transform: scale(1);
}

/* ─── Icon ───────────────────────────────────────────────────── */
.role-preset-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(124, 58, 237, 0.10);
  color: var(--admin-primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 17px;
  transition: background 150ms ease, color 150ms ease;
}

.role-preset-card-item:hover .role-preset-icon {
  background: rgba(124, 58, 237, 0.18);
}

/* ─── Body ───────────────────────────────────────────────────── */
.role-preset-body {
  flex: 1;
  min-width: 0;
}

.role-preset-name {
  font-family: 'Fira Code', monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--admin-text);
  line-height: 1.2;
  margin-bottom: 3px;
}

.role-preset-desc {
  font-size: 12px;
  color: var(--admin-muted);
  line-height: 1.35;
  margin-bottom: 6px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.role-preset-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

.role-preset-count {
  font-family: 'Fira Code', monospace;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--admin-muted);
  background: rgba(100, 116, 139, 0.15);
  padding: 2px 8px;
  border-radius: 99px;
}

.role-preset-card-item.is-active .role-preset-count {
  color: var(--admin-primary-light);
  background: rgba(124, 58, 237, 0.2);
}

/* ─── Check indicator (top-right) ────────────────────────────── */
.role-preset-check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--admin-primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 150ms ease, transform 150ms ease;
  pointer-events: none;
}

/* ─── Tooltip (hover / focus) ────────────────────────────────── */
.role-preset-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(4px);
  min-width: 220px;
  max-width: 280px;
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  padding: 10px 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease, transform 150ms ease;
  z-index: 50;
}

.role-preset-tooltip::after {
  /* arrow */
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--admin-surface);
}

.role-preset-card-item:hover  .role-preset-tooltip,
.role-preset-card-item:focus-visible .role-preset-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.role-preset-tooltip-title {
  font-family: 'Fira Code', monospace;
  font-size: 10px;
  font-weight: 600;
  color: var(--admin-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.role-preset-tooltip-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 180px;
  overflow-y: auto;
}

.role-preset-tooltip-list li code {
  font-family: 'Fira Code', monospace;
  font-size: 11px;
  color: var(--admin-text);
  background: var(--admin-surface-2);
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
}

/* ─── Flash feedback (after applying) ────────────────────────── */
@keyframes rolePresetFlash {
  0%   { background: rgba(124, 58, 237, 0.25); }
  100% { background: transparent; }
}

.role-preset-flash {
  animation: rolePresetFlash 700ms ease-out;
}

/* ============================================================
   Product Type tokens & visibility helpers
   ============================================================ */
:root {
  --pt-hosting-color:  hsl(22, 90%, 52%);
  --pt-domain-color:   hsl(220, 80%, 58%);
  --pt-email-color:    hsl(145, 60%, 42%);
  --pt-ssl-color:      hsl(271, 70%, 55%);
  --pt-saas-color:     hsl(190, 75%, 45%);
  --pt-custom-color:   hsl(340, 65%, 52%);
}

/* CSS-driven visibility via form[data-product-type] */
form[data-product-type] .pt-visibility-domain  { display: none; }
form[data-product-type] .pt-visibility-hosting { display: none; }

form[data-product-type="domain"]  .pt-visibility-domain  { display: block !important; }
form[data-product-type="hosting"] .pt-visibility-hosting { display: block !important; }

/* Pricing matrix table styling */
#pricing-matrix-table tbody td { padding: 8px 14px; }
#pricing-matrix-table .pm-discount {
  background: var(--admin-surface-2);
  border: 1px solid var(--admin-border);
  color: var(--admin-text);
  border-radius: 6px;
  font-family: 'Fira Code', monospace;
  font-size: 13px;
  padding: 6px 8px;
}
#pricing-matrix-table .pm-discount:focus {
  outline: none;
  border-color: var(--admin-primary);
}

/* Product type badge in forms */
.pt-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
}
.pt-badge-hosting { background: rgba(249,115,22,0.15); color: var(--pt-hosting-color); }
.pt-badge-domain  { background: rgba(59,130,246,0.15);  color: var(--pt-domain-color); }
.pt-badge-email   { background: rgba(16,185,129,0.15);  color: var(--pt-email-color); }
.pt-badge-ssl     { background: rgba(124,58,237,0.15);  color: var(--pt-ssl-color); }
.pt-badge-saas    { background: rgba(6,182,212,0.15);   color: var(--pt-saas-color); }
.pt-badge-custom  { background: rgba(236,72,153,0.15);  color: var(--pt-custom-color); }

/* ─── BYO status-dot overview (INT-1294 / INT-1237-A) ──────────────────
   Renders one labelled dot per BYO section (A-G) above the tabs on the
   platformadmin/byo-administration.php koepel page. Uses admin design-
   system CSS variables so both light + dark mode follow automatically. */
.byo-status-overview {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: flex-start;
  margin: 0 0 16px 0;
  padding: 12px 14px;
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 6px;
}

.byo-dot-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 56px;
}

.byo-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  background: var(--admin-muted);
  box-shadow: 0 0 0 2px var(--admin-surface),
              0 0 0 3px var(--admin-border);
}

.byo-dot.dot-ok       { background: var(--admin-success); }
.byo-dot.dot-warn     { background: var(--admin-warning); }
.byo-dot.dot-error    { background: var(--admin-danger); }
.byo-dot.dot-disabled { background: var(--admin-muted); }

.byo-dot-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--admin-text);
  text-align: center;
  white-space: nowrap;
}
