/* ============================================================
   NAMAA AI — Design System v3.0
   Aesthetic: Robinhood-native fintech
   Dark canvas · Bold green · Clean geometric sans
   Plus Jakarta Sans × DM Mono
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,300;1,400;1,500&family=DM+Mono:ital,wght@0,400;0,500;1,400&display=swap');

/* ── Tokens ──────────────────────────────────────────────── */
:root {
  /* Backgrounds — near-black canvas */
  --bg-base:      #090909;
  --bg-surface:   #111111;
  --bg-elevated:  #191919;
  --bg-raised:    #212121;
  --bg-hover:     #2a2a2a;

  /* Borders */
  --border:         rgba(255,255,255,0.07);
  --border-mid:     rgba(255,255,255,0.12);
  --border-strong:  rgba(255,255,255,0.18);
  --border-green:   rgba(0,200,5,0.3);
  --border-green-faint: rgba(0,200,5,0.1);

  /* Green — Robinhood brand */
  --green:        #00c805;
  --green-light:  #21e022;
  --green-bright: #5fff61;
  --green-dim:    rgba(0,200,5,0.10);
  --green-glow:   rgba(0,200,5,0.18);

  /* Status */
  --red:          #ff4040;
  --red-dim:      rgba(255,64,64,0.10);
  --amber:        #ffb020;
  --amber-dim:    rgba(255,176,32,0.10);
  --blue:         #4c9fff;
  --blue-dim:     rgba(76,159,255,0.10);

  /* Text */
  --text-1:       #ffffff;
  --text-2:       #a0a0a0;
  --text-3:       #505050;
  --text-green:   var(--green-light);

  /* Typography — Plus Jakarta Sans (Robinhood-native geometric) */
  --font-display: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-body:    'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono:    'DM Mono', 'Fira Code', monospace;

  /* Structure */
  --header-h:     60px;
  --sidebar-w:    220px;
  --max-w:        1280px;

  /* Radii */
  --r-sm:  6px;
  --r-md:  10px;
  --r-lg:  16px;
  --r-xl:  24px;
  --r-pill: 100px;

  /* Motion */
  --ease:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-b: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast: 120ms;
  --t-mid:  220ms;
  --t-slow: 380ms;

  /* Shadows */
  --shadow-sm:    0 1px 6px rgba(0,0,0,0.6);
  --shadow-md:    0 4px 20px rgba(0,0,0,0.6);
  --shadow-lg:    0 8px 40px rgba(0,0,0,0.7);
  --shadow-green: 0 0 24px rgba(0,200,5,0.18);

  /* Legacy compat — map old names to new tokens */
  --accent-green:      var(--green);
  --accent-green-dim:  var(--green-dim);
  --accent-red:        var(--red);
  --accent-red-dim:    var(--red-dim);
  --accent-yellow:     var(--amber);
  --accent-yellow-dim: var(--amber-dim);
  --accent-blue:       var(--blue);
  --accent-blue-dim:   var(--blue-dim);
  --accent-gold:       var(--amber);
  --accent-purple-dim: var(--blue-dim);

  --text-primary:    var(--text-1);
  --text-secondary:  var(--text-2);
  --text-muted:      var(--text-3);

  --border-subtle:   var(--border);
  --bg-primary:      var(--bg-base);
  --bg-secondary:    var(--bg-surface);
  --bg-card:         var(--bg-elevated);

  --font-primary:    var(--font-body);

  --radius-sm: var(--r-sm);
  --radius-md: var(--r-md);
  --radius-lg: var(--r-lg);
  --radius-xl: var(--r-xl);
  --header-height: var(--header-h);
  --sidebar-width: var(--sidebar-w);

  /* Geometric pattern — subtle grid for depth */
  --geo-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Crect x='0' y='0' width='40' height='40' fill='none'/%3E%3Cpath d='M0 0 L40 0 L40 40' fill='none' stroke='rgba(255,255,255,0.025)' stroke-width='0.5'/%3E%3C/svg%3E");
}

/* ── Light Theme ─────────────────────────────────────────── */
:root[data-theme="light"] {
  --bg-base:      #f5f5f5;
  --bg-surface:   #ffffff;
  --bg-elevated:  #f0f0f0;
  --bg-raised:    #e8e8e8;
  --bg-hover:     #e0e0e0;

  --border:         rgba(0,0,0,0.08);
  --border-mid:     rgba(0,0,0,0.13);
  --border-strong:  rgba(0,0,0,0.20);
  --border-green:   rgba(0,160,5,0.3);
  --border-green-faint: rgba(0,160,5,0.1);

  --green:        #00a005;
  --green-light:  #008a04;
  --green-bright: #006a03;
  --green-dim:    rgba(0,160,5,0.10);
  --green-glow:   rgba(0,160,5,0.12);

  --red:          #d93025;
  --red-dim:      rgba(217,48,37,0.10);
  --amber:        #d97706;
  --amber-dim:    rgba(217,119,6,0.10);
  --blue:         #1a73e8;
  --blue-dim:     rgba(26,115,232,0.10);

  --text-1:       #0d0d0d;
  --text-2:       #555555;
  --text-3:       #888888;
  --text-green:   var(--green-light);

  --shadow-sm:    0 1px 6px rgba(0,0,0,0.08);
  --shadow-md:    0 4px 20px rgba(0,0,0,0.10);
  --shadow-lg:    0 8px 40px rgba(0,0,0,0.12);
  --shadow-green: 0 0 24px rgba(0,160,5,0.12);

  --geo-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Crect x='0' y='0' width='40' height='40' fill='none'/%3E%3Cpath d='M0 0 L40 0 L40 40' fill='none' stroke='rgba(0,0,0,0.04)' stroke-width='0.5'/%3E%3C/svg%3E");
}

