/* ═══════════════════════════════════════════════════════════════════
   DESIGN SYSTEM — RentAITalents
   Global theme construction. Single source of truth for all pages.
   Extracted from homepage (index.html) — the canonical design.
   ═══════════════════════════════════════════════════════════════════ */

/* ── PRIMITIVES ── */
:root {
  /* Color: Brand */
  --c-accent:        #00be8c;
  --c-accent-deep:   #009970;
  --c-accent-glow:   rgba(0,190,140,0.12);
  --c-accent-orange: #e8703a;
  --c-accent-purple: #7c6cf0;
  --c-accent-blue:   #3b82f6;

  /* Color: Semantic */
  --c-success: #22c55e;
  --c-warning: #f59e0b;
  --c-error:   #ef4444;

  /* Color: Light theme (tinted toward teal for brand cohesion) */
  --c-bg:            #ffffff;
  --c-bg-subtle:     #f7f8f8;
  --c-text:          #101216;
  --c-text-secondary:#535860;
  --c-text-muted:    #969BA5;
  --c-border:        rgba(0,8,5,0.06);
  --c-border-med:    rgba(0,8,5,0.1);

  /* Color: Dark theme */
  --c-dark:          #09090b;
  --c-dark-card:     rgba(255,255,255,0.03);
  --c-dark-card-h:   rgba(255,255,255,0.06);
  --c-dark-surface:  #18181b;
  --c-dark-elevated: #27272a;
  --c-dark-text:     #fafafa;
  --c-dark-text-sec: #a1a1aa;
  --c-dark-text-mut: #71717a;
  --c-dark-border:   rgba(255,255,255,0.06);
  --c-dark-border-h: rgba(255,255,255,0.12);

  /* Typography */
  --f-display: 'Newsreader', Georgia, serif;
  --f-body:    'Outfit', system-ui, sans-serif;
  --f-mono:    'JetBrains Mono', monospace;

  /* Type scale (rem) */
  --fs-xs:   0.65rem;
  --fs-sm:   0.75rem;
  --fs-base: 0.85rem;
  --fs-md:   1rem;
  --fs-lg:   1.3rem;
  --fs-xl:   1.6rem;
  --fs-2xl:  2rem;
  --fs-3xl:  2.8rem;

  /* Tracking (letter-spacing) */
  --ls-tight:  -0.035em;
  --ls-snug:   -0.02em;
  --ls-normal:  0;
  --ls-wide:    0.06em;
  --ls-wider:   0.1em;
  --ls-widest:  0.14em;

  /* Radius */
  --r-sm:   6px;
  --r-md:   8px;
  --r-lg:   12px;
  --r-xl:   14px;
  --r-pill: 100px;

  /* Shadows (light theme) */
  --sh-sm:   0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
  --sh-md:   0 4px 16px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
  --sh-lg:   0 12px 40px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
  --sh-glow: 0 8px 40px rgba(0,190,140,0.12);

  /* Motion — the signature easing */
  --ease:     cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 0.15s;
  --dur:      0.25s;
  --dur-slow: 0.7s;

  /* Spacing scale */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
}

/* ═══ CANONICAL SHARED NAMES ═══
   Every design system (Platform, QuantSage, MarCo, Lumina) exports these
   same names so new code can use one set of variables regardless of context.
   See templates/references/design-system.md for the full canonical naming guide. */
