/* ============================================================
   SAPPHIRE ADMIN PANEL — style.css
   Forked from ../sapphire-panel/css/style.css — same design system
   (The Private Vault). Only balance/lang-toggle rules stripped;
   :root tokens and every shared component are untouched.
   ============================================================ */

/* ============================================================
   1. CSS CUSTOM PROPERTIES
   ============================================================ */
:root {
  /* === BACKGROUNDS === */
  --bg-base:        #04060c;
  --bg-surface:     #070b14;
  --bg-elevated:    #0b1022;
  --bg-overlay:     #0f1530;
  --bg-hover:       rgba(255, 255, 255, 0.035);
  --bg-active:      rgba(37, 99, 235, 0.12);

  /* === BORDERS === */
  --border:         rgba(255, 255, 255, 0.065);
  --border-strong:  rgba(255, 255, 255, 0.13);
  --border-accent:  rgba(59, 130, 246, 0.35);
  --border-focus:   rgba(59, 130, 246, 0.65);

  /* === ACCENT (PRIMARY BRAND COLOR) === */
  --accent:         #2563eb;
  --accent-hover:   #3b82f6;
  --accent-light:   #60a5fa;
  --accent-glow:    rgba(37, 99, 235, 0.3);
  --accent-subtle:  rgba(37, 99, 235, 0.09);

  /* === SEMANTIC === */
  --success:        #10b981;
  --success-bg:     rgba(16, 185, 129, 0.09);
  --success-border: rgba(16, 185, 129, 0.22);
  --warning:        #f59e0b;
  --warning-bg:     rgba(245, 158, 11, 0.09);
  --warning-border: rgba(245, 158, 11, 0.22);
  --danger:         #ef4444;
  --danger-bg:      rgba(239, 68, 68, 0.09);
  --danger-border:  rgba(239, 68, 68, 0.22);
  --info:           #3b82f6;
  --info-bg:        rgba(59, 130, 246, 0.09);
  --info-border:    rgba(59, 130, 246, 0.22);

  /* === TEXT === */
  --text-primary:   #eef2ff;
  --text-secondary: rgba(238, 242, 255, 0.58);
  --text-muted:     rgba(238, 242, 255, 0.5); /* 4.86:1 on --bg-base — was 0.4 (3.45:1), below the AA floor DESIGN.md itself promises for this token */

  /* === TYPOGRAPHY — SF Pro system stack, Inter fallback === */
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter",
                  "Helvetica Neue", Arial, sans-serif;
  --font-body:    -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
                  "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-mono:    'JetBrains Mono', 'SF Mono', 'Fira Code', 'Consolas', monospace;

  /* === SPACING & SHAPE === */
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-pill: 9999px;

  /* === SHADOWS === */
  --shadow-sm:      0 2px 8px rgba(0, 0, 0, 0.5);
  --shadow-md:      0 8px 32px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --shadow-glow:    0 0 24px rgba(37, 99, 235, 0.45), 0 0 8px rgba(37, 99, 235, 0.3);
  --shadow-glow-sm: 0 0 20px rgba(37, 99, 235, 0.28);

  /* === TRANSITIONS === */
  --transition-fast: all 120ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 320ms cubic-bezier(0.4, 0, 0.2, 1);

  /* === LAYOUT === */
  --sidebar-width:           240px;
  --sidebar-collapsed-width: 64px;
  --topbar-height:           58px;
}

/* ============================================================
   2. RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Ambient gradient on a fixed layer — same visual as
   background-attachment: fixed, but without the scroll-repaint
   cost on mobile Safari */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(ellipse 90% 55% at 15% -10%, rgba(37, 99, 235, 0.14) 0%, transparent 65%),
    radial-gradient(ellipse 60% 45% at 85% 105%, rgba(37, 99, 235, 0.09) 0%, transparent 60%);
}

a {
  color: var(--accent-light);
  text-decoration: none;
  transition: var(--transition-fast);
}

a:hover {
  color: var(--accent-hover);
}

img, svg {
  display: block;
  max-width: 100%;
}

ul, ol { list-style: none; }

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  background: none;
}

input, select, textarea {
  font-family: var(--font-body);
  font-size: 14px;
}

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