/* System theme — apply light tokens when OS prefers light AND user chose "system" */
:root[data-theme="system"] {
  /* inherits dark by default; overridden by media query below */
}
@media (prefers-color-scheme: light) {
  :root[data-theme="system"] {
    --bg-base:      #f5f5f5;
    --bg-surface:   #ffffff;
    --bg-elevated:  #f0f0f0;
    --bg-raised:    #e8e8e8;
    --bg-hover:     #e0e0e0;
    --border:         rgba(0,0,0,0.08);
    --border-mid:     rgba(0,0,0,0.13);
    --border-strong:  rgba(0,0,0,0.20);
    --border-green:   rgba(0,160,5,0.3);
    --border-green-faint: rgba(0,160,5,0.1);
    --green:        #00a005;
    --green-light:  #008a04;
    --green-bright: #006a03;
    --green-dim:    rgba(0,160,5,0.10);
    --green-glow:   rgba(0,160,5,0.12);
    --red:          #d93025;
    --red-dim:      rgba(217,48,37,0.10);
    --amber:        #d97706;
    --amber-dim:    rgba(217,119,6,0.10);
    --blue:         #1a73e8;
    --blue-dim:     rgba(26,115,232,0.10);
    --text-1:       #0d0d0d;
    --text-2:       #555555;
    --text-3:       #888888;
    --text-green:   var(--green-light);
    --shadow-sm:    0 1px 6px rgba(0,0,0,0.08);
    --shadow-md:    0 4px 20px rgba(0,0,0,0.10);
    --shadow-lg:    0 8px 40px rgba(0,0,0,0.12);
    --shadow-green: 0 0 24px rgba(0,160,5,0.12);
  }
}

/* ── Theme Toggle Component ───────────────────────────────── */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 3px;
}
.theme-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
  font-size: 13px;
  line-height: 1;
}
.theme-toggle-btn:hover {
  background: var(--bg-hover);
  color: var(--text-1);
}
.theme-toggle-btn.active {
  background: var(--bg-raised);
  color: var(--text-1);
  box-shadow: var(--shadow-sm);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-1);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle background dot texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: 0;
}

/* ── Typography — Robinhood-native scale ─────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: var(--text-1);
}

h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.35rem); }

p { color: var(--text-2); }

a { color: var(--green-light); text-decoration: none; }
a:hover { color: var(--green-bright); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.55rem 1.25rem;
  border-radius: var(--r-pill);
  border: none;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.btn-primary {
  background: var(--green);
  color: #000;
}

.btn-primary:hover {
  background: var(--green-light);
  color: #000;
  transform: translateY(-1px);
  box-shadow: var(--shadow-green);
}

.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-1);
  border: 1px solid var(--border-mid);
}

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

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  color: var(--text-1);
  border-color: var(--border-mid);
  background: var(--bg-elevated);
}

.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(255,64,64,0.2);
}

.btn-danger:hover { background: rgba(255,64,64,0.18); }

.btn-sm { padding: 0.35rem 0.85rem; font-size: 0.78rem; }
.btn-lg { padding: 0.75rem 2rem; font-size: 0.95rem; }
.btn-xl { padding: 0.9rem 2.5rem; font-size: 1.05rem; }

/* ── Header ──────────────────────────────────────────────── */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-h);
  background: rgba(9,9,9,0.88);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  transition: background var(--t-mid);
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  gap: 2rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.logo-arabic {
  color: var(--green-light);
  font-size: 1.35rem;
  font-weight: 400;
  line-height: 1;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 0.25rem;
}

.nav-links a {
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  border-radius: var(--r-pill);
  transition: color var(--t-fast), background var(--t-fast);
}

.nav-links a:hover {
  color: var(--text-1);
  background: var(--bg-elevated);
}

.nav-cta { display: flex; gap: 0.5rem; align-items: center; }

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

.form-group label {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.02em;
}

.form-input,
.form-select,
.form-textarea {
  background: var(--bg-elevated);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-md);
  padding: 0.65rem 0.9rem;
  color: var(--text-1);
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 400;
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
  width: 100%;
}

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

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--border-green);
  box-shadow: 0 0 0 3px var(--green-dim);
  background: var(--bg-raised);
}

.form-select {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23505050' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.5rem;
}

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

/* Inline form row */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

/* ── Dashboard Shell ─────────────────────────────────────── */
.dash-layout {
  display: block;
  min-height: 100svh;
  padding-top: var(--header-h);
  position: relative;
  z-index: 1;
}

.dash-sidebar {
  position: fixed;
  top: var(--header-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 0;
  z-index: 100;
}

.dash-sidebar-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 0.75rem;
  flex: 1;
}

