/* ============================================================
   theme.css — GeoLink Developer Console
   Paleta técnica neutra estilo Flespi.
   Acento: Rojo GeoLink #e94560 (vibrante pero técnico).
   ============================================================ */

/* Google Fonts — Inter + Fira Code */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Fira+Code:wght@400;500&display=swap');

/* ════════════════════════════════════════════════════════════
   VARIABLES GLOBALES — Paleta Flespi/GeoLink
   ════════════════════════════════════════════════════════════ */
:root {
  /* ── Fondos ─────────────────────────────────────────────── */
  --bg:        #141414;   /* Fondo principal — casi negro neutro  */
  --surface:   #1e1e1e;   /* Sidebar, page-header, toolbars       */
  --surface-2: #252525;   /* Cards, modales, tablas               */
  --surface-3: #2a2a2a;   /* Inputs, chips, nested surfaces       */
  --surface-4: #333333;   /* Hover sutil, bordes rellenos         */

  /* ── Bordes — líneas de 1 px muy discretas ──────────────── */
  --border:   #2a2a2a;    /* Separador principal (tabla, sidebar) */
  --border-2: #333333;    /* Bordes de inputs y cards             */
  --border-3: #3d3d3d;    /* Focus / bordes más visibles          */

  /* ── Texto ──────────────────────────────────────────────── */
  --text:      #e0e0e0;   /* Lectura principal                    */
  --text-dim:  #9e9e9e;   /* Etiquetas, valores secundarios       */
  --text-mute: #616161;   /* Placeholder, metadatos muy discretos */

  /* ── Acento — Rojo GeoLink vibrante y técnico ───────────── */
  --primary:       #e94560;
  --primary-dim:   rgba(233, 69, 96, 0.12);
  --primary-hover: #ff2d55;
  --primary-border:rgba(233, 69, 96, 0.35);

  /* ── Semánticos ─────────────────────────────────────────── */
  --green:         #00e676;
  --green-dim:     rgba(0, 230, 118, 0.10);
  --green-border:  rgba(0, 230, 118, 0.28);

  --red:           #ff1744;
  --red-dim:       rgba(255, 23, 68, 0.10);
  --red-border:    rgba(255, 23, 68, 0.28);

  --yellow:        #ffc400;
  --yellow-dim:    rgba(255, 196, 0, 0.12);
  --yellow-border: rgba(255, 196, 0, 0.32);

  --blue:          #448aff;
  --blue-dim:      rgba(68, 138, 255, 0.10);
  --blue-border:   rgba(68, 138, 255, 0.28);

  --neutral-dim:    rgba(255, 255, 255, 0.03);
  --neutral-border: rgba(255, 255, 255, 0.07);

  /* ── Estado de dispositivos ─────────────────────────────── */
  --online:  #00e676;
  --offline: #555555;
  --warning: #ffc400;

  /* ── Tipografía ─────────────────────────────────────────── */
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'Fira Code', 'Roboto Mono', 'Consolas', monospace;

  /* ── Layout ─────────────────────────────────────────────── */
  --sidebar-width: 248px;

  /* ── Radios ─────────────────────────────────────────────── */
  --radius-sm: 3px;
  --radius:    5px;
  --radius-lg: 8px;
  --radius-xl: 12px;

  /* ── Sombras — más sutiles con fondo neutro ─────────────── */
  --shadow:    0 2px 6px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 28px rgba(0, 0, 0, 0.7);

  /* ── Transiciones ───────────────────────────────────────── */
  --transition:      140ms ease;
  --transition-slow: 260ms ease;

  /* ── Z-index ────────────────────────────────────────────── */
  --z-sidebar: 100;
  --z-header:  200;
  --z-modal:   500;
  --z-toast:   900;
}

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

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-main);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

button { font-family: var(--font-main); cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: var(--font-main); font-size: 13px; }

/* ── Utilidades ─────────────────────────────────────────────── */
.mono        { font-family: var(--font-mono) !important; }
.text-dim    { color: var(--text-dim)  !important; }
.text-mute   { color: var(--text-mute) !important; }
.text-primary{ color: var(--primary)   !important; }
.text-green  { color: var(--green)     !important; }
.text-red    { color: var(--red)       !important; }
.text-yellow { color: var(--yellow)    !important; }
.text-blue   { color: var(--blue)      !important; }
.hidden { display: none !important; }
.flex   { display: flex; }
.flex-1 { flex: 1; }
.gap-2  { gap: 8px; }
.gap-3  { gap: 12px; }

