/* ═══════════════════════════════════════════════
   Sure Holdings Investor Portal — Premium Design System
   Brand: Institutional, secure, world-class
   Founded 1999 · 27-Year Legacy
   ═══════════════════════════════════════════════ */

/* ── Design Tokens ── */
:root {
  /* Brand Colors */
  --emerald: #064E3B;
  --emerald-light: #065F46;
  --emerald-soft: #ECFDF5;
  --emerald-glow: rgba(6, 78, 59, 0.08);

  --gold: #D4AF37;
  --gold-light: #E5C55A;
  --gold-soft: #FFF9E6;
  --gold-glow: rgba(212, 175, 55, 0.15);

  /* Neutrals */
  --white: #FFFFFF;
  --bg: #F8F9FA;
  --panel: #FFFFFF;
  --line: #E5E7EB;
  --line-strong: #D1D5DB;

  /* Typography */
  --ink: #111827;
  --muted: #4B5563;
  --muted-lighter: #9CA3AF;

  /* Semantic */
  --danger: #991B1B;
  --danger-soft: #FEF2F2;
  --success: #065F46;
  --success-soft: #ECFDF5;
  --warning: #92400E;
  --warning-soft: #FFFBEB;

  /* Accent aliases */
  --primary: var(--emerald);
  --primary-strong: #043A2C;
  --primary-soft: var(--emerald-soft);
  --accent: var(--gold);
  --accent-soft: var(--gold-soft);
  --accent-strong: #C5A031;

  /* Surfaces */
  --surface-soft: #F9FAFB;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 8px;
  --radius-xl: 8px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-display: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
  margin-top: 0;
}

h1 { font-size: 1.75rem; letter-spacing: -0.02em; }
h2 { font-size: 1.35rem; letter-spacing: -0.01em; }
h3 { font-size: 1.1rem; }

p { margin-top: 0; }

.subdued { color: var(--muted); font-size: 0.9rem; }

.caption {
  color: var(--muted-lighter);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

a { color: var(--emerald); text-decoration: none; font-weight: 500; transition: color 0.15s; }
a:hover { color: var(--primary-strong); text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--emerald); outline-offset: 2px; border-radius: 2px; }

.skip-link {
  position: absolute; left: -999px; top: 8px;
  background: var(--white); border: 2px solid var(--emerald);
  color: var(--emerald); border-radius: var(--radius);
  padding: 8px 12px; z-index: 100; font-weight: 600;
}
.skip-link:focus { left: 8px; }

/* ── Topbar ── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0 24px; height: 56px;
  display: flex; align-items: center; justify-content: space-between;
}

.brand {
  font-family: var(--font-display); font-weight: 700;
  font-size: 0.95rem; letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 10px;
}

.brand-logo {
  display: block;
  height: 36px;
  width: 36px;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-text {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-text::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--gold); border-radius: 50%;
  flex-shrink: 0;
}

.brand-name { font-weight: 600; }

.page-role-badge {
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 3px 10px; border-radius: 100px;
  background: var(--emerald-soft); color: var(--emerald);
  border: 1px solid rgba(6,78,59,0.12);
}

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.project-logo-link {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; margin-right: 4px; border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--line);
  background: var(--white); max-width: 100px;
  transition: border-color 0.15s;
}
.project-logo-link:hover { border-color: var(--gold); text-decoration: none; }
.project-logo-link img { display: block; max-height: 30px; max-width: 100px; object-fit: contain; }

.logo-preview-wrap {
  display: flex; align-items: center; justify-content: flex-start;
  min-height: 64px; border: 1px dashed var(--line);
  border-radius: var(--radius); padding: 8px; background: var(--white);
}
.logo-preview-wrap img { display: none; max-width: 200px; max-height: 64px; object-fit: contain; }

/* ── Layout ── */
.layout {
  width: min(1120px, 94vw);
  margin: 28px auto 48px;
  display: grid; gap: 20px;
}

.single-column { grid-template-columns: minmax(0, 520px); justify-content: center; }