.dash-nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.85rem;
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: color var(--t-fast), background var(--t-fast);
  text-decoration: none;
  user-select: none;
}

.dash-nav-item:hover {
  color: var(--text-1);
  background: var(--bg-elevated);
}

.dash-nav-item.active {
  color: var(--text-1);
  background: var(--bg-elevated);
  border: 1px solid var(--border-green-faint);
}

.dash-nav-item.active .dash-nav-icon { color: var(--green); }

.dash-nav-icon {
  font-size: 0.85rem;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.dash-main {
  margin-left: var(--sidebar-w);
  padding: 2rem 2.5rem;
  min-height: calc(100svh - var(--header-h));
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
  z-index: 1;
}

.dash-page { display: none; }
.dash-page.active { display: block; }

.dash-page-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.dash-page-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
  letter-spacing: -0.02em;
}

.dash-page-header p {
  font-size: 0.88rem;
  color: var(--text-3);
  font-weight: 400;
}

/* ── Metrics ─────────────────────────────────────────────── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px;
  background: var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 2rem;
}

.metric-card {
  background: var(--bg-elevated);
  padding: 1.5rem 1.25rem;
  position: relative;
  transition: background var(--t-fast);
}

.metric-card:hover { background: var(--bg-raised); }

.metric-label {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.6rem;
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 1.65rem;
  font-weight: 500;
  color: var(--text-1);
  line-height: 1;
  margin-bottom: 0.25rem;
  letter-spacing: -0.02em;
}

.metric-delta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-3);
}

.metric-delta.positive { color: var(--green); }
.metric-delta.negative { color: var(--red); }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-1);
  letter-spacing: -0.01em;
}

/* ── Tables ──────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body);
  font-size: 0.88rem;
}

.data-table th {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-mid);
  white-space: nowrap;
}

.data-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  font-weight: 400;
  vertical-align: middle;
}

.data-table tr:hover td { background: var(--bg-raised); color: var(--text-1); }
.data-table tr:last-child td { border-bottom: none; }

.td-mono {
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

/* ── Badges / Pills ──────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: var(--r-pill);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

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

.badge-red {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(255,64,64,0.15);
}

.badge-amber {
  background: var(--amber-dim);
  color: var(--amber);
  border: 1px solid rgba(255,176,32,0.15);
}

.badge-neutral {
  background: var(--bg-elevated);
  color: var(--text-2);
  border: 1px solid var(--border-mid);
}

/* Regime badges */
.regime-badge {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: var(--r-pill);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.regime-GREEN  { background: var(--green-dim); color: var(--green-light); border: 1px solid var(--border-green-faint); }
.regime-YELLOW { background: var(--amber-dim); color: var(--amber); border: 1px solid rgba(255,176,32,0.15); }
.regime-RED    { background: var(--red-dim); color: var(--red); border: 1px solid rgba(255,64,64,0.15); }

/* Status dot */
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot-green { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-dot-red   { background: var(--red); }
.status-dot-amber { background: var(--amber); }
.status-dot-grey  { background: var(--text-3); }

/* ── Charts ──────────────────────────────────────────────── */
.chart-container {
  position: relative;
  width: 100%;
  padding: 0.5rem 0;
}

/* ── Position Cards ──────────────────────────────────────── */
.position-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.25rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  transition: border-color var(--t-fast), background var(--t-fast);
}

.position-card:hover {
  border-color: var(--border-green-faint);
  background: var(--bg-raised);
}

.position-symbol {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.01em;
}

.position-meta {
  font-size: 0.78rem;
  color: var(--text-3);
  font-weight: 400;
  margin-top: 0.15rem;
}

.position-pnl {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 500;
  text-align: right;
}

.position-pnl.positive { color: var(--green-light); }
.position-pnl.negative { color: var(--red); }

/* ── Settings ────────────────────────────────────────────── */
.settings-section {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.settings-section-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-raised);
}

.settings-section-title {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.settings-section-body {
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.settings-section-body.single-col {
  grid-template-columns: 1fr;
}

/* Full-width field inside 2-col settings grid */
[style*="grid-column: 1 / -1"] { grid-column: 1 / -1; }

/* Agent control panel */
.agent-control {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.5rem;
}

.agent-status-indicator {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 1rem;
  background: var(--bg-surface);
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
}

.agent-status-label {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ── Sidebar section labels ──────────────────────────────── */
.sidebar-section-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 1rem 0.85rem 0.3rem;
  pointer-events: none;
  list-style: none;
}

.sidebar-section-label:first-child { padding-top: 0.25rem; }

/* ── Universe Tags ───────────────────────────────────────── */
.universe-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.25rem 0.6rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-mid);
  border-radius: var(--r-sm);
  color: var(--text-2);
  transition: all var(--t-fast);
}

.universe-tag:hover {
  border-color: var(--border-green-faint);
  color: var(--green-light);
  background: var(--green-dim);
}

/* ── Animations ──────────────────────────────────────────── */
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.9); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

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

@keyframes greenPulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--green-glow); }
  50%       { box-shadow: 0 0 0 6px transparent; }
}