/* ============================================================
   3. SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.16);
}

/* ============================================================
   4. FOCUS & SELECTION
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection {
  background: rgba(37, 99, 235, 0.3);
  color: var(--text-primary);
}

/* ============================================================
   5. TYPOGRAPHY UTILITIES
   ============================================================ */
.label {
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.tabular { font-variant-numeric: tabular-nums; }
.text-center { text-align: center; }

.font-display { font-family: var(--font-display); }
.font-mono    { font-family: var(--font-mono); }

.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }
.text-accent    { color: var(--accent-light); }
.text-success   { color: var(--success); }
.text-warning   { color: var(--warning); }
.text-danger    { color: var(--danger); }

.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Skip-to-content link (injected by layout.js, first focusable element) */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus-visible {
  transform: translateY(0);
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35);
}

.page-content:focus {
  outline: none;
}

/* ============================================================
   6. LAYOUT — APP SHELL
   ============================================================ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ============================================================
   7. SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: rgba(7, 11, 20, 0.92);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border-right: 1px solid rgba(255, 255, 255, 0.055);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  transition: width var(--transition-slow), transform var(--transition-slow);
  overflow: hidden;
}

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

/* --- Logo block --- */
.sidebar__logo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: var(--topbar-height);
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  flex-shrink: 0;
}

.sidebar__logo-text {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-decoration: none;
}

.logo-mark {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent-light);
  filter: drop-shadow(0 0 6px rgba(96, 165, 250, 0.5));
}

.logo-mark svg {
  width: 22px;
  height: 22px;
}

.logo-wordmark {
  overflow: hidden;
  transition: opacity var(--transition-base), width var(--transition-base);
}

.sidebar__logo-text .logo-diamond {
  color: var(--accent);
}

.sidebar__collapse-btn {
  width: 28px; height: 28px;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.sidebar__collapse-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar__collapse-btn svg {
  transition: transform var(--transition-base);
}

.sidebar.collapsed .sidebar__collapse-btn svg {
  transform: rotate(180deg);
}

.sidebar__mobile-close {
  display: none;
  width: 28px; height: 28px;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.sidebar__mobile-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* --- Profile block --- */
.sidebar__profile {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  flex-shrink: 0;
}

.sidebar__profile-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 8px 6px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar__avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: 0.04em;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.3);
}

.sidebar__profile-info {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: opacity var(--transition-base), width var(--transition-base);
}

.sidebar__username {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.sidebar__role {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: 2px;
}

/* Hide text in collapsed state */
.sidebar.collapsed .sidebar__profile-info,
.sidebar.collapsed .logo-wordmark {
  opacity: 0;
  width: 0;
  overflow: hidden;
  pointer-events: none;
}

/* --- Navigation --- */
.sidebar__nav {
  flex: 1;
  padding: 10px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* --- Nav groups (labeled sections) --- */
.nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-group + .nav-group {
  margin-top: 14px;
}

.nav-group__label {
  padding: 0 12px;
  margin-bottom: 4px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--transition-base);
}

.sidebar.collapsed .nav-group__label {
  opacity: 0;
  height: 0;
  margin: 0;
  padding: 0;
}

.sidebar.collapsed .nav-group + .nav-group {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  height: 38px;
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition-fast);
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(37, 99, 235, 0.15);
  color: var(--accent-light);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.2);
}

.nav-item__icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-item__icon svg {
  width: 17px; height: 17px;
}

.nav-item__label {
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity var(--transition-base), width var(--transition-base);
}

.sidebar.collapsed .nav-item__label {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.sidebar.collapsed .nav-item {
  padding: 0;
  justify-content: center;
  border-radius: var(--radius-md);
}

.sidebar.collapsed .nav-item.active {
  background: rgba(37, 99, 235, 0.15);
}

/* --- Footer --- */
.sidebar__footer {
  padding: 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.045);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  transition: var(--transition-fast);
  cursor: pointer;
  white-space: nowrap;
}

.logout-btn:hover {
  color: var(--danger);
  background: var(--danger-bg);
}

.logout-btn svg {
  width: 15px; height: 15px;
  flex-shrink: 0;
}

