/* ==========================================================================
   AuraAuth - Minimalist Clean SaaS Design System (Linear / Vercel Style)
   Ultra-clean Dark Slate, High-Contrast Typography, Refined Micro-Details
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  /* Minimal Dark Palette (Vercel / Linear Spec) */
  --bg-base: #000000;
  --bg-surface: #09090b;
  --bg-surface-elevated: #121215;
  --bg-card: #0c0d0f;
  --bg-input: #08080a;
  --bg-hover: rgba(255, 255, 255, 0.04);

  /* Subtle Monochromatic Borders */
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-normal: rgba(255, 255, 255, 0.12);
  --border-active: rgba(255, 255, 255, 0.25);
  --border-focus: #ffffff;

  /* Refined Functional Accents (Desaturated, High-End) */
  --accent-white: #ffffff;
  --accent-blue: #3b82f6;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #ef4444;

  /* Typography Colors */
  --text-primary: #ededed;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --text-inverse: #000000;

  /* Typography Scale */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Radii (Modern Crisp 6px - 10px) */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  /* Shadows (Subtle, Deep) */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.8);

  /* Transitions */
  --trans-fast: 0.12s ease;
  --trans-normal: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Global Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14.5px;
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
  background: #27272a;
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: #3f3f46;
}

::selection {
  background: #27272a;
  color: #ffffff;
}

/* Background (Clean, Minimal, No Tacky Orbs) */
.bg-ambient {
  display: none;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 20%, #000 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(circle at 50% 20%, #000 20%, transparent 80%);
  pointer-events: none;
  z-index: 1;
}

#app {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   HEADER & NAVIGATION BAR (VERCEL / LINEAR STYLE)
   ========================================================================== */
.main-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 2rem;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
}

.brand-logo-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: #18181b;
  border: 1px solid var(--border-normal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #ffffff;
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.brand-title span:first-child {
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.brand-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-xs);
  text-transform: uppercase;
}

/* Navigation Segmented Switcher */
.view-switcher {
  display: flex;
  align-items: center;
  background: #09090b;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.25rem;
  gap: 0.2rem;
}

.switcher-btn {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.95rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--trans-fast);
  white-space: nowrap;
}

.switcher-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.switcher-btn.active {
  color: #ffffff;
  background: #18181b;
  border: 1px solid var(--border-normal);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.switcher-btn .badge {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

/* Reseller Profile & Header Actions */
.reseller-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.credit-pill {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: #09090b;
  border: 1px solid var(--border-normal);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.credit-pill strong {
  color: #ffffff;
}

.user-avatar-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.3rem 0.65rem 0.3rem 0.3rem;
  background: #09090b;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.avatar-circle {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-xs);
  background: #27272a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.7rem;
  color: #ffffff;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.15;
}

.user-role {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* ==========================================================================
   BUTTONS (CLEAN MINIMAL SAAS STYLE)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--trans-fast);
  text-decoration: none;
  white-space: nowrap;
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.76rem;
  border-radius: var(--radius-xs);
}

/* Primary = Crisp White Button (Vercel Signature) */
.btn-primary {
  background: #ffffff;
  color: #000000;
  font-weight: 600;
  border-color: #ffffff;
}

.btn-primary:hover {
  background: #e4e4e7;
  border-color: #e4e4e7;
  transform: translateY(-1px);
}

.btn-secondary {
  background: #0e0e11;
  border: 1px solid var(--border-normal);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: #18181b;
  border-color: var(--border-active);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-danger {
  background: #180b0d;
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #f87171;
}

.btn-danger:hover {
  background: #2b0e12;
  border-color: rgba(239, 68, 68, 0.45);
}

/* ==========================================================================
   MAIN LAYOUT & METRICS (MINIMAL CARDS)
   ========================================================================== */
.main-wrapper {
  flex: 1;
  padding: 2rem 2.2rem;
  max-width: 1360px;
  width: 100%;
  margin: 0 auto;
}

.view-section {
  display: none;
  animation: fadeIn 0.2s ease forwards;
}

.view-section.active {
  display: block;
}

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

/* Clean Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-normal);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.35rem;
  transition: border-color var(--trans-fast);
}

.metric-card:hover {
  border-color: var(--border-active);
}

.metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.metric-title {
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-icon-box {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-xs);
  background: #18181b;
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.metric-value-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.metric-value {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #ffffff;
  line-height: 1;
}

.metric-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-xs);
  background: #18181b;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.badge-positive { color: var(--accent-emerald); }
.badge-neutral { color: var(--accent-blue); }
.badge-warning { color: var(--accent-amber); }
.badge-danger { color: var(--accent-rose); }

/* ==========================================================================
   ACTION TOOLBAR & FILTERS
   ========================================================================== */
.action-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.batch-actions-bar {
  display: none;
  align-items: center;
  gap: 0.6rem;
  background: #18181b;
  border: 1px solid var(--border-normal);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
}

.batch-actions-bar.active {
  display: flex;
}

.search-box {
  position: relative;
  min-width: 280px;
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 0.85rem;
}

.search-box input {
  width: 100%;
  padding: 0.55rem 0.95rem 0.55rem 2.4rem;
  background: var(--bg-input);
  border: 1px solid var(--border-normal);
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  outline: none;
  transition: border-color var(--trans-fast);
}

.search-box input:focus {
  border-color: #ffffff;
}

.filter-select {
  padding: 0.55rem 0.95rem;
  background: var(--bg-input);
  border: 1px solid var(--border-normal);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  outline: none;
  cursor: pointer;
  transition: border-color var(--trans-fast);
}

.filter-select:focus {
  border-color: #ffffff;
}

.filter-select option {
  background: #09090b;
  color: #ffffff;
}

/* ==========================================================================
   LICENSE KEYS TABLE (CLEAN MINIMALIST DATA TABLE)
   ========================================================================== */
.table-card,
.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border-normal);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table-card-header,
.table-header-info {
  padding: 1.15rem 1.4rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.table-card-title,
.table-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: #ffffff;
}

.table-card-title .badge,
.table-counter-pill {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-xs);
  background: #18181b;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.license-table,
.keys-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.license-table th,
.keys-table th {
  padding: 0.85rem 1.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #08080a;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.license-table td,
.keys-table td {
  padding: 0.95rem 1.25rem;
  font-size: 0.84rem;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  color: var(--text-primary);
}

.license-table tbody tr:hover td,
.keys-table tbody tr:hover td {
  background: var(--bg-hover);
}

/* Key Display Badge & Cell */
.key-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.key-code,
.key-badge {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.82rem;
  color: #ffffff;
  background: #121215;
  border: 1px solid var(--border-normal);
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-xs);
  letter-spacing: 0.02em;
}

.copy-mini-btn,
.copy-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  border-radius: var(--radius-xs);
  transition: all var(--trans-fast);
}

