/* =========================================================
   SiPeK — base.css
   Fuentes, variables de diseño, reset y layout de la carcasa.
   ========================================================= */

/* ---------- Fuentes locales (OFL) ---------- */
@font-face { font-family: "Tektur"; src: url("../fonts/Tektur-Regular.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Tektur"; src: url("../fonts/Tektur-Medium.woff") format("woff"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("../fonts/InstrumentSans-Regular.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("../fonts/InstrumentSans-Bold.woff") format("woff"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("../fonts/InstrumentSans-Italic.woff") format("woff"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/JetBrainsMono-Regular.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/JetBrainsMono-Bold.woff") format("woff"); font-weight: 700; font-display: swap; }

/* ---------- Variables ---------- */
:root {
  /* Superficies: grafito azulado, de lo más profundo a lo más elevado */
  --ink:      #121820;
  --panel:    #18202a;
  --raised:   #1f2935;
  --line:     #2b3644;
  --line-soft:#222c38;

  /* Texto */
  --text:   #e4eaf2;
  --muted:  #8c98a8;
  --faint:  #5e6a7a;

  /* Señal: el color de la interfaz es "hielo"; el color fuerte queda para el riesgo */
  --signal:      #dce7f4;
  --signal-ink:  #101720;
  --focus:       #7fb2ff;

  /* Severidad */
  --sev-critical: #ff4f6d;
  --sev-high:     #ff8b3d;
  --sev-medium:   #ebc03f;
  --sev-low:      #4ca8f0;
  --sev-info:     #7d8899;

  /* Estado */
  --ok:      #6fcf97;
  --fail:    #ff4f6d;

  /* Paleta de tags */
  --tag-green:  #5bc08a;
  --tag-blue:   #5b9bf0;
  --tag-violet: #a487f0;
  --tag-pink:   #e879b9;
  --tag-amber:  #e0a84a;
  --tag-teal:   #43b8b0;
  --tag-red:    #e86a6a;
  --tag-slate:  #8c98a8;

  /* Tipografía */
  --font-display: "Tektur", "Instrument Sans", system-ui, sans-serif;
  --font-ui:      "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Escala tipográfica (base 14px, razón ~1.25) */
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 14px;
  --fs-lg: 16px;
  --fs-xl: 20px;
  --fs-2xl: 25px;
  --fs-3xl: 32px;
  --fs-4xl: 44px;

  /* Radios: pequeño para controles, mediano para paneles */
  --r-sm: 4px;
  --r-md: 8px;

  --sidebar-w: 236px;
  --topbar-h: 60px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--fs-md);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
code, kbd, pre, .mono { font-family: var(--font-mono); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-sm); }
::selection { background: rgba(127, 178, 255, .3); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Carcasa ---------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  /* Fondo de la columna de la sidebar, para que llegue hasta abajo en páginas largas */
  background: linear-gradient(to right,
    var(--panel) calc(var(--sidebar-w) - 1px), var(--line-soft) calc(var(--sidebar-w) - 1px),
    var(--line-soft) var(--sidebar-w), var(--ink) var(--sidebar-w));
}
.app-main { min-width: 0; display: flex; flex-direction: column; }
.page { padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 28px; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; background: var(--ink); }
  .sidebar { position: static; height: auto; }
  .page { padding: 20px 16px 40px; }
}
