:root {
  --azul: #2563eb;
  --azul-osc: #1d4ed8;
  --gris: #64748b;
  --borde: #e2e8f0;
  --fondo: #f8fafc;
  --verde: #16a34a;
  --rojo: #dc2626;
  --amarillo: #d97706;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--fondo);
  color: #1e293b;
}
a { color: var(--azul); text-decoration: none; }
a:hover { text-decoration: underline; }

.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: #fff;
  border: 1px solid var(--borde);
  border-radius: 10px;
  padding: 32px;
  width: 320px;
}
.login-card h1 { margin: 0 0 4px; font-size: 20px; }
.muted { color: var(--gris); font-size: 13px; }

label { display: block; margin: 12px 0 4px; font-size: 13px; color: var(--gris); }
input, select, button {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--borde);
  border-radius: 6px;
  width: 100%;
}
button {
  background: var(--azul);
  color: #fff;
  border: none;
  cursor: pointer;
  margin-top: 14px;
  width: auto;
  padding: 8px 16px;
}
button:hover { background: var(--azul-osc); }
.checkbox-label { display: flex; align-items: center; gap: 6px; }
.checkbox-label input { width: auto; }

.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  background: #0f172a;
  color: #fff;
  padding: 12px 24px;
}
.topbar-brand { font-weight: bold; }
.topbar-nav { display: flex; gap: 16px; flex: 1; }
.topbar-nav a { color: #cbd5e1; }
.topbar-nav a:hover { color: #fff; }
.topbar-user { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #cbd5e1; }
.topbar-user a { color: #fff; }

.content { max-width: 1000px; margin: 24px auto; padding: 0 20px; }

.alert { padding: 10px 14px; border-radius: 6px; margin: 12px 0; font-size: 14px; }
.alert-error { background: #fef2f2; color: var(--rojo); border: 1px solid #fecaca; }
.alert-ok { background: #f0fdf4; color: var(--verde); border: 1px solid #bbf7d0; }

.panel {
  background: #fff;
  border: 1px solid var(--borde);
  border-radius: 8px;
  padding: 12px 16px;
  margin: 16px 0;
}
.panel summary { cursor: pointer; font-weight: 600; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 16px; }
.form-grid button { grid-column: 1 / -1; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form select, .inline-form button { width: auto; }

.tabla { width: 100%; border-collapse: collapse; background: #fff; margin: 12px 0; }
.tabla th, .tabla td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--borde);
  font-size: 14px;
}
.tabla th { color: var(--gris); font-weight: 600; font-size: 12px; text-transform: uppercase; }
.fila-cumplida { background: #f0fdf4; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #e2e8f0;
  color: #334155;
}
.badge-pendiente { background: #e2e8f0; color: #334155; }
.badge-en_proceso { background: #dbeafe; color: #1d4ed8; }
.badge-observado { background: #fef3c7; color: var(--amarillo); }
.badge-aprobado { background: #dcfce7; color: var(--verde); }
.badge-no_aprobado { background: #fee2e2; color: var(--rojo); }

.etapas-timeline { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 12px 0 24px; }
.etapas-timeline li { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 6px; background: #f8fafc; border: 1px solid var(--borde); font-size: 13px; }
.etapas-timeline li.etapa-actual { border-color: var(--azul); font-weight: 600; }

.estado-bar { display: flex; align-items: center; gap: 16px; margin: 12px 0 24px; }
.req { color: var(--rojo); }
.btn { display: inline-block; background: var(--azul); color: #fff; padding: 8px 14px; border-radius: 6px; }
.btn-link-danger { background: none; border: none; color: var(--rojo); cursor: pointer; padding: 0; width: auto; margin: 0; text-decoration: underline; }

.paginador { display: flex; align-items: center; gap: 16px; margin: 16px 0; font-size: 14px; }
.paginador-deshabilitado { color: #94a3b8; }

.buscador { display: flex; align-items: center; gap: 8px; margin: 12px 0; }
.buscador input[type="text"] { width: auto; }
