:root {
  --bg: #09090b;
  --bg-2: #111114;
  --surface: #18181b;
  --hover: #1f1f23;
  --border: #27272a;
  --border-hover: #3f3f46;
  --text: #fafafa;
  --muted: #a1a1aa;
  --faint: #71717a;
  --accent: #e4e4e7;
  --accent-press: #d4d4d8;
  --accent-2: #a1a1aa;
  --accent-text: #f4f4f5;
  --accent-soft: #fafafa;
  --accent-rgb: 228, 228, 231;
  --on-accent: #09090b;
  --success: #5CE65C;
  --success-text: #5CE65C;
  --success-rgb: 16, 185, 129;
  --error: #ff0000;
  --error-text: #ff0000;
  --error-rgb: 239, 68, 68;
  --warning: #f59e0b;
  --radius: 10px;
  --radius-sm: 8px;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  --font: Inter, ui-sans-serif, system-ui, sans-serif;

  /* Nombres que ya usa la app. Siguen al root de arriba. */
  --bg-secondary: var(--bg-2);
  --surface-hover: var(--hover);
  --text-secondary: var(--muted);
  --sidebar: 248px;
  --sidebar-collapsed: 76px;
  --topbar: 64px;
  --ease: 160ms ease;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }
html { color-scheme: dark; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.011em;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }

::selection { background: rgba(var(--accent-rgb), 0.35); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--accent);
  color: var(--on-accent);
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 80;
}
.skip-link:focus { top: 12px; }

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

.app {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  min-height: 100vh;
  transition: grid-template-columns var(--ease);
}

.app.sidebar-collapsed { grid-template-columns: var(--sidebar-collapsed) 1fr; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 16px 12px;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 8px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--accent-text);
}

.brand-mark svg { width: 18px; height: 18px; }

.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: 14px; font-weight: 650; letter-spacing: -0.03em; }
.brand-text small { color: var(--muted); font-size: 11px; }

.nav { display: flex; flex-direction: column; gap: 4px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  text-align: left;
  transition: background var(--ease), color var(--ease);
}

.nav-item:hover { background: var(--surface); color: var(--text); }

.nav-item.is-active {
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--text);
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-foot { margin-top: auto; }
.version {
  margin: 8px 10px 0;
  color: var(--faint);
  font-size: 11px;
}

.app.sidebar-collapsed .brand-text,
.app.sidebar-collapsed .nav-label,
.app.sidebar-collapsed .version { display: none; }

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 30;
}

.workspace { min-width: 0; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--topbar);
  padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
}

.topbar h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 620;
  letter-spacing: -0.03em;
}

.topbar p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }

.menu-btn { display: none; }

.icon-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

.content { padding: 24px; }

.view-inner { max-width: 1120px; margin: 0 auto; }

h2, h3 { margin: 0; letter-spacing: -0.03em; font-weight: 620; }
h2 { font-size: 15px; }
h3 { font-size: 16px; }

.stack { display: flex; flex-direction: column; gap: 8px; }