/* style.css — Design tokens, themes, layout, components, pages */

/* ============================================================
   DESIGN TOKENS — LIGHT THEME
   ============================================================ */
[data-theme="light"] {
  /* Backgrounds */
  --bg-page:         #f5f5f5;
  --bg-surface:      #ffffff;
  --bg-elevated:     #ffffff;
  --bg-overlay:      rgba(0, 0, 0, 0.5);
  --bg-subtle:       #f9f9f9;
  --bg-hover:        rgba(0, 0, 0, 0.04);
  --bg-active:       rgba(0, 0, 0, 0.06);
  --bg-code:         #f0f0f0;

  /* Borders */
  --border:          rgba(0, 0, 0, 0.10);
  --border-strong:   rgba(0, 0, 0, 0.18);
  --border-subtle:   rgba(0, 0, 0, 0.05);
  --border-focus:    var(--accent);

  /* Text */
  --text-primary:    #0a0a0a;
  --text-secondary:  #4a4a4a;
  --text-tertiary:   #7a7a7a;
  --text-quaternary: #aaaaaa;
  --text-inverse:    #ffffff;
  --text-on-accent:  #ffffff;

  /* Accent — Indigo */
  --accent:          #4f46e5;
  --accent-hover:    #4338ca;
  --accent-subtle:   #eef2ff;
  --accent-alpha:    rgba(79, 70, 229, 0.12);

  /* Status colors */
  --success:         #16a34a;
  --success-bg:      #f0fdf4;
  --success-alpha:   rgba(22, 163, 74, 0.12);
  --warning:         #d97706;
  --warning-bg:      #fffbeb;
  --warning-alpha:   rgba(217, 119, 6, 0.12);
  --danger:          #dc2626;
  --danger-bg:       #fef2f2;
  --danger-alpha:    rgba(220, 38, 38, 0.12);
  --info:            #0284c7;
  --info-bg:         #f0f9ff;
  --info-alpha:      rgba(2, 132, 199, 0.12);

  /* Shadows */
  --shadow-sm:       0 1px 2px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md:       0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg:       0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
  --shadow-xl:       0 20px 25px -5px rgba(0,0,0,0.08), 0 10px 10px -5px rgba(0,0,0,0.03);

  /* Navbar */
  --nav-bg:          rgba(255, 255, 255, 0.85);
  --nav-border:      rgba(0, 0, 0, 0.08);
}

/* ============================================================
   DESIGN TOKENS — DARK THEME
   ============================================================ */
[data-theme="dark"] {
  /* Backgrounds */
  --bg-page:         #0a0a0a;
  --bg-surface:      #111111;
  --bg-elevated:     #1a1a1a;
  --bg-overlay:      rgba(0, 0, 0, 0.7);
  --bg-subtle:       #0f0f0f;
  --bg-hover:        rgba(255, 255, 255, 0.05);
  --bg-active:       rgba(255, 255, 255, 0.08);
  --bg-code:         #1e1e1e;

  /* Borders */
  --border:          rgba(255, 255, 255, 0.08);
  --border-strong:   rgba(255, 255, 255, 0.15);
  --border-subtle:   rgba(255, 255, 255, 0.04);
  --border-focus:    var(--accent);

  /* Text */
  --text-primary:    #f0f0f0;
  --text-secondary:  #a0a0a0;
  --text-tertiary:   #6a6a6a;
  --text-quaternary: #444444;
  --text-inverse:    #0a0a0a;
  --text-on-accent:  #ffffff;

  /* Accent — Indigo */
  --accent:          #6366f1;
  --accent-hover:    #818cf8;
  --accent-subtle:   rgba(99, 102, 241, 0.12);
  --accent-alpha:    rgba(99, 102, 241, 0.15);

  /* Status colors */
  --success:         #22c55e;
  --success-bg:      rgba(34, 197, 94, 0.08);
  --success-alpha:   rgba(34, 197, 94, 0.12);
  --warning:         #f59e0b;
  --warning-bg:      rgba(245, 158, 11, 0.08);
  --warning-alpha:   rgba(245, 158, 11, 0.12);
  --danger:          #ef4444;
  --danger-bg:       rgba(239, 68, 68, 0.08);
  --danger-alpha:    rgba(239, 68, 68, 0.12);
  --info:            #38bdf8;
  --info-bg:         rgba(56, 189, 248, 0.08);
  --info-alpha:      rgba(56, 189, 248, 0.12);

  /* Shadows */
  --shadow-sm:       0 1px 2px rgba(0,0,0,0.3), 0 1px 3px rgba(0,0,0,0.2);
  --shadow-md:       0 4px 6px -1px rgba(0,0,0,0.4), 0 2px 4px -1px rgba(0,0,0,0.2);
  --shadow-lg:       0 10px 15px -3px rgba(0,0,0,0.5), 0 4px 6px -2px rgba(0,0,0,0.2);
  --shadow-xl:       0 20px 25px -5px rgba(0,0,0,0.6), 0 10px 10px -5px rgba(0,0,0,0.2);

  /* Navbar */
  --nav-bg:          rgba(10, 10, 10, 0.85);
  --nav-border:      rgba(255, 255, 255, 0.06);
}

