/* ==============================
   RESET Y BASE
============================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-grad-1: #0a0f1c;
  --bg-grad-2: #111d3a;
  --bg-grad-3: #0a2e6f;

  --brand: #003366;
  --brand-2: #00bfff;

  --card-bg: #ffffff;
  --card-fg: #222222;

  --soft-blue: #e9f2fb;   /* recuadro celeste suave opcional */
  --muted: #6b7280;

  --radius: 12px;
  --shadow: 0 6px 18px rgba(0,0,0,.15);
}

html, body {
  height: 100%;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: linear-gradient(135deg,var(--bg-grad-1),var(--bg-grad-2),var(--bg-grad-3));
  color: #ffffff;
  line-height: 1.6;
}

/* ==============================
   HEADER
   - Logo a la izquierda
   - Títulos a la derecha
============================== */
header {
  background:#0d1b2a;
  color:#fff;
  padding:14px 18px;
  border-bottom:2px solid var(--brand-2);
}

header table {
  width:100%;
  border-collapse:collapse;
}

header td:first-child {
  width:120px;
  vertical-align:middle;
}

header td:last-child {
  text-align:right;
  vertical-align:middle;
}

header h1 {
  font-size:28px;
  margin:0 0 4px 0;
  line-height:1.2;
}

header h3 {
  font-size:18px;
  margin:0 0 2px 0;
  font-weight:700;
}

header p {
  font-size:14px;
  margin:0;
  opacity:.9;
}

/* ==============================
   CONTENEDOR PRINCIPAL
============================== */
.container-95 {
  width:95%;
  max-width:1100px;              /* ✅ límite para que no se desborde */
  margin:22px auto;
}

/* Tarjeta/recuadro para formularios, tablas, etc. */
.card {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom:20px;
  overflow:hidden;
}

.card--white {
  background: var(--card-bg);    /* ✅ recuadro blanco */
  color: var(--card-fg);
  padding:22px;
}

.card--blue {
  background: var(--soft-blue);  /* recuadro celeste opcional */
  color:#111;
  padding:22px;
}

/* Asegurar contraste dentro del recuadro blanco */
.card--white h1,
.card--white h2,
.card--white h3,
.card--white p,
.card--white label,
.card--white th,
.card--white td {
  color: var(--card-fg);
}

/* Títulos de sección dentro de tarjetas */
.section-title {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:16px;
}

.section-title h2 {
  margin:0;
  color:#0a2e6f;
  font-size:22px;
}

/* ==============================
   FORMULARIOS
============================== */
.form-group { margin-bottom:14px; }

label {
  display:block;
  font-weight:bold;
  margin-bottom:6px;
  color:inherit;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
select,
textarea {
  width:100%;
  padding:10px 12px;
  border:1px solid #000;   /* borde negro para contraste */
  border-radius:8px;
  font-size:14px;
  background:#fff;
  color:#111;
  transition: border-color .2s, box-shadow .2s;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand-2);
  outline: none;
  box-shadow: 0 0 0 3px rgba(0,191,255,.25);  /* ✅ foco visible */
}

input:disabled,
select:disabled,
textarea:disabled {
  background:#f3f4f6;
  color:#6b7280;
  cursor:not-allowed;
}

/* Fila de form (dos o más columnas) */
.form-row {
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap:12px;
}

@media (max-width: 720px){
  .form-row { grid-template-columns: 1fr; }
}

/* Acciones del formulario: volver a la IZQ y acción principal a la DER */
.form-actions {
  display:flex;
  justify-content:space-between;    /* ✅ izquierda / derecha */
  align-items:center;
  gap:12px;
  margin-top:18px;
}

/* ==============================
   BOTONES
============================== */
.btn {
  display:flex;
  align-items:center;
  justify-content:center;   /* ✅ centra texto en el botón */
  gap:8px;
  padding:10px 16px;
  font-weight:bold;
  border:none;
  border-radius:8px;
  text-decoration:none;
  cursor:pointer;
  transition: transform .05s ease, background .2s ease, box-shadow .2s ease;
  user-select:none;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background:#0066cc;
  color:#fff;
  box-shadow: 0 2px 0 #004c99;
}

