/* ═══════════════════════════════════════════════════════════════
   Vulforge · Design System
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* surfaces */
  --bg: #0a0d12;
  --surface-1: #10151d;
  --surface-2: #171d27;
  --surface-3: #1f2632;
  --border: #232a36;
  --border-strong: #303845;

  /* text */
  --text: #e6edf3;
  --text-muted: #8b98a8;
  --text-dim: #6a7684;

  /* brand */
  --accent: #ff5722;
  --accent-hover: #ff7043;
  --accent-dim: rgba(255, 87, 34, 0.12);

  /* semantic */
  --ok: #3fb950;
  --warn: #d29922;
  --err: #f85149;
  --info: #58a6ff;

  /* radii + shadow */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--accent); text-decoration: none; }

/* ═══════════════════════════════════════════════════════════════
   LOGIN (keeps its own inline styles in login.html)
   ═══════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════
   APP LAYOUT
   ═══════════════════════════════════════════════════════════════ */

.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

/* ─────────── SIDEBAR ─────────── */

.sidebar {
  background: var(--surface-1);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 18px;
  border-bottom: 1px solid var(--border);
}
.brand-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.2px;
}
.brand-tag {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: -2px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }
.nav-section + .nav-section { margin-top: 24px; }
.nav-heading {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  padding: 0 8px 8px;
  font-weight: 600;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
  position: relative;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}
.nav-badge {
  margin-left: auto;
  background: var(--surface-3);
  color: var(--text-muted);
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.nav-item.active .nav-badge { background: rgba(255,87,34,0.2); color: var(--accent); }

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff9d5e, #ff5722);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
}
.user-info { min-width: 0; flex: 1; }
.user-email {
  font-size: 12px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-logout {
  background: none; border: none; padding: 0;
  color: var(--text-dim); font-size: 11px;
  cursor: pointer; font-family: inherit;
}
.user-logout:hover { color: var(--accent); }

/* ─────────── MAIN AREA ─────────── */

.main {
  padding: 24px 32px 40px;
  max-width: 1400px;
}

/* ─────────── TOP BAR ─────────── */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
}
.breadcrumb svg { color: var(--text-dim); }
.crumb-active {
  color: var(--text);
  font-weight: 500;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
}

.topbar-status { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--text-muted); }
.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}
.status-pill.online { background: rgba(63,185,80,0.12); color: var(--ok); }
.status-pill.offline { background: rgba(139,152,168,0.12); color: var(--text-dim); }
.pulse-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0 currentColor;
  animation: pulse 2s infinite;
}
.status-pill.offline .pulse-dot { animation: none; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 currentColor; }
  70% { box-shadow: 0 0 0 6px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.last-update { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11px; }

/* ─────────── SECTION HEADER ─────────── */

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.section-head h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}
.section-sub { color: var(--text-muted); font-size: 13px; }
.state-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3px;
  margin-left: 4px;
  text-transform: uppercase;
}
.state-badge.off      { background: var(--surface-3); color: var(--text-muted); }
.state-badge.heating  { background: rgba(255,87,34,0.15); color: var(--accent); }
.state-badge.ok       { background: rgba(63,185,80,0.15); color: var(--ok); }
.state-badge.cool     { background: rgba(88,166,255,0.15); color: var(--info); }

.head-actions { display: flex; gap: 8px; }

/* ─────────── BUTTONS ─────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.12s;
}
.btn:hover { background: var(--surface-3); border-color: var(--border-strong); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(255,87,34,0.25);
}
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.sm { padding: 6px 12px; font-size: 12px; }

/* ─────────── METRICS GRID (gauges) ─────────── */

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.metric-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s;
}
.metric-card:hover { border-color: var(--border-strong); }

