/* ============================================================================
   RADEC-Monitor-SnOP-E — Design system SCI
   Paleta y tipografia del Manual de Marca SCI. Tema claro.
   ========================================================================== */

:root {
  /* Paleta SCI */
  --cyan:      #00D8DA;
  --magenta:   #FF00FA;
  --black:     #000000;
  --white:     #FFFFFF;
  --gray-mid:  #595959;
  --gray-soft: #D4D4D4;
  --bg-soft:   #FAFAFA;
  --grad: linear-gradient(135deg, #00D8DA, #FF00FA);

  /* Semantica */
  --verde: #1FA84F;
  --ambar: #E08A00;
  --rojo:  #E0252B;

  /* Superficies */
  --bg:      var(--bg-soft);
  --surface: var(--white);
  --border:  #E6E6EC;
  --text:    #101014;
  --dim:     #4A4A57;
  --muted:   #8A8A99;

  /* Tipografia */
  --font-display: 'Albert Sans', system-ui, sans-serif;
  --font-body:    'Barlow', system-ui, sans-serif;

  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.04);
}

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

body {
  font-family: var(--font-body);
  font-weight: 500;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Barra superior de marca */
.brand-bar { height: 4px; background: var(--grad); }

/* --- Tipografia --- */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.15; color: var(--text); }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
.display-up { text-transform: uppercase; letter-spacing: .04em; }
.tag {
  font-family: var(--font-display); font-size: .72rem; font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.muted { color: var(--muted); }
.dim   { color: var(--dim); }
.num   { font-feature-settings: 'tnum'; font-variant-numeric: tabular-nums; }

a { color: #008b8d; text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Layout app: topbar + sidebar --- */
.app { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; }
.topbar {
  display: flex; align-items: center; gap: 1rem;
  background: var(--black); color: var(--white);
  padding: .7rem 1.25rem;
}
.topbar .logo { font-family: var(--font-display); font-weight: 700; letter-spacing: .02em; }
.topbar .logo span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.topbar nav { display: flex; gap: .25rem; margin-left: 1rem; }
.topbar nav a {
  color: var(--gray-soft); padding: .4rem .8rem; border-radius: 8px;
  font-weight: 600; font-size: .9rem;
}
.topbar nav a:hover { color: var(--white); background: rgba(255,255,255,.08); text-decoration: none; }
.topbar nav a.active { color: var(--black); background: var(--cyan); }
.topbar .spacer { flex: 1; }
.topbar .user { font-size: .82rem; color: var(--gray-soft); }

.wrap { max-width: 1100px; margin: 0 auto; padding: 1.75rem 1.25rem 4rem; width: 100%; }

/* --- Cards --- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem 1.25rem; box-shadow: var(--shadow);
}
.card + .card { margin-top: 1rem; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* --- Botones --- */
.btn {
  font-family: var(--font-display); font-weight: 700; font-size: .9rem;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: .55rem 1rem; border-radius: 9px; cursor: pointer; transition: .12s;
  display: inline-flex; align-items: center; gap: .45rem;
}
.btn:hover { border-color: var(--cyan); }
.btn-primary { background: var(--black); color: var(--white); border-color: var(--black); }
.btn-primary:hover { background: #1a1a1a; }
.btn-accent { background: var(--cyan); color: var(--black); border-color: var(--cyan); }
.btn-accent:hover { filter: brightness(1.05); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* --- Formularios --- */
label { display: block; font-size: .82rem; font-weight: 600; color: var(--dim); margin-bottom: .25rem; }
input, select, textarea {
  font-family: var(--font-body); font-size: .92rem; width: 100%;
  padding: .55rem .7rem; border: 1px solid var(--border); border-radius: 9px;
  background: var(--white); color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--cyan); border-color: var(--cyan); }
textarea { resize: vertical; min-height: 70px; }
.field + .field { margin-top: .8rem; }

/* --- Tablas (header negro, texto blanco, display uppercase) --- */
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
thead th {
  background: var(--black); color: var(--white);
  font-family: var(--font-display); font-weight: 700; font-size: .72rem;
  text-transform: uppercase; letter-spacing: .05em; text-align: left;
  padding: .6rem .7rem;
}
thead th:first-child { border-top-left-radius: 8px; }
thead th:last-child  { border-top-right-radius: 8px; }
tbody td { padding: .55rem .7rem; border-bottom: 1px solid var(--border); vertical-align: top; }
tbody tr:hover { background: #fafafe; }

/* --- Pills / badges --- */
.pill {
  display: inline-block; font-size: .68rem; font-weight: 700;
  padding: .12rem .5rem; border-radius: 999px; white-space: nowrap;
  font-family: var(--font-display); letter-spacing: .02em;
}
.pill-sop { background: rgba(0,216,218,.15); color: #007e80; }
.pill-soe { background: rgba(255,0,250,.12); color: #b000ac; }
.pill-ok  { background: rgba(31,168,79,.14); color: var(--verde); }
.pill-warn{ background: rgba(224,138,0,.14); color: var(--ambar); }
.pill-bad { background: rgba(224,37,43,.12); color: var(--rojo); }
.pill-neutral { background: #eef0f4; color: var(--gray-mid); }

/* --- Callouts --- */
.callout { border-left: 3px solid var(--cyan); background: rgba(0,216,218,.06); padding: .8rem 1rem; border-radius: 0 10px 10px 0; }
.callout.important { border-color: var(--magenta); background: rgba(255,0,250,.05); }

/* --- KPI tiles --- */
.kpi { text-align: left; }
.kpi .value { font-family: var(--font-display); font-weight: 700; font-size: 2rem; line-height: 1; }
.kpi .label { font-size: .78rem; color: var(--muted); margin-top: .3rem; }

/* --- Login --- */
.login-screen { min-height: 100vh; display: grid; place-items: center; background: var(--black); }
.login-card { background: var(--surface); border-radius: 16px; padding: 2rem; width: min(380px, 92vw); box-shadow: var(--shadow); }
.login-card .tag { display: block; margin-bottom: .4rem; }
.login-card h1 { margin-bottom: 1.2rem; }
.login-card .btn { width: 100%; justify-content: center; margin-top: 1rem; }
.login-error { color: var(--rojo); font-size: .85rem; margin-top: .7rem; min-height: 1.1em; }

/* --- Utilidades --- */
.row { display: flex; align-items: center; gap: .6rem; }
.between { justify-content: space-between; }
.mt { margin-top: 1rem; } .mb { margin-bottom: 1rem; }
.section-title { display: flex; align-items: center; gap: .6rem; margin: 1.6rem 0 .6rem; }
.hidden { display: none !important; }

@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; }
  .topbar nav { margin-left: 0; order: 3; width: 100%; }
}