:root {
  /* Interactive */
  --accent: var(--c-accent);
  --accent-hover: var(--c-accent-deep);
  --accent-light: var(--c-accent-glow);

  /* Text */
  --text-primary: var(--c-text);
  --text-secondary: var(--c-text-secondary);
  --text-muted: var(--c-text-muted);
  --text-inverse: #ffffff;

  /* Backgrounds */
  --bg-page: var(--c-bg);
  --bg-surface: var(--c-bg);
  --bg-subtle: var(--c-bg-subtle);
  --bg-hover: rgba(0, 0, 0, 0.04);
  --bg-muted: var(--c-bg-subtle);

  /* Borders */
  --border: var(--c-border);
  --border-strong: var(--c-border-med);
  --border-focus: var(--c-accent);

  /* Semantic */
  --success: var(--c-success);
  --warning: var(--c-warning);
  --danger: var(--c-error);

  /* Typography */
  --font-display: var(--f-display);
  --font-body: var(--f-body);
  --font-mono: var(--f-mono);

  /* Layout */
  --radius-sm: var(--r-sm);
  --radius-md: var(--r-md);
  --radius-lg: var(--r-lg);
  --radius-pill: var(--r-pill);
  --shadow-sm: var(--sh-sm);
  --shadow-md: var(--sh-md);
  --shadow-lg: var(--sh-lg);
  --shadow-glow: var(--sh-glow);
  --transition-fast: var(--dur-fast);
  --transition-normal: var(--dur);

  /* Legacy aliases (keep until all pages migrated) */
  --bg-dark: var(--c-dark);
  --bg-dark-card: var(--c-dark-card);
  --bg-dark-surface: var(--c-dark-surface);
  --text-on-dark: var(--c-dark-text);
  --text-on-dark-muted: var(--c-dark-text-mut);
  --accent-deep: var(--c-accent-deep);
  --accent-glow: var(--c-accent-glow);
  --color-success: var(--c-success);
  --color-error: var(--c-error);
  --color-warning: var(--c-warning);
  --border-default: var(--c-border-med);
  --border-medium: var(--c-border-med);
  --border-light: var(--c-border);
}

/* Old layout class aliases */
.admin-layout { display: flex; min-height: 100vh; background: var(--c-bg-subtle); }
.admin-sidebar {
  width: 220px; background: var(--c-dark); border-right: 1px solid var(--c-dark-border);
  padding: var(--sp-6) var(--sp-3); display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; z-index: 50;
}
.admin-sidebar h3 {
  font-family: var(--f-body); font-size: 0.88rem; font-weight: 700; color: var(--c-dark-text);
  padding: 0 0.5rem var(--sp-6); display: flex; align-items: center; gap: 0.5rem;
}
.admin-sidebar a {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0.75rem; border-radius: var(--r-md);
  font-size: 0.8rem; font-weight: 500; color: var(--c-dark-text-sec); transition: all var(--dur); margin-bottom: 1px;
}
.admin-sidebar a:hover { color: var(--c-dark-text); background: var(--c-dark-card-h); }
.admin-sidebar a.active { color: var(--c-dark-text); background: var(--c-dark-card-h); }
.admin-sidebar a.active::before {
  content: ''; width: 3px; height: 16px; border-radius: 2px; background: var(--c-accent); margin-right: -0.1rem; flex-shrink: 0;
}
.admin-main { flex: 1; margin-left: 220px; padding: var(--sp-8) var(--sp-10); }
.admin-main h1 { font-family: var(--f-display); font-size: var(--fs-xl); font-weight: 500; letter-spacing: var(--ls-snug); color: var(--c-text); margin-bottom: var(--sp-6); }
.admin-main h2 { font-family: var(--f-body); font-size: var(--fs-md); font-weight: 600; color: var(--c-text-secondary); margin-bottom: var(--sp-4); }
@media (max-width: 768px) { .admin-sidebar { display: none; } .admin-main { margin-left: 0; padding: var(--sp-6); } }

/* ═══ RESET ═══ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--f-body);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: var(--f-body); }

/* ═══ ANIMATIONS ═══ */
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(0,190,140,0.3); }
  50% { opacity: 0.5; box-shadow: 0 0 0 6px rgba(0,190,140,0); }
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
}
.reveal.vis { opacity: 1; transform: translateY(0); }
.rd1 { transition-delay: 0.15s; }
.rd2 { transition-delay: 0.3s; }
.rd3 { transition-delay: 0.45s; }

