/* ═══════════════════════════════════════════════════════════════════════════
   ASTRA DESIGN SYSTEM — GrayPay Brand V3
   Target Quality: Stripe / Brex / Adyen / Ramp / Plaid
   Version: 3.0.0 — ASTRA Implementation
   ═══════════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════════════
   1. CSS CUSTOM PROPERTIES — DARK MODE (DEFAULT)
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* ─────────────────────────────────────────────────────────────────────────
     BRAND COLORS (Same in both modes)
     ───────────────────────────────────────────────────────────────────────── */
  --primary: #4B63FF;
  --primary-light: #7C8AFF;
  --primary-dark: #2D3BB8;
  --primary-rgb: 75, 99, 255;

  --accent: #00E0A5;
  --accent-light: #4DFFD0;
  --accent-dark: #00A578;

  /* ─────────────────────────────────────────────────────────────────────────
     SEMANTIC COLORS (Same in both modes)
     ───────────────────────────────────────────────────────────────────────── */
  --success: #17D992;
  --success-light: rgba(23, 217, 146, 0.15);
  --success-border: rgba(23, 217, 146, 0.3);

  --warning: #FFB020;
  --warning-light: rgba(255, 176, 32, 0.15);
  --warning-border: rgba(255, 176, 32, 0.3);

  --danger: #FF4757;
  --danger-light: rgba(255, 71, 87, 0.15);
  --danger-border: rgba(255, 71, 87, 0.3);

  --info: #3B82F6;
  --info-light: rgba(59, 130, 246, 0.15);
  --info-border: rgba(59, 130, 246, 0.3);

  /* ─────────────────────────────────────────────────────────────────────────
     DARK MODE SURFACES & TEXT
     ───────────────────────────────────────────────────────────────────────── */
  --background: #0D1117;
  --background-elevated: #161B22;

  --surface: rgba(255, 255, 255, 0.03);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --surface-active: rgba(255, 255, 255, 0.09);

  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);
  --border-focus: var(--primary);

  --text-primary: #FFFFFF;
  --text-secondary: #A4ACB5;
  --text-tertiary: #6B7280;
  --text-disabled: #4B5563;

  /* ─────────────────────────────────────────────────────────────────────────
     SHADOWS
     ───────────────────────────────────────────────────────────────────────── */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.5);

  /* ─────────────────────────────────────────────────────────────────────────
     TYPOGRAPHY
     ───────────────────────────────────────────────────────────────────────── */
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'IBM Plex Sans', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;

  /* ─────────────────────────────────────────────────────────────────────────
     SPACING (Base: 4px)
     ───────────────────────────────────────────────────────────────────────── */
  --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;
  --space-20: 80px;
  --space-24: 96px;

  /* ─────────────────────────────────────────────────────────────────────────
     TIMING & EASING
     ───────────────────────────────────────────────────────────────────────── */
  --duration-instant: 100ms;
  --duration-fast: 150ms;
  --duration-normal: 200ms;
  --duration-slow: 300ms;
  --duration-slower: 400ms;
  --duration-slowest: 500ms;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* ─────────────────────────────────────────────────────────────────────────
     BORDER RADIUS
     ───────────────────────────────────────────────────────────────────────── */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* ─────────────────────────────────────────────────────────────────────────
     Z-INDEX
     ───────────────────────────────────────────────────────────────────────── */
  --z-base: 0;
  --z-dropdown: 10;
  --z-sticky: 20;
  --z-fixed: 30;
  --z-modal-backdrop: 40;
  --z-modal: 50;
  --z-popover: 60;
  --z-tooltip: 70;
  --z-toast: 80;
}

/* ═══════════════════════════════════════════════════════════════════════════
   2. LIGHT MODE OVERRIDES
   ═══════════════════════════════════════════════════════════════════════════ */

.light-mode {
  --background: #FFFFFF;
  --background-elevated: #F9FAFB;

  --surface: rgba(0, 0, 0, 0.02);
  --surface-hover: rgba(0, 0, 0, 0.04);
  --surface-active: rgba(0, 0, 0, 0.06);

  --border: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(0, 0, 0, 0.15);

  --text-primary: #111827;
  --text-secondary: #6B7280;
  --text-tertiary: #9CA3AF;
  --text-disabled: #D1D5DB;

  --success-light: rgba(23, 217, 146, 0.12);
  --success-border: rgba(23, 217, 146, 0.25);
  --warning-light: rgba(255, 176, 32, 0.12);
  --warning-border: rgba(255, 176, 32, 0.25);
  --danger-light: rgba(255, 71, 87, 0.12);
  --danger-border: rgba(255, 71, 87, 0.25);
  --info-light: rgba(59, 130, 246, 0.12);
  --info-border: rgba(59, 130, 246, 0.25);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.15);
}