.copy-mini-btn:hover,
.copy-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

/* Status Pill & Badge (Clean Linear Style) */
.status-badge,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-xs);
  background: #18181b;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.status-badge.status-active,
.status-pill.status-active {
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.25);
  background: rgba(52, 211, 153, 0.08);
}
.status-badge.status-active .status-dot,
.status-pill.status-active .status-dot { background: #34d399; }

.status-badge.status-unused,
.status-pill.status-unused {
  color: #60a5fa;
  border-color: rgba(96, 165, 250, 0.25);
  background: rgba(96, 165, 250, 0.08);
}
.status-badge.status-unused .status-dot,
.status-pill.status-unused .status-dot { background: #60a5fa; }

.status-badge.status-expired,
.status-pill.status-expired {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.25);
  background: rgba(251, 191, 36, 0.08);
}
.status-badge.status-expired .status-dot,
.status-pill.status-expired .status-dot { background: #fbbf24; }

.status-badge.status-banned,
.status-pill.status-banned {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.25);
  background: rgba(248, 113, 113, 0.08);
}
.status-badge.status-banned .status-dot,
.status-pill.status-banned .status-dot { background: #f87171; }

/* HWID Cells & Badges */
.hwid-cell {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.hwid-tag,
.hwid-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  background: #121215;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
  max-width: 170px;
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hwid-empty {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.hwid-reset-btn {
  background: #18181b;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all var(--trans-fast);
}

.hwid-reset-btn:hover {
  background: #27272a;
  color: #ffffff;
  border-color: var(--border-normal);
}

/* Action Buttons (Table Quick Actions) */
.cell-actions,
.action-btns {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}

.action-btn,
.btn-action-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-xs);
  background: #18181b;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all var(--trans-fast);
}

.action-btn:hover,
.btn-action-icon:hover {
  background: #27272a;
  color: #ffffff;
  border-color: var(--border-normal);
  transform: translateY(-1px);
}

.action-btn.btn-delete:hover,
.btn-action-icon.danger:hover {
  background: #2b0e12;
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}

/* ==========================================================================
   CLIENT SOFTWARE LOGIN / LOADER (MINIMALIST TECH STYLE)
   ========================================================================== */
.client-auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 190px);
  padding: 1.5rem;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--bg-card);
  border: 1px solid var(--border-normal);
  border-radius: var(--radius-lg);
  padding: 2.2rem 2.2rem;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.loader-window-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.15rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.window-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.ctrl-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}
