/* ============================================================
   PRISMA 360 — Design System
   Tokens extraidos de constants/Colors.ts + typography.ts
   ============================================================ */

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

:root {
  /* === PALETA — Dark Theme === */
  --bg-primary: #1A1714;
  --bg-secondary: #1A1714;
  --bg-card: #2A2520;
  --bg-elevated: #352F28;
  --bg-input: #1A1714;
  --bg-surface: #352F28;

  --bg-hover: #3D362E;
  --bg-active: #45403A;
  --bg-selected: rgba(212, 168, 83, 0.12);

  /* Acento principal — dorado PRISMA */
  --accent: #D4A853;
  --accent-hover: #E0B860;
  --accent-dark: #A07D2E;
  --accent-muted: rgba(212, 168, 83, 0.30);
  --accent-subtle: rgba(212, 168, 83, 0.08);
  --gold-light: #F0DCA0;

  /* Acentos secundarios */
  --blue: #6B8FA3;
  --blue-muted: rgba(107, 143, 163, 0.30);
  --green: #7BAF6E;
  --green-muted: rgba(123, 175, 110, 0.30);
  --orange: #E8A840;
  --orange-muted: rgba(232, 168, 64, 0.30);
  --pink: #D46B6B;
  --pink-muted: rgba(212, 107, 107, 0.30);
  --copper: #C47D5A;

  /* Semanticos */
  --success: #7BAF6E;
  --success-muted: rgba(123, 175, 110, 0.15);
  --warning: #E8A840;
  --warning-muted: rgba(232, 168, 64, 0.15);
  --danger: #D46B6B;
  --danger-muted: rgba(212, 107, 107, 0.15);
  --info: #6B8FA3;
  --info-muted: rgba(107, 143, 163, 0.15);

  /* Textos */
  --text-primary: #F5F0E8;
  --text-secondary: #D0C7B8;
  --text-muted: #B8AD9E;
  --text-dim: #6B6560;
  --text-inverse: #1A1714;
  --text-accent: #D4A853;

  /* Bordes */
  --border: #3D362E;
  --border-light: #45403A;
  --border-accent: rgba(212, 168, 83, 0.30);

  /* Gradientes */
  --gradient-prisma: linear-gradient(135deg, #A07D2E, #D4A853, #F0DCA0);
  --gradient-button: linear-gradient(135deg, #D4A853, #A07D2E);
  --gradient-cyan-blue: linear-gradient(135deg, #D4A853, #6B8FA3);
  --gradient-success: linear-gradient(135deg, #7BAF6E, #5A8F5A);

  /* === TIPOGRAFIA === */
  --font-display: 'DM Serif Display', 'Georgia', serif;
  --font-heading: 'Inter', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;

  --text-xs: 0.625rem;     /* 10px */
  --text-sm: 0.75rem;      /* 12px */
  --text-base: 0.875rem;   /* 14px */
  --text-md: 1rem;         /* 16px */
  --text-lg: 1.125rem;     /* 18px */
  --text-xl: 1.5rem;       /* 24px */
  --text-2xl: 2rem;        /* 32px */
  --text-3xl: 2.5rem;      /* 40px */

  --weight-light: 300;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

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

  /* === BORDES === */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* === SOMBRAS === */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 20px rgba(212, 168, 83, 0.3);

  /* === TRANSICIONES === */
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
  --transition-slow: 0.4s ease;
}

/* === GOOGLE FONTS === */
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;600;700&display=swap');

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

/* ============================================================
   PHONE FRAME
   ============================================================ */

.phone-frame {
  width: 375px;
  min-height: 812px;
  background: var(--bg-primary);
  border-radius: 44px;
  border: 3px solid #3D362E;
  overflow: hidden;
  margin: 0 auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 28px 8px;
  font-size: 13px;
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

.screen {
  display: flex;
  flex-direction: column;
  min-height: 760px;
}

.home-indicator {
  width: 134px;
  height: 5px;
  background: var(--text-muted);
  border-radius: 3px;
  margin: 8px auto 12px;
  opacity: 0.3;
}

/* ============================================================
   HEADER
   ============================================================ */

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4) var(--space-5);
}

.header-title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  letter-spacing: 1px;
}

.header-subtitle {
  font-size: var(--text-xs);
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.header-actions {
  display: flex;
  gap: var(--space-2);
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 18px;
  color: var(--text-muted);
}

/* ============================================================
   TAB BAR
   ============================================================ */

.tab-bar {
  display: flex;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: var(--space-2) var(--space-3);
  gap: var(--space-1);
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-2) 0;
  border-radius: var(--radius-md);
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 0.3px;
}

.tab-item.active {
  color: var(--accent);
  background: var(--accent-subtle);
}

.tab-icon {
  font-size: 20px;
  line-height: 1;
}

/* ============================================================
   PAGE CONTENT
   ============================================================ */

.page-content {
  flex: 1;
  overflow-y: auto;
  padding-bottom: var(--space-4);
}

/* ============================================================
   CARDS
   ============================================================ */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin: 0 var(--space-5) var(--space-3);
}

.card-glow {
  border-color: var(--border-accent);
  box-shadow: 0 0 12px rgba(212, 168, 83, 0.08);
}

.card-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.card-desc {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  letter-spacing: 0.5px;
}

.btn-primary {
  background: var(--gradient-button);
  color: var(--text-inverse);
}

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

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

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

.btn-success {
  background: var(--success);
  color: var(--text-inverse);
}

.btn-lg {
  padding: var(--space-4) var(--space-6);
  font-size: var(--text-md);
  border-radius: var(--radius-xl);
  letter-spacing: 1.5px;
}

.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  border-radius: var(--radius-md);
}

