/* ============================================================
   ZepTweaker Admin Panel — modern dark theme
   Sidebar layout · icons · animations · toast notifications
   ============================================================ */

:root {
  /* ── Palette ── */
  --bg: #0e0a13;
  --bg-elevated: #14101b;
  --card: #181320;
  --card2: #1f1830;
  --border: #2a2238;
  --border-soft: #211b2e;

  --text: #ece8f1;
  --text-secondary: #c4bcd4;
  --muted: #8a8099;

  --primary: #913fe2;
  --primary-hover: #a455ed;
  --primary-soft: rgba(145, 63, 226, 0.16);
  --primary-border: rgba(145, 63, 226, 0.42);

  --success: #3fd68c;
  --success-soft: rgba(63, 214, 140, 0.14);
  --warning: #ffb020;
  --warning-soft: rgba(255, 176, 32, 0.14);
  --danger: #ff5247;
  --danger-soft: rgba(255, 82, 71, 0.14);

  /* ── Shape ── */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* ── Motion ── */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 120ms;
  --dur: 220ms;
  --dur-slow: 400ms;
}

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

html,
body {
  height: 100%;
}

body {
  font: 14px / 1.55 "Inter", "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

.hidden {
  display: none !important;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: transparent;
  color: inherit;
}

input,
textarea {
  font: inherit;
  color: var(--text);
  outline: none;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  transition: border-color var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease);
}

input:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

/* ───────── LOGIN ───────── */
.login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background:
    radial-gradient(ellipse at top, rgba(145, 63, 226, 0.15), transparent 60%),
    var(--bg);
  animation: fadeIn var(--dur-slow) var(--ease-out);
}

.login-card {
  width: 380px;
  padding: 38px 32px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(145, 63, 226, 0.06);
  animation: slideUp var(--dur-slow) var(--ease-out);
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 26px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  filter: drop-shadow(0 4px 18px rgba(145, 63, 226, 0.5));
}

.brand-mark.sm {
  width: 26px;
  height: 26px;
}

.brand h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.4px;
}

.brand p {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.login-card form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap input {
  width: 100%;
  padding-left: 38px;
}

.input-icon {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
}

.input-action {
  position: absolute;
  right: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  transition: color var(--dur-fast) var(--ease),
    background var(--dur-fast) var(--ease);
}

.input-action:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.input-action svg {
  width: 16px;
  height: 16px;
}

.error {
  font-size: 12.5px;
  color: var(--danger);
  padding: 6px 10px;
  background: var(--danger-soft);
  border-radius: var(--radius-sm);
}

/* ───────── BUTTONS ───────── */
.btn-primary,
.btn-ghost,
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  font-weight: 600;
  font-size: 13px;
  border-radius: var(--radius-sm);
  transition: transform var(--dur-fast) var(--ease),
    background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease);
}

.btn-primary svg,
.btn-ghost svg,
.btn-danger svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(145, 63, 226, 0.35);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-ghost {
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  background: var(--card2);
  border-color: var(--primary-border);
}

.btn-danger {
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid rgba(255, 82, 71, 0.28);
}

.btn-danger:hover {
  background: rgba(255, 82, 71, 0.22);
  transform: translateY(-1px);
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  transition: color var(--dur-fast) var(--ease),
    background var(--dur-fast) var(--ease);
}

.icon-btn:hover {
  color: var(--text);
  background: var(--card2);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

/* ───────── APP SHELL ───────── */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  animation: fadeIn var(--dur-slow) var(--ease-out);
}

/* Grid children default to min-width:auto — without this the content
   column can't shrink below its widest child and the page scrolls
   horizontally on narrow viewports (the V1.4 clipped-actions bug). */
.app > * {
  min-width: 0;
}

/* ─── Sidebar ─── */
.sidebar {
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 18px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 14px;
}

.sidebar-brand strong {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  border-radius: var(--radius-sm);
  transition: color var(--dur-fast) var(--ease),
    background var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease);
  text-align: left;
  width: 100%;
}