.metric-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.metric-title { display: flex; align-items: center; gap: 8px; }
.metric-title span { font-size: 12px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.4px; }
.metric-icon {
  width: 26px; height: 26px;
  border-radius: 6px;
  display: grid; place-items: center;
}
.metric-delta {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.metric-delta.ok   { background: rgba(63,185,80,0.15); color: var(--ok); }
.metric-delta.warn { background: rgba(210,153,34,0.15); color: var(--warn); }
.metric-delta.far  { background: rgba(248,81,73,0.15); color: var(--err); }

.gauge-wrap {
  position: relative;
  aspect-ratio: 1;
  max-width: 140px;
  margin: 4px auto 8px;
}
.gauge { width: 100%; height: 100%; }
.gauge-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.gauge-value {
  font-size: 26px; font-weight: 500; letter-spacing: -0.5px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  color: var(--text);
  line-height: 1;
}
.gauge-unit { font-size: 11px; color: var(--text-dim); margin-top: 3px; }

.metric-foot {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  padding-top: 8px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.metric-foot strong { color: var(--text); font-family: 'JetBrains Mono', ui-monospace, monospace; font-weight: 500; }

/* ─────────── TIMER CARD ─────────── */

.timer-card { display: flex; flex-direction: column; }
.timer-badge {
  font-size: 10px; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-3); color: var(--text-dim);
  font-weight: 600; letter-spacing: 0.4px; text-transform: uppercase;
}
.timer-badge.active { background: rgba(210,153,34,0.15); color: var(--warn); }
.timer-display {
  text-align: center;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 42px;
  font-weight: 300;
  color: var(--text);
  padding: 20px 0 12px;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}
.timer-presets {
  display: flex; gap: 6px; justify-content: center; margin-bottom: 10px;
}
.chip {
  padding: 4px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.timer-actions { display: flex; gap: 6px; align-items: center; }
.timer-actions input[type=number] {
  flex: 1; min-width: 50px;
  padding: 6px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13px;
}
.timer-actions input[type=number]:focus { outline: none; border-color: var(--accent); }

/* ─────────── PANEL ─────────── */

.panel {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.panel-head h2 { font-size: 15px; font-weight: 600; margin-bottom: 3px; }
.panel-sub { color: var(--text-muted); font-size: 12px; }

/* ─────────── PRESETS ─────────── */

.presets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}
.preset-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: all 0.12s;
  font-family: inherit;
}
.preset-btn:hover { border-color: var(--accent); background: var(--surface-3); }
.preset-emoji { font-size: 24px; }
.preset-name { font-size: 13px; font-weight: 600; }
.preset-spec { font-size: 11px; color: var(--text-muted); margin-top: 2px; font-family: 'JetBrains Mono', ui-monospace, monospace; }

/* ─────────── CONTROLS ─────────── */

.controls-grid {
  display: grid;
  gap: 22px;
}
.control-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}
.control-value {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 15px;
  font-weight: 500;
  color: var(--accent);
}
.control-value em { font-size: 11px; color: var(--text-dim); font-style: normal; font-weight: 400; margin-left: 2px; }

input[type=range] {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: var(--surface-3);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 5px var(--accent-dim);
  transition: transform 0.1s;
}
input[type=range]::-webkit-slider-thumb:hover { transform: scale(1.15); }
input[type=range]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); border: none; cursor: pointer;
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 5px var(--accent-dim);
}
.range-scale {
  display: flex; justify-content: space-between;
  margin-top: 6px;
  color: var(--text-dim);
  font-size: 10px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

/* ─────────── RANGE TABS (chart) ─────────── */

.range-tabs {
  display: flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 2px;
  gap: 2px;
}
.tab {
  padding: 5px 12px;
  background: none;
  border: none;
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--surface-3); color: var(--text); }

/* ─────────── CHART ─────────── */

.chart-wrap {
  height: 300px;
  position: relative;
}
.chart-wrap canvas { max-height: 300px; }

/* ─────────── TIMER ALERT BANNER ─────────── */