.sidebar.collapsed .logout-btn span {
  display: none;
}

/* ============================================================
   8. MAIN WRAPPER
   ============================================================ */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--transition-slow);
}

.sidebar.collapsed ~ .main-wrapper {
  margin-left: var(--sidebar-collapsed-width);
}

/* ============================================================
   9. TOPBAR
   ============================================================ */
.topbar {
  height: var(--topbar-height);
  background: rgba(7, 11, 20, 0.75);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 16px;
}

.topbar__left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

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

.topbar__breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition-fast);
}

.topbar__breadcrumb a:hover {
  color: var(--text-secondary);
}

.topbar__breadcrumb-sep {
  color: var(--text-muted);
  opacity: 0.4;
  font-size: 11px;
}

.topbar__breadcrumb-current {
  color: var(--text-secondary);
  font-weight: 500;
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Bell button */
.topbar__bell {
  width: 34px; height: 34px;
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  position: relative;
}

.topbar__bell:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.topbar__bell svg {
  width: 17px; height: 17px;
}

.notification-dot {
  position: absolute;
  top: 8px; right: 8px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  border: 1.5px solid var(--bg-surface);
}

/* Avatar dropdown */
.topbar__avatar-wrap { position: relative; }

.topbar__avatar {
  width: 34px; height: 34px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: var(--transition-fast);
  letter-spacing: 0.04em;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

.topbar__avatar:hover {
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.5), var(--shadow-glow-sm);
}

.topbar__dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: rgba(11, 16, 34, 0.95);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 6px;
  min-width: 190px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(37, 99, 235, 0.1);
  z-index: 200;
  display: none;
}

.topbar__dropdown.open {
  display: block;
  animation: dropdownIn 160ms cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
}

.dropdown-item svg {
  width: 14px; height: 14px;
  flex-shrink: 0;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.dropdown-item.danger:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

.dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.055);
  margin: 4px 0;
}

/* Hamburger (mobile) */
.sidebar-toggle {
  display: none;
  width: 34px; height: 34px;
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.sidebar-toggle:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar-toggle svg {
  width: 20px; height: 20px;
}

/* ============================================================
   10. PAGE CONTENT
   ============================================================ */
.page-content {
  flex: 1;
  padding: 30px 28px 48px;
  min-width: 0;
  animation: fadeInUp 0.35s cubic-bezier(0.4, 0, 0.2, 1) both;
}

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

/* ============================================================
   11. BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 18px;
  height: 36px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-base);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
}

.btn:disabled,
.btn.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.btn svg {
  width: 14px; height: 14px;
  flex-shrink: 0;
}

/* Primary */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.3) inset;
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 0 24px rgba(37, 99, 235, 0.45), 0 0 8px rgba(37, 99, 235, 0.3);
  color: #fff;
}

/* Secondary */
.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border-color: rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

/* Danger */
.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger-border);
}

.btn-danger:hover {
  background: var(--danger-bg);
  border-color: var(--danger);
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.25);
}

/* Sizes */
.btn-sm {
  height: 30px;
  padding: 0 14px;
  font-size: 12px;
}

.btn-lg {
  height: 44px;
  padding: 0 28px;
  font-size: 14px;
  font-weight: 600;
}

/* Icon button */
.btn-icon {
  width: 34px; height: 34px;
  padding: 0;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.14);
}

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

.btn-icon.btn-sm {
  width: 28px; height: 28px;
}

/* ============================================================
   12. CARDS — Glassmorphism
   ============================================================ */
/* Без backdrop-filter: за карточками только фоновый градиент,
   а блюр на каждой карточке дорого стоит GPU при скролле.
   Блюр остаётся только у оверлеев (sidebar/topbar/модалки/дропдауны). */