/* Staggered reveal — add .stagger-reveal to parent grid/flex container */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.stagger-reveal > * {
  opacity: 0;
  animation: fadeSlideIn 0.4s var(--ease) forwards;
}
.stagger-reveal > *:nth-child(1) { animation-delay: 0s; }
.stagger-reveal > *:nth-child(2) { animation-delay: 0.06s; }
.stagger-reveal > *:nth-child(3) { animation-delay: 0.06s; }
.stagger-reveal > *:nth-child(4) { animation-delay: 0.18s; }
.stagger-reveal > *:nth-child(5) { animation-delay: 0.24s; }
.stagger-reveal > *:nth-child(6) { animation-delay: 0.30s; }
.stagger-reveal > *:nth-child(7) { animation-delay: 0.36s; }
.stagger-reveal > *:nth-child(8) { animation-delay: 0.42s; }

.fade-in {
  opacity: 0;
  animation: fadeSlideIn 0.4s var(--ease) forwards;
}
.stagger-1 { animation-delay: 0.06s; }
.stagger-2 { animation-delay: 0.12s; }
.stagger-3 { animation-delay: 0.18s; }
.stagger-4 { animation-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  .stagger-reveal > *,
  .fade-in,
  .reveal { animation: none; opacity: 1; transform: none; transition: none; }
}

/* ═══ SECTION TAG (monospace label + accent dash — homepage pattern) ═══ */
.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-mono);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--ls-widest);
  color: var(--c-accent-deep);
  margin-bottom: var(--sp-4);
}
.section-tag::before {
  content: '';
  width: 16px;
  height: 2px;
  background: var(--c-accent);
  border-radius: 1px;
}
/* Dark variant */
.section-tag.dark { color: var(--c-accent); }