.animate-pulse    { animation: pulse 2s ease-in-out infinite; }
.animate-spin     { animation: spin 0.8s linear infinite; }
.animate-fade-in  { animation: fadeInUp 0.5s var(--ease) both; }
.animate-green    { animation: greenPulse 2.5s ease-in-out infinite; }

/* Staggered delays */
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.10s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.20s; }
.stagger-5 { animation-delay: 0.25s; }

/* ── Toasts ──────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  z-index: 9999;
  animation: fadeInUp 0.3s var(--ease) both;
  max-width: 340px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-lg);
}

.toast-success {
  background: var(--bg-raised);
  color: var(--green-light);
  border: 1px solid var(--border-green-faint);
}

.toast-error {
  background: var(--bg-raised);
  color: var(--red);
  border: 1px solid rgba(255,64,64,0.2);
}

.toast-info {
  background: var(--bg-raised);
  color: var(--text-1);
  border: 1px solid var(--border-mid);
}

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--bg-hover);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ── Utility ─────────────────────────────────────────────── */
.text-green   { color: var(--green-light) !important; }
.text-red     { color: var(--red) !important; }
.text-amber   { color: var(--amber) !important; }
.text-muted   { color: var(--text-3) !important; }
.text-mono    { font-family: var(--font-mono) !important; }
.text-display { font-family: var(--font-display) !important; }
.text-center  { text-align: center; }
.text-right   { text-align: right; }

.bg-green-dim  { background: var(--green-dim) !important; }
.border-green  { border-color: var(--border-green) !important; }

.divider {
  height: 1px;
  background: var(--border);
  margin: 1.5rem 0;
}

/* ── Loading / Empty states ──────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-3);
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  opacity: 0.4;
}

.empty-state p {
  font-size: 0.92rem;
  color: var(--text-3);
}

.spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--border-mid);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ── Dashboard Charts row ─────────────────────────────────── */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

/* ── Inline section label ─────────────────────────────────── */
.section-eyebrow {
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green);
  display: block;
  margin-bottom: 0.6rem;
}

/* ── Landing hero override for re-use ─────────────────────── */
.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1024px) {
  .dash-sidebar { display: none; }
  .dash-main    { margin-left: 0; padding: 1.5rem; }
  .charts-row   { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-links    { display: none; }
  .settings-section-body { grid-template-columns: 1fr; }
  .form-row     { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .metrics-grid { grid-template-columns: 1fr; }
  .header-inner { padding: 0 1rem; }
}

/* ── Dashboard chart containers ──────────────────────────── */
.chart-container {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  position: relative;
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.chart-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.01em;
}

.chart-canvas {
  width: 100% !important;
  height: 240px !important;
}

/* ── Position cards extended ─────────────────────────────── */
.position-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.position-strategy {
  font-size: 0.75rem;
  color: var(--text-3);
  display: block;
  margin-top: 0.2rem;
}

.position-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.position-metric-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.3rem;
}

.position-metric-value {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-1);
}

.position-rationale {
  font-size: 0.82rem;
  color: var(--text-2);
  font-weight: 300;
  line-height: 1.5;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

/* ── Data table wrapper ───────────────────────────────────── */
.data-table-wrap {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.data-table-wrap .data-table {
  margin: 0;
}

/* ── Animate fade in up ───────────────────────────────────── */
.animate-fade-in-up {
  animation: fadeInUp 0.5s var(--ease) both;
}

/* Text helpers used in dashboard */
.text-green { color: var(--green-light) !important; }
.text-red   { color: var(--red) !important; }

/* ============================================================
   NAMAA AI — Design Enhancement v3.5
   Premium micro-interactions & atmospheric depth
   ============================================================ */

/* ── New keyframes ───────────────────────────────────────── */
@keyframes shine {
  from { transform: translateX(-100%) skewX(-15deg); }
  to   { transform: translateX(300%) skewX(-15deg); }
}

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

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

@keyframes rippleOut {
  0%   { box-shadow: 0 0 0 0 rgba(0,200,5,0.4); }
  70%  { box-shadow: 0 0 0 8px rgba(0,200,5,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,200,5,0); }
}

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

@keyframes borderFlow {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes scanline {
  0%   { transform: translateY(-100%); }
  100% { transform: translateY(100vh); }
}

/* ── Background depth ────────────────────────────────────── */
/* Add a static top-left green ambient glow */
body::after {
  content: '';
  position: fixed;
  top: -30%;
  left: -15%;
  width: 700px;
  height: 700px;
  background: radial-gradient(ellipse at center,
    rgba(0,200,5,0.035) 0%,
    transparent 65%);
  pointer-events: none;
  z-index: 0;
}

/* ── Scrollbar — thinner, accented ───────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover { background: var(--green); }

/* ── Selection ───────────────────────────────────────────── */
::selection {
  background: rgba(0,200,5,0.2);
  color: var(--text-1);
}

/* ── Button — shine sweep on primary ────────────────────── */
.btn-primary {
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.22), transparent);
  transform: translateX(-100%) skewX(-15deg);
  transition: none;
}

.btn-primary:hover::after {
  animation: shine 0.55s var(--ease) forwards;
}

/* ── Header — scrolled enhancement ──────────────────────── */
.header {
  transition: background var(--t-mid), border-color var(--t-mid), box-shadow var(--t-mid);
}

.header.scrolled {
  background: rgba(9,9,9,0.97);
  border-bottom-color: var(--border-green-faint);
  box-shadow: 0 1px 40px rgba(0,0,0,0.5);
}

/* ── Sidebar — active green accent ──────────────────────── */
.dash-nav-item {
  position: relative;
  transition: color var(--t-fast), background var(--t-fast), transform var(--t-fast);
}

.dash-nav-item:hover {
  transform: translateX(2px);
}

.dash-nav-item.active {
  background: linear-gradient(90deg, rgba(0,200,5,0.1) 0%, rgba(0,200,5,0.04) 100%);
  border-color: transparent;
}

.dash-nav-item.active::before {
  content: '';
  position: absolute;
  left: -0.75rem;
  top: 20%;
  bottom: 20%;
  width: 2px;
  background: var(--green);
  border-radius: 0 1px 1px 0;
}

.dash-nav-item.active .dash-nav-icon {
  color: var(--green);
}

/* ── Metric cards — hover value glow ────────────────────── */
.metric-card {
  transition: background var(--t-fast), box-shadow var(--t-fast);
  cursor: default;
}

.metric-card:hover {
  background: var(--bg-raised);
  box-shadow: inset 0 0 0 1px var(--border-green-faint);
}

.metric-card:hover .metric-value {
  color: var(--green-bright);
  text-shadow: 0 0 30px rgba(0,200,5,0.25);
  transition: color var(--t-mid), text-shadow var(--t-mid);
}

/* ── Card — subtle hover green accent ───────────────────── */
.card {
  transition: border-color var(--t-mid), box-shadow var(--t-mid);
}

.card:hover {
  border-color: var(--border-green-faint);
  box-shadow: 0 4px 30px rgba(0,0,0,0.3);
}

/* ── Chart container — green top accent ─────────────────── */
.chart-container {
  transition: border-color var(--t-mid);
}

.chart-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--green), rgba(0,200,5,0.1), transparent);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}