.nav-item:hover {
  color: var(--text);
  background: var(--card2);
  transform: translateX(2px);
}

.nav-item.active {
  color: #c39bf5;
  background: var(--primary-soft);
  font-weight: 600;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.online-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--card);
  border-radius: var(--radius-sm);
}

.whoami {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border-radius: var(--radius-sm);
  background: var(--card);
}

.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #c39bf5);
  border-radius: 50%;
  flex-shrink: 0;
}

.whoami-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.whoami-text strong {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}

.whoami-text span {
  font-size: 11px;
  color: var(--muted);
}

/* ─── Content ─── */
.content {
  padding: 28px 32px;
  max-width: 1280px;
  width: 100%;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: fadeIn var(--dur) var(--ease-out);
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.page-head h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.page-head p {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
  max-width: 540px;
}

/* ─── Stats ─── */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.stat {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--dur) var(--ease),
    transform var(--dur) var(--ease);
}

.stat:hover {
  border-color: var(--primary-border);
  transform: translateY(-2px);
}

.stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  color: #c39bf5;
  flex-shrink: 0;
}

.stat-icon svg {
  width: 20px;
  height: 20px;
}

.stat-body b {
  display: block;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.stat-body span {
  font-size: 11.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: 2px;
  display: block;
}

/* ─── Cards ─── */
.card {
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.card-head h3 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filters input {
  min-width: 180px;
}

.hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.6;
}

.hint .mono {
  color: var(--primary);
  font-weight: 600;
}

/* ─── Tables ─── */
table {
  width: 100%;
  border-collapse: collapse;
}

th {
  padding: 9px 12px;
  font-size: 10.5px;
  color: var(--muted);
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

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

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: rgba(145, 63, 226, 0.04);
}

.mono {
  font-family: "JetBrains Mono", ui-monospace, Consolas, monospace;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.dim {
  color: var(--muted);
}

/* ─── User row ─── */
.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  flex-shrink: 0;
}

.user-avatar.online {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--success);
}

.user-avatar.offline {
  box-shadow: 0 0 0 2px var(--bg);
  opacity: 0.65;
}

.user-name {
  font-weight: 600;
  /* Flex so status pills align to the text center — inline baseline
   * alignment made the pill stretch the line box ~8px taller (the
   * admin row was 70px while everyone else sat at 62px). */
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  white-space: nowrap;
}

.user-id {
  font-size: 11px;
  color: var(--muted);
  font-family: ui-monospace, Consolas, monospace;
}

