/* ============================================================
   HyperCyber Referral & Agent System — Design Tokens + Components
   Style Tier: minimal-light + brand-themed
   Aesthetic: clean-premium / tech-refined
   ============================================================ */

:root {
  /* --- Color System --- */
  --color-primary:         #0ea5e9;
  --color-primary-hover:   #0284c7;
  --color-primary-light:   #e0f2fe;
  --color-primary-lighter: #f0f9ff;
  --color-accent:          #06b6d4;
  --color-accent-hover:    #0891b2;

  --color-success:         #10b981;
  --color-success-light:   #d1fae5;
  --color-warning:         #f59e0b;
  --color-warning-light:   #fef3c7;
  --color-danger:          #ef4444;
  --color-danger-light:    #fee2e2;

  --color-bg:              #f8fafc;
  --color-surface:         #ffffff;
  --color-surface-hover:   #f8fafc;
  --color-surface-muted:   #f1f5f9;

  --color-border:          #e2e8f0;
  --color-border-light:    #f1f5f9;
  --color-border-hover:    #cbd5e1;

  --color-text:            #0f172a;
  --color-text-sub:        #475569;
  --color-text-muted:      #94a3b8;
  --color-text-inverse:    #ffffff;

  /* --- Typography --- */
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono:    'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;

  --text-xs:   12px;
  --text-sm:   13px;
  --text-base: 14px;
  --text-lg:   16px;
  --text-xl:   20px;
  --text-2xl:  24px;
  --text-3xl:  30px;
  --text-4xl:  36px;
  --text-5xl:  48px;

  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.6;

  /* --- Radius --- */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 9999px;

  /* --- Shadow --- */
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 16px 32px -8px rgba(15, 23, 42, 0.12), 0 6px 12px -6px rgba(15, 23, 42, 0.08);
  --shadow-modal: 0 25px 50px -12px rgba(15, 23, 42, 0.25);

  /* --- Spacing (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;

  /* --- Layout --- */
  --container-max: 1200px;
  --sidebar-w: 240px;
  --topbar-h: 60px;
  --client-nav-h: 64px;

  /* --- Motion --- */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 150ms;
  --dur-base: 250ms;
  --dur-slow: 400ms;

  /* --- Brand Gradient --- */
  --brand-gradient: linear-gradient(135deg, #06b6d4 0%, #0ea5e9 40%, #3b82f6 100%);
  --brand-gradient-soft: linear-gradient(135deg, rgba(6,182,212,0.1) 0%, rgba(59,130,246,0.1) 100%);
}

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

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
ul { list-style: none; }

/* ============================================================
   Lucide Icons (inline SVG sizing)
   ============================================================ */
.icon {
  width: 16px;
  height: 16px;
  stroke-width: 1.75;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.icon-sm { width: 14px; height: 14px; }
.icon-lg { width: 20px; height: 20px; }
.icon-xl { width: 24px; height: 24px; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 8px 16px;
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.4;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  transition: all var(--dur-fast) var(--ease-out);
  white-space: nowrap;
  user-select: none;
}
.btn:hover { background: var(--color-surface-hover); border-color: var(--color-border-hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

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

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--color-text-sub);
}
.btn-ghost:hover { background: var(--color-surface-muted); color: var(--color-text); }

.btn-icon {
  padding: 8px;
  width: 36px;
  height: 36px;
}

.btn-lg { padding: 12px 24px; font-size: var(--text-base); }
.btn-sm { padding: 6px 12px; font-size: var(--text-xs); }

/* ============================================================
   Inputs / Forms
   ============================================================ */
.form-input {
  width: 100%;
  padding: 10px 14px;
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  outline: none;
  transition: all var(--dur-fast) var(--ease-out);
}
.form-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}
.form-input::placeholder { color: var(--color-text-muted); }
.form-input:disabled { background: var(--color-surface-muted); cursor: not-allowed; }

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}
.form-label .required { color: var(--color-danger); margin-right: 2px; }

