:root {
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --surface: #fcfcfb;
  --page: #f5f7fa;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #898781;
  --border: #e5e7eb;
  --status-good: #0ca30c;
  --status-warning: #fab219;
  --status-critical: #d03b3b;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--page);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
}

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

/* ---- Login ---- */

#pantalla-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 36px 32px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 1px 3px rgba(11,11,11,0.08), 0 8px 24px rgba(11,11,11,0.06);
}

.login-card h1 { font-size: 19px; margin: 0 0 4px; }
.login-card p.subtitulo { color: var(--text-secondary); margin: 0 0 24px; font-size: 13px; }

.campo { margin-bottom: 14px; }
.campo label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.campo input, .campo select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
}
.campo input:focus, .campo select:focus { border-color: var(--brand); }

.btn-primario {
  width: 100%;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 11px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 6px;
}
.btn-primario:hover { background: var(--brand-dark); }
.btn-primario:disabled { opacity: 0.6; cursor: default; }
.btn-ancho-auto { width: auto; padding: 11px 24px; }

.error-texto { color: var(--status-critical); font-size: 13px; margin-top: 10px; min-height: 16px; }

/* ---- Layout general ---- */

#pantalla-app { display: none; min-height: 100vh; }
#pantalla-app.visible { display: block; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.marca { font-weight: 800; font-size: 16px; }
.topbar-acciones { display: flex; gap: 10px; align-items: center; }

.btn-chico {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  padding: 7px 14px;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  color: var(--text-secondary);
  text-decoration: none;
  display: inline-block;
}
.btn-chico:hover { border-color: var(--brand); color: var(--brand); }

.contenido { padding: 28px; max-width: 960px; margin: 0 auto; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}
.seccion-header { margin-bottom: 16px; }
.seccion-header h2 { margin: 0 0 4px; font-size: 17px; }
.seccion-header p { margin: 0; color: var(--text-secondary); font-size: 13px; }

.form-fila { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.campo-inline { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 4px; }
.campo-inline label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; }
.campo-inline input, .campo-inline select {
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* ---- Tablas ---- */

table.tabla-datos { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tabla-datos th {
  text-align: left;
  padding: 8px 10px;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-bottom: 1px solid var(--border);
}
table.tabla-datos td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.tabla-datos tr:last-child td { border-bottom: none; }
table.tabla-datos select { padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; }

.chip-estado { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.chip-good { background: #e6f7e6; color: #0a5a0a; }
.chip-warning { background: #fff4de; color: #92600a; }
.chip-critical { background: #fbe2e2; color: #9c2a2a; }
.chip-neutral { background: var(--page); color: var(--text-secondary); }

.sin-datos { color: var(--text-muted); font-style: italic; padding: 16px 0; text-align: center; }