/* ═══ BUTTONS ═══ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-family: var(--f-body);
  font-weight: 600;
  font-size: 0.82rem;
  padding: 0.55rem 1.25rem;
  border-radius: var(--r-md);
  border: none;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  white-space: nowrap;
  line-height: 1.4;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }
.btn:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }

.btn-accent, .btn-primary {
  background: var(--c-accent);
  color: #fff;
  box-shadow: 0 1px 3px rgba(0,190,140,0.2);
}
.btn-accent:hover, .btn-primary:hover {
  background: var(--c-accent-deep);
  transform: translateY(-1px);
  box-shadow: var(--sh-glow);
}

.btn-outline, .btn-secondary {
  background: rgba(0,0,0,0.03);
  color: var(--c-text);
  border: 1.5px solid var(--c-border-med);
}
.btn-outline:hover, .btn-secondary:hover {
  border-color: rgba(0,0,0,0.2);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--c-text-secondary);
  padding: 0.55rem 0.75rem;
}
.btn-ghost:hover { color: var(--c-text); }

.btn-danger {
  background: var(--c-error);
  color: #fff;
}
.btn-danger:hover { background: #dc2626; transform: translateY(-1px); }

.btn-dark-outline {
  background: transparent;
  color: var(--c-dark-text-sec);
  border: 1.5px solid var(--c-dark-border-h);
}
.btn-dark-outline:hover {
  color: var(--c-dark-text);
  background: var(--c-dark-card-h);
}

.btn-sm { font-size: 0.75rem; padding: 0.4rem 0.85rem; border-radius: var(--r-md); }
.btn-lg { font-size: 0.88rem; padding: 0.65rem 1.5rem; border-radius: var(--r-lg); }

/* ═══ BADGES ═══ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: var(--r-pill);
}
/* Dark-theme badges */
.badge-success { background: rgba(34,197,94,0.1);  color: #4ade80; }
.badge-warning { background: rgba(245,158,11,0.1); color: #fbbf24; }
.badge-error   { background: rgba(239,68,68,0.1);  color: #f87171; }
.badge-neutral { background: var(--c-dark-surface); color: var(--c-dark-text-mut); }
.badge-brand   { background: var(--c-accent-glow);  color: var(--c-accent); }
/* Light-theme badges */
.badge-success-light { background: #dcfce7; color: #166534; }
.badge-warning-light { background: #fef3c7; color: #92400e; }
.badge-error-light   { background: #fef2f2; color: #991b1b; }

/* ═══ FORM CONTROLS ═══ */
.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--c-text-secondary);
  margin-bottom: 0.3rem;
}
.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 0.6rem 0.85rem;
  font-family: var(--f-body);
  font-size: 0.88rem;
  color: var(--c-text);
  background: var(--c-bg);
  border: 1.5px solid var(--c-border-med);
  border-radius: var(--r-md);
  outline: none;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px var(--c-accent-glow);
}
.form-textarea { min-height: 80px; resize: vertical; }
.form-input.error,
.form-textarea.error,
.form-select.error { border-color: var(--c-error); }
.form-input.error:focus,
.form-textarea.error:focus,
.form-select.error:focus { box-shadow: 0 0 0 3px rgba(239,68,68,0.12); }
.form-error { font-size: var(--fs-xs); color: var(--c-error); margin-top: 0.3rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.form-group { margin-bottom: var(--sp-5); }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

/* ═══ DATA TABLE ═══ */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left;
  padding: 0.6rem 1.5rem;
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--ls-wider);
}
.data-table td {
  padding: 0.75rem 1.5rem;
  font-size: var(--fs-base);
  font-variant-numeric: tabular-nums;
}
/* Light table */
.data-table.light th { color: var(--c-text-muted); border-bottom: 2px solid rgba(0,0,0,0.06); }
.data-table.light td { color: var(--c-text-secondary); border-bottom: 1px solid rgba(0,0,0,0.04); }
.data-table.light tr:hover td { background: rgba(0,0,0,0.01); }
/* Dark table */
.data-table.dark th { color: var(--c-dark-text-mut); border-bottom: 1px solid var(--c-dark-border); border-top: 1px solid var(--c-dark-border); background: var(--c-dark-surface); }
.data-table.dark td { color: var(--c-dark-text-sec); border-bottom: 1px solid var(--c-dark-border); }
.data-table.dark tr:last-child td { border-bottom: none; }
.data-table.dark tr:hover td { background: rgba(255,255,255,0.02); }

/* ═══ CARD ═══ */
.card { border-radius: var(--r-lg); transition: all var(--dur) var(--ease); }
.card.light { background: var(--c-bg); box-shadow: var(--sh-sm); }
.card.light:hover { box-shadow: var(--sh-md); }
.card.dark { background: var(--c-dark-card); border: 1px solid var(--c-dark-border); }
.card.dark:hover { border-color: var(--c-dark-border-h); }

/* ═══ APP LAYOUT (admin/settings sidebar) ═══ */
.app-layout { display: flex; min-height: 100vh; }
.app-sidebar {
  width: 220px;
  background: var(--c-dark);
  border-right: 1px solid var(--c-dark-border);
  padding: var(--sp-6) var(--sp-3);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0;
  z-index: 50;
}
.app-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.5rem var(--sp-6);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--c-dark-text);
}
.app-sidebar-brand .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--c-accent);
  box-shadow: 0 0 8px var(--c-accent-glow);
}
.app-sidebar-section { margin-bottom: var(--sp-6); }
.app-sidebar-label {
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--ls-wider);
  color: var(--c-dark-text-mut);
  padding: 0 0.75rem;
  margin-bottom: 0.4rem;
}
.app-sidebar a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--r-md);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--c-dark-text-sec);
  transition: all var(--dur);
  margin-bottom: 1px;
}
.app-sidebar a:hover { color: var(--c-dark-text); background: var(--c-dark-card-h); }
.app-sidebar a.active { color: var(--c-dark-text); background: var(--c-dark-card-h); }
.app-sidebar a.active::before {
  content: '';
  width: 3px; height: 16px;
  border-radius: 2px;
  background: var(--c-accent);
  margin-right: -0.1rem;
  flex-shrink: 0;
}
.app-sidebar-footer { margin-top: auto; padding-top: var(--sp-4); border-top: 1px solid var(--c-dark-border); }
.app-main { flex: 1; margin-left: 220px; padding: var(--sp-8) var(--sp-10); }

