/* ========================================================
   DocuPro MVP — Design System
   Premium dark-mode UI for engineering project control
   ======================================================== */

/* ---------- CSS Variables (Design Tokens) ---------- */
:root {
  /* Colors - dark palette with electric accent */
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: #1a1f2e;
  --bg-card-hover: #222842;
  --bg-input: #151b2b;
  --bg-glass: rgba(26, 31, 46, 0.85);

  --border-primary: #2a3050;
  --border-hover: #3b4578;
  --border-accent: #6366f1;

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-accent: #818cf8;

  /* Accent gradient */
  --gradient-accent: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);
  --gradient-accent-hover: linear-gradient(135deg, #818cf8 0%, #a78bfa 50%, #c4b5fd 100%);
  --gradient-danger: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
  --gradient-success: linear-gradient(135deg, #10b981 0%, #34d399 100%);
  --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);

  /* Status colors */
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-info: #6366f1;
  --color-blocked: #f97316;

  /* S-Curve */
  --color-pv: #6366f1;
  --color-ev: #10b981;
  --color-ac: #ef4444;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* Border radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  transition: background-color var(--transition-base), color var(--transition-base);
}

:root[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-input: #f1f5f9;
  --bg-glass: rgba(255, 255, 255, 0.9);

  --border-primary: #e2e8f0;
  --border-hover: #cbd5e1;
  --border-accent: #6366f1;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-accent: #4f46e5;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.1);
}

.card, .sidebar, .nav-item, .btn, .form-input, table, th, td, .kpi-card, .login-card {
  transition: background-color var(--transition-base), border-color var(--transition-base), color var(--transition-base), box-shadow var(--transition-base);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border-primary); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* ---------- Layout ---------- */
#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-primary);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform var(--transition-base);
}

.sidebar-brand {
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--border-primary);
}

.sidebar-brand h1 {
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.03em;
}

.sidebar-brand p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

.sidebar-nav {
  padding: var(--space-md);
  flex: 1;
  overflow-y: auto;
}

.nav-section {
  margin-bottom: var(--space-lg);
}

.nav-section-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: var(--space-sm) var(--space-md);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(99, 102, 241, 0.12);
  color: var(--text-accent);
  border-left: 3px solid var(--border-accent);
}

.nav-item .nav-icon {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
}

.sidebar-footer {
  padding: var(--space-md) var(--space-xl);
  border-top: 1px solid var(--border-primary);
}

.user-info {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--gradient-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
  color: white;
}

.user-details {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.main-content {
  margin-left: 260px;
  flex: 1;
  padding: var(--space-xl) var(--space-2xl);
  max-width: 100%;
  overflow-x: hidden;
}

/* ---------- Login Page ---------- */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 30% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
              radial-gradient(ellipse at 70% 50%, rgba(139, 92, 246, 0.06) 0%, transparent 50%);
  animation: aurora 15s ease-in-out infinite alternate;
}

@keyframes aurora {
  0% { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(-5%, 3%) rotate(3deg); }
}

.login-card {
  position: relative;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.login-card h1 {
  font-size: 2rem;
  font-weight: 800;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
  margin-bottom: var(--space-xs);
  letter-spacing: -0.03em;
}

.login-card .subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: var(--space-xl);
}

/* ---------- Forms ---------- */
.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
  letter-spacing: 0.01em;
}

.form-input {
  width: 100%;
  padding: 0.625rem var(--space-md);
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.875rem;
  transition: all var(--transition-fast);
  outline: none;
}