/* ─── Pills / chips ─── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  font-size: 10.5px;
  font-weight: 600;
  border-radius: 99px;
  text-transform: capitalize;
}

.pill.admin {
  color: #c39bf5;
  background: var(--primary-soft);
}

.pill.disabled {
  color: var(--danger);
  background: var(--danger-soft);
}

/* Administrator role badge on role cards — gold, Discord-style */
.pill.admin-gold {
  color: #ffcf5c;
  background: rgba(255, 176, 32, 0.14);
  border: 1px solid rgba(255, 176, 32, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-size: 9.5px;
  padding: 2px 8px;
}

.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.dot.on {
  background: var(--success);
  box-shadow: 0 0 8px rgba(63, 214, 140, 0.6);
}

.dot.off {
  background: var(--muted);
}

/* ─── Feature chips (inline toggle) ─── */
.features {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.fchip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 99px;
  transition: all var(--dur-fast) var(--ease);
  color: var(--muted);
}

.fchip:hover {
  border-color: var(--primary-border);
  color: var(--text-secondary);
}

.fchip.on {
  color: #c39bf5;
  background: var(--primary-soft);
  border-color: var(--primary);
}

.fchip.loading {
  opacity: 0.5;
  cursor: wait;
  pointer-events: none;
}

.fchip .chip-check {
  width: 12px;
  height: 12px;
  display: none;
}

.fchip.on .chip-check {
  display: inline-flex;
}

.fchip input {
  display: none;
}

/* ─── Row actions ─── */
.row-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

/* ─── Action type pills (logs) ─── */
.action-pill {
  display: inline-flex;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  font-family: ui-monospace, Consolas, monospace;
}

.action-pill.login,
.action-pill.panel_login {
  color: var(--success);
  background: var(--success-soft);
}

.action-pill.login_failed,
.action-pill.panel_login_failed,
.action-pill.login_blocked {
  color: var(--danger);
  background: var(--danger-soft);
}

.action-pill.toggle,
.action-pill.attach {
  color: #c39bf5;
  background: var(--primary-soft);
}

.action-pill.admin_user_create,
.action-pill.admin_user_update,
.action-pill.admin_user_delete,
.action-pill.admin_logs_clear,
.action-pill.admin_min_version {
  color: var(--warning);
  background: var(--warning-soft);
}

.action-pill.blacklist_add,
.action-pill.blacklist_remove {
  color: #5ec5ff;
  background: rgba(94, 197, 255, 0.12);
}

/* ─── Client log levels ─── */
.action-pill.crash {
  color: #ff8080;
  background: rgba(255, 71, 71, 0.16);
}

.action-pill.error {
  color: var(--danger);
  background: var(--danger-soft);
}

.action-pill.warn {
  color: var(--warning);
  background: var(--warning-soft);
}

.action-pill.info {
  color: #5ec5ff;
  background: rgba(94, 197, 255, 0.12);
}

.clog-msg {
  max-width: 640px;
}

.clog-stack {
  margin: 8px 0 2px;
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.5;
  color: #b8b8c8;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 8px;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
}

/* ─── Server blacklist (user modal) ─── */
.server-blacklist {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
  padding: 2px;
}

.sbl-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.sbl-entry .sbl-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.sbl-entry .sbl-text strong {
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sbl-entry .sbl-text span {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pill.locked {
  color: var(--warning);
  background: var(--warning-soft);
}

/* ─── Discord-style role permission editor ─── */
/* ─── Role editor (Discord-style, V1.8) ───
 * Modal tab bar → Display / Permissions. The Permissions tab is ONE
 * scrollable pane: category sections (General / per-tweak-group /
 * Advanced) with a "Select all" switch per section, a search box, and
 * the Administrator master switch that disables everything else. */

.role-modal .modal-card,
.role-modal {
  max-width: 620px;
}

.role-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}

.role-tab {
  padding: 8px 18px 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  position: relative;
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}

.role-tab:hover {
  color: var(--text);
  background: rgba(145, 63, 226, 0.08);
}

.role-tab.active {
  color: var(--text);
}

.role-tab.active::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--primary);
}

.role-tab-body.hidden {
  display: none;
}

/* Permission toolbar: search + clear all */
.perm-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.perm-search-wrap {
  flex: 1;
  min-width: 0;
}

.perm-search-wrap svg {
  position: absolute;
  left: 11px;
  width: 15px;
  height: 15px;
  color: var(--muted);
  pointer-events: none;
}

.perm-search-wrap input {
  padding-left: 34px !important;
}

/* The single scrollable permission pane */
.perm-scroll {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
  max-height: 420px;
  overflow-y: auto;
  padding: 4px 6px 10px;
}

.perm-section {
  padding: 6px 4px 2px;
}

.perm-section + .perm-section {
  border-top: 1px solid var(--border-soft);
  margin-top: 6px;
  padding-top: 10px;
}

.perm-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 8px 7px;
  background: rgba(255, 255, 255, 0.025);
  border-radius: 8px;
  margin: 2px 0 4px;
}

.perm-section-title {
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: #a89dba;
}

.perm-master {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  flex: none;
}

.perm-master:hover {
  color: var(--text);
}

/* Permission rows — 2-column grid like Discord's editor on wide modals */
.perm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}

@media (max-width: 560px) {
  .perm-grid {
    grid-template-columns: 1fr;
  }
}

.perm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 10px;
  border-radius: 9px;
  min-width: 0;
}

.perm-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.perm-row.locked {
  opacity: 0.55;
  pointer-events: none;
}