/* ═══ PAGE HEADER ═══ */
.page-title {
  font-family: var(--f-display);
  font-size: var(--fs-xl);
  font-weight: 500;
  letter-spacing: var(--ls-snug);
}
.page-subtitle {
  font-size: var(--fs-base);
  font-weight: 300;
  margin-top: 0.2rem;
}

/* ═══ LIGHT SIDEBAR (admin pages — light theme) ═══ */
.light-layout { display: flex; min-height: 100vh; }
.light-sidebar {
  width: 220px; background: var(--c-bg); border-right: 1px solid var(--c-border);
  padding: var(--sp-6) var(--sp-3); display: flex; flex-direction: column;
  position: fixed; top: 0; bottom: 0; z-index: 50;
}
.light-sidebar-brand { display: flex; align-items: center; gap: 0.5rem; padding: 0 0.5rem var(--sp-6); font-size: 0.88rem; font-weight: 700; color: var(--c-text); }
.light-sidebar-brand .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-accent); box-shadow: 0 0 8px var(--c-accent-glow); }
.light-sidebar-section { margin-bottom: var(--sp-6); }
.light-sidebar-label { font-size: 0.6rem; font-weight: 600; text-transform: uppercase; letter-spacing: var(--ls-wider); color: var(--c-text-muted); padding: 0 0.75rem; margin-bottom: 0.4rem; }
.light-sidebar a { display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0.75rem; border-radius: var(--r-md); font-size: 0.82rem; font-weight: 500; color: var(--c-text-secondary); transition: all var(--dur); margin-bottom: 1px; }
.light-sidebar a:hover { color: var(--c-text); background: var(--c-bg-subtle); }
.light-sidebar a.active { color: var(--c-text); background: var(--c-bg-subtle); font-weight: 600; }
.light-sidebar a.active::before { content: ''; width: 3px; height: 16px; border-radius: 2px; background: var(--c-accent); margin-right: -0.1rem; flex-shrink: 0; }
.light-sidebar-footer { margin-top: auto; padding-top: var(--sp-4); border-top: 1px solid var(--c-border); }
.light-main { flex: 1; margin-left: 220px; padding: var(--sp-8) var(--sp-10); }
@media (max-width: 768px) { .light-sidebar { display: none; } .light-main { margin-left: 0; padding: var(--sp-6); } }

/* ═══ SITE NAV (light, for public pages) ═══ */
.site-nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.5rem, 4vw, 3rem);
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  border-bottom: 1px solid var(--c-border);
}
.site-nav .nav-logo {
  font-family: var(--f-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--c-text);
  letter-spacing: var(--ls-snug);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.site-nav .nav-links { display: flex; align-items: center; gap: 0.25rem; }
.site-nav .nav-links a {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--c-text-secondary);
  padding: 0.5rem 0.75rem;
  border-radius: var(--r-md);
  transition: color var(--dur-fast);
  position: relative;
}
.site-nav .nav-links a:hover,
.site-nav .nav-links a.active { color: var(--c-text); }
.site-nav .nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0.75rem; right: 0.75rem;
  height: 1.5px;
  background: var(--c-accent);
  transform: scaleX(0);
  transition: transform var(--dur) var(--ease);
}
.site-nav .nav-links a:hover::after,
.site-nav .nav-links a.active::after { transform: scaleX(1); }

/* ═══ SITE FOOTER ═══ */
.site-footer {
  text-align: center;
  padding: var(--sp-8);
  font-size: 0.72rem;
  color: var(--c-text-muted);
  border-top: 1px solid var(--c-border);
}
.site-footer a { color: var(--c-text-muted); transition: color var(--dur-fast); }
.site-footer a:hover { color: var(--c-accent); }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 768px) {
  .app-sidebar { display: none; }
  .app-main { margin-left: 0; padding: var(--sp-6); }
}