.form-input:focus {
  border-color: var(--border-accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-error {
  color: var(--color-danger);
  font-size: 0.75rem;
  margin-top: var(--space-xs);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.625rem var(--space-lg);
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  outline: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-accent);
  color: white;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  background: var(--gradient-accent-hover);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
}

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

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.btn-danger {
  background: var(--gradient-danger);
  color: white;
}

.btn-sm {
  padding: 0.375rem var(--space-md);
  font-size: 0.8125rem;
}

.btn-full {
  width: 100%;
}

.btn-icon:hover {
  color: var(--text-accent) !important;
  transform: scale(1.1);
  background: rgba(99, 102, 241, 0.1) !important;
  border-radius: var(--radius-sm);
}

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

/* ---------- Page Header ---------- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
}

.page-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

/* ---------- Cards ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: all var(--transition-fast);
}

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

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.card-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ---------- KPI Cards ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.kpi-card.spi::before { background: var(--gradient-accent); }
.kpi-card.cpi::before { background: var(--gradient-success); }
.kpi-card.eac::before { background: var(--gradient-warning); }
.kpi-card.bac::before { background: var(--gradient-danger); }

.kpi-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.kpi-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.kpi-value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.kpi-value.good { color: var(--color-success); }
.kpi-value.warning { color: var(--color-warning); }
.kpi-value.danger { color: var(--color-danger); }
.kpi-value.neutral { color: var(--text-accent); }

.kpi-detail {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: var(--space-sm);
}

/* ---------- Dashboard Grid ---------- */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
}

.chart-container {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  position: relative;
}

.chart-wrapper {
  position: relative;
  height: 350px;
}

/* ---------- Tables ---------- */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-primary);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

thead {
  background: var(--bg-secondary);
}

th {
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.6875rem;
  white-space: nowrap;
  border-bottom: 1px solid var(--border-primary);
}

td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-primary);
  color: var(--text-secondary);
  white-space: nowrap;
}

tr:hover td {
  background: var(--bg-card-hover);
}

tr:last-child td {
  border-bottom: none;
}

/* ---------- Badges / Tags ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-draft { background: rgba(100, 116, 139, 0.2); color: #94a3b8; }
.badge-rev-interna { background: rgba(99, 102, 241, 0.15); color: #818cf8; }
.badge-rev-a { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.badge-rev-b { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge-rev-0 { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-aprobado { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.badge-retrabajo { background: rgba(239, 68, 68, 0.15); color: #f87171; }

.badge-documento { background: rgba(59, 130, 246, 0.12); color: #60a5fa; }
.badge-actividad { background: rgba(168, 85, 247, 0.12); color: #c084fc; }

/* Fire badges */
.badge-fire { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.badge-fire.atrasado { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.badge-fire.riesgo { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge-fire.bloqueado { background: rgba(249, 115, 22, 0.15); color: #fb923c; }

/* ---------- Progress Bars ---------- */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
  background: var(--gradient-accent);
}

.progress-fill.success { background: var(--gradient-success); }
.progress-fill.warning { background: var(--gradient-warning); }
.progress-fill.danger { background: var(--gradient-danger); }

/* ---------- Timesheet Grid ---------- */
.timesheet-grid {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.timesheet-grid table {
  table-layout: fixed;
}

.timesheet-grid th:first-child,
.timesheet-grid td:first-child {
  width: 200px;
  min-width: 200px;
}

.timesheet-grid .hour-input {
  width: 60px;
  padding: 4px 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.8125rem;
  text-align: center;
  transition: all var(--transition-fast);
  outline: none;
}

.timesheet-grid .hour-input:focus {
  border-color: var(--border-accent);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.timesheet-grid .hour-input.has-value {
  color: var(--text-accent);
  font-weight: 600;
}

.timesheet-total {
  font-weight: 700;
  color: var(--text-accent);
}

.timesheet-day-header {
  text-align: center;
  width: 80px;
  min-width: 80px;
}

/* ---------- Alerts / Notifications ---------- */
.alert {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--color-success);
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--color-danger);
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--color-warning);
}

/* ---------- Loading ---------- */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-primary);
  border-top-color: var(--border-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  gap: var(--space-md);
  color: var(--text-muted);
}

/* ---------- Empty State ---------- */
.empty-state {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--text-muted);
}