/* ── Data table — green left flash on hover ──────────────── */
.data-table tbody tr {
  transition: background var(--t-fast);
}

.data-table tbody tr:hover td:first-child {
  border-left: 2px solid var(--green);
  padding-left: calc(0.75rem - 1px);
}

.data-table tbody tr:hover td {
  background: linear-gradient(90deg, rgba(0,200,5,0.04) 0%, var(--bg-raised) 80px);
  color: var(--text-1);
}

/* ── Status dot — ripple animation ───────────────────────── */
.status-dot-green {
  animation: rippleOut 2s ease-out infinite;
}

/* ── Settings section — focus-within highlight ───────────── */
.settings-section {
  transition: border-color var(--t-mid);
}

.settings-section:focus-within {
  border-color: var(--border-green-faint);
}

.settings-section-header {
  transition: background var(--t-fast);
}

/* ── Position card — elevated hover ──────────────────────── */
.position-card {
  transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}

.position-card:hover {
  border-color: var(--border-green-faint);
  background: var(--bg-raised);
  box-shadow: 0 4px 24px rgba(0,0,0,0.35), inset 0 0 0 1px var(--border-green-faint);
  transform: translateY(-1px);
}

/* ── Dashboard page — entry animation ────────────────────── */
.dash-page.active {
  animation: pageEnter 0.3s var(--ease) both;
}

/* ── Toast — slide in from right ────────────────────────── */
.toast {
  animation: slideInRight 0.35s var(--ease) both;
  border-left: 3px solid transparent;
}

.toast-success { border-left-color: var(--green); }
.toast-error   { border-left-color: var(--red); }
.toast-info    { border-left-color: var(--border-mid); }

/* ── Skeleton loading ────────────────────────────────────── */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-elevated) 25%,
    var(--bg-raised) 50%,
    var(--bg-elevated) 75%
  );
  background-size: 800px 100%;
  animation: shimmer 1.6s ease-in-out infinite;
  border-radius: var(--r-sm);
  color: transparent !important;
  user-select: none;
  pointer-events: none;
}

.skeleton-text {
  height: 0.88rem;
  width: 80%;
  display: block;
}

.skeleton-value {
  height: 1.65rem;
  width: 60%;
  display: block;
}

/* ── Form — focus enhancement ────────────────────────────── */
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(0,200,5,0.1), 0 1px 0 0 var(--green) inset;
  background: var(--bg-raised);
}

/* ── Input group (icon inside input) ─────────────────────── */
.input-group {
  position: relative;
}

.input-group .form-input {
  padding-right: 2.5rem;
}

.input-group-icon {
  position: absolute;
  right: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}

/* ── Badge — pulse for live states ───────────────────────── */
.badge-live {
  position: relative;
}

.badge-live::before {
  content: '';
  position: absolute;
  left: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  animation: rippleOut 2s ease-out infinite;
}

/* ── Regime badge — refined ──────────────────────────────── */
.regime-badge {
  transition: all var(--t-fast);
}

/* ── Agent status banner — upgrade ──────────────────────── */
#agent-status-banner {
  background: var(--bg-surface) !important;
  border-bottom: 1px solid var(--border) !important;
  position: relative;
}