.perm-row-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.perm-row-text strong {
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
  /* Long permission names wrap onto a second line (Discord-style) —
   * the switch stays centered; no clipping, no ellipsis. */
  overflow-wrap: anywhere;
}

.perm-row-text small {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
  margin-top: 2px;
}

/* Advanced section — Administrator, danger-tinted like Discord */
.perm-advanced {
  margin-top: 6px;
}

.perm-admin-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  border: 1px solid rgba(255, 82, 71, 0.35);
  background: rgba(255, 82, 71, 0.06);
  padding: 12px 14px;
}

.perm-admin-row:hover {
  background: rgba(255, 82, 71, 0.1);
}

.perm-admin-row .switch {
  margin-top: 2px;
}

.perm-admin-row.on {
  border-color: rgba(255, 82, 71, 0.6);
  box-shadow: 0 0 14px rgba(255, 82, 71, 0.12) inset;
}

.perm-admin-row.on .perm-row-text strong {
  color: var(--danger);
}

.perm-admin-banner {
  margin: 6px 4px 10px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--warning);
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

/* Locked switches (Administrator covers them) */
.switch.locked {
  pointer-events: none;
  opacity: 0.6;
}

/* mixed (indeterminate) master switch — warning-tinted track */
.switch.mixed {
  background: var(--warning-soft);
  border-color: var(--warning);
}

/* ─── Empty state ─── */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 44px 24px;
  text-align: center;
  color: var(--muted);
}

.empty svg {
  width: 36px;
  height: 36px;
  opacity: 0.5;
}

.empty strong {
  color: var(--text-secondary);
  font-size: 14px;
}

.empty span {
  font-size: 12.5px;
  max-width: 360px;
}

/* ─── Settings row ─── */
.settings-row {
  display: flex;
  gap: 10px;
  margin: 14px 0 8px;
}

.settings-row .input-wrap {
  flex: 1;
  max-width: 220px;
}

/* Engine payload editor (Settings) */
#engine-script {
  width: 100%;
  resize: vertical;
  font-size: 11.5px;
  line-height: 1.5;
  min-height: 220px;
  tab-size: 2;
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: auto;
}
.settings-row .input-wrap.grow {
  max-width: none;
}
.settings-row .grow {
  flex: 1;
}

/* ─── Modal ─── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 6, 12, 0.75);
  backdrop-filter: blur(4px);
  animation: fadeIn var(--dur) var(--ease-out);
}

.modal-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 440px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 26px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  animation: slideUp var(--dur) var(--ease-out);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-head h2 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field > span {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.field small {
  font-size: 11.5px;
  color: var(--muted);
}

.field .input-wrap input {
  width: 100%;
  padding-left: 12px;
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 4px;
}

/* ─── Toasts ─── */
.toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  min-width: 260px;
  max-width: 380px;
  pointer-events: auto;
  animation: slideInRight var(--dur) var(--ease-out);
}

.toast.removing {
  animation: slideOutRight var(--dur) var(--ease) forwards;
}

.toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
}

.toast.success .toast-icon {
  background: var(--success-soft);
  color: var(--success);
}

.toast.error .toast-icon {
  background: var(--danger-soft);
  color: var(--danger);
}

.toast.info .toast-icon {
  background: var(--primary-soft);
  color: #c39bf5;
}

.toast-icon svg {
  width: 14px;
  height: 14px;
}

.toast-body {
  flex: 1;
}

.toast-body strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.toast-body span {
  font-size: 12px;
  color: var(--muted);
}

/* ─── Loading skeleton ─── */
.skeleton {
  display: inline-block;
  background: linear-gradient(
    90deg,
    var(--card2) 0%,
    var(--border-soft) 50%,
    var(--card2) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: 4px;
  height: 14px;
  width: 80px;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ─── Animations ─── */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(20px);
  }
}

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: sticky;
    top: 0;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 10px 14px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .sidebar-brand {
    border-bottom: none;
    padding: 0 14px 0 0;
    margin: 0 14px 0 0;
    border-right: 1px solid var(--border-soft);
  }
  .sidebar-nav {
    flex-direction: row;
    flex: 1;
    gap: 4px;
  }
  .nav-item {
    padding: 8px 10px;
  }
  .nav-item span {
    display: none;
  }
  .sidebar-footer {
    padding-top: 0;
    border-top: none;
  }
  .online-badge {
    display: none;
  }
  .content {
    padding: 18px;
  }
}