.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow-sm); transition: box-shadow 0.2s;
}
.panel:hover { box-shadow: var(--shadow-md); }

/* ── Buttons ── */
.btn {
  border: 1px solid transparent; border-radius: var(--radius);
  padding: 10px 18px; min-height: 44px; min-width: 44px;
  font-weight: 600; font-size: 0.88rem; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center;
  justify-content: center; gap: 6px; transition: all 0.15s ease;
  font-family: var(--font-sans); line-height: 1.2;
  letter-spacing: 0.01em;
  user-select: none;
}
.btn:focus-visible { outline: 2px solid var(--emerald); outline-offset: 2px; }

/* Primary — dark emerald fill, white text */
.btn-primary {
  color: var(--white);
  background: var(--emerald);
  border-color: var(--emerald);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-strong);
  border-color: var(--primary-strong);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(6,78,59,0.25);
  text-decoration: none; color: var(--white);
}
.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.btn-primary:focus-visible {
  outline: 2px solid var(--emerald);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(6,78,59,0.12);
}
.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

/* Gold Accent — rich gold fill, dark text */
.btn-gold {
  color: var(--ink);
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.btn-gold:hover:not(:disabled) {
  background: #E5C860;
  border-color: #E5C860;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(212,175,55,0.3);
  text-decoration: none; color: var(--ink);
}
.btn-gold:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.btn-gold:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Secondary — light gray fill, solid border, dark text */
.btn-secondary {
  color: var(--ink);
  background: var(--surface-soft);
  border: 1.5px solid var(--line);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.btn-secondary:hover:not(:disabled) {
  background: #EEF0F2;
  border-color: var(--line-strong);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
  text-decoration: none; color: var(--ink);
}
.btn-secondary:active:not(:disabled) {
  transform: translateY(0);
  background: #E2E5E9;
  border-color: var(--muted-lighter);
}
.btn-secondary:focus-visible {
  outline: 2px solid var(--emerald);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(6,78,59,0.12);
}
.btn-secondary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  border-color: var(--line);
}

/* Link-style button */
.btn-linkish {
  background: transparent;
  border: none;
  color: var(--emerald);
  cursor: pointer;
  font-weight: 600;
  padding: 8px 12px;
  min-height: 44px;
  min-width: 44px;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  transition: color 0.15s, background 0.15s;
  border-radius: var(--radius-sm);
}
.btn-linkish:hover {
  color: var(--primary-strong);
  background: var(--emerald-soft);
}

/* Admin badge button */
.btn-admin {
  background: var(--emerald-soft);
  color: var(--emerald);
  border: 1.5px solid rgba(6,78,59,0.15);
  font-weight: 600;
}
.btn-admin:hover {
  background: var(--emerald);
  color: var(--white);
  border-color: var(--emerald);
}

/* ── Forms ── */
.form-grid { display: grid; gap: 12px; }
input, select, textarea, button { font: inherit; }
input, select, textarea {
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 10px 12px; background: var(--white); color: var(--ink);
  font-size: 0.9rem; transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder, textarea::placeholder { color: var(--muted-lighter); opacity: 1; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--emerald); box-shadow: 0 0 0 3px var(--emerald-glow);
}

/* ── Status ── */
.status { min-height: 1.2rem; font-size: 0.88rem; color: var(--muted); }
.status.error { color: var(--danger); font-weight: 500; }
.status.ok { color: var(--success); font-weight: 500; }

/* ── KPI Grid ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 720px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }

.kpi {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; background: var(--white); text-align: center;
}
.kpi-value { font-size: 1.6rem; font-weight: 700; color: var(--emerald); line-height: 1.2; }
.kpi-label {
  color: var(--muted); font-size: 0.82rem; font-weight: 500;
  margin-top: 4px; text-transform: uppercase; letter-spacing: 0.04em;
}

/* ── Section Head ── */
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 16px;
}
.section-head h2 { margin-bottom: 0; }

