/* ═══════════════════════════════════════════════════════════════
   QOBOXI — Design System "Foundry"
   Tipografía: Sora (display) + DM Sans (body) + DM Mono (data)
   Paleta: Navy profundo + Ámbar industrial
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=DM+Mono:wght@400;500&display=swap');

/* ── Variables ──────────────────────────────────────────────── */
:root {
  --font-sans:    'DM Sans', -apple-system, sans-serif;
  --font-display: 'Sora', -apple-system, sans-serif;
  --font-mono:    'DM Mono', 'Courier New', monospace;

  /* Primario: Azul marino profundo */
  --primary:       #0f2744;
  --primary-h:     #1e3a5f;
  --primary-l:     #e8f0fb;
  --primary-rgb:   15, 39, 68;

  /* Acento: Ámbar industrial */
  --accent:        #f59e0b;
  --accent-h:      #d97706;
  --accent-l:      #fef3c7;

  /* Semánticos */
  --success:       #059669;
  --success-l:     #d1fae5;
  --warning:       #d97706;
  --warning-l:     #fef3c7;
  --danger:        #dc2626;
  --danger-l:      #fee2e2;
  --info:          #0284c7;
  --info-l:        #e0f2fe;

  /* Superficies — modo claro */
  --bg:            #fafaf8;
  --bg2:           #f0f0ed;
  --card:          #ffffff;
  --card-h:        #f8f8f6;
  --surface2:      #f4f4f2;
  --border:        #e2e2de;
  --border2:       #ccccc8;

  /* Texto — modo claro */
  --text:          #0a0a09;
  --text2:         #3a3a36;
  --text-muted:    #6e6e68;
  --text-light:    #9e9e98;

  /* Sombras */
  --sh0: 0 1px 2px rgba(0,0,0,.04);
  --sh1: 0 2px 6px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.04);
  --sh2: 0 6px 16px rgba(0,0,0,.07), 0 2px 6px rgba(0,0,0,.04);
  --sh3: 0 16px 32px rgba(0,0,0,.09), 0 4px 10px rgba(0,0,0,.05);

  /* Radios */
  --r-xs: 4px;
  --r-sm: 7px;
  --r-md: 11px;
  --r-lg: 16px;
  --r-xl: 22px;

  /* Transición */
  --t: .15s ease;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ── Tipografía ─────────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}
.mono, .data-val {
  font-family: var(--font-mono);
  font-feature-settings: "tnum";
}

/* ── Tarjetas ───────────────────────────────────────────────── */
.card, .qb-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh1);
  padding: 24px;
  margin-bottom: 18px;
}
.card h1 {
  font-family: var(--font-display);
  font-size: .8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-muted);
  border: none;
  margin-bottom: 18px;
}

/* ── Botones ────────────────────────────────────────────────── */
.btn, button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: .84rem;
  font-weight: 700;
  padding: 9px 16px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--t);
  white-space: nowrap;
  text-decoration: none;
}
.btn-primary, .btn-save {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover, .btn-save:hover { background: var(--primary-h); border-color: var(--primary-h); opacity: 1; }
.btn-accent {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-accent:hover { background: var(--accent-h); }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border2);
}
.btn-ghost:hover { background: var(--surface2); color: var(--text); }
.btn-danger, .btn-del {
  background: var(--danger-l);
  color: var(--danger);
  border-color: #fca5a5;
}
.btn-danger:hover, .btn-del:hover { background: var(--danger); color: #fff; }
.btn-success {
  background: var(--success-l);
  color: var(--success);
  border-color: #6ee7b7;
}
.btn-edit {
  background: var(--primary-l);
  color: var(--primary);
  border-color: #93c5fd;
}
.btn-cancel {
  background: var(--surface2);
  color: var(--text-muted);
  border-color: var(--border);
}

/* ── Inputs y selects ───────────────────────────────────────── */
input[type=text],
input[type=email],
input[type=password],
input[type=number],
select,
textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border2);
  border-radius: var(--r-sm);
  font-family: var(--font-sans);
  font-size: .88rem;
  background: var(--card);
  color: var(--text);
  transition: border-color var(--t), box-shadow var(--t);
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb),.1);
}
label {
  display: block;
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  margin-bottom: 5px;
  margin-top: 14px;
}
label:first-of-type { margin-top: 0; }

/* ── Badges / etiquetas ─────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.badge-primary   { background: var(--primary-l); color: var(--primary); }
.badge-accent    { background: var(--accent-l);  color: #92400e; }
.badge-success   { background: var(--success-l); color: #065f46; }
.badge-warning   { background: var(--warning-l); color: #92400e; }
.badge-danger    { background: var(--danger-l);  color: #991b1b; }
.badge-neutral   { background: var(--surface2);  color: var(--text-muted); }

/* ── Tabla ──────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; }
thead tr { background: var(--surface2); }
thead th {
  padding: 9px 12px;
  text-align: left;
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
}
tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: .85rem;
  color: var(--text2);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--card-h); }

/* ── Navbar ─────────────────────────────────────────────────── */
#qb-navbar {
  background: var(--primary) !important;
  box-shadow: 0 1px 0 rgba(255,255,255,.06), 0 2px 12px rgba(0,0,0,.2) !important;
}

/* ── Logo Qoboxi ────────────────────────────────────────────── */
.qb-logo {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -.5px;
}
.qb-logo .accent { color: var(--accent); }

/* ── Scrollbar discreta ─────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-light); }

/* ── Animación de entrada ───────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp .25s ease both; }

/* ── Theme toggle ───────────────────────────────────────────── */
/* Theme toggle hidden - dark mode coming soon */
#themeToggle { display: none !important;
  position: fixed;
  bottom: 18px;
  right: 18px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border2);
  box-shadow: var(--sh2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  z-index: 9000;
  transition: var(--t);
}
#themeToggle:hover { transform: scale(1.1); }

/* ── Tabs (admin) ───────────────────────────────────────────── */
.tabs-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  background: var(--surface2);
  padding: 5px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}
.tab-btn {
  padding: 8px 16px;
  border: none;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: .82rem;
  cursor: pointer;
  transition: var(--t);
  white-space: nowrap;
}
.tab-btn:hover { color: var(--text); background: var(--card); }
.tab-btn.active {
  background: var(--card);
  color: var(--primary);
  box-shadow: var(--sh0);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Utilitarios ────────────────────────────────────────────── */
.text-muted  { color: var(--text-muted); }
.text-light  { color: var(--text-light); }
.text-accent { color: var(--accent); }
.text-success{ color: var(--success); }
.text-danger { color: var(--danger); }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.mono   { font-family: var(--font-mono); }
