/* ═══════════════════════════════════════════════════════════════
   JEFFARIGPS · Panel CSS
   Tema oscuro, tipografías Inter / JetBrains Mono / Space Grotesk
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* ─── Colores ──────────────────────────────────────────────── */
  --bg-primary:    #0a0e0f;
  --bg-secondary:  #11161a;
  --bg-tertiary:   #1a2024;

  --text-primary:   #e8eef2;
  --text-secondary: #a0adb6;
  --text-tertiary:  #5e6d77;

  --border:        #1f262c;
  --border-hover:  #2d363e;

  --accent:        #45d4a8;
  --accent-dim:    #2da985;
  --accent-glow:   rgba(69,212,168,0.08);

  --info:    #5cb1ff;
  --warning: #f5b942;
  --danger:  #ec5959;
  --danger-bg: rgba(236,89,89,0.08);

  /* ─── Tipografías ──────────────────────────────────────────── */
  --font-sans:    'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', 'Courier New', monospace;
  --font-display: 'Space Grotesk', var(--font-sans);

  /* ─── Otros ────────────────────────────────────────────────── */
  --radius:    6px;
  --radius-lg: 10px;
  --shadow-lg: 0 12px 36px rgba(0,0,0,0.4);
}

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

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code, pre { font-family: var(--font-mono); font-size: 0.9em; }

/* ─── HEADER GLOBAL ─────────────────────────────────────────── */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}
.app-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
}
.app-title-main   { color: var(--text-primary); }
.app-title-accent { color: var(--accent); }
.app-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--text-secondary);
}
.app-update { font-family: var(--font-mono); font-size: 12px; }

.app-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

/* ─── TABS ──────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
  align-items: center;
}
.tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.tab:hover { color: var(--text-primary); }
.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ─── CARDS ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 14px;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 12px;
  flex-wrap: wrap;
}
.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}
.card-title-accent {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
}
.card-description {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 14px;
  line-height: 1.6;
}
.card.empty {
  text-align: center;
  color: var(--text-tertiary);
  padding: 30px;
}

/* ─── BUTTONS ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border-hover);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}
.btn:hover { background: var(--bg-primary); border-color: var(--accent-dim); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-sm { padding: 5px 10px; font-size: 12px; }

.btn-primary {
  background: var(--accent);
  color: #001712;
  border-color: var(--accent);
  font-weight: 600;
}
.btn-primary:hover { background: var(--accent-dim); border-color: var(--accent-dim); }

.btn-ghost {
  background: transparent;
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg-tertiary); }

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
}
.btn-danger:hover { opacity: 0.9; }

/* ─── INPUTS ────────────────────────────────────────────────── */
.input, .textarea, select {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.input-label {
  display: block;
  font-size: 11px;
  color: var(--text-tertiary);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-weight: 500;
}

/* ─── CHIPS ─────────────────────────────────────────────────── */
.chip {
  display: inline-block;
  background: var(--bg-primary);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  border: 1px solid var(--border);
  cursor: pointer;
  margin: 2px;
}
.chip:hover { background: var(--accent-glow); }

/* ─── TIP / HELP ────────────────────────────────────────────── */
.tip-wrap {
  position: relative;
  display: inline-block;
  margin-left: 4px;
}
.info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 600;
  cursor: help;
  border: 1px solid var(--border);
}
.tip {
  display: none;
  position: absolute;
  top: 24px;
  left: 0;
  z-index: 50;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  padding: 10px 14px;
  width: 260px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
  box-shadow: var(--shadow-lg);
}
.tip-wrap:hover .tip { display: block; }
.tip-h {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  font-size: 12px;
}

/* ─── SKELETONS ─────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: skel 1.4s ease-in-out infinite;
  border-radius: var(--radius);
}
@keyframes skel {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── TOASTS ────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.toast.success {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent);
}
.toast.error {
  background: var(--danger-bg);
  border-color: var(--danger);
  color: var(--danger);
}

/* ─── WA STATUS LIGHT ───────────────────────────────────────── */
.wa-light {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-left: 6px;
}
.wa-light.on   { background: #4ade80; box-shadow: 0 0 8px #4ade80; animation: pulse 2s infinite; }
.wa-light.warn { background: #fbbf24; }
.wa-light.off  { background: #ef4444; }

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

/* ─── BOT MODE CHIP (en tabs) ───────────────────────────────── */
.bot-mode-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  user-select: none;
}
.bot-mode-chip:hover { border-color: var(--border-hover); }
.bot-mode-chip.trabajo { color: var(--accent); }
.bot-mode-chip.pruebas { color: var(--warning); }
.bot-mode-chip.apagado { color: var(--danger); }

.bmc-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.bmc-dot.green  { background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.bmc-dot.yellow { background: var(--warning); }
.bmc-dot.red    { background: var(--danger); }

.bmc-arrow { font-size: 9px; opacity: 0.7; }

.bmc-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  padding: 4px;
  min-width: 160px;
  box-shadow: var(--shadow-lg);
  z-index: 100;
}
.bmc-dropdown.open { display: block; }
.bmc-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-secondary);
}
.bmc-option:hover  { background: var(--bg-tertiary); color: var(--text-primary); }
.bmc-option.active { color: var(--text-primary); font-weight: 600; }

/* ─── TABLAS GENÉRICAS ──────────────────────────────────────── */
.row-list { display: flex; flex-direction: column; gap: 6px; }
.row-list .row {
  display: grid;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
}

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 700px) {
  .app-header { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  .app-main { padding: 12px; }
  .card { padding: 14px; }
}