.form-select {
  width: 100%;
  padding: 10px 36px 10px 14px;
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  outline: none;
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: all var(--dur-fast) var(--ease-out);
}
.form-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.form-textarea {
  width: 100%;
  padding: 10px 14px;
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  outline: none;
  resize: vertical;
  min-height: 80px;
  transition: all var(--dur-fast) var(--ease-out);
}
.form-textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.form-hint { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 6px; }
.char-count { text-align: right; font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 4px; }

.input-with-suffix { position: relative; }
.input-suffix {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  pointer-events: none;
}

.form-group { margin-bottom: var(--space-5); }

/* Filter-style small inputs */
.filter-input, .filter-select {
  padding: 7px 12px;
  font-size: var(--text-xs);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text-sub);
  outline: none;
  height: 32px;
  transition: all var(--dur-fast) var(--ease-out);
}
.filter-input:focus, .filter-select:focus { border-color: var(--color-primary); color: var(--color-text); }
.filter-select {
  appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  cursor: pointer;
}

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-body { padding: var(--space-5); }
.card-header {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ============================================================
   Tables
   ============================================================ */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
  padding: 12px 16px;
  text-align: left;
  font-size: var(--text-sm);
}
.data-table th {
  font-weight: 500;
  color: var(--color-text-sub);
  background: var(--color-surface-muted);
  border-bottom: 1px solid var(--color-border);
}
.data-table td {
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border-light);
}
.data-table tbody tr:hover { background: var(--color-surface-muted); }
.data-table td.num, .data-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table td.mono { font-family: var(--font-mono); font-size: var(--text-xs); }

/* Transaction hash cell */
.tx-hash-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-sub);
}
.tx-hash-cell .tx-text {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tx-hash-cell .tx-copy {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.tx-hash-cell .tx-copy:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
}
.tx-hash-cell .tx-copy.copied {
  background: var(--color-success-light);
  color: var(--color-success);
}
.tx-hash-cell .tx-link {
  flex-shrink: 0;
  color: var(--color-text-muted);
  text-decoration: none;
  display: inline-flex;
  transition: color var(--dur-fast) var(--ease-out);
}
.tx-hash-cell .tx-link:hover { color: var(--color-primary); }
.tx-hash-pending {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-style: italic;
}

/* ============================================================
   Modal
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
  animation: fadeIn var(--dur-base) var(--ease-out);
}
.modal-overlay.active { display: flex; }

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

.modal {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  padding: var(--space-8);
  position: relative;
  box-shadow: var(--shadow-modal);
  animation: modalIn var(--dur-base) var(--ease-out);
}
.modal-lg { max-width: 560px; }

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

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  transition: all var(--dur-fast) var(--ease-out);
}
.modal-close:hover { background: var(--color-surface-muted); color: var(--color-text); }

.modal-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: var(--leading-tight);
  margin-bottom: var(--space-2);
}
.modal-subtitle {
  font-size: var(--text-base);
  color: var(--color-text-sub);
  margin-bottom: var(--space-6);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-border-light);
}

/* ============================================================
   Tabs
   ============================================================ */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--color-border);
  padding: 0 var(--space-5);
  gap: var(--space-1);
}
.tab {
  padding: 14px 16px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-sub);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--dur-fast) var(--ease-out);
  background: none;
  margin-bottom: -1px;
}
.tab:hover { color: var(--color-text); }
.tab.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }

/* ============================================================
   Badges / Tags
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: var(--text-xs);
  font-weight: 500;
  border-radius: var(--radius-full);
  line-height: 1.6;
}
.badge-success { background: var(--color-success-light); color: #065f46; }
.badge-warning { background: var(--color-warning-light); color: #92400e; }
.badge-danger  { background: var(--color-danger-light); color: #991b1b; }
.badge-info    { background: var(--color-primary-light); color: #075985; }
.badge-default { background: var(--color-surface-muted); color: var(--color-text-sub); }

.tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  background: var(--color-primary);
  color: white;
  letter-spacing: 0.3px;
}

/* ============================================================
   Empty State
   ============================================================ */