.card {
  background: rgba(255, 255, 255, 0.028);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.card-hover {
  transition: var(--transition-base);
}

.card-hover:hover {
  transform: translateY(-2px);
  border-color: var(--border-accent);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 24px rgba(37, 99, 235, 0.15),
              inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.card__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card__title svg {
  width: 15px; height: 15px;
  color: var(--text-muted);
}

.card__body { padding: 20px; }

.card__footer {
  padding: 12px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.055);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* ============================================================
   13. DATA TABLE
   ============================================================ */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table thead th {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 16px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.data-table tbody td {
  padding: 12px 16px;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody tr { transition: var(--transition-fast); }

.data-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-primary);
}

.data-table tbody td.text-primary {
  color: var(--text-primary);
  font-weight: 500;
}

/* ============================================================
   14. BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid var(--warning-border);
}

.badge-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}

.badge-info {
  background: var(--info-bg);
  color: var(--info);
  border: 1px solid var(--info-border);
}

.badge-accent {
  background: var(--accent-subtle);
  color: var(--accent-light);
  border: 1px solid var(--border-accent);
}

.badge-muted {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.badge::before { display: none; }

.badge-dot::before {
  content: '';
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}

/* ============================================================
   15. STATUS PILLS
   ============================================================ */
.status-undetected {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.status-updating {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid var(--warning-border);
}

.status-detected {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}

.status-testing {
  background: var(--info-bg);
  color: var(--info);
  border: 1px solid var(--info-border);
}

/* ============================================================
   16. FORMS
   ============================================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: -0.005em;
}

.form-label .required {
  color: var(--danger);
  margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  padding: 0 14px;
  height: 40px;
  transition: var(--transition-fast);
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  letter-spacing: -0.01em;
}

.form-textarea {
  height: auto;
  padding: 10px 14px;
  resize: vertical;
  min-height: 84px;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.045);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

/* Select arrow */
.form-select-wrap { position: relative; }

.form-select-wrap::after {
  content: '';
  position: absolute;
  right: 14px; top: 50%;
  transform: translateY(-50%);
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--text-muted);
  pointer-events: none;
}

.form-select-wrap .form-select { padding-right: 34px; }

.form-select option {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

/* ============================================================
   CUSTOM SELECT — premium dropdown component
   ============================================================ */

/* Hide native select when custom select is active */
.cs-native-hidden {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* Wrapper replaces the original select */
.cs-wrap {
  position: relative;
  width: 100%;
}

/* Trigger button */
.cs-trigger {
  width: 100%;
  height: 40px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-body);
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition-fast);
  letter-spacing: -0.01em;
  text-align: left;
}

.cs-trigger:hover {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.045);
}

.cs-open .cs-trigger,
.cs-trigger:focus {
  outline: none;
  border-color: var(--border-focus);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.cs-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cs-label--placeholder {
  color: var(--text-muted);
}

.cs-arrow {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.cs-open .cs-arrow {
  transform: rotate(180deg);
  color: var(--accent-light);
}

/* Floating panel (appended to body, position: fixed) */
.cs-panel {
  position: fixed;
  z-index: 9999;
  background: rgba(10, 15, 30, 0.96);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7),
              0 0 0 1px rgba(37, 99, 235, 0.1),
              inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.18s ease,
              transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.cs-panel--visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* Search input inside panel */
.cs-search-wrap {
  padding: 10px 10px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  gap: 8px;
}

.cs-search-icon {
  color: var(--text-muted);
  flex-shrink: 0;
}

.cs-search {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 12.5px;
  font-family: var(--font-body);
  padding: 0;
  letter-spacing: -0.01em;
}

.cs-search::placeholder { color: var(--text-muted); }

/* Scrollable list */
.cs-list {
  max-height: 280px;
  overflow-y: auto;
  padding: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.cs-list::-webkit-scrollbar { width: 4px; }
.cs-list::-webkit-scrollbar-track { background: transparent; }
.cs-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* Category group header */
.cs-group {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 10px 4px;
  user-select: none;
  pointer-events: none;
}

/* Option item */
.cs-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 100ms ease, color 100ms ease;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cs-item:hover {
  background: rgba(37, 99, 235, 0.12);
  color: var(--text-primary);
}

.cs-item--selected {
  color: var(--accent-light);
  background: rgba(37, 99, 235, 0.1);
}

.cs-item--selected:hover {
  background: rgba(37, 99, 235, 0.18);
}

/* .cs-item--focus: ADMIN-ONLY ADDITION — visual cursor for the keyboard
   navigation added to custom-select.js (Arrow/Home/End/Enter). Not
   present upstream, which has a search box but no keyboard nav at all. */
.cs-item--focus {
  background: rgba(37, 99, 235, 0.16);
  box-shadow: inset 0 0 0 1px var(--border-accent);
}

/* Checkmark */
.cs-check {
  flex-shrink: 0;
  color: var(--accent-light);
}

.cs-check--hidden {
  opacity: 0;
}

.cs-item-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Search highlight */
.cs-highlight {
  background: rgba(37, 99, 235, 0.3);
  color: var(--accent-light);
  border-radius: 2px;
  padding: 0 1px;
}

/* Empty state */
.cs-empty {
  padding: 16px 10px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

/* Hide native select arrow when form-select-wrap contains a cs-wrap */
.form-select-wrap:has(.cs-wrap)::after { display: none; }

/* Password input wrapper */
.input-wrap { position: relative; }

.input-wrap .form-input { padding-right: 40px; }

.input-eye {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: var(--transition-fast);
}

.input-eye:hover { color: var(--text-secondary); }

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

.form-error {
  font-size: 12px;
  color: var(--danger);
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-error svg { width: 12px; height: 12px; flex-shrink: 0; }

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

/* ============================================================
   17. MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: rgba(11, 16, 34, 0.96);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(37, 99, 235, 0.1);
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition-base);
}

.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.modal__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.modal__close {
  width: 28px; height: 28px;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  cursor: pointer;
}

.modal__close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.modal__close svg { width: 15px; height: 15px; }

.modal__body { padding: 20px 24px; }

.modal__footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.modal-lg { max-width: 640px; }

/* ============================================================
   18. TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(11, 16, 34, 0.95);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.65);
  min-width: 280px;
  max-width: 360px;
  pointer-events: all;
  animation: toastIn 280ms cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.hiding {
  animation: toastOut 220ms ease forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(14px) scale(0.94); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

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

.toast__icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast__icon svg { width: 18px; height: 18px; }

.toast__content { flex: 1; min-width: 0; }

.toast__message {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.45;
  letter-spacing: -0.01em;
}

.toast__close {
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.toast__close:hover { color: var(--text-primary); }
.toast__close svg { width: 13px; height: 13px; }

.toast-success { border-color: rgba(16, 185, 129, 0.3); }
.toast-success .toast__icon { color: var(--success); }

.toast-error { border-color: rgba(239, 68, 68, 0.3); }
.toast-error .toast__icon { color: var(--danger); }

.toast-warning { border-color: rgba(245, 158, 11, 0.3); }
.toast-warning .toast__icon { color: var(--warning); }

.toast-info { border-color: rgba(59, 130, 246, 0.3); }
.toast-info .toast__icon { color: var(--info); }

/* ============================================================
   19. SKELETON LOADER
   ============================================================ */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 25%,
    rgba(255, 255, 255, 0.07) 50%,
    rgba(255, 255, 255, 0.04) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

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

.skeleton-text    { height: 14px; border-radius: 4px; }
.skeleton-title   { height: 22px; border-radius: 6px; }
.skeleton-card    { height: 120px; border-radius: var(--radius-lg); }
.skeleton-row     { height: 44px; border-radius: var(--radius-sm); }

/* ============================================================
   20. EMPTY STATE
   ============================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 52px 24px;
  text-align: center;
  gap: 12px;
}

.empty-state__icon {
  width: 48px; height: 48px;
  color: var(--text-muted);
  opacity: 0.4;
  margin-bottom: 4px;
}

.empty-state__icon svg { width: 48px; height: 48px; }

.empty-state__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}

.empty-state__description {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 300px;
  line-height: 1.55;
}

/* ============================================================
   21. PAGE HEADER
   ============================================================ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.page-header__left { min-width: 0; }

.page-header__title {
  font-family: var(--font-body);
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.page-header__subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 5px;
  letter-spacing: -0.01em;
}

.page-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ============================================================
   22. STAT CARDS
   ============================================================ */
.stat-card {
  background: rgba(255, 255, 255, 0.028);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.stat-card__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-card__label svg { width: 13px; height: 13px; }

.stat-card__value {
  font-family: var(--font-body);
  font-size: 30px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.stat-card__value--accent { color: var(--accent-light); }
.stat-card__value--sm { font-size: 22px; }

.stat-card__meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 7px;
}

/* ============================================================
   23. FILTERS / TOOLBAR
   ============================================================ */
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-pills {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.filter-pill {
  padding: 5px 13px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.filter-pill:hover {
  color: var(--text-secondary);
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.05);
}

.filter-pill.active {
  background: rgba(37, 99, 235, 0.15);
  color: var(--accent-light);
  border-color: var(--border-accent);
}

/* Tab toggle */
.tab-group {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-pill);
  padding: 3px;
  gap: 2px;
}

.tab-btn {
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
  background: var(--accent);
  color: #fff;
}

/* ============================================================
   24. SEARCH INPUT
   ============================================================ */
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-wrap__icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
}

.search-wrap__icon svg { width: 14px; height: 14px; }

.search-input {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  color: var(--text-primary);
  font-size: 13px;
  padding: 0 14px 0 34px;
  height: 34px;
  transition: var(--transition-fast);
  width: 220px;
  letter-spacing: -0.01em;
}

.search-input::placeholder { color: var(--text-muted); }

.search-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
  background: rgba(255, 255, 255, 0.05);
  width: 260px;
}

/* ============================================================
   25. PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.055);
}

.pagination__info {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 80px;
  text-align: center;
}

.pagination__btn {
  width: 28px; height: 28px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
  background: rgba(255, 255, 255, 0.03);
}

.pagination__btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.14);
}

.pagination__btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.pagination__btn svg { width: 13px; height: 13px; }

/* ============================================================
   26. KEY VALUE (masked license keys)
   ============================================================ */
.key-value {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-fast);
  user-select: none;
}

.key-value:hover { color: var(--accent-light); }

.key-value.revealed {
  color: var(--text-primary);
  user-select: text;
}

.key-value__icon {
  width: 13px; height: 13px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Key-value cell: value + its own reveal/hide toggle (renderKeyRow,
   components.js). Separate button, not part of .key-value itself,
   so its click doesn't also trigger the copy-to-clipboard handler. */
.key-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.key-eye-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  flex-shrink: 0;
  border: none;
  background: none;
  padding: 0;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
}

.key-eye-toggle:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

/* Row-action icon buttons (reset HWID / revoke) were bare siblings
   inside the <td>, left-aligned with no gap of their own — centered
   the pair as a unit instead of guessing at cell text-align. */
.key-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* ============================================================
   27. SIDEBAR OVERLAY (mobile)
   ============================================================ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 99;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.sidebar-overlay.visible { opacity: 1; }

/* ============================================================
   28. BOTTOM NAV (mobile)
   ============================================================ */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(7, 11, 20, 0.92);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  border-top: 1px solid rgba(255, 255, 255, 0.055);
  height: 62px;
  z-index: 90;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px;
}

.bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: 1;
  height: 100%;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.bottom-nav__item svg { width: 20px; height: 20px; }

.bottom-nav__item.active { color: var(--accent-light); }

.bottom-nav__item:hover { color: var(--text-secondary); }

/* ============================================================
   29. DIVIDER & SPACERS
   ============================================================ */
.divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.055);
  margin: 20px 0;
}

.gap-4  { gap: 4px; }   .gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }  .gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }  .gap-24 { gap: 24px; }