#agent-status-banner::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--green), transparent);
  transition: width 0.8s var(--ease);
}

#agent-status-banner.running::after {
  width: 100%;
}

/* ── Universe tag — hover refinement ─────────────────────── */
.universe-tag {
  transition: all var(--t-fast);
}

.universe-tag:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* ── Data table header sticky ─────────────────────────────── */
.data-table-wrap {
  max-height: 600px;
  overflow-y: auto;
  position: relative;
}

.data-table thead th {
  position: sticky;
  top: 0;
  background: var(--bg-elevated);
  z-index: 2;
}

/* ── Section divider with label ──────────────────────────── */
.divider-labeled {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 2rem 0;
}

.divider-labeled::before,
.divider-labeled::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.divider-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  white-space: nowrap;
}

/* ── Number emphasis — large display nums ─────────────────── */
.num-display {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

/* ── Gradient text ───────────────────────────────────────── */
.text-gradient-green {
  background: linear-gradient(135deg, var(--green) 0%, var(--green-bright) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Metric card accent variant ──────────────────────────── */
.metric-card.accent {
  background: linear-gradient(135deg, var(--bg-elevated) 0%, rgba(0,200,5,0.05) 100%);
  border-left: 2px solid var(--green);
}

.metric-card.accent .metric-value {
  color: var(--green-light);
}

/* ── Sidebar section label refinement ────────────────────── */
.sidebar-section-label {
  color: rgba(255,255,255,0.18);
  font-size: 0.58rem;
  letter-spacing: 0.15em;
  margin-top: 0.25rem;
}

/* ── Agent control panel refinement ─────────────────────── */
.agent-status-indicator {
  transition: border-color var(--t-fast), background var(--t-fast);
}

.agent-status-indicator:hover {
  border-color: var(--border-green-faint);
  background: var(--bg-elevated);
}

/* ── Green glow shadow utility ───────────────────────────── */
.glow-green {
  box-shadow: var(--shadow-green);
}

/* ── Dash sidebar bottom area ────────────────────────────── */
.dash-sidebar > div:last-child {
  border-top: 1px solid var(--border);
}

/* ── Improve metric delta ────────────────────────────────── */
.metric-delta {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

/* ── Pricing card enhancements ───────────────────────────── */
.pricing-card-highlight {
  background: linear-gradient(160deg, var(--bg-elevated) 0%, rgba(0,200,5,0.07) 100%);
  border-color: var(--border-green-faint) !important;
  box-shadow: 0 0 40px rgba(0,200,5,0.08), 0 8px 40px rgba(0,0,0,0.5);
}

/* ── Onboarding step — active glow ───────────────────────── */
.step-active-dot {
  box-shadow: 0 0 0 4px rgba(0,200,5,0.15);
}

/* ── Responsive touch targets ────────────────────────────── */
@media (hover: none) {
  .dash-nav-item:hover { transform: none; }
  .universe-tag:hover  { transform: none; }
  .position-card:hover { transform: none; }
}

/* ── Print — hide non-essential ──────────────────────────── */
@media print {
  .dash-sidebar, .header, #agent-status-banner { display: none; }
  .dash-main { margin-left: 0; }
}

/* ============================================================
   PLUS JAKARTA SANS — Robinhood-native tuning
   Ensures the geometric sans renders at its best across
   every key component at every weight.
   ============================================================ */

/* Tighter metric values — big numbers feel like Robinhood's portfolio view */
.metric-value {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
}

/* Nav items — slightly bolder, tighter */
.dash-nav-item {
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: -0.005em;
}

/* Card titles */
.card-title,
.chart-title,
.settings-section-title {
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Dash page headers */
.dash-page-header h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.035em;
}

/* Logo — tight, bold, app-native */
.logo {
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 1rem;
}

/* Buttons — slightly heavier weight */
.btn {
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Table headers */
.data-table th {
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

/* Badge text */
.badge,
.regime-badge {
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* Sidebar section labels */
.sidebar-section-label {
  font-family: var(--font-body);
  font-weight: 700;
}

/* Auth brand headline — Robinhood-style hero number/headline */
.auth-brand-headline {
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.0;
}

/* Hero headline on landing — bold, clean, geometric */
.hero-headline {
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.0;
}

/* Position symbol — ticker style */
.position-symbol {
  font-family: var(--font-body);
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* Ensure inline styles that hard-code Syne fallback gracefully */
[style*="font-family:var(--font-display)"],
[style*="font-family: var(--font-display)"] {
  font-family: var(--font-display) !important;
}

/* ============================================================
   EDITORIAL LAYER v1 — Quiet Editorial × Sacred Geometry
   Applied to marketing pages for a distinctive, heritage feel.
   Private-bank typography · Muted gold · Islamic motifs
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght,SOFT@0,9..144,300..700,0..100;1,9..144,300..700,0..100&family=Amiri:ital,wght@0,400;0,700;1,400&display=swap');

:root {
  --font-editorial: 'Fraunces', 'Playfair Display', Georgia, serif;
  --font-arabic: 'Amiri', 'Noto Naskh Arabic', serif;

  /* Heritage gold — used sparingly for Shariah/Islamic moments only */
  --gold:        #c9a86a;
  --gold-bright: #e3c07c;
  --gold-dim:    rgba(201,168,106,0.08);
  --gold-mid:    rgba(201,168,106,0.18);
  --gold-line:   rgba(201,168,106,0.32);

  /* Deeper ink for editorial sections */
  --ink:     #07080a;
  --ink-2:   #0c0e12;
  --paper:   #f4efe4;
}

/* ── Editorial kicker — italic serif with hairline rule ─────── */
.ed-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  font-family: var(--font-editorial);
  font-style: italic;
  font-size: 0.92rem;
  font-weight: 400;
  font-variation-settings: 'opsz' 14, 'SOFT' 60;
  letter-spacing: 0.01em;
  color: var(--gold);
  margin-bottom: 1.5rem;
}

.ed-kicker::before {
  content: '';
  display: inline-block;
  width: 2.5rem;
  height: 1px;
  background: var(--gold-line);
}

/* ── Figure number — tiny mono label "§ 01" ─────────────────── */
.ed-figure {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--gold);
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.85rem;
}

/* ── Editorial headline — Fraunces with optical sizing ──────── */
.ed-headline {
  font-family: var(--font-editorial);
  font-variation-settings: 'opsz' 144, 'SOFT' 50, 'wght' 400;
  font-size: clamp(2.6rem, 5.8vw, 4.75rem);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.028em;
  color: var(--text-1);
  margin: 0 0 1.5rem;
}

.ed-headline em,
.ed-headline .ital {
  font-style: italic;
  font-variation-settings: 'opsz' 144, 'SOFT' 100, 'wght' 300;
  color: var(--gold-bright);
  font-weight: 300;
}

.ed-headline .arabic-inline {
  font-family: var(--font-arabic);
  font-style: normal;
  font-weight: 400;
  color: var(--gold);
  letter-spacing: 0;
  font-size: 0.78em;
  margin-right: 0.15em;
}

/* ── Editorial sub — refined body, larger than default ─────── */
.ed-sub {
  font-family: var(--font-body);
  font-size: 1.08rem;
  font-weight: 300;
  line-height: 1.72;
  color: var(--text-2);
  max-width: 520px;
  margin: 0 0 2.5rem;
}

/* ── Pull quote — serif italic, centered, bracketed by rules ── */
.ed-pullquote {
  font-family: var(--font-editorial);
  font-variation-settings: 'opsz' 144, 'SOFT' 100, 'wght' 300;
  font-style: italic;
  font-size: clamp(1.6rem, 3.2vw, 2.6rem);
  line-height: 1.3;
  letter-spacing: -0.018em;
  color: var(--text-1);
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
  padding: 1rem;
}

.ed-pullquote::before,
.ed-pullquote::after {
  content: '';
  display: block;
  width: 48px;
  height: 1px;
  background: var(--gold-line);
  margin: 2.5rem auto;
}

.ed-pullquote cite {
  display: block;
  font-style: normal;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 1rem;
}

/* ── Gold hairline divider ──────────────────────────────────── */
.ed-rule {
  border: none;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gold-line), transparent);
  max-width: 280px;
  margin: 3rem auto;
}

/* ── Sacred geometry background — 8-point star, tessellating ── */
.bg-geo {
  position: relative;
  overflow: hidden;
}

.bg-geo > .bg-geo-layer,
.bg-geo::before {
  content: '';
  position: absolute;
  inset: -10%;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'><g fill='none' stroke='%23c9a86a' stroke-width='0.6' opacity='0.35'><polygon points='70,12 82,40 112,40 88,60 100,92 70,72 40,92 52,60 28,40 58,40'/><circle cx='70' cy='60' r='18'/><polygon points='70,30 78,52 100,52 82,64 90,88 70,74 50,88 58,64 40,52 62,52'/></g></svg>");
  background-size: 140px 140px;
  background-repeat: repeat;
  pointer-events: none;
  z-index: 0;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at center, black 0%, transparent 75%);
          mask-image: radial-gradient(ellipse 70% 60% at center, black 0%, transparent 75%);
}

.bg-geo > *:not(.bg-geo-layer) {
  position: relative;
  z-index: 1;
}

/* ── Gold badge — Shariah / Islamic signifier ──────────────── */
.gold-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-bright);
  background: var(--gold-dim);
  border: 1px solid var(--gold-line);
  padding: 0.32rem 0.9rem;
  border-radius: var(--r-pill);
}