.btn-primary:hover { background:#0057ad; }

.btn-primary:disabled {
  background:#9ca3af;
  color:#f3f4f6;
  cursor:not-allowed;
  box-shadow:none;
}

.btn-secondary {
  background:#9bb8e4;
  color:#111827;
  box-shadow: 0 2px 0 #4e4e4e;
}

.btn-secondary:hover { background:#ebc6a9; }

/* Botón peligro (cerrar sesión, bajas, etc.) */
.btn-danger {
  background:#b30000;
  color:#fff;
  box-shadow: 0 2px 0 #7a0000;
}
.btn-danger:hover { background:#990000; }

/* ==============================
   TABLAS
============================== */
.table-responsive {
  width:100%;
  overflow:auto;                 /* ✅ evita que se salga en móvil */
}

.table {
  width:100%;
  border-collapse:collapse;
  margin-top:8px;
  background:#fff;
  color:#111;
  border:1px solid #e5e7eb;
}

.table th, .table td {
  padding:10px 12px;
  border-bottom:1px solid #e5e7eb;
  text-align:left;
  white-space:nowrap;
}

.table th {
  background: var(--brand);
  color:#fff;
  position:sticky;
  top:0;
  z-index:1;
}

.table tr:nth-child(even) { background:#f9fafb; }

/* ==============================
   ALERTAS / AYUDA
============================== */
.alert {
  padding:10px 12px;
  border-radius:8px;
  margin-bottom:12px;
  font-size:14px;
}

.alert-info {
  background:#e0f2fe;
  color:#0c4a6e;
  border:1px solid #bae6fd;
}

.alert-warning {
  background:#fff7ed;
  color:#7c2d12;
  border:1px solid #fed7aa;
}

.alert-success {
  background:#ecfdf5;
  color:#065f46;
  border:1px solid #a7f3d0;
}

.alert-danger {
  background:#fee2e2;
  color:#7f1d1d;
  border:1px solid #fecaca;
}

/* ==============================
   ACORDEÓN (colapsables)
============================== */
.accordion {
  border:1px solid #e5e7eb;
  border-radius:10px;
  overflow:hidden;
  background:#fff;
  color:#111;
}

.accordion-header {
  width:100%;
  text-align:left;
  padding:12px 16px;
  background:#f3f4f6;
  border:none;
  cursor:pointer;
  font-weight:bold;
}

.accordion-content {
  display:none;
  padding:12px 16px;
}

/* ==============================
   MODAL (genérico + logout)
============================== */
.modal {
  display:none;
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.65);
  z-index:2000;
  align-items:center;
  justify-content:center;
  padding:16px;
}

.modal.show { display:flex; }

.modal-card {
  width:min(400px, 90vw);
  background:#ffffff;
  color:#111;
  border-radius:12px;
  box-shadow: var(--shadow);
  padding:18px;
  animation: fadeIn .3s ease;
}

.modal-header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:10px;
}

.modal-title {
  font-size:20px;
  font-weight:700;
  color:#0a2e6f;
}

.modal-body { margin:8px 0 14px; font-size:15px; }

.modal-actions {
  display:flex;
  justify-content:flex-end;
  gap:10px;
}

@keyframes fadeIn {
  from { opacity:0; transform: translateY(-10px); }
  to { opacity:1; transform: translateY(0); }
}

/* ==============================
   FOOTER
============================== */
footer {
  margin-top:26px;
  text-align:center;
  padding:12px 16px;
  background:#0d1b2a;
  color:#fff;
  border-top:2px solid var(--brand-2);
  font-size:14px;
}

/* ==============================
   RESPONSIVE HEADER
============================== */
@media (max-width: 768px) {
  header h1 { font-size:22px; }
  header h3 { font-size:16px; }
  header p  { font-size:13px; }
}

@media (max-width: 480px) {
  header h1 { font-size:20px; }
  header h3 { font-size:15px; }
  header p  { font-size:12px; }
}

/* Estilo general para tablas */
.tabla-estilo {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-top: 10px;
}

.tabla-estilo th,
.tabla-estilo td {
  border: 1px solid #ccc;
  padding: 6px 10px;
  text-align: left;
}

.tabla-estilo th {
  background-color: #f4f4f4;
  font-weight: bold;
  text-transform: uppercase;
  text-align: center;
}

.tabla-estilo tbody tr:nth-child(even) {
  background-color: #fafafa;
}

.tabla-estilo tbody tr:hover {
  background-color: #f1f7ff;
}

/* Botón cancelar dentro de tabla */
.tabla-estilo .btn-danger {
  background-color: #e74c3c;
  color: #fff;
  border: none;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}

.tabla-estilo .btn-danger:hover {
  background-color: #c0392b;
}