.mt-4  { margin-top: 4px; }   .mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }  .mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }  .mt-24 { margin-top: 24px; }

.mb-4  { margin-bottom: 4px; }   .mb-8  { margin-bottom: 8px; }
.mb-10 { margin-bottom: 10px; }  .mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }  .mb-20 { margin-bottom: 20px; }

.fs-11 { font-size: 11px; }  .fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }  .fs-14 { font-size: 14px; }

.fw-400 { font-weight: 400; }  .fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }  .fw-700 { font-weight: 700; }

.dim { opacity: 0.6; }
.strike { text-decoration: line-through; opacity: 0.55; }
.relative { position: relative; }
.overflow-hidden { overflow: hidden; }

/* ============================================================
   30. GRID UTILITIES
   ============================================================ */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* Stats: 5 карточек (Generated / Redeemed / Expired / Active / Spent) */
.stats-cards { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1024px) { .stats-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px)  { .stats-cards { grid-template-columns: 1fr; } }

.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.min-w-0 { min-width: 0; }
.w-full { width: 100%; }

/* ============================================================
   31. RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width) !important;
    z-index: 100;
  }

  .sidebar.mobile-open { transform: translateX(0); }

  .sidebar-overlay { display: block; }

  .sidebar-toggle { display: flex; }

  .main-wrapper {
    margin-left: 0 !important;
    padding-bottom: 62px;
  }

  .bottom-nav { display: flex; }

  .sidebar__collapse-btn { display: none; }

  .sidebar__mobile-close { display: flex; }

  .page-content { padding: 20px 16px 36px; }

  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }

  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal {
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    max-height: 90vh;
    max-width: 100%;
  }

  .page-header {
    flex-direction: column;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .grid-4 { grid-template-columns: 1fr; }
  .toolbar { gap: 6px; }
  .search-input { width: 100%; }
  .search-input:focus { width: 100%; }

  .page-header__title { font-size: 22px; }
}

/* ============================================================
   NOTIFICATIONS PANEL (topbar bell)
   ============================================================ */
