/* ============================================================
   KRONOS v3 — Variables, reset y layout base
   ============================================================ */

:root {
  /* Colores base */
  --bg:          #0f0f11;
  --bg2:         #18181c;
  --bg3:         #222228;
  --bg4:         #2a2a32;
  --bg5:         #32323c;

  /* Bordes */
  --border:      rgba(255,255,255,0.07);
  --border2:     rgba(255,255,255,0.12);
  --border3:     rgba(255,255,255,0.18);

  /* Texto */
  --text:        #f0eff4;
  --text2:       #8b8a96;
  --text3:       #55545f;

  /* Acento principal */
  --accent:      #7c6af7;
  --accent2:     #5b4de0;
  --accent-soft: rgba(124,106,247,0.12);
  --accent-soft2:rgba(124,106,247,0.20);

  /* Semánticos */
  --green:       #34d399;
  --green-soft:  rgba(52,211,153,0.12);
  --red:         #f87171;
  --red-soft:    rgba(248,113,113,0.10);
  --amber:       #fbbf24;
  --amber-soft:  rgba(251,191,36,0.12);
  --blue:        #60a5fa;
  --blue-soft:   rgba(96,165,250,0.12);

  /* Prioridades */
  --priority-low:    #34d399;
  --priority-medium: #fbbf24;
  --priority-high:   #f87171;

  /* Tipografía */
  --font:  'DM Sans', system-ui, sans-serif;
  --mono:  'DM Mono', 'Cascadia Code', monospace;

  /* Layout */
  --sidebar:     224px;
  --header:       60px;
  --radius:       10px;
  --radius-lg:    16px;
  --radius-xl:    22px;

  /* Sombras */
  --shadow-sm:   0 2px 8px rgba(0,0,0,0.25);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.35);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.50);
}

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

html { font-size: 14px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

img { max-width: 100%; display: block; }

input, select, textarea, button {
  font-family: var(--font);
  font-size: inherit;
}

/* ── Layout shell ─────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

#main {
  margin-left: var(--sidebar);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

#topbar {
  height: var(--header);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
  flex-shrink: 0;
}

#content {
  padding: 28px;
  flex: 1;
  overflow-x: hidden;
}

/* ── Views ────────────────────────────────────────────────── */
.view { display: none; }
.view.active { display: block; }

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--bg5); }

/* ── Utilidades ───────────────────────────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.min-w-0 { min-width: 0; }

.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Animaciones ─────────────────────────────────────────── */
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .4; transform: scale(.8); }
}

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

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

@keyframes slideInUp {
  from { transform: translateY(8px); opacity: 0; }
  to   { transform: translateY(0);   opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