.empty-state {
  padding: 64px 24px;
  text-align: center;
  color: var(--color-text-muted);
}
.empty-state .empty-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  color: var(--color-text-muted);
  opacity: 0.6;
}
.empty-state .empty-text { font-size: var(--text-sm); }

/* ============================================================
   Client Surface — Top Navbar
   ============================================================ */
.client-navbar {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 0 24px;
  height: var(--client-nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.client-nav-left { display: flex; align-items: center; gap: 40px; }

.client-logo {
  font-size: 18px;
  font-weight: 700;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.3px;
  white-space: nowrap;
}

.client-nav-links { display: flex; gap: 4px; }
.client-nav-links a {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-sub);
  border-radius: var(--radius-sm);
  transition: all var(--dur-fast) var(--ease-out);
}
.client-nav-links a:hover { color: var(--color-text); background: var(--color-surface-muted); }
.client-nav-links a.active { color: var(--color-primary); background: var(--color-primary-lighter); }

.client-nav-right { display: flex; align-items: center; gap: 12px; }

.wallet-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.wallet-pill:hover { border-color: var(--color-primary); color: var(--color-primary); }
.wallet-pill .wallet-addr {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-sub);
}

.client-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 32px 24px;
}

/* ============================================================
   Admin Surface — Sidebar Layout
   ============================================================ */
.admin-layout {
  display: flex;
  min-height: 100vh;
  background: var(--color-bg);
}

.admin-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  padding: var(--space-4) 0;
  overflow-y: auto;
  z-index: 50;
}

.admin-sidebar-logo {
  padding: 0 var(--space-5) var(--space-4);
  border-bottom: 1px solid var(--color-border-light);
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-sidebar-logo .logo-mark {
  width: 32px;
  height: 32px;
  background: var(--brand-gradient);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 14px;
}
.admin-sidebar-logo .logo-text {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
}

.sidebar-section { padding: 0 var(--space-3); margin-bottom: var(--space-2); }

.sidebar-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-3);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--color-text-muted);
  cursor: pointer;
  user-select: none;
  transition: color var(--dur-fast);
}
.sidebar-section-title:hover { color: var(--color-text-sub); }
.sidebar-section-title .section-icon { display: inline-flex; align-items: center; gap: 10px; }
.sidebar-section-title .section-arrow { transition: transform var(--dur-fast); }
.sidebar-section.collapsed .section-arrow { transform: rotate(-90deg); }
.sidebar-section.collapsed .sidebar-menu { display: none; }

.sidebar-menu { list-style: none; }
.sidebar-menu li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  font-size: var(--text-sm);
  color: var(--color-text-sub);
  border-radius: var(--radius-sm);
  transition: all var(--dur-fast) var(--ease-out);
  cursor: pointer;
}
.sidebar-menu li a:hover { background: var(--color-surface-muted); color: var(--color-text); }
.sidebar-menu li a.active {
  background: var(--color-primary-lighter);
  color: var(--color-primary);
  font-weight: 500;
}
.sidebar-menu li a .icon { color: currentColor; }

.admin-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.admin-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 0 var(--space-6);
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
}

.admin-header-left { display: flex; align-items: center; gap: 12px; }
.admin-breadcrumb { font-size: var(--text-sm); color: var(--color-text-muted); }
.admin-breadcrumb .current { color: var(--color-text); font-weight: 500; }

.admin-header-right { display: flex; align-items: center; gap: 12px; }

.rate-indicator {
  font-size: var(--text-sm);
  color: var(--color-text-sub);
}
.rate-indicator strong {
  color: var(--color-primary);
  font-weight: 600;
}

