/* ════════════════════════════════════════════════
   VARCProject — Global Design System
   Extracted from landing page, extended for app
   ════════════════════════════════════════════════ */

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

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

/* ── TOKENS ── */
:root {
  /* Backgrounds */
  --bg-base:     #0a0a0b;
  --bg-surface:  #111113;
  --bg-elevated: #161618;
  --bg-card:     #1a1a1d;
  --bg-hover:    #1f1f23;

  /* Borders */
  --border:       rgba(255,255,255,0.07);
  --border-light: rgba(255,255,255,0.12);
  --border-focus: rgba(255,255,255,0.22);

  /* Text */
  --text-primary:   #f0f0f2;
  --text-secondary: #a0a0a8;
  --text-muted:     #5a5a62;
  --text-dim:       #3a3a42;

  /* Accents */
  --accent:       #d4d4dc;
  --accent-glow:  rgba(200,200,220,0.08);
  --white:        #ffffff;

  /* Semantic */
  --success:      rgba(120,200,120,0.85);
  --error:        rgba(220,100,100,0.85);
  --warning:      rgba(220,180,80,0.85);
  --success-bg:   rgba(120,200,120,0.08);
  --error-bg:     rgba(220,100,100,0.08);
  --warning-bg:   rgba(220,180,80,0.08);

  /* Typography */
  --font-display: 'Space Mono', monospace;
  --font-body:    'Outfit', sans-serif;

  /* Spacing */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;

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

  /* Transitions */
  --t-fast: 0.15s ease;
  --t-base: 0.25s ease;
  --t-slow: 0.4s ease;

  /* Sidebar */
  --sidebar-w: 240px;
}

/* ── BASE ── */
html { scroll-behavior: smooth; }

body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ── LAYOUT ── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

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

.page-content {
  flex: 1;
  padding: var(--sp-8);
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

/* ── AMBIENT BG ── */
.ambient {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}
.ambient-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(80,80,100,0.10) 0%, transparent 70%);
  top: -200px; left: -100px;
  animation: drift1 20s ease-in-out infinite alternate;
}
.ambient-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(60,60,90,0.08) 0%, transparent 70%);
  bottom: 10%; right: -100px;
  animation: drift2 25s ease-in-out infinite alternate;
}
@keyframes drift1 { from { transform: translate(0,0); } to { transform: translate(60px,80px); } }
@keyframes drift2 { from { transform: translate(0,0); } to { transform: translate(-50px,-70px); } }

/* ── TYPOGRAPHY ── */
.font-display  { font-family: var(--font-display); }
.font-body     { font-family: var(--font-body); }

.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }
.text-white     { color: var(--white); }

/* ── SECTION TAG ── */
.section-tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 9px; font-weight: 400;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 5px 12px; border-radius: var(--r-full);
  margin-bottom: var(--sp-5);
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--white);
  margin-bottom: var(--sp-2);
}

.page-desc {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-display);
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.02em;
  padding: 11px 22px;
  border-radius: var(--r-sm);
  transition: all var(--t-base);
  cursor: pointer;
  border: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--white);
  color: var(--bg-base);
  position: relative; overflow: hidden;
}
.btn-primary::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(0,0,0,0);
  transition: background var(--t-base);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(255,255,255,0.12); }
.btn-primary:hover::after { background: rgba(0,0,0,0.06); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--border-light); color: var(--text-primary); }

.btn-danger {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid rgba(220,100,100,0.2);
}
.btn-danger:hover { background: rgba(220,100,100,0.14); }

.btn-sm { font-size: 11px; padding: 8px 16px; }
.btn-xs { font-size: 10px; padding: 6px 12px; }
.btn-full { width: 100%; justify-content: center; }

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ── CARDS ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  position: relative;
  overflow: hidden;
  transition: all var(--t-slow);
}

.card-hover:hover {
  transform: translateY(-3px);
  border-color: var(--border-light);
  box-shadow: 0 16px 48px rgba(0,0,0,0.35);
}
.card-hover::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(255,255,255,0.03) 0%, transparent 60%);
  opacity: 0; transition: opacity var(--t-slow);
}
.card-hover:hover::before { opacity: 1; }

/* ── STAT BOX ── */
.stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  transition: border-color var(--t-base);
}
.stat-box:hover { border-color: var(--border-light); }
.stat-box .num {
  font-family: var(--font-display);
  font-size: 26px; font-weight: 700;
  color: var(--white);
  letter-spacing: -0.03em;
  margin-bottom: var(--sp-1);
}
.stat-box .lbl {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-muted);
}