/* ═══════════════════════════════════════════════════════════════════════════
   3. KEYFRAME ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════════ */

/* Fade animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

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

/* Scale animations */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes scaleOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.95);
  }
}

@keyframes scaleInSpring {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  70% {
    opacity: 1;
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* Slide animations */
@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

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

@keyframes slideInUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes slideInDown {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

/* Loading animations */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes progress {
  0% { left: -30%; }
  100% { left: 100%; }
}

/* Attention animations */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(75, 99, 255, 0.4); }
  50% { box-shadow: 0 0 20px 4px rgba(75, 99, 255, 0.4); }
}

@keyframes ring {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

/* Real-time update animations */
@keyframes flashGreen {
  0% { color: var(--text-primary); }
  30% { color: var(--success); }
  100% { color: var(--text-primary); }
}

@keyframes flashRed {
  0% { color: var(--text-primary); }
  30% { color: var(--danger); }
  100% { color: var(--text-primary); }
}

@keyframes highlightNew {
  0% { background: rgba(75, 99, 255, 0.2); }
  100% { background: transparent; }
}

@keyframes shrink {
  from { width: 100%; }
  to { width: 0%; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   4. BASE STYLES
   ═══════════════════════════════════════════════════════════════════════════ */

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

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

body {
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.625;
  color: var(--text-primary);
  background-color: var(--background);
  transition: background-color var(--duration-normal) var(--ease-out),
              color var(--duration-normal) var(--ease-out);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
  color: var(--primary-light);
}

/* ═══════════════════════════════════════════════════════════════════════════
   5. TYPOGRAPHY
   ═══════════════════════════════════════════════════════════════════════════ */

.gp-display {
  font-family: var(--font-heading);
  font-size: 48px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h1, .gp-h1 {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

h2, .gp-h2 {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.005em;
  color: var(--text-primary);
}

h3, .gp-h3 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
}

h4, .gp-h4 {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
}

.gp-body {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.625;
  color: var(--text-primary);
}

.gp-small {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-secondary);
}

.gp-caption {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
}

.gp-micro {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.03em;
  color: var(--text-tertiary);
}

.gp-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ═══════════════════════════════════════════════════════════════════════════
   6. BUTTONS (gp-btn)
   ═══════════════════════════════════════════════════════════════════════════ */

.gp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-ui);
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: 
    background-color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}

.gp-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(75, 99, 255, 0.4);
}

.gp-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Button variants */
.gp-btn-primary {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
}

.gp-btn-primary:hover {
  background: var(--primary-light);
  border-color: var(--primary-light);
  transform: translateY(-1px);
}

.gp-btn-primary:active {
  background: var(--primary-dark);
  transform: translateY(0);
}

.gp-btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border);
}

.gp-btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
}

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

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

.gp-btn-danger {
  background: var(--danger);
  color: #FFFFFF;
  border-color: var(--danger);
}

.gp-btn-danger:hover {
  background: #FF6B78;
}

.gp-btn-success {
  background: var(--success);
  color: #0D1117;
  border-color: var(--success);
}

.gp-btn-success:hover {
  background: #2EE8A6;
}

.gp-btn-outline-primary {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.gp-btn-outline-primary:hover {
  background: rgba(75, 99, 255, 0.1);
}

/* Button sizes */
.gp-btn-lg {
  height: 48px;
  padding: 0 24px;
  font-size: 15px;
}

.gp-btn-md {
  height: 40px;
  padding: 0 20px;
  font-size: 14px;
}

.gp-btn-sm {
  height: 32px;
  padding: 0 14px;
  font-size: 13px;
}

.gp-btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
}

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

.gp-btn-icon.gp-btn-lg {
  width: 48px;
  height: 48px;
}

/* Button with icon */
.gp-btn-icon-left,
.gp-btn-icon-right {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Loading state */
.gp-btn.loading {
  pointer-events: none;
}

.gp-btn.loading .gp-spinner {
  animation: spin 800ms linear infinite;
}

/* ═══════════════════════════════════════════════════════════════════════════
   7. CARDS (gp-card)
   ═══════════════════════════════════════════════════════════════════════════ */

.gp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.gp-card-elevated {
  background: var(--background-elevated);
  box-shadow: var(--shadow-lg);
  transition: 
    transform var(--duration-normal) var(--ease-out),
    box-shadow var(--duration-normal) var(--ease-out);
}

.gp-card-elevated:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.16);
  transform: translateY(-2px);
}

.gp-card-interactive {
  cursor: pointer;
  transition: 
    transform var(--duration-normal) var(--ease-out),
    border-color var(--duration-normal) var(--ease-out),
    box-shadow var(--duration-normal) var(--ease-out);
}