/* ── Project Cards ── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.project-card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04); transition: all 0.2s ease;
  position: relative; overflow: hidden;
}
.project-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--project-card-accent, var(--emerald)); opacity: 0.6;
}
.project-card:hover {
  box-shadow: var(--shadow-lg); transform: translateY(-2px);
  border-color: var(--project-card-accent, var(--emerald));
}

.project-card__theme-chip {
  display: inline-flex; align-items: center; gap: 6px;
  margin-bottom: 12px; padding: 4px 10px;
  border: 1px solid var(--project-card-line, var(--line));
  border-radius: 100px;
  background: var(--project-card-soft, var(--emerald-soft));
  color: var(--project-card-ink, var(--emerald));
  font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.project-card__theme-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--project-card-accent, var(--emerald));
}
.project-card__header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 8px;
}
.project-card__header h3 { font-size: 1.05rem; margin-bottom: 4px; }
.project-card__header .subdued { font-size: 0.8rem; color: var(--muted-lighter); font-weight: 500; }
.project-card__status { margin: 8px 0 16px; font-size: 0.85rem; color: var(--muted); }
.project-card__status strong { color: var(--ink); }
.project-card__actions {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding-top: 14px; border-top: 1px solid var(--line);
}
.project-card__actions .btn {
  font-size: 0.82rem; padding: 8px 14px; min-height: 36px;
}

/* ── Dashboard ── */
.dashboard-actions {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 12px; margin-bottom: 20px;
}

/* Hero Section */
.hero-panel {
  background: linear-gradient(135deg, #064E3B 0%, #043A2C 35%, #082D1E 65%, #0A2318 100%);
  border: none; border-radius: var(--radius);
  padding: 0; overflow: hidden; position: relative;
  box-shadow: 0 20px 40px rgba(6,78,59,0.15);
}
.hero-panel::after {
  content: '';
  position: absolute; inset: 0;
  background:
    /* Gold glow left */
    radial-gradient(ellipse at 15% 40%, rgba(212,175,55,0.12) 0%, transparent 55%),
    /* Warm glow right */
    radial-gradient(ellipse at 85% 60%, rgba(212,175,55,0.06) 0%, transparent 50%),
    /* Subtle top light */
    radial-gradient(ellipse at 50% 0%, rgba(255,255,255,0.05) 0%, transparent 50%),
    /* Bottom depth */
    radial-gradient(ellipse at 50% 100%, rgba(0,0,0,0.15) 0%, transparent 50%);
  pointer-events: none;
}
.hero-panel__bg {
  position: absolute; inset: 0;
  background-image: var(--hero-bg-image, none);
  background-size: cover; background-position: center;
  opacity: 0.12; pointer-events: none;
}
.hero-panel__content {
  position: relative; z-index: 1;
  padding: 48px 40px; color: rgba(255,255,255,0.92);
}
.hero-panel__eyebrow {
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--gold);
  margin-bottom: 16px; display: flex; align-items: center; gap: 10px;
}
.hero-panel__eyebrow::before {
  content: '';
  display: inline-block; width: 4px; height: 4px;
  background: var(--gold); border-radius: 50%;
}
.hero-panel__title {
  font-family: var(--font-display);
  font-size: 2rem; font-weight: 700; line-height: 1.2;
  letter-spacing: -0.03em; color: var(--white);
  margin-bottom: 16px; max-width: 680px;
}
.hero-panel__subtitle {
  font-size: 1rem; line-height: 1.6;
  color: rgba(255,255,255,0.75);
  max-width: 600px; margin-bottom: 28px;
}

/* Legacy Bar */
.legacy-bar {
  display: flex; flex-wrap: wrap; gap: 0;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 24px; margin-top: 8px;
}
.legacy-bar__item { padding: 8px 24px 8px 0; position: relative; }
.legacy-bar__item + .legacy-bar__item { padding-left: 24px; }
.legacy-bar__item + .legacy-bar__item::before {
  content: '';
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 1px; height: 24px; background: rgba(255,255,255,0.12);
}
.legacy-bar__value {
  font-family: var(--font-display);
  font-size: 1.2rem; font-weight: 700;
  color: var(--gold); line-height: 1.2;
}
.legacy-bar__label {
  font-size: 0.78rem; color: rgba(255,255,255,0.55);
  margin-top: 2px; letter-spacing: 0.02em;
}