.ctrl-dot.red { background: #3f3f46; }
.ctrl-dot.yellow { background: #52525b; }
.ctrl-dot.green { background: #71717a; }

.window-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.window-badge {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-xs);
}

.auth-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.auth-logo {
  width: 52px;
  height: 52px;
  margin: 0 auto 1.1rem auto;
  border-radius: var(--radius-md);
  background: #18181b;
  border: 1px solid var(--border-normal);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.auth-title {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin-bottom: 0.3rem;
}

.auth-subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.auth-hwid-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: #121215;
  border: 1px solid var(--border-subtle);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-xs);
  margin-top: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.auth-hwid-badge strong {
  color: #ffffff;
}

.loader-telemetry-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding: 0.65rem;
  background: #08080a;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.telemetry-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.telemetry-box .t-label {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 0.15rem;
}

.telemetry-box .t-val {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.telemetry-box .t-val.verified { color: var(--accent-emerald); }
.telemetry-box .t-val.active { color: #ffffff; }

.auth-form-group {
  margin-bottom: 1.25rem;
}

.auth-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.45rem;
}

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

.key-input {
  width: 100%;
  padding: 0.75rem 4.5rem 0.75rem 0.95rem;
  background: var(--bg-input);
  border: 1px solid var(--border-normal);
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  outline: none;
  transition: border-color var(--trans-fast);
}

.key-input:focus {
  border-color: #ffffff;
}

.paste-key-btn {
  position: absolute;
  right: 0.5rem;
  background: #18181b;
  border: 1px solid var(--border-normal);
  color: var(--text-secondary);
  font-size: 0.74rem;
  font-weight: 500;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--trans-fast);
}

.paste-key-btn:hover {
  background: #27272a;
  color: #ffffff;
}

.auth-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.35rem;
}

.remember-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.auth-btn-submit {
  width: 100%;
  padding: 0.85rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: #000000;
  border: none;
  cursor: pointer;
  transition: all var(--trans-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.auth-btn-submit:hover {
  background: #e4e4e7;
  transform: translateY(-1px);
}

.auth-footer {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--text-secondary);
  text-decoration: underline;
}

.auth-footer a:hover {
  color: #ffffff;
}

/* Success Card */
.auth-success-card {
  display: none;
  text-align: center;
}
.auth-success-card.active {
  display: block;
}

.status-ring {
  width: 54px;
  height: 54px;
  margin: 0 auto 1.15rem auto;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--accent-emerald);
}

.software-info-box {
  background: #09090b;
  border: 1px solid var(--border-normal);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin: 1.25rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.software-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
}

.software-info-row .label { color: var(--text-muted); }
.software-info-row .value { font-family: var(--font-mono); font-weight: 600; color: #ffffff; }

.launch-btn {
  width: 100%;
  padding: 0.85rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: #000000;
  border: none;
  cursor: pointer;
  margin-bottom: 0.75rem;
  transition: all var(--trans-fast);
}

.launch-btn:hover {
  background: #e4e4e7;
}

/* ==========================================================================
   DEVELOPER & API SIMULATOR VIEW
   ========================================================================== */
.api-view-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.code-card {
  background: var(--bg-card);
  border: 1px solid var(--border-normal);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.code-card-header {
  padding: 0.95rem 1.25rem;
  background: #08080a;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.code-lang-selector {
  display: flex;
  gap: 0.35rem;
}

.lang-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  cursor: pointer;
  font-weight: 500;
  transition: all var(--trans-fast);
}

.lang-btn.active {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
  font-weight: 600;
}

.code-block-wrapper {
  position: relative;
  max-height: 480px;
  overflow-y: auto;
}

.code-block {
  padding: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.6;
  color: #d4d4d8;
  background: #000000;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Activity Log */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.activity-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.15rem;
  background: #09090b;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
}

.activity-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.activity-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-xs);
  background: #18181b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.activity-desc {
  font-weight: 500;
  color: var(--text-primary);
}

.activity-time {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ==========================================================================
   MODALS SYSTEM (MINIMAL VERGEL / LINEAR STYLE)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.modal-content,
.modal-card {
  width: 100%;
  max-width: 520px;
  background: #0e0e11;
  border: 1px solid var(--border-normal);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  position: relative;
  transform: scale(0.98);
  transition: transform 0.2s ease;
}

.modal-overlay.active .modal-content,
.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-header {
  padding: 1.15rem 1.5rem;
  background: #09090b;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  letter-spacing: -0.01em;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.35rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem;
  transition: color var(--trans-fast);
}

.modal-close-btn:hover {
  color: #ffffff;
}

.modal-body {
  padding: 1.5rem;
  max-height: 75vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 1.1rem 1.5rem;
  background: #09090b;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Form Grid & Input Controls Inside Modals */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-control,
.form-input,
.form-select,
.form-textarea {
  width: 100% !important;
  box-sizing: border-box;
  padding: 0.65rem 0.85rem;
  background: var(--bg-input);
  border: 1px solid var(--border-normal);
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.84rem;
  outline: none;
  transition: border-color var(--trans-fast);
}

.form-control:focus,
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: #ffffff;
  background: #000000;
}

.form-control option {
  background: #0e0e11;
  color: #ffffff;
}

.form-textarea {
  resize: vertical;
  min-height: 70px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 400px;
  background: #18181b;
  border: 1px solid var(--border-normal);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--shadow-md);
  animation: slideToast 0.2s ease forwards;
}