/* ============================================================
   GLOBAL TOKENS (not theme-dependent)
   ============================================================ */
:root {
  /* Spacing scale (4px base) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Typography scale */
  --text-xs:   12px;
  --text-sm:   13px;
  --text-base: 14px;
  --text-md:   15px;
  --text-lg:   16px;
  --text-xl:   18px;
  --text-2xl:  22px;
  --text-3xl:  28px;

  /* Radius */
  --radius-sm:  4px;
  --radius-md:  6px;
  --radius-lg:  8px;
  --radius-xl:  12px;
  --radius-2xl: 16px;
  --radius-full: 9999px;

  /* Nav height */
  --nav-height: 56px;

  /* Transition */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:  cubic-bezier(0.4, 0, 1, 1);
}

/* ============================================================
   BASE
   ============================================================ */
body {
  background: var(--bg-page);
  color: var(--text-primary);
}

/* Scoped transitions for interactive elements (theme toggle, hover states) */
.btn, .topnav-link, .form-input, .form-select, .card, .badge,
.stat-card, .quick-action-card, .dropdown-item, .nav-icon-btn,
.toast, .user-avatar-btn, .lang-dropdown-trigger, .cmd-k-btn,
.mobile-nav-link, .tab-btn, .toggle-track {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, opacity 0.15s ease;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.page-content {
  margin-top: var(--nav-height);
  flex: 1;
  padding: var(--space-8) var(--space-6);
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

.page-content.full-width {
  max-width: none;
}

/* ============================================================
   TOP NAVIGATION
   ============================================================ */
.topnav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  padding: 0 var(--space-6);
  gap: var(--space-6);
}

.topnav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--text-primary);
  flex-shrink: 0;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.topnav-logo svg {
  flex-shrink: 0;
}

.topnav-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex: 1;
}

.topnav-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
  border: none;
  background: none;
  text-decoration: none;
}

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

.topnav-link.active {
  color: var(--text-primary);
  background: var(--bg-active);
}

.topnav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.nav-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  border: none;
  background: none;
  position: relative;
}

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

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

.cmd-k-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.cmd-k-btn:hover {
  border-color: var(--border-strong);
  color: var(--text-secondary);
  background: var(--bg-hover);
}

.cmd-k-btn svg {
  width: 14px;
  height: 14px;
  stroke-width: 2;
}

.cmd-k-shortcut {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 11px;
}

.cmd-k-shortcut kbd {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 4px;
  font-family: inherit;
  font-size: 10px;
  line-height: 1.5;
  color: var(--text-tertiary);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--accent-subtle);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  flex-shrink: 0;
}