/* ── Tables ── */
.table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.table th {
  border-bottom: 2px solid var(--line); text-align: left;
  padding: 12px 10px; font-weight: 600; color: var(--muted);
  font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em;
}
.table td {
  border-bottom: 1px solid var(--line); padding: 11px 10px; color: var(--ink);
}
.table tr:last-child td { border-bottom: none; }

/* ── Timeline ── */
.timeline { margin: 0; padding: 0; list-style: none; display: grid; gap: 0; }
.timeline li {
  padding: 14px 0 14px 20px; border-left: 2px solid var(--line); position: relative;
}
.timeline li::before {
  content: '';
  position: absolute; left: -5px; top: 20px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--emerald); border: 2px solid var(--white);
}
.timeline li:last-child { border-left-color: transparent; }
.timeline li strong { display: block; font-size: 0.95rem; margin-bottom: 2px; }
.timeline li .subdued { font-size: 0.78rem; margin-bottom: 6px; }
.timeline li p:last-child { margin-bottom: 0; font-size: 0.88rem; color: var(--muted); }

/* ── Action Rows ── */
.actions-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ── Header Nav ── */
.header-nav {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 28px; padding-bottom: 16px; border-bottom: 1px solid var(--line);
}
.header-nav-actions { display: flex; align-items: center; gap: 16px; }
.header-nav a { color: var(--emerald); font-weight: 500; }

/* ── Portfolio / Admin Containers ── */
.portfolio-container, .admin-container {
  max-width: 1200px; margin: 0 auto; padding: 28px 24px;
}
.portfolio-header { margin-bottom: 28px; }
.portfolio-header h1 { font-size: 1.75rem; margin-bottom: 4px; }
.portfolio-header h2 { font-size: 1.25rem; margin-bottom: 16px; }
.portfolio-stats, .investments-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px;
}

.stat-card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm);
}
.stat-label {
  font-size: 0.8rem; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.04em; font-weight: 600; margin-bottom: 6px;
}
.stat-value { font-size: 1.4rem; font-weight: 700; color: var(--emerald); }

/* ── Tabs ── */
.tabs-container {
  display: flex; gap: 0;
  border-bottom: 2px solid var(--line); margin-bottom: 24px; overflow-x: auto;
}
.tab-button {
  padding: 12px 20px; background: transparent; border: none; cursor: pointer;
  font-weight: 600; font-size: 0.88rem; color: var(--muted);
  border-bottom: 3px solid transparent; transition: all 0.2s;
  white-space: nowrap; font-family: var(--font-sans);
}
.tab-button.active { color: var(--emerald); border-bottom-color: var(--emerald); }
.tab-button:hover { color: var(--ink); }

/* ── KYC ── */
.kyc-section {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 24px;
  margin-bottom: 24px; box-shadow: var(--shadow-sm);
}
.kyc-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.kyc-header h2 { margin: 0; font-size: 1.1rem; }
.kyc-badge { padding: 5px 12px; border-radius: 100px; font-size: 0.78rem; font-weight: 600; }
.kyc-badge.pending { background: var(--warning-soft); color: var(--warning); border: 1px solid rgba(146,64,14,0.12); }
.kyc-badge.approved { background: var(--success-soft); color: var(--success); border: 1px solid rgba(6,95,70,0.12); }
.kyc-badge.rejected { background: var(--danger-soft); color: var(--danger); border: 1px solid rgba(153,27,27,0.12); }
.kyc-status { font-size: 0.9rem; color: var(--muted); margin-bottom: 16px; }

.upload-area {
  padding: 24px; border: 2px dashed var(--line-strong);
  border-radius: var(--radius); text-align: center; cursor: pointer;
  transition: all 0.2s; background: var(--surface-soft);
}
.upload-area:hover, .upload-area.drag-over { border-color: var(--emerald); background: var(--emerald-soft); }
.upload-area input { display: none; }
.upload-area-text { margin: 0; cursor: pointer; }
.upload-area-note { font-size: 0.82rem; color: var(--muted); }