.gp-card-interactive:hover {
  border-color: var(--primary-light);
  box-shadow: 0 8px 32px rgba(75, 99, 255, 0.12);
  transform: translateY(-2px);
}

.gp-card-interactive:active {
  transform: translateY(0);
  transition-duration: var(--duration-instant);
}

.gp-card-interactive:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(75, 99, 255, 0.4);
}

/* Metric card */
.gp-card-metric {
  border-left: 4px solid var(--primary);
  padding: 20px 24px;
}

.gp-card-metric .metric-value {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}

.gp-card-metric .metric-label {
  font-size: 13px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.gp-card-metric .metric-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  margin-top: 8px;
}

.gp-card-metric .metric-trend.up {
  color: var(--success);
}

.gp-card-metric .metric-trend.down {
  color: var(--danger);
}

/* Metric card border variants */
.gp-card-metric.success {
  border-left-color: var(--success);
}

.gp-card-metric.warning {
  border-left-color: var(--warning);
}

.gp-card-metric.danger {
  border-left-color: var(--danger);
}

.gp-card-metric.accent {
  border-left-color: var(--accent);
}

/* Portal card */
.gp-card-portal {
  text-align: center;
  padding: 40px 32px;
  background: linear-gradient(180deg, var(--surface), transparent);
  transition: 
    transform var(--duration-normal) var(--ease-out),
    box-shadow var(--duration-normal) var(--ease-out);
}

.gp-card-portal:hover {
  transform: scale(1.02);
  box-shadow: 0 0 40px rgba(75, 99, 255, 0.15);
}

.gp-card-portal .portal-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  color: var(--primary);
}

.gp-card-portal .portal-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.gp-card-portal .portal-desc {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Card sections */
.gp-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.gp-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.gp-card-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.gp-card-body {
  /* Default content area */
}

.gp-card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  margin-top: 16px;
}

/* Metric update animation */
.gp-card-metric.updating .metric-value {
  animation: pulse 400ms ease-out;
}

/* ═══════════════════════════════════════════════════════════════════════════
   8. TABLES (gp-table)
   ═══════════════════════════════════════════════════════════════════════════ */

.gp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.gp-table th,
.gp-table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.gp-table th {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  background: var(--surface);
}

.gp-table td {
  color: var(--text-primary);
}

.gp-table tbody tr {
  transition: background var(--duration-fast) ease;
}

.gp-table tbody tr:hover {
  background: var(--surface-hover);
}

/* Table variants */
.gp-table-striped tbody tr:nth-child(odd) {
  background: var(--surface);
}

.gp-table-striped tbody tr:hover {
  background: var(--surface-hover);
}

.gp-table-dense th,
.gp-table-dense td {
  padding: 8px 12px;
  font-size: 13px;
}

.gp-table-bordered th,
.gp-table-bordered td {
  border: 1px solid var(--border);
}

.gp-table-sticky {
  position: relative;
}

.gp-table-sticky thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

.gp-table-sticky th {
  background: var(--background);
}

/* Table cell types */
.gp-table-number {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.gp-table-currency {
  font-family: var(--font-mono);
  font-weight: 500;
  text-align: right;
}

.gp-table-status {
  width: 120px;
}

.gp-table-actions {
  text-align: right;
  width: 100px;
}

.gp-table-actions .action-group {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.gp-table-id {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
}

.gp-table-date {
  white-space: nowrap;
  color: var(--text-secondary);
}

/* Table container */
.gp-table-container {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.gp-table-container .gp-table {
  margin: 0;
}

.gp-table-container .gp-table th:first-child,
.gp-table-container .gp-table td:first-child {
  padding-left: 20px;
}

.gp-table-container .gp-table th:last-child,
.gp-table-container .gp-table td:last-child {
  padding-right: 20px;
}

/* Row animations */
.gp-table-row-detail {
  animation: fadeInUp var(--duration-normal) var(--ease-out);
}

.gp-table-row.updated {
  animation: glow 1000ms ease-out;
}

.gp-table-row.new {
  animation: highlightNew 2000ms ease-out;
}

/* ═══════════════════════════════════════════════════════════════════════════
   9. BADGES (gp-badge)
   ═══════════════════════════════════════════════════════════════════════════ */

.gp-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 9999px;
  white-space: nowrap;
}

.gp-badge svg {
  width: 14px;
  height: 14px;
}

/* Badge variants */
.gp-badge-success {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid var(--success-border);
}

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

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

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

.gp-badge-neutral {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.gp-badge-primary {
  background: rgba(75, 99, 255, 0.15);
  color: var(--primary);
  border: 1px solid rgba(75, 99, 255, 0.3);
}

.gp-badge-high-risk {
  background: linear-gradient(135deg, var(--danger), var(--warning));
  color: #FFFFFF;
  border: none;
  font-weight: 600;
}

/* Badge sizes */
.gp-badge-sm {
  height: 20px;
  padding: 0 8px;
  font-size: 11px;
}

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

/* Badge with status dot */
.gp-badge-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ═══════════════════════════════════════════════════════════════════════════
   10. FORMS (gp-form)
   ═══════════════════════════════════════════════════════════════════════════ */

.gp-form-group {
  margin-bottom: 16px;
}

.gp-form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

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

.gp-form-hint {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 6px;
}

.gp-form-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 6px;
}

/* Text input */
.gp-input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: 
    border-color var(--duration-fast) ease,
    box-shadow var(--duration-fast) ease;
}

.gp-input::placeholder {
  color: var(--text-tertiary);
}

.gp-input:hover {
  border-color: var(--border-hover);
}

.gp-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(75, 99, 255, 0.15);
}

