/* MAIN RESET */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f4f6f9;
  color: #333;
  line-height: 1.6;
  padding: 2rem;
}

/* CENTRADO SOLO PARA LOGIN Y REGISTER */
.centered-page {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  padding: 0;
  background: #f4f6f9;
}

/* CONTENEDORES */
.login-container,
.form-container {
  max-width: 720px;
  margin: auto;
  background: #fff;
  padding: 2rem 2.5rem;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
}

/* Estilo exclusivo login */
.login-container {
  width: 100%;
  max-width: 400px;
  text-align: center;
}

/* HEADERS */
h1, h2, h3 {
  margin-bottom: 1rem;
  color: #1e293b;
}

h1 {
  font-size: 2rem;
  text-align: center;
}

h2 {
  font-size: 1.5rem;
}

/* FORMULARIOS */
form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
select,
textarea {
  padding: 0.6rem 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 1rem;
  width: 100%;
  background: #fff;
}

textarea {
  resize: vertical;
  min-height: 100px;
}

input[type="file"] {
  padding: 0.3rem;
}

/* BOTONES */
button,
.btn-nueva,
.btn-ver {
  padding: 0.6rem 1.2rem;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background 0.2s ease;
}

button:hover,
.btn-nueva:hover,
.btn-ver:hover {
  background: #1d4ed8;
}

/* MENSAJES */
.error {
  background: #fee2e2;
  color: #b91c1c;
  padding: 0.8rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.success {
  background: #dcfce7;
  color: #166534;
  padding: 0.8rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}

/* DASHBOARD HEADER */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 1rem;
}

.dashboard-header .user-info {
  font-size: 0.9rem;
}

.logout-btn {
  background: none;
  color: #dc2626;
  font-weight: bold;
  text-decoration: none;
  margin-left: 1rem;
}

.logout-btn:hover {
  text-decoration: underline;
}

/* MINUTAS */
.minutas-list {
  display: grid;
  gap: 1rem;
}