.admin-content { padding: var(--space-6); flex: 1; }

.page-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-5);
  gap: var(--space-4);
  flex-wrap: wrap;
}
.page-toolbar h2 {
  font-size: var(--text-xl);
  font-weight: 600;
}
.page-toolbar-title { display: flex; align-items: center; gap: 10px; }

.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4) var(--space-5);
  gap: var(--space-3);
  flex-wrap: wrap;
  border-bottom: 1px solid var(--color-border-light);
}
.filters-row { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }

/* ============================================================
   Stat Cards (Referral Dashboard)
   ============================================================ */
.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  transition: all var(--dur-base) var(--ease-out);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-sub);
  margin-bottom: var(--space-2);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  cursor: help;
}

.stat-value {
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.stat-card-sm .stat-value { font-size: var(--text-xl); }

/* ============================================================
   Copy Item
   ============================================================ */
.copy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  gap: 12px;
}
.copy-row .copy-text {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: var(--color-primary-lighter);
  color: var(--color-primary);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 500;
  transition: all var(--dur-fast) var(--ease-out);
  flex-shrink: 0;
}
.copy-btn:hover { background: var(--color-primary); color: white; }
.copy-btn.copied { background: var(--color-success); color: white; }

/* ============================================================
   Alert Banner
   ============================================================ */
.alert-banner {
  background: var(--color-warning-light);
  border: 1px solid #fcd34d;
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.alert-banner h3 { font-size: var(--text-lg); font-weight: 600; margin-bottom: 4px; color: #92400e; }
.alert-banner p { font-size: var(--text-sm); color: #b45309; }

/* ============================================================
   Hero / Entry Page
   ============================================================ */
.hero-section {
  min-height: calc(100vh - var(--client-nav-h));
  background: var(--color-surface);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(14, 165, 233, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14, 165, 233, 0.06) 1px, transparent 1px);
  background-size: 50px 50px;
  transform: perspective(600px) rotateX(60deg) translateY(40%);
  transform-origin: bottom center;
  mask-image: linear-gradient(to bottom, transparent, black 25%, black 75%, transparent);
}

.hero-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(6,182,212,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.hero-glow-1 { top: -200px; left: -100px; }
.hero-glow-2 { bottom: -200px; right: -100px; background: radial-gradient(circle, rgba(59,130,246,0.12) 0%, transparent 70%); }

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 40px 24px;
  max-width: 640px;
  animation: heroReveal var(--dur-slow) var(--ease-out) both;
}

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

.hero-title {
  font-size: var(--text-5xl);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: var(--space-4);
  letter-spacing: -1px;
}
.hero-title .gradient-text {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-sub);
  margin-bottom: var(--space-8);
  line-height: var(--leading-relaxed);
}

.hero-cta {
  padding: 14px 36px;
  font-size: var(--text-base);
  font-weight: 600;
  background: var(--color-text);
  color: var(--color-text-inverse);
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--dur-base) var(--ease-out);
}
.hero-cta:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

/* ============================================================
   Login Page
   ============================================================ */
.login-page {
  min-height: 100vh;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
}

.login-wrap { width: 100%; max-width: 420px; }

.login-logo-mark {
  width: 64px;
  height: 64px;
  background: var(--brand-gradient);
  border-radius: var(--radius-lg);
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 28px;
  font-weight: 800;
  box-shadow: var(--shadow-md);
}

.login-title {
  font-size: var(--text-3xl);
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--space-2);
}
.login-subtitle {
  text-align: center;
  color: var(--color-text-sub);
  font-size: var(--text-base);
  margin-bottom: var(--space-8);
}

.login-card {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-7);
  box-shadow: var(--shadow-sm);
}

.login-submit {
  width: 100%;
  padding: 12px;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
  margin-top: var(--space-2);
}
.login-submit:hover { background: var(--color-primary-hover); }
.login-submit:disabled { opacity: 0.6; cursor: not-allowed; }