.gp-input.error {
  border-color: var(--danger);
  animation: shake 400ms ease-out;
}

.gp-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--surface);
}

/* Select */
.gp-select {
  width: 100%;
  height: 40px;
  padding: 0 36px 0 12px;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  appearance: none;
  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='%23A4ACB5' 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;
  background-size: 16px;
}

.gp-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(75, 99, 255, 0.15);
}

/* Textarea */
.gp-textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  resize: vertical;
}

.gp-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(75, 99, 255, 0.15);
}

/* Checkbox */
.gp-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.gp-checkbox input {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  appearance: none;
  transition: all var(--duration-fast) ease;
}

.gp-checkbox input:checked {
  background: var(--primary);
  border-color: var(--primary);
  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='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20,6 9,17 4,12'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  animation: scaleInSpring var(--duration-normal) var(--ease-spring);
}

.gp-checkbox input:focus-visible {
  box-shadow: 0 0 0 3px rgba(75, 99, 255, 0.4);
}

.gp-checkbox span {
  font-size: 14px;
  color: var(--text-primary);
}

/* Toggle switch */
.gp-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all var(--duration-normal) ease;
}

.gp-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: left var(--duration-normal) var(--ease-out);
}

.gp-toggle.active {
  background: var(--primary);
  border-color: var(--primary);
}

.gp-toggle.active::after {
  left: 22px;
  background: #FFFFFF;
}

/* Input with icon */
.gp-input-group {
  position: relative;
}

.gp-input-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--text-tertiary);
  pointer-events: none;
}

.gp-input-icon.left {
  left: 12px;
}

.gp-input-icon.right {
  right: 12px;
}

.gp-input-group .gp-input.has-icon-left {
  padding-left: 40px;
}

.gp-input-group .gp-input.has-icon-right {
  padding-right: 40px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   11. NAVIGATION (gp-nav)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Sidebar */
.gp-sidebar {
  width: 260px;
  height: 100vh;
  background: var(--background);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  z-index: var(--z-fixed);
  transition: width var(--duration-normal) var(--ease-out);
}

.gp-sidebar.collapsed {
  width: 64px;
}

.gp-sidebar-logo {
  height: 64px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.gp-sidebar-logo img {
  width: 32px;
  height: 32px;
}

.gp-sidebar-logo span {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.gp-sidebar-nav {
  flex: 1;
  padding: 16px 8px;
  overflow-y: auto;
}

.gp-sidebar-section {
  margin-bottom: 24px;
}

.gp-sidebar-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  padding: 0 8px;
  margin-bottom: 8px;
}

.gp-sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  padding: 0 12px;
  margin: 2px 0;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: 
    background-color var(--duration-fast) ease,
    color var(--duration-fast) ease;
}

.gp-sidebar-item:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.gp-sidebar-item.active {
  background: rgba(75, 99, 255, 0.1);
  color: var(--primary);
}

.gp-sidebar-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.gp-sidebar-item span {
  font-size: 14px;
  font-weight: 500;
}

.gp-sidebar-user {
  padding: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.gp-sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface);
}