.gold-badge::before {
  content: '◈';
  color: var(--gold);
  font-size: 0.65rem;
}

/* ── Beta / Coming-soon tag for honest marketing ───────────── */
.tag-beta,
.tag-soon {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.18rem 0.5rem;
  border-radius: var(--r-sm);
  vertical-align: middle;
  margin-left: 0.5rem;
  line-height: 1;
}

.tag-beta {
  color: var(--amber);
  background: var(--amber-dim);
  border: 1px solid rgba(255,176,32,0.26);
}

.tag-soon {
  color: var(--blue);
  background: var(--blue-dim);
  border: 1px solid rgba(76,159,255,0.26);
}

/* ── Editorial card — tall, refined, gold corner chevron ───── */
.ed-card {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 2rem 1.75rem;
  overflow: hidden;
  transition: border-color var(--t-mid) var(--ease),
              transform var(--t-mid) var(--ease),
              background var(--t-mid) var(--ease);
}

.ed-card:hover {
  border-color: var(--gold-line);
  transform: translateY(-3px);
  background: var(--bg-raised);
}

.ed-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, transparent 50%, var(--gold-dim) 50%);
  pointer-events: none;
}

.ed-card .ed-card-num {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 1rem;
  display: block;
}

.ed-card h3 {
  font-family: var(--font-editorial);
  font-variation-settings: 'opsz' 48, 'SOFT' 30, 'wght' 500;
  font-size: 1.3rem;
  font-weight: 500;
  letter-spacing: -0.012em;
  color: var(--text-1);
  margin: 0 0 0.6rem;
  line-height: 1.2;
}