/* ── FORM ELEMENTS ── */
.form-group { display: flex; flex-direction: column; gap: var(--sp-2); }

.form-label {
  font-family: var(--font-display);
  font-size: 10px; font-weight: 400;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-muted);
}

.form-input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 14px; font-weight: 400;
  color: var(--text-primary);
  transition: border-color var(--t-base), box-shadow var(--t-base);
  outline: none;
}
.form-input::placeholder { color: var(--text-dim); }
.form-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.04);
}
.form-input:hover:not(:focus) { border-color: var(--border-light); }

.form-error {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--error);
  margin-top: var(--sp-1);
  display: none;
}
.form-error.visible { display: block; }

/* ── BADGE / TAG ── */
.badge {
  display: inline-flex; align-items: center;
  font-family: var(--font-display);
  font-size: 9px; font-weight: 400;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 4px 10px; border-radius: var(--r-sm);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.badge-category {
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

/* ── DIVIDER ── */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border) 20%, var(--border) 80%, transparent);
  margin: var(--sp-8) 0;
}

/* ── ALERT / TOAST ── */
.alert {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: 13px; line-height: 1.6;
  border: 1px solid transparent;
}
.alert-success { background: var(--success-bg); border-color: rgba(120,200,120,0.15); color: var(--success); }
.alert-error   { background: var(--error-bg);   border-color: rgba(220,100,100,0.15); color: var(--error); }
.alert-warning { background: var(--warning-bg); border-color: rgba(220,180,80,0.15);  color: var(--warning); }

/* ── TOAST SYSTEM ── */
#toast-container {
  position: fixed; bottom: 28px; right: 28px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: var(--sp-3);
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--r-md);
  padding: 14px 20px;
  font-family: var(--font-body); font-size: 13px;
  color: var(--text-primary);
  display: flex; align-items: center; gap: var(--sp-3);
  min-width: 260px; max-width: 340px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  animation: toast-in 0.3s cubic-bezier(0.34,1.56,0.64,1) forwards;
  backdrop-filter: blur(16px);
}
.toast.out { animation: toast-out 0.25s ease forwards; }
.toast-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.toast-success .toast-dot { background: var(--success); }
.toast-error   .toast-dot { background: var(--error); }
.toast-info    .toast-dot { background: var(--text-secondary); }
@keyframes toast-in  { from { opacity:0; transform: translateX(20px); } to { opacity:1; transform:none; } }
@keyframes toast-out { from { opacity:1; transform: none; } to { opacity:0; transform: translateX(20px); } }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-5);
  opacity: 0; pointer-events: none;
  transition: opacity var(--t-base);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--r-xl);
  padding: var(--sp-8);
  width: 100%; max-width: 480px;
  position: relative;
  transform: scale(0.96) translateY(8px);
  transition: transform var(--t-base);
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }
.modal-close {
  position: absolute; top: var(--sp-5); right: var(--sp-5);
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all var(--t-fast);
  cursor: pointer; background: none;
}
.modal-close:hover { border-color: var(--border-light); color: var(--text-primary); }
.modal-title {
  font-family: var(--font-display);
  font-size: 16px; font-weight: 700;
  color: var(--white); margin-bottom: var(--sp-2);
}
.modal-desc { font-size: 13px; color: var(--text-muted); margin-bottom: var(--sp-6); }

/* ── PROGRESS BAR ── */
.progress-track {
  height: 3px; background: var(--bg-elevated);
  border-radius: 3px; overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, rgba(160,160,180,0.4), rgba(200,200,220,0.9));
  transition: width 1s cubic-bezier(0.4,0,0.2,1);
}

/* ── LOADING SPINNER ── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--text-secondary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── SKELETON ── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-hover) 50%, var(--bg-elevated) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── SCROLL REVEAL ── */
.reveal {
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible { opacity: 1; transform: none; }
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }
.reveal-delay-5 { transition-delay: 0.40s; }

/* ── GRID UTILITIES ── */
.grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: var(--sp-5); }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--sp-5); }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: var(--sp-5); }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: var(--sp-16) var(--sp-8);
}
.empty-state-icon {
  width: 52px; height: 52px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--bg-elevated);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  margin: 0 auto var(--sp-5);
}
.empty-state h3 {
  font-family: var(--font-display);
  font-size: 14px; font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--sp-2);
}
.empty-state p { font-size: 13px; color: var(--text-muted); }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .app-main { margin-left: 0; }
  .grid-3 { grid-template-columns: repeat(2,1fr); }
  .grid-4 { grid-template-columns: repeat(2,1fr); }
  .page-content { padding: var(--sp-5); }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .page-content { padding: var(--sp-4); }
}