.timer-alert-banner {
  background: linear-gradient(135deg, rgba(210,153,34,0.15), rgba(255,87,34,0.15));
  border: 1px solid var(--warn);
  border-radius: var(--r-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
  animation: pulseTimer 1.5s ease-in-out infinite;
  box-shadow: 0 0 20px rgba(210,153,34,0.2);
}
@keyframes pulseTimer {
  0%, 100% { box-shadow: 0 0 20px rgba(210,153,34,0.2); }
  50%       { box-shadow: 0 0 40px rgba(210,153,34,0.5); }
}
.timer-alert-content {
  display: flex; align-items: center; gap: 16px;
  flex-wrap: wrap;
}
.timer-alert-icon {
  font-size: 32px;
  animation: shake 0.6s ease-in-out infinite;
}
@keyframes shake {
  0%, 100% { transform: rotate(0); }
  25%      { transform: rotate(-10deg); }
  75%      { transform: rotate(10deg); }
}
.timer-alert-title {
  font-size: 15px; font-weight: 600; color: var(--warn);
}
.timer-alert-msg {
  font-size: 13px; color: var(--text-muted); margin-top: 2px;
}
.timer-alert-content > div:not(.timer-alert-icon) { flex: 1; min-width: 200px; }

/* ─────────── EMPTY STATE (activar horno) ─────────── */

.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
}
.empty-card {
  max-width: 400px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 32px;
  text-align: center;
  box-shadow: var(--shadow-md);
}
.empty-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  margin: 0 auto 16px;
  display: grid; place-items: center;
}
.empty-card h1 { font-size: 20px; margin-bottom: 6px; }
.empty-card p { color: var(--text-muted); font-size: 13px; margin-bottom: 20px; }
.empty-card form { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.empty-card .field label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-dim); font-weight: 600; margin-bottom: 4px; }
.empty-card .field input {
  width: 100%; padding: 10px 12px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r-sm); color: var(--text); font-size: 14px; font-family: inherit;
}
.empty-card .field input:focus { outline: none; border-color: var(--accent); }
.empty-card .btn { justify-content: center; margin-top: 6px; }

.error {
  color: var(--err);
  font-size: 12px;
  padding: 10px 12px;
  background: rgba(248,81,73,0.08);
  border: 1px solid rgba(248,81,73,0.3);
  border-radius: var(--r-sm);
  margin-top: 12px;
}

/* ─────────── HORNOS LIST (pagina Mis Hornos) ─────────── */

.hornos-list { display: flex; flex-direction: column; gap: 10px; }
.horno-list-card {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 20px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
  cursor: pointer;
  transition: all 0.12s;
  text-decoration: none;
}
.horno-list-card:hover { border-color: var(--accent); background: var(--surface-2); }
.horno-list-icon {
  width: 48px; height: 48px;
  border-radius: var(--r-md);
  background: var(--accent-dim);
  color: var(--accent);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.horno-list-info { flex: 1; }
.horno-list-name { font-size: 14px; font-weight: 600; font-family: 'JetBrains Mono', ui-monospace, monospace; }
.horno-list-model { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.horno-list-status { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.last-seen { font-size: 11px; color: var(--text-dim); }
.horno-list-arrow { color: var(--text-dim); }
.horno-list-card:hover .horno-list-arrow { color: var(--accent); }
.horno-list-actions { display: flex; gap: 6px; align-items: center; }
.horno-list-actions .btn { text-decoration: none; }

/* ─────────── DATA TABLE (Historial) ─────────── */

.table-wrap { overflow-x: auto; margin: -8px -8px 0; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left; padding: 10px 12px;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-dim); font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table .mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px; color: var(--text-muted); }

.action-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  background: var(--surface-3);
  color: var(--text-muted);
}
.action-tag.on         { background: rgba(63,185,80,0.15); color: var(--ok); }
.action-tag.off        { background: rgba(139,152,168,0.15); color: var(--text-muted); }
.action-tag.set_top    { background: rgba(255,87,34,0.15); color: var(--accent); }
.action-tag.set_floor  { background: rgba(63,185,80,0.15); color: var(--ok); }
.action-tag.set_rpm    { background: rgba(88,166,255,0.15); color: var(--info); }
.action-tag.start_timer, .action-tag.stop_timer { background: rgba(210,153,34,0.15); color: var(--warn); }

/* ─────────── MODAL (Recetas) ─────────── */

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: grid; place-items: center;
  z-index: 200;
  padding: 20px;
}
.modal {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  max-width: 440px;
  width: 100%;
  box-shadow: var(--shadow-md);
}
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px;
}
.modal-head h2 { font-size: 16px; font-weight: 600; }
.modal .field { margin-bottom: 12px; }
.modal .field label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-dim); font-weight: 600; margin-bottom: 5px; }
.modal .field input {
  width: 100%; padding: 9px 12px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r-sm); color: var(--text); font-size: 14px; font-family: inherit;
}
.modal .field input:focus { outline: none; border-color: var(--accent); }

/* ─────────── WIZARD DE PAIRING ─────────── */