/* ── Dialog / Modal ── */
dialog {
  border: 1px solid var(--line); border-radius: var(--radius-xl);
  padding: 28px; max-width: 500px; width: 90%; box-shadow: var(--shadow-xl);
}
dialog::backdrop { background: rgba(0,0,0,0.4); }
dialog h3 { margin-top: 0; margin-bottom: 20px; font-size: 1.15rem; }
dialog .form-grid label { font-weight: 600; font-size: 0.85rem; color: var(--muted); margin-top: 4px; }

.modal-overlay {
  display: none; position: fixed; top:0; left:0; right:0; bottom:0;
  background: rgba(0,0,0,0.4); z-index: 999; align-items: center; justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--white); border-radius: var(--radius-xl);
  padding: 28px; max-width: 500px; width: 90%; box-shadow: var(--shadow-xl);
}
.modal h2 { margin-top: 0; margin-bottom: 20px; }
.modal-field { margin-bottom: 16px; }
.modal-field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.88rem; }
.modal-field textarea { resize: vertical; min-height: 80px; }
.modal-actions { display: flex; gap: 12px; margin-top: 24px; }
.modal-actions button { flex: 1; }

/* ── Investment Cards ── */
.investment-card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 20px;
  margin-bottom: 16px; box-shadow: var(--shadow-sm);
}
.investment-card h3 { margin: 0 0 12px; font-size: 1.05rem; }
.investment-details {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px;
}
.detail-item { font-size: 0.88rem; }
.detail-label {
  color: var(--muted); margin-bottom: 4px; font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: 0.03em; font-weight: 600;
}
.detail-value { font-weight: 600; color: var(--ink); }

.invest-button {
  padding: 10px 20px; min-height: 44px; min-width: 44px;
  background: var(--emerald); color: var(--white); border: none;
  border-radius: var(--radius); cursor: pointer; font-weight: 600;
  font-size: 0.9rem; transition: all 0.15s; font-family: var(--font-sans);
}
.invest-button:hover:not(:disabled) { background: var(--primary-strong); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.invest-button:active:not(:disabled) { transform: translateY(0); }
.invest-button:disabled { opacity: 0.5; cursor: not-allowed; }

.no-investments { padding: 48px 20px; text-align: center; color: var(--muted); }
.text-link { color: var(--emerald); font-weight: 600; }

/* ── Admin Pages ── */
.admin-container { max-width: 1000px; }
.admin-header { margin-bottom: 28px; }
.admin-header h1 { font-size: 1.6rem; margin-bottom: 6px; }
.admin-subtitle { color: var(--muted); font-size: 0.95rem; margin: 0; }

.nav-links {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 20px; padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.nav-links a { color: var(--emerald); font-weight: 500; font-size: 0.9rem; }

.project-selector { margin-bottom: 24px; }
.project-selector label { display: block; font-weight: 600; font-size: 0.85rem; margin-bottom: 6px; color: var(--muted); }
.project-selector select { width: 100%; max-width: 400px; }

.form-section {
  margin-bottom: 24px; padding: 20px;
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--white);
}
.form-section h2 { font-size: 1.1rem; margin-bottom: 16px; }
.form-section .hidden { display: none; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-weight: 600; font-size: 0.85rem; margin-bottom: 6px; color: var(--muted); }
.form-group input, .form-group select, .form-group textarea { width: 100%; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

.bank-details-info {
  background: var(--surface-soft); padding: 14px;
  border-radius: var(--radius); font-size: 0.88rem; max-height: 300px; overflow-y: auto;
}
.bank-details-title { display: block; margin-bottom: 8px; font-weight: 600; }

/* ── Notice Note ── */
.notice-note {
  margin-top: 10px; padding: 12px 14px;
  border: 1px solid var(--gold); border-radius: var(--radius);
  background: var(--gold-soft); color: var(--ink); font-size: 0.88rem;
}
.notice-note ol { margin: 6px 0 0 0; padding-left: 20px; }
.notice-note li { margin-bottom: 4px; }

/* ── Demo Credentials ── */
.demo-credentials {
  margin-top: 20px; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px;
  background: var(--surface-soft); font-size: 0.88rem;
}
.demo-credentials summary { font-weight: 600; cursor: pointer; color: var(--muted); }
.demo-credentials ul { margin: 10px 0 0; padding-left: 20px; }
.demo-credentials li { margin-bottom: 4px; font-family: var(--font-mono); font-size: 0.82rem; }
.demo-credentials code {
  background: var(--emerald-soft); padding: 1px 6px; border-radius: 3px;
  font-size: 0.82rem; color: var(--emerald);
}

/* ── Tooltips ── */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%);
  background: var(--ink); color: var(--white);
  font-size: 0.78rem; font-weight: 400; line-height: 1.4;
  white-space: nowrap; padding: 6px 12px;
  border-radius: var(--radius-sm); pointer-events: none; opacity: 0;
  transition: opacity 0.18s ease; z-index: 100;
  max-width: 280px; white-space: normal; box-shadow: var(--shadow-lg);
}
[data-tooltip]:hover::after, [data-tooltip]:focus-visible::after { opacity: 1; }
[data-tooltip]::before {
  content: '';
  position: absolute; bottom: calc(100% + 4px); left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: var(--ink);
  pointer-events: none; opacity: 0; transition: opacity 0.18s ease; z-index: 100;
}
[data-tooltip]:hover::before, [data-tooltip]:focus-visible::before { opacity: 1; }