.lang-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  background: none;
}

.lang-dropdown-trigger:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

/* Mobile hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  padding: var(--space-2);
  border: none;
  background: none;
  color: var(--text-secondary);
}

.nav-hamburger svg {
  width: 20px;
  height: 20px;
}

/* ============================================================
   DROPDOWN MENU
   ============================================================ */
.dropdown-container {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  min-width: 180px;
  z-index: 200;
  overflow: hidden;
  animation: dropdownIn 0.12s var(--ease-out);
}

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

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

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

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

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

.dropdown-separator {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.dropdown-header {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.page-header-left {}

.page-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.page-subtitle {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin-top: var(--space-1);
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 7px var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
  line-height: 1.4;
  white-space: nowrap;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

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

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

/* Primary (filled) button */
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text-on-accent);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

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

.btn-danger:hover:not(:disabled) {
  background: var(--danger-alpha);
}

/* Success button */
.btn-success {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

/* Icon button */
.btn-icon {
  padding: 7px;
  background: transparent;
  border-color: var(--border);
  color: var(--text-secondary);
}

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

.btn-sm {
  padding: 4px 10px;
  font-size: var(--text-xs);
}

.btn-sm svg {
  width: 12px;
  height: 12px;
}

.btn-lg {
  padding: 10px var(--space-6);
  font-size: var(--text-base);
}

/* ============================================================
   CARDS / SURFACE
   ============================================================ */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
}

.card-sm {
  padding: var(--space-4);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.card-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.card-subtitle {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* ============================================================
   BENTO GRID
   ============================================================ */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

.bento-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

.bento-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}

.quick-action-grid > * {
  min-height: 44px;
}

.checkout-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--space-4);
}

/* Stat card */
.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-6);
  position: relative;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.stat-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.stat-card-label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-2);
}

.stat-card-value {
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.04em;
  line-height: 1;
  font-family: 'Inter', sans-serif;
}

.stat-card-meta {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-top: var(--space-2);
}

.stat-card-icon {
  position: absolute;
  right: var(--space-5);
  top: var(--space-5);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.stat-card-icon.accent {
  background: var(--accent-alpha);
  color: var(--accent);
}

.stat-card-icon.success {
  background: var(--success-alpha);
  color: var(--success);
}

.stat-card-icon.warning {
  background: var(--warning-alpha);
  color: var(--warning);
}

.stat-card-icon.danger {
  background: var(--danger-alpha);
  color: var(--danger);
}

/* Category label on stat cards */
.stat-card-category {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-quaternary);
  margin-bottom: var(--space-1);
  line-height: 1;
}

/* Alert state — red border for active alerts */
.stat-card-alert {
  border-color: var(--danger);
  box-shadow: 0 0 0 1px var(--danger), inset 0 0 0 0 transparent;
}

.stat-card-alert:hover {
  border-color: var(--danger);
  box-shadow: 0 0 0 1px var(--danger), var(--shadow-sm);
}

.stat-card-alert .stat-card-icon {
  animation: alert-pulse 2s ease-in-out infinite;
}

@keyframes alert-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Quick action card */
.quick-action-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-4) var(--space-5);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-align: left;
  width: 100%;
}

.quick-action-card:hover {
  border-color: var(--accent);
  background: var(--accent-alpha);
  box-shadow: var(--shadow-sm);
}

.quick-action-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--accent-alpha);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.quick-action-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
}

.quick-action-desc {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
}

.badge-primary {
  background: var(--accent-alpha);
  color: var(--accent);
}

.badge-success {
  background: var(--success-alpha);
  color: var(--success);
}

.badge-warning {
  background: var(--warning-alpha);
  color: var(--warning);
}

.badge-danger {
  background: var(--danger-alpha);
  color: var(--danger);
}

.badge-muted {
  background: var(--bg-active);
  color: var(--text-tertiary);
}

.badge-info {
  background: var(--info-alpha);
  color: var(--info);
}