.gp-sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.gp-sidebar-user-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gp-sidebar-user-role {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Top navbar */
.gp-topbar {
  height: 64px;
  background: var(--background);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}

.gp-topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.gp-topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.gp-topbar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.gp-topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.gp-topbar-breadcrumb a {
  color: var(--text-secondary);
}

.gp-topbar-breadcrumb a:hover {
  color: var(--primary);
}

.gp-topbar-breadcrumb span {
  color: var(--text-tertiary);
}

/* Mobile menu */
.gp-mobile-menu {
  animation: slideInLeft var(--duration-slow) var(--ease-out);
}

/* Dropdown */
.gp-dropdown-menu {
  animation: scaleIn var(--duration-fast) var(--ease-out);
  transform-origin: top center;
}

/* ═══════════════════════════════════════════════════════════════════════════
   12. SHELL LAYOUT (gp-shell)
   ═══════════════════════════════════════════════════════════════════════════ */

.gp-shell {
  display: flex;
  min-height: 100vh;
  background: var(--background);
}

.gp-shell-content {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
}

.gp-shell-content.sidebar-collapsed {
  margin-left: 64px;
}

.gp-main {
  flex: 1;
  padding: 40px 48px;
  overflow-y: auto;
  animation: fadeInUp var(--duration-slower) var(--ease-out);
}

/* ═══════════════════════════════════════════════════════════════════════════
   13. PAGE HEADER
   ═══════════════════════════════════════════════════════════════════════════ */

.gp-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
}

.gp-page-header-content {
  flex: 1;
}

.gp-page-title {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.gp-page-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}

.gp-page-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   14. MODALS (gp-modal)
   ═══════════════════════════════════════════════════════════════════════════ */

.gp-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal-backdrop);
  animation: fadeIn var(--duration-normal) ease-out;
}

.gp-modal-overlay.closing {
  animation: fadeOut var(--duration-fast) ease-in forwards;
}

.gp-modal {
  background: var(--background-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-xl);
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: scaleIn var(--duration-normal) var(--ease-out);
}

.gp-modal.closing {
  animation: scaleOut var(--duration-fast) ease-in forwards;
}

.gp-modal-header {
  padding: 24px 24px 0;
  animation: fadeInUp var(--duration-normal) var(--ease-out) 50ms both;
}