.notif-badge {
  position: absolute;
  top: 1px; right: 1px;
  min-width: 15px; height: 15px;
  padding: 0 3px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--bg-surface);
}

.notif-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 330px;
  background: rgba(11, 16, 34, 0.95);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(37, 99, 235, 0.1);
  z-index: 200;
  display: none;
}

.notif-panel.open {
  display: block;
  animation: dropdownIn 160ms cubic-bezier(0.4, 0, 0.2, 1);
}

.notif-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.notif-panel__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.notif-panel__mark-all {
  font-size: 11px;
  color: var(--accent-light);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.notif-panel__mark-all:hover {
  background: var(--bg-hover);
}

.notif-panel__list {
  max-height: 380px;
  overflow-y: auto;
  padding: 6px;
}

.notif-item {
  display: flex;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
}

.notif-item:hover {
  background: var(--bg-hover);
}

/* Уведомление без ссылки — не выглядит кликабельным */
.notif-item--static { cursor: default; }
.notif-item--static:hover { background: transparent; }
.notif-item--unread.notif-item--static:hover { background: rgba(37, 99, 235, 0.06); }

.notif-item--unread {
  background: rgba(37, 99, 235, 0.06);
}

.notif-item__icon {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-hover);
  color: var(--text-secondary);
}

/* ============================================================
   ACCESSIBILITY — reduced motion
   Respect the OS-level "reduce motion" preference: collapse all
   animations/transitions to near-zero so content appears instantly.
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   === ADMIN-ONLY ADDITIONS (not present in sapphire-panel/css/style.css) ===
   32. ROLE BADGE — a role is not a status, so it does not use the
       tinted-pill .badge* vocabulary; --radius-sm, not pill (pill
       in this system means "filter", per .filter-pill).
   ============================================================ */