@keyframes slideToast {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast.toast-success { border-left: 2px solid var(--accent-emerald); }
.toast.toast-error { border-left: 2px solid var(--accent-rose); }
.toast.toast-info { border-left: 2px solid var(--text-secondary); }

.toast-icon { font-size: 1rem; }
.toast-message { font-size: 0.82rem; color: var(--text-primary); font-weight: 500; }

/* ==========================================================================
   STAFF SECURITY LOGIN OVERLAY (MINIMAL VERGEL / LINEAR LOGIN GATE)
   ========================================================================== */
.admin-auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s;
}

.admin-auth-overlay.active {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.admin-auth-card {
  width: 100%;
  max-width: 440px;
  background: #0c0d0f;
  border: 1px solid var(--border-normal);
  border-radius: var(--radius-lg);
  padding: 2.4rem 2.2rem;
  box-shadow: var(--shadow-lg);
  position: relative;
}

/* Remove gimmicky corner brackets */
.hud-corner {
  display: none;
}

.hud-telemetry-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.telemetry-pill {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text-muted);
  background: #141417;
  border: 1px solid var(--border-subtle);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-xs);
}

.telemetry-pill.live {
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.2);
}

.beacon-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #34d399;
  display: inline-block;
  margin-right: 0.3rem;
}

.auth-security-badge {
  display: none;
}

.admin-auth-header {
  text-align: center;
  margin-bottom: 1.85rem;
}

.security-shield-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 1.1rem auto;
  border-radius: var(--radius-md);
  background: #18181b;
  border: 1px solid var(--border-normal);
  display: flex;
  align-items: center;
  justify-content: center;
}

.shield-svg {
  width: 22px;
  height: 22px;
  color: #ffffff;
}

.shield-pulse,
.shield-radar {
  display: none;
}

.admin-auth-title {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin-bottom: 0.35rem;
}

.admin-auth-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

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

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

.admin-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-normal);
  border-radius: var(--radius-sm);
  padding: 0.75rem 2.5rem 0.75rem 2.6rem;
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.86rem;
  outline: none;
  transition: border-color var(--trans-fast);
}

.admin-input:focus {
  border-color: #ffffff;
  background: #000000;
}

.toggle-pwd-btn {
  position: absolute;
  right: 0.75rem;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 0.25rem;
  transition: color var(--trans-fast);
}

.toggle-pwd-btn:hover {
  color: #ffffff;
}

/* Password Strength Indicator */
.pwd-strength-container {
  margin-top: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.strength-bar {
  flex: 1;
  height: 3px;
  background: #18181b;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.strength-fill {
  height: 100%;
  width: 25%;
  background: #52525b;
  border-radius: var(--radius-full);
  transition: width 0.2s ease, background 0.2s ease;
}

.strength-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-muted);
}

/* Quick Fill Preset Button */
.admin-quick-fill-row {
  margin-top: 0.4rem;
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: flex-end;
}

.quick-chip-btn {
  background: #141417;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all var(--trans-fast);
}

.quick-chip-btn:hover {
  background: #27272a;
  color: #ffffff;
  border-color: var(--border-normal);
}

.ip-indicator {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Vercel-Style Master Login Button (White Primary) */
.admin-auth-submit-btn {
  width: 100%;
  padding: 0.85rem;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: #000000;
  border: none;
  cursor: pointer;
  transition: all var(--trans-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.15rem;
}

.admin-auth-submit-btn:hover {
  background: #e4e4e7;
  transform: translateY(-1px);
}

.admin-warning-banner {
  margin-top: 1.15rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  background: #09090b;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 0.65rem 0.85rem;
  line-height: 1.4;
  text-align: center;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 1200px) {
  .metrics-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .main-header {
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.85rem;
  }
  .view-switcher {
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
  }
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .api-view-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .main-wrapper {
    padding: 1rem;
  }
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  .action-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .search-box {
    width: 100%;
    min-width: 0;
  }
  .admin-auth-card {
    padding: 1.75rem 1.4rem;
  }
}