.gp-modal-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.gp-modal-description {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.gp-modal-body {
  padding: 24px;
  animation: fadeInUp var(--duration-normal) var(--ease-out) 100ms both;
}

.gp-modal-footer {
  padding: 0 24px 24px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  animation: fadeInUp var(--duration-normal) var(--ease-out) 150ms both;
}

/* ═══════════════════════════════════════════════════════════════════════════
   15. NOTIFICATIONS & ALERTS
   ═══════════════════════════════════════════════════════════════════════════ */

/* Toast */
.gp-toast {
  position: fixed;
  top: 24px;
  right: 24px;
  background: var(--background-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 400px;
  z-index: var(--z-toast);
  animation: slideInDown var(--duration-slow) var(--ease-out);
}

.gp-toast.exiting {
  animation: fadeOut var(--duration-normal) ease-in forwards;
}

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

.gp-toast-content {
  flex: 1;
}

.gp-toast-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.gp-toast-message {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.gp-toast-close {
  width: 20px;
  height: 20px;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: color var(--duration-fast) ease;
}

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

.gp-toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 12px 12px;
  animation: shrink 5000ms linear forwards;
}

/* Toast variants */
.gp-toast-success .gp-toast-icon {
  color: var(--success);
}

.gp-toast-warning .gp-toast-icon {
  color: var(--warning);
}

.gp-toast-danger .gp-toast-icon {
  color: var(--danger);
}

.gp-toast-info .gp-toast-icon {
  color: var(--info);
}

/* Alert banner */
.gp-banner {
  padding: 12px 20px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideInDown var(--duration-slow) var(--ease-out);
}

.gp-banner.dismissing {
  animation: slideInUp var(--duration-normal) ease-in reverse forwards;
}

.gp-banner-info {
  background: var(--info-light);
  border: 1px solid var(--info-border);
  color: var(--info);
}

.gp-banner-warning {
  background: var(--warning-light);
  border: 1px solid var(--warning-border);
  color: var(--warning);
}

.gp-banner-danger {
  background: var(--danger-light);
  border: 1px solid var(--danger-border);
  color: var(--danger);
}

.gp-banner-success {
  background: var(--success-light);
  border: 1px solid var(--success-border);
  color: var(--success);
}

/* ═══════════════════════════════════════════════════════════════════════════
   16. LOADING STATES
   ═══════════════════════════════════════════════════════════════════════════ */

/* Spinner */
.gp-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.gp-spinner-lg {
  width: 32px;
  height: 32px;
  border-width: 3px;
  animation: spin 1000ms linear infinite;
}

/* Skeleton */
.gp-skeleton {
  background: linear-gradient(
    90deg,
    var(--surface) 25%,
    var(--surface-hover) 50%,
    var(--surface) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
  border-radius: 4px;
}

.gp-skeleton-text {
  height: 14px;
  margin-bottom: 8px;
}

.gp-skeleton-title {
  height: 24px;
  width: 60%;
  margin-bottom: 12px;
}

.gp-skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.gp-skeleton-button {
  height: 40px;
  width: 120px;
  border-radius: 8px;
}

/* Loading dots */
.gp-loading-dots {
  display: flex;
  gap: 4px;
}

.gp-loading-dots span {
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  animation: bounce 600ms ease-in-out infinite;
}

.gp-loading-dots span:nth-child(1) { animation-delay: 0ms; }
.gp-loading-dots span:nth-child(2) { animation-delay: 100ms; }
.gp-loading-dots span:nth-child(3) { animation-delay: 200ms; }

/* ═══════════════════════════════════════════════════════════════════════════
   17. STAGGERED ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════════ */

/* Grid stagger */
.stagger-grid > * {
  animation: fadeInUp var(--duration-slow) var(--ease-out) both;
}

.stagger-grid > *:nth-child(1) { animation-delay: 0ms; }
.stagger-grid > *:nth-child(2) { animation-delay: 50ms; }
.stagger-grid > *:nth-child(3) { animation-delay: 100ms; }
.stagger-grid > *:nth-child(4) { animation-delay: 150ms; }
.stagger-grid > *:nth-child(5) { animation-delay: 200ms; }
.stagger-grid > *:nth-child(6) { animation-delay: 250ms; }
.stagger-grid > *:nth-child(7) { animation-delay: 300ms; }
.stagger-grid > *:nth-child(8) { animation-delay: 350ms; }
.stagger-grid > *:nth-child(9) { animation-delay: 400ms; }
.stagger-grid > *:nth-child(10) { animation-delay: 450ms; }
.stagger-grid > *:nth-child(11) { animation-delay: 500ms; }
.stagger-grid > *:nth-child(12) { animation-delay: 550ms; }

/* List stagger */
.stagger-list > * {
  animation: fadeInLeft 250ms var(--ease-out) both;
}

.stagger-list > *:nth-child(1) { animation-delay: 0ms; }
.stagger-list > *:nth-child(2) { animation-delay: 40ms; }
.stagger-list > *:nth-child(3) { animation-delay: 80ms; }
.stagger-list > *:nth-child(4) { animation-delay: 120ms; }
.stagger-list > *:nth-child(5) { animation-delay: 160ms; }
.stagger-list > *:nth-child(6) { animation-delay: 200ms; }
.stagger-list > *:nth-child(7) { animation-delay: 240ms; }
.stagger-list > *:nth-child(8) { animation-delay: 280ms; }

/* Table row stagger */
.stagger-table tbody tr {
  animation: fadeIn var(--duration-normal) ease-out both;
}

.stagger-table tbody tr:nth-child(1) { animation-delay: 0ms; }
.stagger-table tbody tr:nth-child(2) { animation-delay: 30ms; }
.stagger-table tbody tr:nth-child(3) { animation-delay: 60ms; }
.stagger-table tbody tr:nth-child(4) { animation-delay: 90ms; }
.stagger-table tbody tr:nth-child(5) { animation-delay: 120ms; }
.stagger-table tbody tr:nth-child(6) { animation-delay: 150ms; }
.stagger-table tbody tr:nth-child(7) { animation-delay: 180ms; }
.stagger-table tbody tr:nth-child(8) { animation-delay: 210ms; }
.stagger-table tbody tr:nth-child(9) { animation-delay: 240ms; }
.stagger-table tbody tr:nth-child(10) { animation-delay: 270ms; }

/* Hero stagger */
.hero-badge { animation: fadeInUp var(--duration-slower) var(--ease-out) 0ms both; }
.hero-title { animation: fadeInUp var(--duration-slower) var(--ease-out) 100ms both; }
.hero-subtitle { animation: fadeInUp var(--duration-slower) var(--ease-out) 200ms both; }
.hero-cta { animation: fadeInUp var(--duration-slower) var(--ease-out) 300ms both; }
.hero-image { animation: fadeIn 600ms var(--ease-out) 400ms both; }

/* Metrics grid stagger */
.gp-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.gp-metrics-grid .gp-card-metric {
  animation: fadeInUp var(--duration-slow) var(--ease-out) both;
}

.gp-metrics-grid .gp-card-metric:nth-child(1) { animation-delay: 0ms; }
.gp-metrics-grid .gp-card-metric:nth-child(2) { animation-delay: 50ms; }
.gp-metrics-grid .gp-card-metric:nth-child(3) { animation-delay: 100ms; }
.gp-metrics-grid .gp-card-metric:nth-child(4) { animation-delay: 150ms; }

/* ═══════════════════════════════════════════════════════════════════════════
   18. LIVE INDICATORS
   ═══════════════════════════════════════════════════════════════════════════ */

.live-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.live-indicator::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 1500ms ease-in-out infinite;
}

/* Metric value updates */
.metric-value.updating {
  animation: pulse 400ms ease-out;
}

.metric-value.positive-change {
  animation: flashGreen 600ms ease-out;
}

.metric-value.negative-change {
  animation: flashRed 600ms ease-out;
}

/* ═══════════════════════════════════════════════════════════════════════════
   19. THEME TOGGLE
   ═══════════════════════════════════════════════════════════════════════════ */

.gp-theme-toggle {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--duration-fast) ease;
}

.gp-theme-toggle:hover {
  background: var(--surface-hover);
}

.gp-theme-toggle svg {
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
}

.gp-theme-toggle .icon-moon { display: none; }
.gp-theme-toggle .icon-sun { display: block; }

.light-mode .gp-theme-toggle .icon-moon { display: block; }
.light-mode .gp-theme-toggle .icon-sun { display: none; }

/* ═══════════════════════════════════════════════════════════════════════════
   20. RESPONSIVE BREAKPOINTS
   ═══════════════════════════════════════════════════════════════════════════ */

/* Desktop XL: 1440px+ */
@media (min-width: 1440px) {
  .gp-main {
    max-width: 1440px;
    margin: 0 auto;
  }
}

/* Desktop: 1280px */
@media (max-width: 1280px) {
  .gp-metrics-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Laptop: 1024px */
@media (max-width: 1024px) {
  .gp-sidebar {
    width: 64px;
  }
  
  .gp-sidebar-logo span,
  .gp-sidebar-item span,
  .gp-sidebar-section-title,
  .gp-sidebar-user-info {
    display: none;
  }
  
  .gp-sidebar-item {
    justify-content: center;
    padding: 0;
  }
  
  .gp-shell-content {
    margin-left: 64px;
  }
  
  .gp-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Tablet: 768px */
@media (max-width: 768px) {
  .gp-sidebar {
    position: fixed;
    left: -260px;
    width: 260px;
    transition: left var(--duration-slow) var(--ease-out);
  }
  
  .gp-sidebar.open {
    left: 0;
  }
  
  .gp-sidebar-logo span,
  .gp-sidebar-item span,
  .gp-sidebar-section-title,
  .gp-sidebar-user-info {
    display: block;
  }
  
  .gp-sidebar-item {
    justify-content: flex-start;
    padding: 0 12px;
  }
  
  .gp-shell-content {
    margin-left: 0;
  }
  
  .gp-main {
    padding: 24px;
  }
  
  .gp-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  
  .gp-page-header {
    flex-direction: column;
    gap: 16px;
  }
  
  .gp-page-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

/* Mobile: 480px */
@media (max-width: 480px) {
  .gp-main {
    padding: 16px;
  }
  
  .gp-metrics-grid {
    grid-template-columns: 1fr;
  }
  
  .gp-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .gp-card {
    padding: 16px;
  }
  
  .gp-card-metric .metric-value {
    font-size: 24px;
  }
  
  .gp-modal {
    max-width: 100%;
    margin: 16px;
    border-radius: 12px;
  }
  
  .gp-toast {
    left: 16px;
    right: 16px;
    max-width: none;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   21. ACCESSIBILITY
   ═══════════════════════════════════════════════════════════════════════════ */

/* Focus visible */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .gp-badge {
    border-width: 2px;
  }
  
  .gp-btn {
    border-width: 2px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   22. UTILITY CLASSES
   ═══════════════════════════════════════════════════════════════════════════ */

/* Display */
.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }
.d-inline-flex { display: inline-flex; }

/* Flex */
.flex-row { flex-direction: row; }
.flex-column { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }

/* Gap */
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.gap-8 { gap: 32px; }

/* Spacing */
.p-0 { padding: 0; }
.p-2 { padding: 8px; }
.p-4 { padding: 16px; }
.p-6 { padding: 24px; }
.m-0 { margin: 0; }
.m-2 { margin: 8px; }
.m-4 { margin: 16px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }

/* Width/Height */
.w-full { width: 100%; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }

/* Text */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.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; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }

/* Border radius */
.rounded { border-radius: 4px; }
.rounded-md { border-radius: 8px; }
.rounded-lg { border-radius: 12px; }
.rounded-full { border-radius: 9999px; }

/* Visibility */
.invisible { visibility: hidden; }
.visible { visibility: visible; }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

/* Cursor */
.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }

/* Will-change for animations */
.will-animate {
  will-change: transform, opacity;
}

.animation-complete {
  will-change: auto;
}

/* ═══════════════════════════════════════════════════════════════════════════
   23. LEGACY COMPATIBILITY (Non-breaking)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Legacy button classes */
.btn { @extend .gp-btn; }
.btn-primary { @extend .gp-btn-primary; }
.btn-secondary { @extend .gp-btn-secondary; }
.btn-ghost { @extend .gp-btn-ghost; }

/* Legacy card classes */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

/* Legacy badge classes */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 9999px;
}

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

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

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

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

/* Legacy table styles */
table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: var(--surface);
}

th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

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

/* Legacy sidebar */
.sidebar {
  width: 260px;
  height: 100vh;
  background: var(--background);
  border-right: 1px solid var(--border);
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
}

.sidebar-item:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.sidebar-item.active {
  background: rgba(75, 99, 255, 0.1);
  color: var(--primary);
}

/* Legacy navbar */
.navbar {
  height: 64px;
  background: var(--background);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BEM-STYLE ALIASES (double-dash convention for HTML compatibility)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Button BEM aliases - sizes */
.gp-btn--sm { height: 32px; padding: 0 12px; font-size: 13px; }
.gp-btn--md { height: 40px; padding: 0 16px; font-size: 14px; }
.gp-btn--lg { height: 48px; padding: 0 24px; font-size: 16px; }

/* Button BEM aliases - variants */
.gp-btn--primary { background: var(--primary); color: #FFFFFF; border-color: var(--primary); }
.gp-btn--primary:hover { background: var(--primary-light); border-color: var(--primary-light); transform: translateY(-1px); }
.gp-btn--secondary { background: transparent; color: var(--text-primary); border-color: var(--border); }
.gp-btn--secondary:hover { background: var(--surface-hover); border-color: var(--border-hover); }
.gp-btn--danger { background: var(--danger); color: #FFFFFF; border-color: var(--danger); }
.gp-btn--danger:hover { background: #FF6B7A; transform: translateY(-1px); }
.gp-btn--success { background: var(--success); color: #0D1117; border-color: var(--success); }
.gp-btn--success:hover { background: #2AE9A2; transform: translateY(-1px); }
.gp-btn--ghost { background: transparent; color: var(--text-secondary); border-color: transparent; }
.gp-btn--ghost:hover { background: var(--surface-hover); color: var(--text-primary); }

/* Card BEM aliases */
.gp-card--metric { display: flex; flex-direction: column; gap: 8px; }
.gp-card--metric .gp-card__value { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; color: var(--text-primary); }
.gp-card--metric .gp-card__label { font-size: 13px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }
.gp-card--elevated { background: var(--background-elevated); box-shadow: var(--shadow-lg); }
.gp-card--elevated:hover { box-shadow: 0 8px 32px rgba(0, 0, 0, 0.16); transform: translateY(-2px); }
.gp-card--interactive { cursor: pointer; transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease; }
.gp-card--interactive:hover { border-color: var(--primary-light); box-shadow: 0 8px 32px rgba(75, 99, 255, 0.12); transform: translateY(-2px); }

/* Badge BEM aliases */
.gp-badge--success { background: rgba(23, 217, 146, 0.15); color: var(--success); border: 1px solid rgba(23, 217, 146, 0.3); }
.gp-badge--danger { background: rgba(255, 71, 87, 0.15); color: var(--danger); border: 1px solid rgba(255, 71, 87, 0.3); }
.gp-badge--warning { background: rgba(255, 171, 0, 0.15); color: var(--warning); border: 1px solid rgba(255, 171, 0, 0.3); }
.gp-badge--info { background: rgba(75, 99, 255, 0.15); color: var(--primary); border: 1px solid rgba(75, 99, 255, 0.3); }
.gp-badge--high-risk { background: rgba(255, 71, 87, 0.2); color: var(--danger); border: 1px solid rgba(255, 71, 87, 0.4); }

/* Table BEM aliases */
.gp-table--striped tbody tr:nth-child(even) { background: var(--surface-elevated); }
.gp-table--compact th, .gp-table--compact td { padding: 8px 12px; }
.gp-table--hover tbody tr { transition: background 0.15s ease; }
.gp-table--hover tbody tr:hover { background: var(--surface-hover); }

/* Shell BEM aliases */
.gp-shell--admin { --shell-accent: var(--primary); }
.gp-shell--merchant { --shell-accent: var(--success); }
.gp-shell--bank { --shell-accent: #4DA3FF; }
.gp-shell--partner { --shell-accent: var(--warning); }

/* Sidebar BEM aliases */
.gp-sidebar--admin { background: var(--background); border-right: 1px solid var(--border); }
.gp-sidebar--merchant { background: var(--background); border-right: 1px solid var(--border); }
.gp-sidebar--bank { background: var(--background); border-right: 1px solid var(--border); }
.gp-sidebar--partner { background: var(--background); border-right: 1px solid var(--border); }

/* ═══════════════════════════════════════════════════════════════════════════
   END OF ASTRA DESIGN SYSTEM
   ═══════════════════════════════════════════════════════════════════════════ */