.btn-full {
  width: 100%;
}

/* ============================================================
   CHIPS & BADGES
   ============================================================ */

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
}

.chip-accent {
  border-color: var(--accent-muted);
  color: var(--accent);
  background: var(--accent-subtle);
}

.chip-success {
  border-color: var(--green-muted);
  color: var(--success);
  background: var(--success-muted);
}

.chip-danger {
  border-color: var(--pink-muted);
  color: var(--danger);
  background: var(--danger-muted);
}

.chip-warning {
  border-color: var(--orange-muted);
  color: var(--warning);
  background: var(--warning-muted);
}

.chip-info {
  border-color: var(--blue-muted);
  color: var(--info);
  background: var(--info-muted);
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.badge-dot.gold { background: var(--accent); }
.badge-dot.green { background: var(--success); }
.badge-dot.red { background: var(--danger); }
.badge-dot.blue { background: var(--info); }

/* ============================================================
   INPUTS
   ============================================================ */

.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.input-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

.input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition-fast);
  font-family: var(--font-body);
}

.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

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

/* ============================================================
   STAT CARDS
   ============================================================ */

.stats-row {
  display: flex;
  gap: var(--space-2);
  padding: 0 var(--space-5);
  margin-bottom: var(--space-3);
}

.stat-card {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  text-align: center;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--accent);
}

.stat-label {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* ============================================================
   TOGGLE / SWITCH
   ============================================================ */

.toggle {
  width: 44px;
  height: 26px;
  border-radius: 13px;
  background: var(--border);
  position: relative;
  flex-shrink: 0;
}

.toggle.on {
  background: var(--success);
}

.toggle::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  top: 3px;
  left: 3px;
  transition: transform var(--transition-fast);
}

.toggle.on::after {
  transform: translateX(18px);
}

/* ============================================================
   SECTION DIVIDERS
   ============================================================ */

.section-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: var(--space-4) var(--space-5) var(--space-2);
}

.divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-3) var(--space-5);
}

/* ============================================================
   LIST ROWS
   ============================================================ */

.list-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
}

.list-row-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.list-row-content {
  flex: 1;
  min-width: 0;
}

.list-row-title {
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
}

.list-row-sub {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.list-row-right {
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

/* ============================================================
   PROGRESS BAR
   ============================================================ */

.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
  transition: width var(--transition-base);
}

.progress-fill.green { background: var(--success); }
.progress-fill.pink { background: var(--pink); }

/* ============================================================
   UTILITIES
   ============================================================ */

.text-accent { color: var(--accent); }
.text-green { color: var(--success); }
.text-pink { color: var(--danger); }
.text-blue { color: var(--info); }
.text-orange { color: var(--warning); }
.text-muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }

.flex-row { display: flex; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.px-5 { padding-left: var(--space-5); padding-right: var(--space-5); }
