/* ==========================================================================
   Kreatik OS — style.css
   Variables globales, reset y estilos base.
   ========================================================================== */

/* ---------- Tipografía local (sin dependencia de internet) ----------
   Inter Variable cubre pesos 100-900. Mientras Jesús no tenga los
   archivos de Space Grotesk, --font-display también usa Inter para
   no depender de Google Fonts. Cuando consiga Space Grotesk, solo
   hay que agregar su @font-face aquí. */
@font-face {
  font-family: 'Inter';
  src: url('../fonts/Inter-VariableFont_opsz_wght.ttf') format('truetype-variations'),
       url('../fonts/Inter-VariableFont_opsz_wght.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../fonts/Inter-Italic-VariableFont_opsz_wght.ttf') format('truetype-variations'),
       url('../fonts/Inter-Italic-VariableFont_opsz_wght.ttf') format('truetype');
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

:root {
  /* Superficie */
  --bg-app: #0a0b0d;
  --bg-sidebar: #0d0e11;
  --surface-0: #111318;
  --surface-1: #16181e;
  --bg-card: #16181e;
  --bg-input: #1c1f27;
  --surface-2: #1c1f27;
  --surface-hover: #21242d;
  --border: #23262f;
  --border-soft: #1b1e26;

  /* Texto */
  --text: #f2f3f5;
  --text-primary: #f2f3f5;
  --text-secondary: #9aa0ac;
  --text-muted: #656b78;

  /* Marca */
  --accent: #3b82f6;
  --accent-2: #60a5fa;
  --accent-rgb: 59, 130, 246;
  --accent-glow: rgba(59, 130, 246, 0.35);
  --accent-soft: rgba(59, 130, 246, 0.12);

  /* Estado */
  --success: #34d399;
  --danger: #f87171;
  --warning: #fbbf24;

  /* Forma */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-md: 14px;
  --radius-lg: 18px;

  /* Tipografía */
  --font-display: 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Movimiento */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --fast: 140ms;
  --normal: 220ms;

  /* Sombras (profundidad premium) */
  --shadow-card: 0 1px 2px rgba(0,0,0,0.4), 0 14px 28px -10px rgba(0,0,0,0.55);
  --shadow-card-hover: 0 1px 2px rgba(0,0,0,0.5), 0 22px 44px -14px rgba(0,0,0,0.65);
}

/* ---------- Light Mode ---------- */
body.light-mode {
  --bg-app: #eef1f6;
  --bg-sidebar: #f8f9fc;
  --surface-0: #f4f5f9;
  --surface-1: #ffffff;
  --bg-card: #ffffff;
  --bg-input: #f4f5f9;
  --surface-2: #e9ecf3;
  --surface-hover: #dfe3ed;
  --border: #cdd3e0;
  --border-soft: #e2e6ef;

  --text: #1a202c;
  --text-primary: #1a202c;
  --text-secondary: #4a5568;
  --text-muted: #8896ab;

  --accent: #3b82f6;
  --accent-2: #2563eb;
  --accent-rgb: 59, 130, 246;
  --accent-glow: rgba(59, 130, 246, 0.25);
  --accent-soft: rgba(59, 130, 246, 0.1);

  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;

  --shadow-card: 0 1px 3px rgba(50,70,110,0.08), 0 6px 20px rgba(50,70,110,0.06);
  --shadow-card-hover: 0 2px 6px rgba(50,70,110,0.1), 0 10px 30px rgba(50,70,110,0.1);
}

body.light-mode .topbar {
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
}
body.light-mode .topbar-title {
  color: #ffffff;
}
body.light-mode .topbar-subtitle {
  color: rgba(255,255,255,0.75);
}
body.light-mode .topbar-actions .btn-icon {
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.2);
}
body.light-mode .topbar-actions .btn-icon:hover {
  background: rgba(255,255,255,0.25);
  color: #ffffff;
}

body.light-mode .sidebar {
  background: linear-gradient(180deg, #f8f9fc 0%, #eef1f6 100%);
  border-right: 1px solid var(--border-soft);
}

body.light-mode .nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
}
body.light-mode .nav-item.active .nav-icon {
  background: var(--accent);
  color: #fff;
}

body.light-mode .stat-card {
  background: #ffffff;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-card);
}
body.light-mode .stat-card:hover {
  box-shadow: var(--shadow-card-hover);
}

body.light-mode .card {
  background: #ffffff;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-card);
}

body.light-mode .btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  box-shadow: 0 2px 8px rgba(59,130,246,0.3);
}
body.light-mode .btn-primary:hover {
  box-shadow: 0 4px 16px rgba(59,130,246,0.4);
}

body.light-mode .notif-badge {
  background: #ef4444;
  color: #fff;
  box-shadow: 0 0 0 2px #fff;
}

/* ---------- Theme Switch (Pill) ---------- */
.theme-switch-wrap {
  margin-right: 4px;
}
.theme-pill {
  display: flex;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 4px;
  gap: 0;
  cursor: pointer;
  transition: background 0.3s, border-color 0.3s;
}
.theme-pill:hover {
  border-color: var(--accent);
}
.theme-pill-option {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--text-muted);
  transition: all 0.3s ease;
}
.theme-pill-option.active {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(59,130,246,0.35);
}

body.light-mode .theme-pill {
  background: rgba(255,255,255,0.7);
  border-color: rgba(59,130,246,0.25);
}
body.light-mode .theme-pill-option.active {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(59,130,246,0.3);
}

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

html, body {
  height: 100%;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

a { color: inherit; text-decoration: none; }

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

input, select, textarea {
  background: var(--surface-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  outline: none;
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}

input:hover, select:hover, textarea:hover {
  border-color: #2c303b;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

textarea { resize: vertical; min-height: 80px; }

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%239aa0ac'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 30px;
}

label.field-label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--surface-2);
  border-radius: 10px;
  border: 2px solid var(--bg-app);
}
::-webkit-scrollbar-thumb:hover { background: #2a2e39; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.hidden { display: none !important; }

.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-accent { color: var(--accent-2); }

/* Centrar todos los íconos Flaticon dentro de sus contenedores */
i.fi {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  vertical-align: middle;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes blinkCursor {
  0%, 100% { border-color: transparent; }
  50% { border-color: var(--accent); }
}