.ed-card p {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-2);
  font-weight: 300;
  margin: 0;
}

/* ── Editorial grid — 3-col on desktop, responsive collapse ── */
.ed-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  max-width: 1120px;
  margin: 0 auto;
}

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

@media (max-width: 960px) {
  .ed-grid, .ed-grid.two, .ed-grid.four { grid-template-columns: 1fr; }
}

/* ── Section header aligned left with editorial proportions ── */
.ed-section-head {
  max-width: 1120px;
  margin: 0 auto 3rem;
  padding: 0 0.5rem;
}

.ed-section-head .ed-headline {
  font-size: clamp(2rem, 3.8vw, 3rem);
  margin-bottom: 0.75rem;
}

.ed-section-head .ed-sub {
  margin-bottom: 0;
}

/* ── Dual-column editorial feature block ───────────────────── */
.ed-split {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 3.5rem;
  max-width: 1120px;
  margin: 0 auto;
  align-items: start;
}

@media (max-width: 960px) {
  .ed-split { grid-template-columns: 1fr; gap: 2rem; }
}

/* ── Staggered reveal on load (opt-in with data-reveal) ────── */
@keyframes edReveal {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

[data-reveal] {
  opacity: 0;
  animation: edReveal 900ms var(--ease) forwards;
}

[data-reveal="1"] { animation-delay: 100ms; }
[data-reveal="2"] { animation-delay: 220ms; }
[data-reveal="3"] { animation-delay: 340ms; }
[data-reveal="4"] { animation-delay: 460ms; }
[data-reveal="5"] { animation-delay: 580ms; }
[data-reveal="6"] { animation-delay: 700ms; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { animation: none; opacity: 1; }
}

/* ── Focus ring — accessibility for editorial layer ────────── */
.ed-card:focus-visible,
.gold-badge:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
}

/* ============================================================
   NAMAA AI — Design v4.0
   Robinhood / Linear quality micro-detail pass
   ============================================================ */

/* ── 1. Card depth hierarchy — inset top-edge highlight ─────── */
.card,
.metric-card,
.chart-container {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 4px 24px rgba(0,0,0,0.4);
}

/* ── 2. Button active press state ───────────────────────────── */
.btn-primary:active {
  transform: translateY(1px);
  box-shadow: none;
}

/* ── 3. Table row hover — green left accent on first cell ───── */
.data-table tbody tr:hover td:first-child {
  border-left: 2px solid var(--green);
  padding-left: calc(0.75rem - 2px);
}

/* ── 4. Input focus ring — green glow ───────────────────────── */
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(0, 200, 5, 0.12);
  background: var(--bg-raised);
}

/* ── 5. Sidebar active state — stronger border + green text ─── */
.dash-nav-item.active {
  border-left: 3px solid var(--green);
  color: var(--green);
  font-weight: 600;
  padding-left: calc(0.85rem - 3px);
}

.dash-nav-item.active .dash-nav-label,
.dash-nav-item.active {
  color: var(--green);
}

/* ── 6. Status badge — consistent padding & typography ─────── */
.regime-badge {
  padding: 0.2rem 0.6rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: 4px;
}

/* ── 7. Metric value — clamp size + tabular nums ────────────── */
.metric-value {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

/* ── 8. Skeleton shimmer — proper gradient animation ────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, rgba(255,255,255,0.04) 50%, var(--bg-elevated) 75%);
  background-size: 200% 100%;
  animation: shimmer-v4 1.5s infinite;
  border-radius: 6px;
}

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

/* ── 9. Page content entry animation ────────────────────────── */
.page-content {
  animation: pageEnter-v4 0.25s ease;
}

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

/* ── 10. Scrollbar — dark thin ──────────────────────────────── */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ── 11. Empty state component ──────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  gap: 0.75rem;
}

.empty-state-icon {
  font-size: 2rem;
  opacity: 0.3;
}

.empty-state-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-2);
}

.empty-state-sub {
  font-size: 0.8rem;
  color: var(--text-3);
  text-align: center;
  max-width: 280px;
}

/* ── 12. Toast colored left borders by type ─────────────────── */
.toast.toast-success { border-left: 3px solid var(--green); }
.toast.toast-error   { border-left: 3px solid #f85149; }
.toast.toast-info    { border-left: 3px solid #58a6ff; }