@media (max-width: 620px) {
  .whoami-text {
    display: none; /* keep avatar + logout icon only — no width blowout */
  }
  .sidebar-footer {
    padding: 0;
    margin: 0;
    border: none;
  }
  .content {
    padding: 12px;
  }
  .stats {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  }
}

/* ══════════ V1.3 additions: devices, tweaks, switches ══════════ */

/* Expandable per-user device rows — the ROW is hidden until opened.
 * (V1.8 fix: the row used to render with padding while its content
 * was display:none, so every user WITH devices carried a ghost ~20px
 * gap under their row — that was the "up and downs" row rhythm.) */
.device-row {
  display: none;
}
.device-row.open {
  display: table-row;
}
.device-row.open > td {
  background: rgba(0, 0, 0, 0.18);
  padding: 4px 14px 12px;
  animation: slideDown 0.18s ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}
.device-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.device {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: var(--card2);
  transition: border-color 0.15s ease;
}
.device:hover { border-color: var(--border); }
.device.revoked { opacity: 0.55; }
.device-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--primary-soft);
  color: var(--primary);
  flex: none;
}
.device-icon svg { width: 17px; height: 17px; }
.device-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.device-body strong { font-size: 12.5px; color: var(--text); }
.device-body span { font-size: 11px; color: var(--muted); }
.btn-danger.sm {
  padding: 5px 11px;
  font-size: 11px;
  gap: 5px;
}

/* "3 devices ▾" expander */
.link-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
  transition: background 0.15s ease;
}
.link-btn:hover { background: var(--primary-soft); }

/* Active tweak pills in the users table */
.tweak-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 170px;
}
.pill.tweak {
  background: var(--success-soft);
  color: var(--success);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}

/* Toggle switch (tweaks enabled) */
.switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: var(--card2);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
  flex: none;
}
.switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.18s cubic-bezier(0.2, 0, 0, 1), background 0.18s ease;
}
.switch.on { background: var(--primary-soft); border-color: var(--primary-border); }
.switch.on .switch-knob {
  transform: translateX(16px);
  background: var(--primary);
}

/* Tweak icon in table */
.tweak-icon-sm {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary-soft), rgba(145, 63, 226, 0.05));
  color: var(--primary);
  flex: none;
}
.tweak-icon-sm svg { width: 17px; height: 17px; }

/* Keypoints textarea + modal tweaks */
#tweak-payload {
  width: 100%;
  min-height: 200px;
  resize: vertical;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-secondary);
  font-family: "Cascadia Code", "JetBrains Mono", Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.15s ease;
  box-sizing: border-box;
}
#tweak-payload:focus { border-color: var(--primary-border); }
.error-inline {
  color: var(--danger);
  font-size: 11.5px;
  margin-top: 6px;
  display: block;
  min-height: 14px;
}
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.modal-card.wide { max-width: 560px; width: calc(100vw - 48px); }
select.input-wrap input, #tweak-section {
  width: 100%;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 13px;
  padding: 10px 12px;
  outline: none;
}
#tweak-section:focus { border-color: var(--primary-border); }

/* ─── Custom selects (NO default browser chrome anywhere) ───
 * appearance:none kills the OS arrow; a painted chevron replaces it.
 * Applies to every <select> in the panel (clog filter, tweak section). */
select {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  padding: 10px 36px 10px 12px;
  outline: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8099' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
select:hover { border-color: var(--border); background-color: #241b33; }
select:focus { border-color: var(--primary-border); }
select option {
  background: var(--card2);
  color: var(--text);
}
.filters select { width: auto; padding: 8px 32px 8px 10px; }

/* Security posture list */
.security-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
}
.security-list li {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  color: var(--text-secondary);
  padding: 9px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: var(--card2);
}
.security-list li::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px rgba(63, 214, 140, 0.5);
  flex: none;
}