.empty-state .icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn var(--transition-fast);
}

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

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp var(--transition-base);
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.modal-title {
  font-size: 1.125rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: var(--space-xs);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.modal-close:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.modal-actions {
  display: flex;
  gap: var(--space-sm);
  justify-content: flex-end;
  margin-top: var(--space-lg);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .main-content { padding: var(--space-md); }
}

/* ---------- Animations ---------- */
.fade-in {
  animation: fadeIn var(--transition-base);
}

.slide-in {
  animation: slideUp var(--transition-base);
}

/* Pulse for fire items */
.pulse {
  animation: pulse 2s ease-in-out infinite;
}

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

/* ---------- Week Picker ---------- */
.week-nav {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.week-nav button {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all var(--transition-fast);
}

.week-nav button:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.week-nav .week-label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ---------- Select dropdown ---------- */
.form-select {
  width: 100%;
  padding: 0.625rem var(--space-md);
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.875rem;
  transition: all var(--transition-fast);
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8.825L1.175 4 2.238 2.938 6 6.7l3.763-3.763L10.825 4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.form-select:focus {
  border-color: var(--border-accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* ---------- Capacity / Misc ---------- */
.capacity-bar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.inline-flex {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}

/* ---------- Tabs ---------- */
.tab-btn {
  padding: 0.75rem 1.25rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab-btn:hover {
  color: var(--text-secondary);
  background: rgba(99, 102, 241, 0.05);
}

.tab-btn.active {
  color: var(--text-accent);
  border-bottom-color: var(--border-accent);
}

.tab-content {
  padding: var(--space-md) 0;
}

/* ========================================================
   LANDING PAGE STYLES
   ======================================================== */

.landing-page {
  min-height: 100vh;
  background: var(--bg-primary);
}

.landing-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* Landing Header */
.landing-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: var(--space-md) 0;
  background: rgba(10, 14, 26, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-primary);
}

.landing-header .landing-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.landing-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.landing-nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.landing-nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.landing-nav-link:hover {
  color: var(--text-primary);
}

/* Hero Section */
.landing-hero {
  padding: 8rem 0 4rem;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.landing-hero .landing-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-content {
  max-width: 600px;
}

.hero-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-full);
  color: var(--text-accent);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: var(--space-lg);
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: var(--space-lg);
  color: var(--text-primary);
}

.hero-gradient {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-xl);
}

.hero-subtitle strong {
  color: var(--text-primary);
}

.hero-cta {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.hero-note {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Hero Visual / Mockup */
.hero-visual {
  display: flex;
  justify-content: center;
}

.hero-mockup {
  width: 100%;
  max-width: 450px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-primary);
  box-shadow: var(--shadow-lg), 0 0 60px rgba(99, 102, 241, 0.1);
  overflow: hidden;
}

.mockup-header {
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  display: flex;
  gap: 0.5rem;
}

.mockup-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.mockup-dot.red { background: #ef4444; }
.mockup-dot.yellow { background: #f59e0b; }
.mockup-dot.green { background: #10b981; }

.mockup-content {
  padding: 1.5rem;
}

.mockup-kpi-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.mockup-kpi {
  flex: 1;
  background: var(--bg-secondary);
  padding: 1rem;
  border-radius: var(--radius-md);
  text-align: center;
}

.mockup-kpi .kpi-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.mockup-kpi .kpi-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.mockup-kpi .kpi-value.good { color: #10b981; }
.mockup-kpi .kpi-value.warning { color: #f59e0b; }

.mockup-chart {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.chart-svg {
  width: 100%;
  height: 80px;
}

.chart-line {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-line.pv { stroke: #6366f1; }
.chart-line.ev { stroke: #10b981; }
.chart-line.ac { stroke: #ef4444; }

/* Landing Sections */
.landing-section {
  padding: 5rem 0;
}

.section-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: rgba(99, 102, 241, 0.15);
  border-radius: var(--radius-full);
  color: var(--text-accent);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: var(--space-md);
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  text-align: center;
}

.section-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  text-align: center;
  max-width: 700px;
  margin: 0 auto var(--space-2xl);
}

/* Pain Points */
.landing-pain {
  background: var(--bg-secondary);
}

.pain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}

.pain-card {
  background: var(--bg-card);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-primary);
  text-align: center;
}

.pain-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: var(--space-md);
}

.pain-card h3 {
  font-size: 1.25rem;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.pain-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Features Grid */
.landing-features .landing-container {
  text-align: center;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-lg);
}

.feature-card {
  background: var(--bg-card);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-primary);
  text-align: left;
  transition: all var(--transition-base);
}

.feature-card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
  transform: translateY(-4px);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: var(--space-md);
}

.feature-card h3 {
  font-size: 1.125rem;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* How it Works */
.landing-how {
  background: var(--bg-secondary);
}

.steps-grid {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.step-card {
  background: var(--bg-card);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-primary);
  text-align: center;
  max-width: 280px;
}

.step-number {
  width: 48px;
  height: 48px;
  background: var(--gradient-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  margin: 0 auto var(--space-md);
}

.step-card h3 {
  font-size: 1.125rem;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.step-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.step-arrow {
  font-size: 2rem;
  color: var(--text-muted);
}

/* Pricing */
.landing-pricing .landing-container {
  text-align: center;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
  max-width: 1000px;
  margin: 0 auto;
}

.pricing-card {
  background: var(--bg-card);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-primary);
  text-align: left;
  position: relative;
}

.pricing-card.featured {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
}

.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gradient-accent);
  color: white;
  padding: 0.25rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.pricing-header {
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border-primary);
}

.pricing-header h3 {
  font-size: 1.25rem;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.pricing-price {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}

.price-amount {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.price-period {
  color: var(--text-muted);
}

.pricing-features {
  list-style: none;
  margin-bottom: var(--space-xl);
}

.pricing-features li {
  padding: 0.5rem 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* CTA Section */
.landing-cta {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  border-top: 1px solid var(--border-primary);
  border-bottom: 1px solid var(--border-primary);
}

.cta-content {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.cta-content h2 {
  font-size: 2rem;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.cta-content p {
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  font-size: 1.125rem;
}

/* Footer */
.landing-footer {
  padding: 3rem 0 2rem;
  background: var(--bg-secondary);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--border-primary);
  margin-bottom: var(--space-lg);
}

.footer-brand p {
  color: var(--text-muted);
  margin-top: var(--space-sm);
  font-size: 0.875rem;
}

.footer-links {
  display: flex;
  gap: var(--space-lg);
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  text-align: center;
}

.footer-bottom p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Button sizes for landing */
.btn-lg {
  padding: 1rem 2rem;
  font-size: 1rem;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* Responsive Landing */
@media (max-width: 968px) {
  .landing-hero .landing-container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-content {
    max-width: 100%;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .hero-cta {
    justify-content: center;
    flex-wrap: wrap;
  }

  .hero-visual {
    order: -1;
  }

  .hero-mockup {
    max-width: 350px;
  }

  .steps-grid {
    flex-direction: column;
  }

  .step-arrow {
    transform: rotate(90deg);
  }

  .footer-content {
    flex-direction: column;
    gap: var(--space-lg);
    text-align: center;
  }
}

@media (max-width: 640px) {
  .landing-nav {
    gap: var(--space-md);
  }

  .landing-nav-link {
    display: none;
  }

  .hero-title {
    font-size: 2rem;
  }

  .section-title {
    font-size: 1.75rem;
  }
}

/* hCaptcha Styles */
.h-captcha {
  margin: var(--space-sm) 0;
}

.h-captcha iframe {
  border-radius: var(--border-radius);
}