.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: var(--bg-hover);
  border: 1px solid var(--border-strong);
  white-space: nowrap;
}

.role-badge--owner {
  color: var(--accent-light);
  border-color: var(--border-accent);
}

.role-badge--support {
  color: var(--text-secondary);
  border-color: var(--border-strong);
}

/* ============================================================
   33. AUDIT DIFF — before → after, used on logs.html (Admin
       Audit), dashboard.html (Recent Admin Activity) and
       reseller-detail.html (Activity tab). The strike on the old
       value is colored (not just decorative) so the direction of
       change reads without parsing the numbers.
   ============================================================ */
.audit-diff {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.audit-diff__old {
  color: var(--text-muted);
  text-decoration: line-through;
  text-decoration-color: rgba(239, 68, 68, 0.6);
}

.audit-diff__arrow {
  color: var(--text-muted);
  flex-shrink: 0;
  width: 11px;
  height: 11px;
}

.audit-diff__new {
  color: var(--text-primary);
  font-weight: 600;
}

/* ============================================================
   34. EXPAND ROW — expandable table row (stats.html Reseller/
       Product tabs, applications.html, logs.html). Written from
       scratch: no precedent exists in the reseller panel — the
       nearest analogues (guide.css .guide-faq-item, api-docs.css
       .api-faq-item) animate a <div>'s max-height, which does not
       work on <tr> (display:table-row ignores max-height; forcing
       display:block breaks column alignment with the header).
       [hidden] toggles instantly (animating row insertion at 40+
       rows is jank); only the inner content fades/slides. Chevron
       rotates 90°, not 180° — this drills into a DIFFERENT
       dataset (a breakdown), it is not an accordion revealing more
       of the same text.
   ============================================================ */
.expand-row { cursor: pointer; }

.expand-row:hover td {
  background: rgba(255, 255, 255, 0.025);
}

.expand-row:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: -2px;
}