@media (max-width: 1100px) {
  .field-grid { grid-template-columns: 1fr; }
  .tweak-pills { max-width: 110px; }
}

/* ============================================================
   V1.5 — Roles system + responsive users list (shadcn-flavored)
   ============================================================ */

/* ─── Users list: real table — data bound to its column, drag-to-reorder ─── */
.users-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

.users-table th {
  text-align: left;
  font-size: 10.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  cursor: grab;
  user-select: none;
}

.users-table th:last-child {
  cursor: default;
}

.users-table th.dragging {
  opacity: 0.45;
  cursor: grabbing;
}

.users-table th.drag-over {
  box-shadow: inset 2px 0 0 var(--primary);
  color: var(--primary);
}

.user-row td {
  height: 58px;           /* uniform row height — the grid never "breathes" */
  padding: 6px 14px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
  text-align: left;
  transition: background var(--dur-fast) var(--ease);
}

.user-row:hover td {
  background: rgba(145, 63, 226, 0.05);
}

.user-row:last-of-type td {
  border-bottom: none;
}

.u-roles {
  display: flex !important;
  flex-wrap: nowrap;       /* single line — wrapped badges made rows taller */
  align-items: center;
  gap: 5px;
  max-width: 240px;
  overflow: hidden;
  white-space: nowrap;      /* "no roles" & badges never wrap to 2 lines */
}

.u-login {
  font-size: 12px;
  white-space: nowrap;
}

.u-tweaks {
  display: flex !important;
  flex-wrap: nowrap;       /* single line — same uniform-height reason */
  align-items: center;
  gap: 4px;
  max-width: 190px;
  overflow: hidden;
  white-space: nowrap;
}

.u-devices {
  font-size: 12.5px;
  white-space: nowrap;
}

.u-actions {
  display: flex !important;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}

/* Actions column keeps a stable width whether or not the delete
 * button exists (admins have none) — no more lopsided right edge. */
.user-row td.u-actions,
.users-table th:last-child {
  min-width: 118px;
}

/* Expanded device list lives in its own row under the user — the ROW's
   .open class controls visibility (see .device-row above). */

/* ─── Role badges (Discord-style colored pills) ─── */
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2.5px 9px 2.5px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.1px;
  line-height: 1.5;
  border: 1px solid;
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.role-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

/* ─── Roles page: card grid ─── */
.roles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
  padding: 16px;
}
.role-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card2);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  transition: border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.role-card:hover {
  border-color: var(--primary-border);
  transform: translateY(-1px);
}
.role-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.role-card-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: none;
  box-shadow: 0 0 10px -1px currentColor;
}
.role-card-name {
  font-weight: 700;
  font-size: 14.5px;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.role-card-tag {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 650;
}
.role-card-members {
  font-size: 11.5px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.role-card-perms {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
  color: var(--text-secondary);
}
.perm-line {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  line-height: 1.45;
}
.perm-line .k {
  color: var(--muted);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 650;
  flex: none;
  width: 44px;
  padding-top: 1px;
}
.perm-line .v {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}
.perm-chip {
  font-size: 10.5px;
  padding: 1.5px 8px;
  border-radius: 999px;
  background: rgba(145, 63, 226, 0.12);
  border: 1px solid rgba(145, 63, 226, 0.28);
  color: #c9a6f2;
  font-weight: 600;
  white-space: nowrap;
}
.perm-chip.none {
  background: transparent;
  border-color: var(--border);
  color: var(--muted);
}
.role-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}
.role-card-actions .btn-ghost,
.role-card-actions .btn-danger {
  flex: 1;
  justify-content: center;
  padding: 7px 10px;
  font-size: 12px;
}

/* ─── Chip sets (toggleable multi-select chips in modals) ─── */
.chip-set {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.cchip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card2);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition:
    border-color var(--dur-fast) var(--ease),
    background var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease);
}
.cchip:hover {
  border-color: var(--primary-border);
  transform: translateY(-1px);
}
.cchip:active {
  transform: translateY(0);
}
.cchip.on {
  background: var(--primary-soft);
  border-color: var(--primary-border);
  color: #d4b3f7;
}
.cchip .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  flex: none;
  transition: background var(--dur-fast) var(--ease);
}
.cchip.on .dot {
  background: currentColor;
  box-shadow: 0 0 8px -1px currentColor;
}
.cchip.wild {
  border-style: dashed;
}
.cchip.wild.on {
  border-style: solid;
  background: rgba(255, 176, 32, 0.13);
  border-color: rgba(255, 176, 32, 0.45);
  color: #ffd489;
}