.minuta-card {
  background: #fff;
  padding: 1.2rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.minuta-card h3 {
  margin-bottom: 0.5rem;
}

/* TABLAS */
.acuerdos-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.acuerdos-table th,
.acuerdos-table td {
  border: 1px solid #e5e7eb;
  padding: 0.75rem;
  text-align: left;
}

.acuerdos-table th {
  background-color: #f1f5f9;
  color: #1e293b;
}

/* UTILITY */
.actions {
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: flex-end;
}

/* ya tienes align-items:end en .filtros-grid */
.filtros-grid{ display:grid; grid-template-columns:repeat(12,1fr); gap:.75rem; align-items:end; }

/* nuevo: coloca el bloque de acciones junto al select "Mostrar" y pegado al fondo */
.actions-col{ align-self:end; display:flex; justify-content:flex-end; }
.actions{ display:flex; gap:.6rem; align-items:center; }

/* opcional: que los botones tengan altura similar a los inputs/selects */
.actions .btn{ padding:.55rem 1rem; }

/* =========================
   Paginación (dashboard/listas)
   ========================= */
.pager{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-top:1rem;
  gap:1rem;
  flex-wrap:wrap;
}

.pager .pages{
  display:flex;
  gap:.35rem;
  flex-wrap:wrap;
}

.pager .pages a,
.pager .pages span{
  padding:.5rem .75rem;
  border:1px solid #e5e7eb;
  border-radius:8px;
  background:#fff;
  text-decoration:none;
  color:#1f2937;            /* texto visible en botones normales */
  font-weight:700;
  line-height:1;
  min-width:2.1rem;
  text-align:center;
}

.pager .pages a:hover{
  background:#f1f5f9;
}

/* Página activa */
.pager .pages .active{
  background:#2563eb;
  border-color:#2563eb;
  color:#fff;
}

/* Deshabilitados (extremos) */
.pager .pages .disabled{
  color:#94a3b8;
  background:#f8fafc;
  border-color:#e5e7eb;
  cursor:not-allowed;
}

/* Elipsis "…" */
.pager .pages .gap{
  border-color:transparent;
  background:transparent;
  color:#64748b;
  padding:.5rem .25rem;
}

/* ==== Evitar estiramiento cuando el resumen es largo ==== */
.grid-2 { 
  align-items: start;             /* los dos paneles principales no se estiran */
}

.meta {
  align-items: start;             /* los pares etiqueta/valor no se estiran */
}

.meta > div {
  align-self: start;              /* cada celda se alinea arriba */
}

.meta .chips,
.meta .btns,
.meta .btn {
  align-self: start;              /* contenido dentro de las celdas también arriba */
  height: auto;                   /* por si el navegador intentaba tomar 100% */
}

.btns { 
  align-items: flex-start;        /* evita que el botón crezca a lo alto */
}

.chip { 
  line-height: 1.1;               /* evita “pastillas” altas si el contenedor es grande */
  padding: .25rem .6rem;          /* refuerza altura compacta */
}

/* ==== Miniaturas de adjuntos en comentarios ==== */
.com-files { margin-top: 8px; }

.com-files .file-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.com-files .file-card{
  border: 1px solid var(--gris-200);
  background: #fff;
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.com-files .file-thumb{
  width: 100%;
  height: 120px;              /* altura fija = miniatura */
  border-radius: 8px;
  object-fit: cover;          /* recorta manteniendo proporción */
  border: 1px solid var(--gris-200);
  background: #f8fafc;
  display: block;
}

.com-files .file-icon{
  display: flex;
  align-items: center;
  justify-content: center;
  height: 120px;
  border-radius: 8px;
  border: 1px dashed var(--gris-200);
  background: #f8fafc;
  font-size: 32px;
  color: #1e3a8a;
}

/* Por si alguien pega imágenes dentro del texto del comentario,
   evitar que se desborden */
.comentario img:not(.file-thumb){
  max-width: 100%;
  height: auto;
}

/* GRID de filtros (ya lo tienes) */
.filtros-grid{
  display:grid;
  grid-template-columns:repeat(12,1fr);
  gap:.75rem;
  align-items:end;                 /* <- asegura alineación por la base */
}

/* columnas ya usadas */
.f-col-4{grid-column:span 4}
.f-col-3{grid-column:span 3}
.f-col-2{grid-column:span 2}

/* NUEVO: celda para los botones de acción, al final de la fila */
.f-actions{
  grid-column:10 / -1;             /* ocupa las 3 últimas columnas (10,11,12) */
  display:flex;
  gap:.6rem;
  justify-content:flex-end;
  align-self:end;                  /* queda a la altura de los inputs */
}

/* Responsivo */
@media (max-width:880px){
  .filtros-grid{ grid-template-columns:1fr 1fr; }
  .f-col-4,.f-col-3,.f-col-2{ grid-column:auto; }
  .f-actions{
    grid-column:1 / -1;            /* botones ocupan toda la fila en móvil */
    justify-content:space-between;
  }
}

.autosave-chip{
  position:fixed; right:14px; bottom:14px;
  background:#0ea5e9; color:#fff;
  padding:.4rem .65rem; border-radius:999px;
  font-weight:700; font-size:.85rem;
  box-shadow:0 6px 18px rgba(0,0,0,.15);
  opacity:.98; display:none;
  z-index:2147483647;         /* ↑ encima del modal/overlay */
  pointer-events:none;        /* no interfiere con clicks */
  transform:translateZ(0);    /* fuerza nueva capa */
}

/* hace que chips de “Seleccionados” acomoden bien en varias líneas */
#lista-seleccionados{ display:flex; flex-wrap:wrap; gap:.4rem; min-height:44px }

/* la grid que contiene Filtro / Seleccionados arranca arriba */
.grid-2{ align-items:flex-start; } /* opcional: aplica a todas las grid-2 */