.wizard-modal { max-width: 500px; }
.wizard-progress {
  display: flex; align-items: center; justify-content: center;
  margin: 8px 0 24px;
  gap: 0;
}
.wizard-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 2px solid var(--border-strong);
  transition: all 0.2s;
}
.wizard-dot.done {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255,87,34,0.15);
}
.wizard-line {
  width: 60px; height: 2px;
  background: var(--surface-3);
  margin: 0 6px;
  transition: background 0.3s;
}
.wizard-line.done { background: var(--accent); }

.wizard-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.wizard-sub { color: var(--text-muted); font-size: 13px; margin-bottom: 16px; line-height: 1.5; }
.wizard-tip {
  font-size: 12px; color: var(--warn);
  background: rgba(210,153,34,0.08);
  border: 1px solid rgba(210,153,34,0.2);
  padding: 8px 12px;
  border-radius: var(--r-sm);
  margin-top: 8px;
}
.wizard-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 24px;
}

.pair-progress {
  display: flex; flex-direction: column; align-items: center;
  padding: 40px 20px;
}
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--surface-3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.pair-status { color: var(--text-muted); font-size: 13px; text-align: center; }

.pair-success {
  text-align: center;
  padding: 20px 0;
}
.pair-check {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: rgba(63,185,80,0.15);
  color: var(--ok);
  font-size: 32px;
  display: grid; place-items: center;
  margin: 0 auto 16px;
  box-shadow: 0 0 0 6px rgba(63,185,80,0.08);
}
.pair-success h3 { font-size: 18px; margin-bottom: 8px; }

code {
  background: var(--surface-3);
  color: var(--accent);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
}

/* ─────────── PERFIL ─────────── */

.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.profile-item label {
  display: block;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px;
  color: var(--text-dim); font-weight: 600; margin-bottom: 5px;
}
.profile-value { font-size: 14px; color: var(--text); }
.profile-value.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 13px; }

/* ─────────── AJUSTES: setting rows + switch ─────────── */

.setting-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  gap: 20px;
}
.setting-row:first-of-type { border-top: none; padding-top: 0; }
.setting-name { font-size: 13px; font-weight: 500; margin-bottom: 3px; }
.setting-desc { font-size: 12px; color: var(--text-muted); }

.switch {
  position: relative; display: inline-block;
  width: 40px; height: 22px;
  flex-shrink: 0;
}
.switch input { display: none; }
.slider-sw {
  position: absolute; inset: 0;
  background: var(--surface-3);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s;
}
.slider-sw::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  top: 3px; left: 3px;
  transition: transform 0.2s;
}
.switch input:checked + .slider-sw { background: var(--accent); }
.switch input:checked + .slider-sw::before { transform: translateX(18px); }

.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.about-grid label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-dim); font-weight: 600; margin-bottom: 5px; }
.about-grid .mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 13px; color: var(--text); }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 1100px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 800px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; bottom: 0; left: 0; right: 0; top: auto;
    height: auto; flex-direction: row;
    border-right: none; border-top: 1px solid var(--border);
    z-index: 100;
  }
  .sidebar-brand, .sidebar-footer { display: none; }
  .sidebar-nav { padding: 8px; display: flex; flex: 1; overflow-x: auto; }
  .nav-section { display: flex; gap: 4px; margin: 0; flex: 1; }
  .nav-section + .nav-section { border-left: 1px solid var(--border); padding-left: 8px; margin-left: 8px; }
  .nav-heading { display: none; }
  .nav-item { flex-direction: column; gap: 2px; padding: 6px 8px; font-size: 10px; }
  .nav-item span:not(.nav-badge) { font-size: 10px; }
  .nav-badge { display: none; }
  .nav-item.active::before { display: none; }

  .main { padding: 16px 16px 100px; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .metric-card { padding: 14px; }
  .gauge-value { font-size: 22px; }
  .timer-display { font-size: 32px; }

  .section-head h1 { font-size: 18px; }
  .head-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .panel { padding: 16px; }
}

@media (max-width: 480px) {
  .metrics-grid { grid-template-columns: 1fr; }
  .presets { grid-template-columns: 1fr 1fr; }
  .topbar { flex-direction: column; align-items: flex-start; gap: 8px; }
}