.badge svg {
  width: 10px;
  height: 10px;
}

/* ============================================================
   TABLE
   ============================================================ */
.table-container {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
}

.table-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.table-toolbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: 1;
  flex-wrap: wrap;
}

.table-toolbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

table {
  width: 100%;
}

thead {
  border-bottom: 1px solid var(--border);
}

th {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-tertiary);
  text-align: left;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg-subtle);
}

th.sortable {
  cursor: pointer;
  user-select: none;
}

th.sortable:hover {
  color: var(--text-secondary);
}

td {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

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

tbody tr {
  transition: background 0.1s;
}

tbody tr:hover {
  background: var(--bg-hover);
}

tbody tr.selected {
  background: var(--accent-alpha);
}

td.domain-cell {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
}

.table-empty {
  padding: var(--space-16) var(--space-8);
  text-align: center;
}

/* Checkbox */
.checkbox-cell {
  width: 40px;
  padding-left: var(--space-4);
}

input[type="checkbox"] {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  cursor: pointer;
  accent-color: var(--accent);
}

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.form-label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

.form-label.required::after {
  content: ' *';
  color: var(--danger);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 8px var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: var(--text-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-alpha);
}

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

.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: var(--danger);
}

.form-error {
  font-size: var(--text-xs);
  color: var(--danger);
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
  font-family: inherit;
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236a6a6a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
  cursor: pointer;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

.form-row-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

.input-with-icon {
  position: relative;
}

.input-with-icon .input-icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-quaternary);
  width: 14px;
  height: 14px;
  pointer-events: none;
}

.input-with-icon .form-input {
  padding-left: 34px;
}

.input-clear-btn {
  position: absolute;
  right: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-quaternary);
  cursor: pointer;
  border: none;
  background: none;
  display: flex;
  align-items: center;
  padding: 2px;
  border-radius: var(--radius-sm);
}

.input-clear-btn:hover {
  color: var(--text-tertiary);
  background: var(--bg-hover);
}

/* ============================================================
   TOGGLE
   ============================================================ */
.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.toggle input[type="checkbox"] {
  width: 0;
  height: 0;
  opacity: 0;
  position: absolute;
}

.toggle-track {
  width: 32px;
  height: 18px;
  background: var(--bg-code);
  border-radius: var(--radius-full);
  transition: background 0.15s;
  position: relative;
  border: 1px solid var(--border);
}

.toggle-track::after {
  content: '';
  position: absolute;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  background: var(--text-tertiary);
  transition: transform 0.15s var(--ease-out), background 0.15s;
}

.toggle input:checked + .toggle-track {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle input:checked + .toggle-track::after {
  transform: translateX(14px) translateY(-50%);
  background: white;
}

/* ============================================================
   TABS
   ============================================================ */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-6);
  gap: 0;
}

.tab-btn {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-tertiary);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-secondary);
}

.tab-btn.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}

.tab-btn svg {
  width: 14px;
  height: 14px;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  animation: fadeIn 0.15s ease;
  backdrop-filter: blur(4px);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalIn 0.15s var(--ease-out);
}

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

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

.modal-sm {
  max-width: 380px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.modal-close {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  cursor: pointer;
  border: none;
  background: none;
  transition: all 0.1s;
}

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

.modal-close svg {
  width: 16px;
  height: 16px;
}

.modal-body {
  padding: var(--space-6);
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  font-size: var(--text-sm);
  color: var(--text-primary);
  pointer-events: all;
  max-width: 360px;
  animation: toastIn 0.2s var(--ease-out);
}

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

.toast-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon   { color: var(--danger); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info .toast-icon    { color: var(--info); }

.toast-close {
  margin-left: auto;
  color: var(--text-quaternary);
  cursor: pointer;
  padding: 2px;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
}

.toast-close:hover {
  color: var(--text-tertiary);
}

/* ============================================================
   SPINNER / SKELETON
   ============================================================ */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  flex-shrink: 0;
}

.spinner-sm {
  width: 14px;
  height: 14px;
  border-width: 1.5px;
}

.spinner-lg {
  width: 32px;
  height: 32px;
  border-width: 3px;
}

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

.skeleton {
  border-radius: var(--radius-md);
  background: linear-gradient(
    90deg,
    var(--bg-hover) 25%,
    var(--bg-active) 50%,
    var(--bg-hover) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-16) var(--space-8);
  text-align: center;
  gap: var(--space-4);
}

.empty-state-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-xl);
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-quaternary);
}