.password-wrapper { position: relative; }
.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
  transition: color var(--dur-fast);
}
.password-toggle:hover { color: var(--color-text-sub); }

/* ============================================================
   Staggered Page Reveal
   ============================================================ */
.reveal > * {
  opacity: 0;
  transform: translateY(12px);
  animation: revealItem var(--dur-base) var(--ease-out) forwards;
}
.reveal > *:nth-child(1) { animation-delay: 50ms; }
.reveal > *:nth-child(2) { animation-delay: 100ms; }
.reveal > *:nth-child(3) { animation-delay: 150ms; }
.reveal > *:nth-child(4) { animation-delay: 200ms; }
.reveal > *:nth-child(5) { animation-delay: 250ms; }
.reveal > *:nth-child(6) { animation-delay: 300ms; }
.reveal > *:nth-child(7) { animation-delay: 350ms; }
.reveal > *:nth-child(8) { animation-delay: 400ms; }

@keyframes revealItem {
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Action Links
   ============================================================ */
.action-link {
  color: var(--color-primary);
  font-size: var(--text-sm);
  cursor: pointer;
  margin-right: 12px;
  transition: color var(--dur-fast);
}
.action-link:hover { text-decoration: underline; }
.action-link.danger { color: var(--color-danger); }

/* ============================================================
   Admin — Enhanced UI Details
   ============================================================ */

/* Table enhancements */
.data-table thead th {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.2px;
  text-transform: none;
}
.data-table tbody tr {
  transition: background-color var(--dur-fast) var(--ease-out);
}
.data-table tbody tr:last-child td { border-bottom: none; }

.data-table .row-actions {
  display: flex;
  gap: var(--space-3);
  align-items: center;
}

/* Enhanced empty state */
.empty-state {
  padding: 80px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}
.empty-state .empty-icon {
  width: 56px;
  height: 56px;
  color: var(--color-text-muted);
  opacity: 0.4;
  margin-bottom: var(--space-1);
}
.empty-state .empty-title {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--color-text-sub);
}
.empty-state .empty-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  max-width: 320px;
  text-align: center;
}
.empty-state .empty-action {
  margin-top: var(--space-2);
}

/* Modal header accent line */
.modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--brand-gradient);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

/* Form field focus ring polish */
.form-input:focus, .form-select:focus, .form-textarea:focus {
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}

/* Select option hover — native only, but we style the wrapper */
.form-select {
  transition: all var(--dur-fast) var(--ease-out);
}
.form-select:hover { border-color: var(--color-border-hover); }

/* Skeleton loader */
.skeleton {
  background: linear-gradient(90deg, var(--color-surface-muted) 25%, var(--color-border-light) 50%, var(--color-surface-muted) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Page toolbar stat chips */
.toolbar-stats {
  display: flex;
  gap: var(--space-4);
  align-items: center;
}
.toolbar-stat {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.toolbar-stat .label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.toolbar-stat .value {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

/* Admin sidebar — active indicator */
.sidebar-menu li a.active {
  position: relative;
}
.sidebar-menu li a.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--color-primary);
  border-radius: 0 3px 3px 0;
}

/* Admin header breadcrumb separator tweak */
.admin-breadcrumb .current::before {
  content: '·';
  margin: 0 6px;
  color: var(--color-text-muted);
}

/* Card hover lift for dashboard cards */
.card-hover {
  transition: all var(--dur-base) var(--ease-out);
}
.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
  .admin-sidebar { transform: translateX(-100%); transition: transform var(--dur-base) var(--ease-out); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
}

@media (max-width: 768px) {
  .client-nav-links { display: none; }
  .client-container { padding: 20px 16px; }
  .admin-content { padding: var(--space-4); }
  .hero-title { font-size: var(--text-3xl); }
  .stat-value { font-size: var(--text-2xl); }
}