/* ── Auth Panel ── */
.auth-panel { text-align: center; }
.auth-panel h1 { margin-bottom: 8px; }
.auth-panel .form-grid { text-align: left; max-width: 380px; margin: 20px auto; }
.auth-panel .btn-primary { width: 100%; margin-top: 4px; }
.auth-panel .actions-row { justify-content: center; margin-top: 16px; }

/* ── Editor Instructions ── */
.editor-instructions {
  background: var(--emerald-soft);
  border: 1px solid rgba(6,78,59,0.12);
  border-radius: var(--radius); padding: 16px 20px; margin-bottom: 20px;
}
.editor-instructions strong { color: var(--emerald); }
.editor-instructions ol { margin: 8px 0 0 0; padding-left: 20px; }
.editor-instructions li { margin-bottom: 4px; font-size: 0.88rem; color: var(--muted); }

/* ── Project Detail Header ── */
.project-detail__header-inner { margin-bottom: 16px; }
.project-detail__code {
  font-size: 0.78rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--muted-lighter); margin-bottom: 6px;
}
.project-detail__overview p { color: var(--muted); max-width: 700px; }

/* ── App Shell (Sidebar + Main) ── */
/* Layout handled by Tailwind grid: grid grid-cols-1 md:grid-cols-[260px_1fr] */
.app-shell {
  min-height: calc(100vh - 56px);
}

.sidebar-container {
  /* Tailwind handles display/width: hidden md:block w-[260px] */
  border-right: 1px solid var(--line);
  background: var(--white);
}

.sidebar {
  position: sticky;
  top: 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: calc(100vh - 56px);
  padding: 16px 0;
  overflow-y: auto;
}

.sidebar__sections {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 8px;
}

.sidebar__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s;
}
.sidebar__item:hover {
  background: var(--surface-soft);
  color: var(--ink);
  text-decoration: none;
}
.sidebar__item--active {
  background: var(--emerald-soft);
  color: var(--emerald);
  font-weight: 600;
}
.sidebar__item--active:hover {
  background: var(--emerald-soft);
  color: var(--emerald);
}

.sidebar__icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar__label {
  font-size: 0.85rem;
}

.sidebar__divider {
  display: flex;
  align-items: center;
  margin: 12px 12px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted-lighter);
}
.sidebar__divider::before,
.sidebar__divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}
.sidebar__divider span {
  padding: 0 8px;
}