.empty-state-icon svg {
  width: 24px;
  height: 24px;
}

.empty-state-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-secondary);
}

.empty-state-desc {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  max-width: 320px;
}

/* ============================================================
   STEPPER (multi-step wizard)
   ============================================================ */
.stepper {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: var(--space-8);
}

.stepper-step {
  display: flex;
  align-items: center;
  flex: 1;
  gap: var(--space-3);
  position: relative;
}

.stepper-step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: calc(24px + var(--space-3));
  right: calc(0px - var(--space-3));
  top: 50%;
  transform: translateY(-50%);
  height: 1px;
  background: var(--border);
  z-index: 0;
}

.stepper-step.completed:not(:last-child)::after {
  background: var(--accent);
}

.stepper-num {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  transition: all 0.2s;
}

.stepper-step.active .stepper-num {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.stepper-step.completed .stepper-num {
  border-color: var(--accent);
  background: var(--accent-alpha);
  color: var(--accent);
}

.stepper-label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.stepper-step.active .stepper-label {
  color: var(--text-primary);
}

.stepper-step.completed .stepper-label {
  color: var(--text-secondary);
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border);
}

.pagination-info {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.page-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: none;
  font-size: var(--text-xs);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.1s;
}

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

.page-btn.active {
  border-color: var(--accent);
  background: var(--accent-alpha);
  color: var(--accent);
  font-weight: 500;
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-btn svg {
  width: 12px;
  height: 12px;
}

/* ============================================================
   BULK ACTIONS TOOLBAR
   ============================================================ */
.bulk-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  background: var(--accent-alpha);
  border-bottom: 1px solid var(--accent);
  animation: slideDown 0.15s ease;
}

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

.bulk-toolbar-count {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--accent);
}

.bulk-toolbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ============================================================
   AUTH PAGES
   ============================================================ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background: var(--bg-page);
  position: relative;
  overflow: hidden;
}

.auth-bg-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image: radial-gradient(circle at 2px 2px, var(--text-primary) 1px, transparent 0);
  background-size: 32px 32px;
  pointer-events: none;
}

.auth-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: var(--space-10) var(--space-10);
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-xl);
  position: relative;
  z-index: 1;
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-8);
}

.auth-logo-text {
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.auth-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  margin-bottom: var(--space-1);
  text-align: center;
}

.auth-subtitle {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  text-align: center;
  margin-bottom: var(--space-8);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-4) 0;
}

.auth-divider-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-divider-text {
  font-size: var(--text-xs);
  color: var(--text-quaternary);
  white-space: nowrap;
}

.auth-footer {
  text-align: center;
  margin-top: var(--space-6);
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

.auth-link {
  color: var(--accent);
  cursor: pointer;
  font-weight: 500;
}

.auth-link:hover {
  color: var(--accent-hover);
}

.demo-btn {
  width: 100%;
  padding: 10px var(--space-4);
  border-radius: var(--radius-md);
  border: 1.5px dashed var(--border-strong);
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.demo-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-alpha);
}

/* Password strength */
.password-strength {
  display: flex;
  gap: 3px;
  margin-top: var(--space-1);
}

.strength-bar {
  flex: 1;
  height: 3px;
  border-radius: var(--radius-full);
  background: var(--border);
  transition: background 0.2s;
}