.expand-row.open {
  background: rgba(37, 99, 235, 0.06);
}

.expand-row.open:hover td {
  background: transparent;
}

.expand-row__toggle {
  width: 28px;
  padding-right: 0 !important;
}

.expand-row__chevron {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  transition: transform var(--transition-base);
}

.expand-row.open .expand-row__chevron {
  transform: rotate(90deg);
  color: var(--accent-light);
}

.expand-panel td {
  padding: 0 16px 14px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.expand-panel__inner {
  padding: 12px 14px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  animation: expandPanelIn 200ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes expandPanelIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.data-table--nested {
  font-size: 12px;
}

.data-table--nested thead th {
  font-size: 9.5px;
  padding: 6px 10px;
  border-bottom-color: rgba(255, 255, 255, 0.07);
}

.data-table--nested tbody td {
  padding: 8px 10px;
  border-bottom-color: rgba(255, 255, 255, 0.035);
}

/* ============================================================
   35. SEVERITY (announcements.html + dashboard "Attention
       needed"). Named separately from .badge-info/-warning/-danger
       — announcement severity drives the reseller-side banner
       color, a distinct concept worth naming so it doesn't get
       "simplified" into a plain status badge later. Same
       tinted-pill values as their .badge-* counterparts, plus a
       --severity-color custom property so announcements.css can
       use it for a left-border accent without re-deriving the color.
   ============================================================ */
.severity-info {
  background: var(--info-bg);
  color: var(--info);
  border: 1px solid var(--info-border);
  --severity-color: var(--info);
}

.severity-warning {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid var(--warning-border);
  --severity-color: var(--warning);
}

.severity-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
  --severity-color: var(--danger);
}

/* ============================================================
   36. ROLE GATE — data-owner-only="disable" controls (see
       CONTEXT.md §4). The padlock glyph makes the disabled state
       read as policy, not as a broken button.
   ============================================================ */
.gate-lock {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  margin-right: 2px;
}

/* The DEMO chip is a deliberate honesty marker — used on login.html's
   password field to flag that control as scaffolding (see api.js's
   login() comment), nothing else in the panel is. */
.demo-chip {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--warning);
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius-sm);
  padding: 1px 5px;
  flex-shrink: 0;
}

/* ============================================================
   37. NOTIFICATION PANEL — missing rules for markup main.js
       already emits (initNotifications()) but sapphire-panel's
       style.css never styled: .notif-item__title/__body/__time/
       __content and .notif-panel__empty rendered as bare
       unstyled text there. Fixed here since the admin panel keeps
       the notification panel mechanism.
   ============================================================ */
.notif-item__content {
  flex: 1;
  min-width: 0;
}

.notif-item__title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.notif-item__body {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.notif-item__time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.notif-panel__empty {
  padding: 32px 16px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-muted);
}

/* ============================================================
   38. LIST ITEM ROW — was reseller-detail.css only, promoted here
       because products.js reuses the exact same markup for its
       Detection Status History modal without loading that
       stylesheet (rendered as unstyled, run-together text).
   ============================================================ */
.rd-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.rd-list-item:last-child {
  border-bottom: none;
}

.rd-list-item__main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.rd-list-item__sub {
  font-size: 11.5px;
  color: var(--text-muted);
}