.sidebar__footer {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  margin-top: auto;
}

.sidebar__session {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.sidebar__logout {
  font-size: 0.82rem;
}

.app-main {
  flex: 1;
  min-width: 0;
  padding: 28px 24px;
  margin: 0;
}

.mobile-only {
  display: none !important;
}

/* ── Sub-tabs (Portfolio) ── */
.sub-tabs {
  display: flex;
  gap: 0;
  margin-top: 16px;
  border-bottom: 2px solid var(--line);
  overflow-x: auto;
}

.sub-tab {
  padding: 10px 18px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--muted);
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: var(--font-sans);
}
.sub-tab.active {
  color: var(--emerald);
  font-weight: 600;
  border-bottom-color: var(--emerald);
}
.sub-tab:hover {
  color: var(--ink);
}

/* ── Ecosystem Sync Fallback Banner ── */
#ecosystem-fallback-banner .notice-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
#ecosystem-fallback-banner code {
  background: rgba(146,64,14,0.08);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.82rem;
}

/* ── Sovereign Network Explainer ── */
.sovereign-panel {
  border: 1px solid var(--line);
  border-left: 4px solid #D4AF37;
  background: linear-gradient(135deg, #FFFBEB 0%, #FFFDF5 100%);
}
.sovereign-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}
.sovereign-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #065F46;
  background: #ECFDF5;
  border: 1px solid rgba(6,95,70,0.15);
  padding: 4px 10px;
  border-radius: 100px;
  letter-spacing: 0.02em;
}
.sovereign-footer {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(212,175,55,0.25);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.sovereign-security {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ── Subsidiary Description ── */
.project-card__subsidiary {
  margin: 8px 0 12px;
  padding: 10px 12px;
  background: #F9FAFB;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  line-height: 1.5;
  color: #374151;
}
.project-card__subsidiary strong {
  color: #111827;
  font-weight: 600;
}

/* ── Helpers ── */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-center { text-align: center; }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE OVERRIDES — Mobile-First Breakpoints
   ═══════════════════════════════════════════════════════════ */

/* ── Clamp-based Fluid Typography ── */
h1 { font-size: clamp(1.35rem, 4.5vw, 1.75rem); }
h2 { font-size: clamp(1.1rem, 3.2vw, 1.35rem); }
h3 { font-size: clamp(0.95rem, 2.4vw, 1.1rem); }
.hero-panel__title { font-size: clamp(1.4rem, 5vw, 2rem); }
.hero-panel__subtitle { font-size: clamp(0.85rem, 2.8vw, 1rem); }
.stat-value { font-size: clamp(1.1rem, 3.6vw, 1.4rem); }
.kpi-value { font-size: clamp(1.2rem, 4vw, 1.6rem); }
.investment-card h3 { font-size: clamp(0.9rem, 2.6vw, 1.05rem); }
.project-card__header h3 { font-size: clamp(0.9rem, 2.6vw, 1.05rem); }

/* ── Bottom Mobile Navigation Bar ── */
/* Display and positioning handled by Tailwind: !block md:!hidden fixed bottom-0 left-0 right-0 z-50 */
.mobile-bottom-nav {
  background: rgba(255,255,255,0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 6px env(safe-area-inset-right, 8px) env(safe-area-inset-bottom, 6px) env(safe-area-inset-left, 8px);
}

.mobile-bottom-nav__inner {
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  max-width: 500px;
  margin: 0 auto;
}

.mobile-bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 12px;
  min-width: 56px;
  min-height: 44px;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: color 0.15s;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: var(--font-sans);
  -webkit-tap-highlight-color: transparent;
}
.mobile-bottom-nav__item:active {
  background: var(--emerald-soft);
}
.mobile-bottom-nav__item--active {
  color: var(--emerald);
  font-weight: 600;
}
.mobile-bottom-nav__icon {
  font-size: 1.15rem;
  line-height: 1;
}

/* ── 768px Breakpoint: Full Mobile Layout ── */
@media (max-width: 768px) {
  /* Layout shifts — Tailwind grid handles column layout, padding for bottom nav */
  .app-shell {
    padding-bottom: 62px;
  }

  /* Main content fills width */
  .app-main {
    width: 100%;
    max-width: 100%;
    padding: 16px;
    margin: 0;
  }
  .layout {
    width: 100%;
    max-width: 100%;
    margin: 16px auto 0;
    gap: 14px;
  }

  /* Hero panel — compact */
  .hero-panel__content {
    padding: 28px 20px;
  }
  .hero-panel__eyebrow {
    font-size: 0.68rem;
    margin-bottom: 10px;
  }
  .hero-panel__title {
    max-width: 100%;
    margin-bottom: 12px;
  }
  .hero-panel__subtitle {
    max-width: 100%;
    margin-bottom: 20px;
  }

  /* Legacy bar wraps */
  .legacy-bar__item {
    padding: 6px 16px 6px 0;
  }
  .legacy-bar__item + .legacy-bar__item {
    padding-left: 16px;
  }
  .legacy-bar__value {
    font-size: 1rem;
  }

  /* KPI grid — 2 columns on mobile */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .kpi {
    padding: 12px;
  }
  .kpi-value {
    font-size: clamp(1.1rem, 4vw, 1.4rem);
  }

  /* Project cards — full width */
  .project-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .project-card {
    padding: 16px;
  }
  .project-card__header h3 {
    font-size: 1rem;
  }
  .project-card__actions .btn {
    font-size: 0.78rem;
    padding: 8px 12px;
    min-height: 44px;
  }

  /* Subsidiary description */
  .project-card__subsidiary {
    font-size: 0.78rem;
    padding: 8px 10px;
  }

  /* Sub-tabs — scrollable horizontal on mobile */
  .sub-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0;
  }
  .sub-tabs::-webkit-scrollbar {
    display: none;
  }
  .sub-tab {
    flex-shrink: 0;
    padding: 10px 14px;
    font-size: 0.8rem;
    min-height: 44px;
    min-width: 44px;
  }

  /* Portfolio stats stack */
  .portfolio-stats {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .stat-card {
    padding: 14px;
  }

  /* Sovereign panel */
  .sovereign-panel {
    padding: 16px;
  }
  .sovereign-badge {
    font-size: 0.68rem;
  }

  /* KYC section */
  .kyc-section {
    padding: 16px;
  }
  .kyc-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  /* Investment cards — full width */
  .investment-details {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .investment-card {
    padding: 16px;
  }

  /* Detail items */
  .detail-item {
    font-size: 0.82rem;
  }

  /* Tabs container — scrollable */
  .tabs-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tabs-container::-webkit-scrollbar {
    display: none;
  }
  .tab-button {
    flex-shrink: 0;
    padding: 10px 14px;
    font-size: 0.82rem;
    min-height: 44px;
    min-width: 44px;
  }

  /* Tables become scrollable on mobile */
  .table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Modal fills width on mobile */
  .modal {
    width: 95%;
    padding: 20px;
    margin: 0 auto;
  }

  /* Investment history table */
  .compact-table {
    font-size: 0.8rem;
  }
  .compact-table th,
  .compact-table td {
    padding: 6px 0;
  }

  /* Ecosystem cards go full width */
  .ecosystem-card-grid {
    grid-template-columns: 1fr;
  }

  /* Editor instructions */
  .editor-instructions {
    padding: 12px 16px;
  }

  /* Dashboard actions */
  .dashboard-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .dashboard-actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* Skeleton cards — full width on mobile */
  .skeleton-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Tablet: 769px–1024px ── */
@media (min-width: 769px) and (max-width: 1024px) {
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .app-main {
    padding: 24px 20px;
  }
  .hero-panel__content {
    padding: 36px 28px;
  }
  .portfolio-stats {
    grid-template-columns: repeat(3, 1fr);
  }
  .investment-details {
    grid-template-columns: repeat(2, 1fr);
  }
  .kpi-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