.strength-bar.filled-1 { background: var(--danger); }
.strength-bar.filled-2 { background: var(--warning); }
.strength-bar.filled-3 { background: var(--warning); }
.strength-bar.filled-4 { background: var(--success); }
.strength-bar.filled-5 { background: var(--success); }

.strength-label {
  font-size: var(--text-xs);
  margin-top: 3px;
}

.strength-label.s1, .strength-label.s2 { color: var(--danger); }
.strength-label.s3 { color: var(--warning); }
.strength-label.s4, .strength-label.s5 { color: var(--success); }

/* ============================================================
   DNS PAGE
   ============================================================ */
.dns-record-type {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: var(--bg-code);
  color: var(--text-secondary);
  white-space: nowrap;
}

.dns-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  color: var(--text-secondary);
  word-break: break-all;
}

/* ============================================================
   BILLING PAGE
   ============================================================ */
.wallet-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wallet-balance {
  font-size: var(--text-3xl);
  font-weight: 700;
  letter-spacing: -0.04em;
  font-family: 'JetBrains Mono', monospace;
}

.currency-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-code);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ============================================================
   TAG COMPONENTS
   ============================================================ */
.tag-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 500;
}

.color-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.color-picker-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
  margin-top: var(--space-2);
}

.color-option {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.1s;
}

.color-option:hover {
  transform: scale(1.1);
}

.color-option.selected {
  border-color: var(--text-primary);
}

/* ============================================================
   NOTIFICATION DOT
   ============================================================ */
.notif-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--danger);
  position: absolute;
  top: 4px;
  right: 4px;
}

/* ============================================================
   LOADING STATE
   ============================================================ */
.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-16);
  gap: var(--space-3);
  color: var(--text-tertiary);
  font-size: var(--text-sm);
}

/* ============================================================
   SECTION HEADER
   ============================================================ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.section-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

/* ============================================================
   DOMAIN STATUS CHIP
   ============================================================ */
.domain-status {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.domain-status.active   { background: var(--success-alpha); color: var(--success); }
.domain-status.expired  { background: var(--danger-alpha); color: var(--danger); }
.domain-status.pending  { background: var(--warning-alpha); color: var(--warning); }
.domain-status.locked   { background: var(--info-alpha); color: var(--info); }
.domain-status.inactive { background: var(--bg-active); color: var(--text-tertiary); }

/* ============================================================
   TOOLTIP
   ============================================================ */
.tooltip-wrapper {
  position: relative;
  display: inline-flex;
}

.tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 11px;
  padding: 4px 8px;
  border-radius: var(--radius-md);
  white-space: nowrap;
  pointer-events: none;
  box-shadow: var(--shadow-md);
  z-index: 300;
  opacity: 0;
  transition: opacity 0.1s;
}

.tooltip-wrapper:hover .tooltip {
  opacity: 1;
}

/* ============================================================
   SLIDE PANEL
   ============================================================ */
.slide-panel-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: 400;
  animation: fadeIn 0.15s ease;
}

.slide-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 480px;
  max-width: 100vw;
  background: var(--bg-elevated);
  border-left: 1px solid var(--border);
  z-index: 401;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  animation: slideIn 0.2s var(--ease-out);
}

@keyframes slideIn {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

.slide-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.slide-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.slide-panel-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border);
  display: flex;
  gap: var(--space-2);
  justify-content: flex-end;
  flex-shrink: 0;
}

/* ============================================================
   ZONE FILE AREA
   ============================================================ */
.zone-file-area {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  min-height: 200px;
  resize: vertical;
  color: var(--text-secondary);
  width: 100%;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .bento-grid { grid-template-columns: repeat(2, 1fr); }
  .bento-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .page-content { padding: var(--space-6) var(--space-4); }
}