/* ─── Role modal: color picker row ─── */
.color-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.swatches {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.swatch {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
  flex: none;
}
.swatch:hover {
  transform: scale(1.12);
}
.swatch.sel {
  border-color: #fff;
  transform: scale(1.12);
}
.color-row .input-wrap {
  width: 110px;
  flex: none;
}

/* ─── Edit-user modal head ─── */
.user-modal-head {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card2);
  margin-bottom: 16px;
}
.user-modal-head .user-avatar.big {
  width: 44px;
  height: 44px;
  font-size: 17px;
}
.user-modal-head strong {
  font-size: 15px;
  display: block;
}
.user-modal-head span {
  font-size: 11.5px;
}

.admin-note {
  font-size: 12px;
  color: #ffd489;
  background: var(--warning-soft);
  border: 1px solid rgba(255, 176, 32, 0.3);
  border-radius: 10px;
  padding: 9px 12px;
  margin-bottom: 14px;
  line-height: 1.5;
}

@media (max-width: 860px) {
  .u-actions {
    margin-left: 0;
  }
  .roles-grid {
    grid-template-columns: 1fr;
  }
}

/* ══════════ V1.8 additions: custom scrollbars everywhere ══════════
 * Nothing in the panel ships with default browser chrome — scrollbars
 * are slim, rounded and theme-colored (matching the desktop app's
 * overlay look) on both WebKit/Blink and Firefox. */

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: #3a2f4d transparent;
}

/* WebKit / Blink (Chrome, Edge, Electron) */
::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #3a2f4d;
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background: #524273;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:active {
  background: var(--primary);
  background-clip: content-box;
}
::-webkit-scrollbar-corner {
  background: transparent;
}
/* Slimmer variant for dense inner panels (tables, log lists, modals) */
.users-table-wrap::-webkit-scrollbar,
.clog-list::-webkit-scrollbar,
.log-list::-webkit-scrollbar,
.modal-card::-webkit-scrollbar,
.perm-scroll::-webkit-scrollbar {
  height: 7px;
  width: 7px;
}


/* ── V1.9 role editor: categories are the tabs ── */
.perm-toolbar-hint {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.4;
  flex: 1;
  min-width: 0;
}

.perm-cattabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px 0 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}

.perm-cattab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.perm-cattab em {
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  background: color-mix(in srgb, var(--fg) 8%, transparent);
  border-radius: 999px;
  padding: 1px 7px;
}

.perm-cattab-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.perm-cattab:hover {
  color: var(--fg);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}

.perm-cattab.active {
  color: var(--fg);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}

.perm-cattab.granted .perm-cattab-dot {
  background: var(--success);
  box-shadow: 0 0 7px color-mix(in srgb, var(--success) 65%, transparent);
}

.perm-cattab.danger:hover {
  color: #ffb84d;
  border-color: rgba(255, 184, 77, 0.45);
}

.perm-cattab.danger.active {
  color: #ffd28a;
  border-color: rgba(255, 184, 77, 0.65);
  background: rgba(255, 184, 77, 0.12);
}

.perm-tab-master {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: color-mix(in srgb, var(--accent) 5%, transparent);
}

.perm-tab-master.on {
  border-color: color-mix(in srgb, var(--success) 55%, var(--border));
}

.perm-tab-master.on .perm-row-text strong {
  color: var(--success);
}