/* ── Scrollbar — muy fino, apenas perceptible ─────────────── */
::-webkit-scrollbar       { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-3); }

/* ════════════════════════════════════════════════════════════
   BOTONES — Flespi style: bordes finos, sin fondos pesados
   ════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

/* Primario — solo con acento, sin sombras */
.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

/* Ghost — minimalista, borde + texto */
.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border-color: var(--border-2);
}
.btn-ghost:hover {
  background: var(--surface-3);
  color: var(--text);
  border-color: var(--border-3);
}

/* Danger */
.btn-danger {
  background: transparent;
  color: var(--red);
  border-color: var(--red-border);
}
.btn-danger:hover { background: var(--red-dim); }

.btn-sm   { padding: 3px 9px; font-size: 11px; }
.btn-icon { padding: 5px; width: 28px; height: 28px; justify-content: center; }

/* ── Botones de acción en tabla — minimalistas ─────────────── */
.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-2);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color var(--transition), color var(--transition),
              background var(--transition);
}
.btn-action:hover {
  border-color: var(--border-3);
  color: var(--text);
  background: var(--surface-3);
}
.btn-action.btn-action--primary:hover {
  border-color: var(--primary-border);
  color: var(--primary);
  background: var(--primary-dim);
}
.btn-action.btn-action--danger:hover {
  border-color: var(--red-border);
  color: var(--red);
  background: var(--red-dim);
}
.btn-action.btn-action--green:hover {
  border-color: var(--green-border);
  color: var(--green);
  background: var(--green-dim);
}

/* ════════════════════════════════════════════════════════════
   BADGES
   ════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  border-radius: 3px;           /* cuadrado técnico, no pill */
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.4px;
  line-height: 1.4;
  font-family: var(--font-mono);
}

.badge-count  { background: var(--primary);  color: #fff; min-width: 18px; padding: 1px 5px; border-radius: 10px; }
.badge-online {
  background: rgba(0, 230, 118, 0.08);
  color: var(--green);
  border: 1px solid var(--green-border);
}
.badge-offline {
  background: rgba(85, 85, 85, 0.12);
  color: var(--offline);
  border: 1px solid rgba(85, 85, 85, 0.28);
}
.badge-get    { background: var(--blue-dim);   color: var(--blue);   border: 1px solid var(--blue-border); }
.badge-post   { background: var(--green-dim);  color: var(--green);  border: 1px solid var(--green-border); }
.badge-put    { background: var(--yellow-dim); color: var(--yellow); border: 1px solid var(--yellow-border); }
.badge-delete { background: var(--red-dim);    color: var(--red);    border: 1px solid var(--red-border); }

/* ════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ════════════════════════════════════════════════════════════ */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 12px;
  max-width: 340px;
  pointer-events: all;
  animation: toast-in 0.22s ease forwards;
}

.toast.toast-success { border-left: 3px solid var(--green); }
.toast.toast-error   { border-left: 3px solid var(--red);   }
.toast.toast-warn    { border-left: 3px solid var(--yellow); }
.toast.toast-info    { border-left: 3px solid var(--blue);  }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ════════════════════════════════════════════════════════════
   STATUS DOT
   ════════════════════════════════════════════════════════════ */
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.online  { background: var(--green); box-shadow: 0 0 5px var(--green); }
.status-dot.offline { background: var(--offline); }
.status-dot.warning { background: var(--warning); }

/* ════════════════════════════════════════════════════════════
   FORM INPUTS — técnicos y neutros
   ════════════════════════════════════════════════════════════ */
.field { display: flex; flex-direction: column; gap: 5px; }
.field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
select {
  padding: 6px 10px;
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 12px;
  transition: border-color var(--transition);
  outline: none;
  width: 100%;
}

.input:focus,
input:focus,
select:focus {
  border-color: var(--primary);
}

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

select option { background: var(--surface-2); }

/* ════════════════════════════════════════════════════════════
   EMPTY STATE + SPINNER
   ════════════════════════════════════════════════════════════ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  color: var(--text-mute);
  font-size: 12px;
  text-align: center;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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