@media (max-width: 768px) {
  .topnav-nav { display: none; }
  .nav-hamburger { display: flex; }
  .cmd-k-btn .cmd-k-shortcut { display: none; }
  .bento-grid { grid-template-columns: 1fr 1fr; }
  .bento-grid-3 { grid-template-columns: 1fr; }
  .quick-action-grid { grid-template-columns: repeat(2, 1fr); }
  .checkout-layout { grid-template-columns: 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; }
  .auth-card { padding: var(--space-6); }
  .slide-panel { width: 100%; }
}

@media (max-width: 480px) {
  .bento-grid { grid-template-columns: 1fr; }
  .quick-action-grid { grid-template-columns: 1fr; }
  .page-content { padding: var(--space-4) var(--space-3); }
  .topnav {
    padding: 0 var(--space-3);
    gap: var(--space-2);
  }
  .topnav-logo {
    flex-shrink: 1;
    min-width: 0;
  }
  .topnav-actions {
    gap: var(--space-1);
  }
}

/* ============================================================
   MOBILE NAV OVERLAY
   ============================================================ */
.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: 99;
  animation: fadeIn 0.15s ease;
}

.mobile-nav-panel {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  animation: slideDown 0.15s var(--ease-out);
  box-shadow: var(--shadow-lg);
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.1s;
  border: none;
  background: none;
  text-align: left;
}

.mobile-nav-link:hover, .mobile-nav-link.active {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.mobile-nav-link svg {
  width: 18px;
  height: 18px;
}

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

.search-input-wrapper .search-icon {
  position: absolute;
  left: var(--space-3);
  color: var(--text-quaternary);
  width: 14px;
  height: 14px;
  pointer-events: none;
  flex-shrink: 0;
}

.search-input {
  padding: 7px var(--space-3) 7px 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: var(--text-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
  min-width: 200px;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-alpha);
}

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

/* ============================================================
   TRANSFER STATUS
   ============================================================ */
.transfer-status-pending  { color: var(--warning); }
.transfer-status-approved { color: var(--success); }
.transfer-status-rejected { color: var(--danger); }
.transfer-status-cancelled { color: var(--text-tertiary); }

/* ============================================================
   MISC UTILITY CLASSES
   ============================================================ */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.w-full { width: 100%; }
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.text-muted { color: var(--text-tertiary); }
.text-primary-color { color: var(--text-primary); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-mono { font-family: 'JetBrains Mono', monospace; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============================================================
   COMMAND PALETTE
   ============================================================ */

  .cmd-palette-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    z-index: 600;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    backdrop-filter: blur(4px);
    animation: cmdFadeIn 0.12s ease;
  }

  @keyframes cmdFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
  }

  .cmd-palette {
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 580px;
    overflow: hidden;
    animation: cmdPaletteIn 0.15s var(--ease-out);
  }

  @keyframes cmdPaletteIn {
    from { opacity: 0; transform: scale(0.94) translateY(-12px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
  }

  .cmd-search-wrap {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border);
  }

  .cmd-search-wrap svg {
    width: 18px;
    height: 18px;
    color: var(--text-tertiary);
    flex-shrink: 0;
  }

  .cmd-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: var(--text-base);
    color: var(--text-primary);
    outline: none;
  }

  .cmd-input::placeholder { color: var(--text-quaternary); }

  .cmd-kbd {
    font-size: 11px;
    color: var(--text-quaternary);
    padding: 2px 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-code);
    font-family: inherit;
  }

  .cmd-results {
    max-height: 400px;
    overflow-y: auto;
    padding: var(--space-2);
  }

  .cmd-group-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-quaternary);
    padding: var(--space-2) var(--space-3);
    margin-top: var(--space-1);
  }

  .cmd-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-3);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.1s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
  }

  .cmd-item:hover, .cmd-item.selected {
    background: var(--bg-hover);
  }

  .cmd-item.selected {
    background: var(--accent-alpha);
  }

  .cmd-item-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    background: var(--bg-code);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    flex-shrink: 0;
  }

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

  .cmd-item-icon.accent {
    background: var(--accent-alpha);
    color: var(--accent);
  }

  .cmd-item-label {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
  }

  .cmd-item-desc {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    margin-top: 1px;
  }

  .cmd-item-shortcut {
    margin-left: auto;
    display: flex;
    gap: 3px;
  }

  .cmd-footer {
    border-top: 1px solid var(--border);
    padding: var(--space-3) var(--space-5);
    display: flex;
    align-items: center;
    gap: var(--space-4);
  }

  .cmd-hint {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    font-size: 11px;
    color: var(--text-quaternary);
  }

  .cmd-no-results {
    text-align: center;
    padding: var(--space-10) var(--space-6);
    color: var(--text-tertiary);
    font-size: var(--text-sm);
  }

/* ============================================================
   CLICKABLE STAT CARDS
   ============================================================ */
.stat-card-clickable {
  cursor: pointer;
  user-select: none;
}

.stat-card-clickable:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-sm);
}

.stat-card-clickable:active {
  transform: scale(0.99);
}

.stat-card-clickable:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.stat-card-arrow {
  position: absolute;
  right: var(--space-3);
  bottom: var(--space-3);
  color: var(--text-quaternary);
  transition: color 0.15s, transform 0.15s;
}

.stat-card-clickable:hover .stat-card-arrow {
  color: var(--accent);
  transform: translateX(2px);
}

/* ============================================================
   DOMAIN COMBO BOX (Searchable Dropdown for 30k+ domains)
   ============================================================ */
.domain-combo {
  position: relative;
}

.domain-combo-trigger {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-size: var(--text-sm);
  color: var(--text-primary);
  font-family: inherit;
  line-height: 1.5;
}

.domain-combo-trigger:hover {
  border-color: var(--border-strong);
}

.domain-combo-trigger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.domain-combo-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: dropdownFadeIn 0.12s ease-out;
}

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

.domain-combo-search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.domain-combo-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: var(--text-sm);
  color: var(--text-primary);
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.domain-combo-input::placeholder {
  color: var(--text-quaternary);
}

.domain-combo-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  cursor: pointer;
  padding: 2px;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
}

.domain-combo-clear:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.domain-combo-count {
  padding: 4px 12px;
  font-size: 11px;
  color: var(--text-quaternary);
  border-bottom: 1px solid var(--border);
  background: var(--bg-app);
}

.domain-combo-list {
  max-height: 300px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.domain-combo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 7px 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: var(--text-sm);
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  color: var(--text-secondary);
  text-align: left;
  transition: background 0.08s;
}

.domain-combo-item:hover,
.domain-combo-item.highlighted {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.domain-combo-item.selected {
  color: var(--accent);
  font-weight: 500;
}

.domain-combo-item-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.domain-combo-empty {
  padding: 24px 12px;
  text-align: center;
  color: var(--text-quaternary);
  font-size: var(--text-sm);
}

.domain-combo-more {
  padding: 8px 12px;
  text-align: center;
  color: var(--text-quaternary);
  font-size: 11px;
  border-top: 1px solid var(--border);
  background: var(--bg-app);
}

/* ============================================================
   PUSH DOMAIN OPTION CARDS
   ============================================================ */
.push-option-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-6) var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  width: 100%;
}

.push-option-card:hover {
  border-color: var(--accent);
  background: var(--accent-alpha);
  box-shadow: var(--shadow-sm);
}

.push-option-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
}

.push-option-card:hover .push-option-icon {
  background: var(--accent-alpha);
}

.push-option-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.push-option-desc {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  line-height: 1.5;
}

/* ============================================================
   ACCESSIBILITY — Screen-reader-only & skip link
   ============================================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sr-only-focusable:focus {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  width: auto;
  height: auto;
  padding: 8px 16px;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  background: var(--accent);
  color: var(--text-on-accent);
  font-size: 14px;
  font-weight: 600;
  border-radius: 0 0 var(--radius-md) 0;
}

