/* === Estilos globales OBCIVELEC S.H. === */

:root {
  --color-principal: #014f86;
}

/* Fuente base */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f8fafa;
  color: #222;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}

/* Encabezados */
h1, h2, h3, h4 {
  color: var(--color-principal);
  margin-top: 20px;
}

/* Botones */
.btn {
  background-color: var(--color-principal);
  color: white;
  padding: 0 18px; /* quitamos altura vertical para dejar a 'height' controlarla */
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.3s ease;
  text-decoration: none;

  display: flex;
  align-items: center;     /* centra verticalmente */
  justify-content: center; /* centra horizontalmente */

  height: 36px;
  min-width: 90px;
  font-size: 14px;
  line-height: 1;          /* evita que el texto tenga margen vertical */
}

.btn:hover {
  background-color: #012e5f;
}

.btn-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 5px;
  transition: transform 0.2s ease;
}

.btn-icon:hover svg {
  transform: scale(1.2);
}

.btn-secundario {
    background-color: #e0e0e0;
    color: #003B73;
    border: 1px solid #bbb;
    padding: 10px 20px;
    text-decoration: none;
    display: inline-block;
    border-radius: 8px;
    font-weight: 500;
    margin-top: 15px;
    transition: background-color 0.3s ease;
}

.btn-secundario:hover {
    background-color: #d5d5d5;
}

.btn.eliminar {
  background-color: #d32f2f;
  color: white;
  border: none;
  font-weight: bold;
  cursor: pointer;
  margin-top: 10px;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 0 18px;
  height: 36px;
  min-width: 90px;
  line-height: 1;
  font-size: 14px;
}


/* Tablas */
table:not(.historial-fotos) {
  display: table;
  width: 100%;
  table-layout: fixed;
}

thead th {
  background-color: var(--color-principal);
  color: white;
  padding: 10px;
  text-align: center;
}

tbody td {
  border: 1px solid #ccc;
  padding: 10px;
}

.input-ejecutado {
  width: 80px;
  text-align: right;
}

.col-observacion {
  max-width: 260px;
  word-wrap: break-word;
}

/* Formularios generales */
input[type="text"],
input[type="email"],
input[type="date"],
input[type="file"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 10px;
  margin-top: 5px;
  margin-bottom: 15px;
  border: 1px solid #ccc;
  border-radius: 5px;
  box-sizing: border-box;
  font-size: 16px;
  height: 42px;
}

label {
  font-weight: 600;
  display: block;
  margin-bottom: 5px;
}

/* Header panel */
.header-panel {
  background-color: var(--color-principal);
  color: white;
  padding: 20px;
  text-align: center;
  border-radius: 6px 6px 0 0;
}

/* Secciones */
.section-box {
  background-color: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  margin-bottom: 30px;
}

/* Links */
a {
  color: var(--color-principal);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Footer o cierre */
.footer {
  text-align: center;
  font-size: 0.8rem;
  color: #888;
  margin-top: 40px;
  padding: 20px;
}

/* Imagenes */
img {
  max-width: 100%;
  height: auto;
  border-radius: 5px;
}

/* === Login === */
.login-container {
  max-width: 400px;
  margin: 60px auto;
  background: white;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 0 12px rgba(0,0,0,0.1);
  text-align: center;
}

.logo-login {
  max-width: 120px;
  margin-bottom: 20px;
}

.login-container h2 {
  color: var(--color-principal);
  margin-bottom: 20px;
}

.login-container input {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  border-radius: 5px;
  border: 1px solid #ccc;
}

.login-container .btn {
  width: 100%;
}


/* Estados de ítems */
.estado-pendiente {
  color: #d32f2f;
  background-color: #fdecea;
  border-left: 4px solid #d32f2f;
  font-weight: bold;
}

.estado-progreso {
  color: #f57c00;
  background-color: #fff3e0;
  border-left: 4px solid #f57c00;
  font-weight: bold;
}

.estado-completado {
  color: #388e3c;
  background-color: #e8f5e9;
  border-left: 4px solid #388e3c;
  font-weight: bold;
}

/* Accesibilidad foco */
button:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #014f86;
  outline-offset: 2px;
}

/* Ajustar la celda de “Acción” */
td:last-child {
  min-width: 250px;
  white-space: normal;
}

td input[type="file"],
td input[type="text"] {
  width: 100%;
  margin-bottom: 6px;
}

/* Estilos específicos para tabla de historial de fotos */
table.historial-fotos {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 14px;
  table-layout: fixed;
}

table.historial-fotos th,
table.historial-fotos td {
  padding: 12px;
  vertical-align: top;
  text-align: left;
}

table.historial-fotos th {
  background-color: var(--color-principal);
  color: white;
}

table.historial-fotos img {
  width: 180px;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

table.historial-fotos td:last-child {
  text-align: center;
}

table.historial-fotos thead th {
  text-align: center;
}

/* Tamaño del logo por defecto */
.logo-panel {
  max-width: 160px;
  height: auto;
}

/* Botón cerrar sesión específico */
.btn-logout {
  background-color: #ccc;
  color: #000;
  padding: 10px 18px;
  border-radius: 6px;
  font-weight: 600;
  text-align: center;
  max-width: fit-content;
}

/* ==== Encabezado General para Módulos ==== */
.encabezado-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #003B73;
  padding: 10px 20px;
  color: white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.encabezado-izquierda {
  display: flex;
  align-items: center;
  gap: 15px;
}

.logo-panel {
  height: 50px;
  width: auto;
}

.nombre-usuario {
  font-weight: 600;
  font-size: 1rem;
}

.encabezado-derecha .btn-cerrar-sesion {
  background-color: #ffffff;
  color: #003B73;
  border: none;
  padding: 6px 14px;
  border-radius: 5px;
  font-weight: bold;
  text-decoration: none;
  transition: background 0.3s ease;
}

.encabezado-derecha .btn-cerrar-sesion:hover {
  background-color: #e6e6e6;
}

.contenido-panel {
  max-width: 1200px;   /* Ajusta según preferencia */
  margin: 0 auto;      /* Centra horizontalmente */
  padding: 16px;       /* Espacio interno */
  box-sizing: border-box;
}


.alerta-exito {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 12px;
    border-radius: 6px;
    margin: 10px 0;
    font-weight: bold;
}

.modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center !important;     /* fuerza vertical */
  justify-content: center !important; /* fuerza horizontal */
  overflow: hidden;
}

.modal-content {
  background: #fff;
  padding: 20px;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 8px;
  position: relative;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

.modal-contenido-grande {
  position: relative;
  display: flex;
  align-items: center;
  gap: 20px;
  background: none;
  padding: 0;
}

.close {
    position: absolute;
    top: 10px; right: 15px;
    font-size: 24px;
    cursor: pointer;
}

/* Etiquetas visuales para roles */
.rol-cliente {
  background-color: #e1f5fe;
  color: #0277bd;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
  display: inline-block;
  font-size: 0.9rem;
}

.rol-ingeniero {
  background-color: #fff8e1;
  color: #f9a825;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
  display: inline-block;
  font-size: 0.9rem;
}

.rol-operario {
  background-color: #e8f5e9;
  color: #388e3c;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
  display: inline-block;
  font-size: 0.9rem;
}

.rol-desconocido {
  background-color: #eceff1;
  color: #546e7a;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
  display: inline-block;
  font-size: 0.9rem;
}

.asignacion-checkbox {
  display: block;
  margin-left: 12px;
  margin-bottom: 6px;
}

/* Modal de galería mejorado */

.modal-header {
  width: 100%;
  text-align: center;
  font-size: 1.4em;
  font-weight: bold;
  color: #003B73;
  padding: 12px;
  border-bottom: 1px solid #ddd;
}

.cerrar-modal {
  position: absolute;
  top: -15px;
  right: -15px;
  font-size: 28px;
  color: white;
  cursor: pointer;
  background-color: #000;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.contenedor-imagen {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-height: 80vh;
  overflow: hidden;
}

#fotoActual {
  max-height: 85vh;
  max-width: 90vw;
}


#btnDescargarFoto {
  margin-top: 12px;
  background-color: #005b94;
  color: white;
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;
}

.contador {
  background: rgba(0, 0, 0, 0.6);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: white;
  margin-top: 4px;
}

.tipo-foto {
  background: rgba(0, 0, 0, 0.7);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 4px;
  color: white;
}

.info-modal {
  position: absolute;
  bottom: 20px;
  left: 20px;
  text-align: left;
  z-index: 11;
}

.contenedor-imagen img {
  max-height: 60vh;
  width: auto;
  height: auto;
  display: block;
  margin: 0 auto;
}

.btn-descarga {
  display: inline-block;
  margin-top: 6px;
  background-color: #003B73;
  color: white;
  padding: 8px 14px;
  border-radius: 5px;
  text-decoration: none;
  font-size: 13px;
}

.nav-btn {
  background: none;
  color: white;
  font-size: 30px;
  border: none;
  cursor: pointer;
  user-select: none;
}

.nav-btn:hover {
  transform: scale(1.2);
}

.overlay-modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-small {
  background: white;
  padding: 30px;
  border-radius: 8px;
  width: 95%;
  max-width: 700px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  position: relative;
}

.modal-abierto {
  overflow: hidden;
}

.col-observacion {
  max-width: 300px;          /* Ajusta según necesidad */
  white-space: pre-wrap;     /* Mantiene saltos de línea */
  word-wrap: break-word;     /* Rompe palabras largas si es necesario */
  overflow-wrap: break-word; /* Compatible con navegadores modernos */
  vertical-align: top;       /* Alinea correctamente con otras celdas */
}

.tabla-fotos-pendientes th.col-codigo,
.tabla-fotos-pendientes td.col-codigo {
    width: 80px;
}

.tabla-fotos-pendientes th.col-descripcion,
.tabla-fotos-pendientes td.col-descripcion {
    width: 500px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.tabla-fotos-pendientes th.col-comentario,
.tabla-fotos-pendientes td.col-comentario {
    width: 220px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.tabla-fotos-pendientes th.col-imagen,
.tabla-fotos-pendientes td.col-imagen {
    width: 180px;
    text-align: center;
}

.tabla-fotos-pendientes th.col-acciones,
.tabla-fotos-pendientes td.col-acciones {
    width: 80px;
    text-align: center;
}

.tabla-fotos-pendientes {
    table-layout: fixed;
    width: 100%;
}

.tabla-fotos-pendientes td {
    overflow: hidden;
    text-overflow: ellipsis;
}

.tabla-fotos-pendientes .acciones-columna form {
    margin-bottom: 8px;
}

.tabla-items-operario {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.tabla-items-operario th,
.tabla-items-operario td {
    padding: 8px;
    box-sizing: border-box;
    vertical-align: top;
    text-align: left;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

/* Columnas específicas */
.tabla-items-operario th.col-codigo,
.tabla-items-operario td.col-codigo {
    width: 70px;
}

.tabla-items-operario th.col-descripcion,
.tabla-items-operario td.col-descripcion {
    width: 480px;
}

.tabla-items-operario th.col-unidad,
.tabla-items-operario td.col-unidad {
    width: 60px;
}

.tabla-items-operario th.col-cantidad,
.tabla-items-operario td.col-cantidad {
    width: 70px;
}

.tabla-items-operario th.col-observaciones,
.tabla-items-operario td.col-observaciones {
    width: 180px;
}

.tabla-items-operario th.col-estado,
.tabla-items-operario td.col-estado {
    width: 100px;
    text-align: center;
}

.tabla-items-operario th.col-accion,
.tabla-items-operario td.col-accion {
    width: 220px;
}

.tabla-items-operario th {
    text-align: center;
}

.tabla-items-ingeniero {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.tabla-items-ingeniero th,
.tabla-items-ingeniero td {
    padding: 6px;
    vertical-align: top;
    box-sizing: border-box;
    word-wrap: break-word;
    white-space: normal;
}

/* Anchos personalizados */
.col-codigo { width: 60px; text-align: center; }
.col-descripcion { width: 380px; }
.col-unidad { width: 60px; text-align: center; }
.col-cantidad,
.col-ejecutado,
.col-avance,
.col-estado,
.col-accion {
    width: 80px;
    text-align: center;
}
.col-observacion { width: 100px; }

.avance-pendiente {
    background-color: #fceaea;
    color: #c00000;
    font-weight: bold;
}

.avance-progreso {
    background-color: #fff4e5;
    color: #e67e22;
    font-weight: bold;
}

.avance-completado {
    background-color: #e8fce8;
    color: #2e8b57;
    font-weight: bold;
}

.tabla-detalle-actividades {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.tabla-detalle-actividades th,
.tabla-detalle-actividades td {
    padding: 6px;
    vertical-align: top;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

/* Anchos personalizados */
.col-codigo { width: 60px; text-align: center; }
.col-descripcion { width: 300px; }
.col-unidad { width: 60px; text-align: center; }
.col-cant-contratada,
.col-cant-ejecutada,
.col-avance { width: 80px; text-align: center; }

.col-obs-ing { width: 140px; }
.col-fotos { width: 130px; text-align: center; }
.col-obs-cliente {
    width: 90px;
    text-align: left;
}

.col-obs-cliente .btn {
    font-size: 0.75em;
    padding: 4px 6px;
    width: auto;
    max-width: 100%;
    white-space: nowrap;
}

.col-obs-cliente .btn-secundario {
    font-size: 0.75em;
    padding: 4px 6px;
    width: 100%;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1.1em;
    color: #014f86;
    cursor: pointer;
}

th.col-obs-cliente {
  text-align: center;
  vertical-align: middle;
  padding: 6px;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

td.col-obs-cliente {
    width: 140px;
    min-width: 140px;
    max-width: 140px;
    overflow: hidden;
    white-space: nowrap;
}

.etiqueta.obra {
    background-color: #1976d2;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.etiqueta.mantenimiento {
    background-color: #43a047;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

/* Mejora tabla de clientes: evita scroll horizontal */
.tabla-clientes {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.tabla-clientes th {
  text-align: center;
}

.tabla-clientes td {
  padding: 10px;
  text-align: left;
  word-wrap: break-word;
  white-space: normal;
  overflow-wrap: break-word;
  vertical-align: top;
}

.tabla-clientes td:last-child {
  min-width: 140px; /* Botones de acción */
  white-space: nowrap;
}

/* Alinear botones en columna y centrar celda de acciones */
.tabla-clientes td.acciones,
.tabla-clientes th.acciones {
  text-align: center;
  vertical-align: middle;
  width: 100px;
}

.tabla-clientes td.acciones .btn {
  display: block;
  width: 80px;
  margin: 6px auto;
  height: 36px;
  line-height: 36px;
  font-size: 14px;
  text-align: center;
}

.tabs {
  display: flex;
  border-bottom: 2px solid #ccc;
  gap: 4px;
  margin-bottom: 20px;
  padding-left: 10px;
}

.tabs button {
  background-color: #e6f0fa;
  color: #003B73;
  padding: 10px 18px;
  border: 1px solid #ccc;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
  font-size: 16px;
}

.tabs button:hover {
  background-color: #d0e6f9;
}

.tabs button.activa {
  background-color: white;
  border-color: #ccc;
  border-bottom: 2px solid white;
  color: #000;
  position: relative;
  z-index: 1;
}

.botones-accion {
  display: flex;
  gap: 12px; /* 👈 Separación entre botones */
  margin-top: 20px;
  flex-wrap: wrap;
}

.btn-cancelar {
  background-color: #f5f5f5;
  color: #003B73;
  border: 1px solid #ccc;
  padding: 0 18px;
  font-weight: 600;
  border-radius: 6px;
  height: 36px;
  line-height: 36px;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.btn-cancelar:hover {
  background-color: #e0e0e0;
}

.btn-accion-proyecto {
  display: block;
  width: 100%;
  text-align: center;
  padding: 8px 0;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  font-size: 14px;
  margin-bottom: 6px;
  box-sizing: border-box;
  transition: background 0.3s ease;
  text-decoration: none; /* importante para <a> */
}

.btn-accion-proyecto:hover {
  background-color: #003660;
}

.btn-accion-proyecto.rojo {
  background-color: #c62828;
  color: #fff;
}

.btn-accion-proyecto.rojo:hover {
  background-color: #a72828;
}

.btn-accion-proyecto:not(.rojo) {
  background-color: #0b4f79;
  color: #fff;
}

table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

table td, table th {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.botones-acciones {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.botones-acciones button,
.botones-acciones a {
  width: 120px !important; /* 🔒 Fuerza el ancho uniforme */
  text-align: center;
  box-sizing: border-box;
}

th.col-acciones,
td.col-acciones {
  width: 130px;      /* suficiente para apilar 3 botones */
  max-width: 140px;
  min-width: 120px;
  text-align: center;
  white-space: nowrap;
}

td.fecha {
  white-space: nowrap;
  text-align: center;
  width: 100px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-grid .full-width {
  grid-column: span 2;
}

.form-grid input[type="text"],
.form-grid input[type="number"],
.form-grid textarea {
  height: 40px;
  font-size: 14px;
  padding: 6px 10px;
  width: 100%;
  box-sizing: border-box;
  border-radius: 6px;
  border: 1px solid #ccc;
  transition: border-color 0.3s ease;
}

.form-grid textarea {
  height: 80px;
  resize: vertical;
}

/* Solo afecta la tabla de oficinas */
table.tabla-oficinas {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

/* Para las celdas de esa tabla */
table.tabla-oficinas td,
table.tabla-oficinas th {
  word-wrap: break-word;
  white-space: normal;
  padding: 10px;
}

.btn-eliminar {
  background-color: #d32f2f;
  color: white;
  border: none;
  padding: 0 18px;
  font-weight: 600;
  border-radius: 6px;
  height: 36px;
  line-height: 36px;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background-color 0.3s ease;
}
.btn-eliminar:hover {
  background-color: #b71c1c;
}

.tabs {
    list-style: none;
    display: flex;
    margin: 20px 0;
    padding: 0;
}
.tab {
    padding: 10px 20px;
    border: 1px solid #ccc;
    cursor: pointer;
    background-color: #eee;
}
.tab.active {
    background-color: #fff;
    border-bottom: none;
    font-weight: bold;
}
.pestana {
    display: none;
}
.pestana.activa {
    display: block;
    padding: 15px;
    border: 1px solid #ccc;
}

.tabla-comparativa {
    width: 100%;
    table-layout: fixed; /* ✅ Agregar esta línea */
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 14px;
    text-align: center;
}

.tabla-comparativa th {
    background-color: #0a4b85;
    color: #fff;
    padding: 4px 6px;
    border: 1px solid #003366;
}

.tabla-comparativa td {
    background-color: #f9f9f9;
    border: 1px solid #ccc;
    padding: 4px 6px;
}

.tabla-comparativa tfoot tr {
    background-color: #e3f2fd;
    font-weight: bold;
    text-align: right;
}

.tabla-comparativa tfoot td,
.tabla-comparativa tfoot th {
    padding: 6px 10px;
    border-top: 2px solid #0a4b85;
}

.tabla-comparativa tbody td.col-descripcion {
  text-align: left !important;
  vertical-align: top;
  white-space: normal;
}

/* Badges de estado (módulo cliente) */
.tabla-comparativa td.col-estado {
  text-align: center;
}

.estado-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 9999px;     /* pill */
  font-weight: 600;
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
  white-space: normal;       /* ✅ permitir salto de línea */
  border: 1px solid currentColor;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: 110px;          /* limita el ancho */
}

/* Paleta suave y profesional */
.estado-badge.is-pendiente  { color: #f57c00; background: #fff3e0; } /* naranja suave */
.estado-badge.is-proceso    { color: #1976d2; background: #e3f2fd; } /* azul suave   */
.estado-badge.is-ejecutado  { color: #2e7d32; background: #e8f5e9; } /* verde suave  */
.estado-badge.is-noejecuta  { color: #c62828; background: #fdecea; } /* rojo suave   */
.estado-badge.is-aprobado   { color: #1b5e20; background: #e8f5e9; } /* verde ok     */

/* Estados especiales para INP */
.estado-badge.is-poraprobar {
  color: #6d4c41;
  background: #fbe9e7;
  border: 1px solid #6d4c41;
}

.estado-badge.is-rechazado {
  color: #b71c1c;
  background: #ffebee;
  border: 1px solid #b71c1c;
}

/* Tip: si alguna fila tiene mucha altura, centra vertical */
.tabla-comparativa td.col-estado { vertical-align: middle; }

.fila-total,
.fila-total-final {
    background-color: #0a4b85;
    color: white;
}

.col-item {
  width: 40px;
  text-align: center;
}

.col-descripcion {
  width: 300px;
  white-space: normal;
  word-wrap: break-word;
}

.col-unidad {
  width: 40px;
  text-align: center;
}

.col-cant-contratado,
.col-cant-ejecutado {
  width: 20px;
  text-align: center;
}

.col-unitario-contratado,
.col-unitario-ejecutado,
.col-total-contratado,
.col-total-ejecutado {
  width: 200px;
  text-align: right;
  white-space: nowrap;
}

.col-estado {
  width: 90px;
  text-align: center;
}

.col-avance {
  width: 60px;
  text-align: center;
}

.fila-separadora {
  background-color: #e3f2fd;
  font-weight: bold;
  text-align: center;
}

.texto-separador {
  font-size: 1rem;
  padding: 8px;
  color: #0d47a1;
}

.galeria-fotos {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.foto-miniatura {
    width: 160px;
    text-align: center;
}
.foto-miniatura img {
    width: 100%;
    border: 1px solid #ccc;
    cursor: pointer;
}


.cerrar {
    position: absolute;
    top: 20px; right: 40px;
    color: white;
    font-size: 30px;
    cursor: pointer;
}
.btn-aprobar {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 5px;
    cursor: pointer;
}
.btn-eliminar {
    background-color: #f44336;
    color: white;
    border: none;
    padding: 5px;
    cursor: pointer;
}
.foto-aprobada {
    font-size: 14px;
    color: green;
    font-weight: bold;
}

h5 {
    margin-top: 10px;
    font-weight: bold;
    color: #444;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
}

.botones-aprobacion {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.btn-accion {
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-accion.aprobar {
    background-color: #4CAF50;
    color: white;
}

.btn-accion.aprobar:hover {
    background-color: #45a049;
}

.btn-accion.eliminar {
    background-color: #e53935;
    color: white;
}

.btn-accion.eliminar:hover {
    background-color: #c62828;
}

.btn-ver-fotos:hover {
  background-color: #005999;
}

/* Reducir ancho de la columna "Código" */
.tabla-fotos td:nth-child(1),
.tabla-fotos th:nth-child(1) {
    width: 80px;
    text-align: center;
}

/* Reducir ancho de la columna "Ver Fotos" */
.tabla-fotos td:nth-child(3),
.tabla-fotos th:nth-child(3) {
    width: 120px;
    text-align: center;
}

/* Estilo del botón "Ver Fotos" */
.btn-ver-fotos {
  background-color: #00497a;
  color: white;
  font-size: 14px;
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;

  height: 36px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  min-width: 110px;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
}

.btn-ver-fotos:hover {
  background-color: #0061a8;
}

/* Ajustes de ancho por columna */
.tabla-observaciones th:nth-child(1),
.tabla-observaciones td:nth-child(1) {
    width: 80px;
    text-align: center;
}

.tabla-observaciones th:nth-child(2) {
    width: 300px;
}

.tabla-observaciones td:nth-child(2) {
    white-space: normal !important;
    word-break: break-word;
    max-width: 400px;
}

.tabla-observaciones th:nth-child(5),
.tabla-observaciones td:nth-child(5) {
    width: 140px;
    text-align: center;
}

/* Botón Ver completo */
.tabla-observaciones .btn-link {
    font-size: 14px;
    padding: 4px 10px;
    background-color: #00497a;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    margin-top: 5px;
}

.tabla-observaciones .btn-link:hover {
    background-color: #00325a;
}

/* Botón Ver / Registrar */
.tabla-observaciones .btn-sm {
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 6px;
}

.resumen-fechas-avance {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-left: 4px solid #007BFF;
    border-radius: 8px;
}

.bloque-fechas, .bloque-avance {
    flex: 1 1 220px;
}

.bloque-fechas h3,
.bloque-avance h3 {
    margin-bottom: 8px;
    font-size: 1.1rem;
    color: #333;
}

/* Estilos para tabla de documentos del proyecto */
.tabla-documentos th.col-tipo,
.tabla-documentos td.col-tipo {
    width: 220px;
}

.tabla-documentos th.col-descripcion,
.tabla-documentos td.col-descripcion {
    width: auto;
}

.tabla-documentos th.col-archivo,
.tabla-documentos td.col-archivo {
    width: 130px;
    text-align: center;
    white-space: nowrap;
}

.tabla-documentos th.col-fecha,
.tabla-documentos td.col-fecha {
    width: 110px;
    text-align: center;
    white-space: nowrap;
}

.grupo-botones-fotos {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

th.col-ver-fotos,
td.col-ver-fotos {
    width: 220px;
    min-width: 180px;
    text-align: center;
    white-space: nowrap;
}

.btn-descarga-overlay {
  position: absolute;
  bottom: 20px;
  right: 20px;
  background-color: rgba(0, 91, 148, 0.9);
  color: white;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  text-decoration: none;
  z-index: 10;
  transition: background 0.3s;
}

.btn-descarga-overlay:hover {
  background-color: rgba(0, 91, 148, 1);
}

.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-contenido {
    background: white;
    padding: 20px;
    border-radius: 10px;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 0 10px rgba(0,0,0,0.4);
}

.modal-contenido h2 {
    margin-top: 0;
}

/* ==== Columna Asignaciones ==== */
td.col-asignaciones,
th.col-asignaciones {
  white-space: normal !important;   /* permite que el texto se divida en varias líneas */
  word-wrap: break-word;
  overflow-wrap: anywhere;          /* rompe palabras muy largas si es necesario */
  vertical-align: top;
  max-width: 300px;                 /* límite opcional para que no se expanda demasiado */
}

/* Lista dentro de la celda Asignaciones */
td.col-asignaciones ul {
  margin: 0;
  padding-left: 18px; /* mantiene las viñetas ordenadas */
}

/* ==== Ajuste columna Rol ==== */
th.col-rol,
td.col-rol {
  width: 100px;           /* suficiente para "ingeniero" */
  max-width: 120px;
  text-align: center;     /* se verá más ordenado */
  white-space: nowrap;    /* evita que se parta la palabra */
}

/* Botones dentro de Acciones */
td.col-acciones .botones-acciones {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;          /* separación entre botones */
}

td.col-acciones .btn,
td.col-acciones .btn-eliminar {
  width: 100px;      /* ancho uniforme */
  font-size: 13px;
  height: 34px;
  line-height: 34px;
}

/* ===== TABLA ÍTEMS POR PROYECTO ===== */
.tabla-wrapper {
  width: 100%;
  overflow-x: auto;           /* evita romper móvil */
}

.tabla-items-proyecto {
  width: 100%;
  table-layout: fixed;        /* respeta los anchos del colgroup */
  border-collapse: collapse;
  font-size: 14px;
}

.tabla-items-proyecto th,
.tabla-items-proyecto td {
  padding: 8px 10px;
  vertical-align: top;
  white-space: normal;        /* permite quiebres donde aplique */
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.tabla-items-proyecto thead th {
  position: sticky;           /* encabezado fijo al hacer scroll */
  top: 0;
  z-index: 1;
}

/* Zebra */
.tabla-items-proyecto tbody tr:nth-child(odd) {
  background: #fbfdff;
}

/* ===== Anchos por columna ===== */
.tabla-items-proyecto col.col-codigo        { width: 80px; }
.tabla-items-proyecto col.col-descripcion   { width: 34%; }  /* la más ancha */
.tabla-items-proyecto col.col-unidad        { width: 70px; }
.tabla-items-proyecto col.col-cantidad      { width: 90px; }
.tabla-items-proyecto col.col-unitario      { width: 130px; }
.tabla-items-proyecto col.col-especificaciones { width: 18%; }
.tabla-items-proyecto col.col-observaciones { width: 18%; }
.tabla-items-proyecto col.col-acciones      { width: 120px; }

/* ===== Alineaciones específicas ===== */

/* CÓDIGO (columna 1) */
.tabla-items-proyecto tr > td:nth-of-type(1) {
  vertical-align: middle;     /* centrado vertical */
  text-align: center;         /* centrado horizontal */
  white-space: nowrap;
  padding-top: 8px;           /* restauramos el padding original */
  padding-bottom: 8px;
}

.tabla-items-proyecto tr > td:nth-of-type(1) .view-mode,
.tabla-items-proyecto tr > td:nth-of-type(1) .edit-mode {
  display: inline-block;
  line-height: normal;
}

/* UNIDAD (Columna 3) y CANTIDAD (Columna 4) */
.tabla-items-proyecto tr > td:nth-of-type(3),
.tabla-items-proyecto tr > td:nth-of-type(4) {
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
}

/* VR. UNITARIO (Columna 5) */
.tabla-items-proyecto tr > td:nth-of-type(5),
.tabla-items-proyecto thead th:nth-of-type(5) {
  text-align: right;
  white-space: nowrap;
}


/* ===== Columna Acciones compacta ===== */
.tabla-items-proyecto th.col-acciones,
.tabla-items-proyecto td.col-acciones {
  text-align: center;
  white-space: nowrap;
}

.tabla-items-proyecto td.col-acciones .botones-acciones {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.tabla-items-proyecto td.col-acciones .btn,
.tabla-items-proyecto td.col-acciones .btn.eliminar {
  width: 100px;
  height: 34px;
  line-height: 34px;
  font-size: 13px;
}

/* ===== Modo edición: inputs ocupan todo el ancho de su celda ===== */
.tabla-items-proyecto .edit-mode {
  width: 100%;
  box-sizing: border-box;
}

/* Fondo oscuro */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

/* Caja del modal */
.modal-contenido {
    background: #fff;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;   /* límite de altura */
    display: flex;
    flex-direction: column;
    overflow: hidden;   /* evita que se salga el contenido */
}

/* Encabezado */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #ddd;
    background: #f8f9fa;
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
}

/* Botón cerrar */
.btn-cerrar {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
}

/* Cuerpo con scroll */
.modal-body {
    padding: 16px;
    overflow-y: auto;
    flex: 1; /* ocupa espacio restante */
}

/* Footer fijo */
.modal-footer {
    padding: 12px 16px;
    border-top: 1px solid #ddd;
    text-align: right;
    background: #f8f9fa;
}

/* === Botones compactos para INP (cliente) === */
.acciones-inp {
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  white-space: nowrap;
}

.btn.btn-sm,
.btn-eliminar.btn-sm {
  height: 28px;          /* más bajitos */
  min-width: 72px;       /* más angostos */
  padding: 0 10px;       /* menos padding */
  font-size: 12px;       /* tipografía más pequeña */
  line-height: 1;
  border-radius: 9999px; /* pill */
}

/* Opcional: quitar ancho mínimo general de .btn dentro de acciones INP */
.acciones-inp .btn,
.acciones-inp .btn-eliminar {
  min-width: auto;
}

/* Un pelín de aire con el badge */
.col-estado .estado-badge { margin-bottom: 4px; }

#modal-comentario-inp-gestion .modal-content p { white-space: pre-wrap; }
#modal-comentario-inp-gestion.modal { z-index: 9999; }

/* === Toggle de contraseña: estilo escritorio === */
.login-container .input-password { position: relative; }

.login-container .input-password input[type="password"],
.login-container .input-password input[type="text"] {
  padding-right: 44px; /* espacio para el botón */
}

.login-container .toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  opacity: .75;
}

.login-container .toggle-password:hover { opacity: 1; }
.login-container .toggle-password:focus-visible {
  outline: 3px solid rgba(97,165,194,.35); /* #61A5C2 */
  outline-offset: 2px;
  border-color: rgba(97,165,194,.35);
}

/* Icono usando máscara SVG (ligero y consistente con el tema) */
.login-container .toggle-password::before {
  content: "";
  width: 20px; height: 20px;
  background-color: #0f2940; /* tono cercano a tu azul oscuro */
  mask: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M1 12s4-7 11-7 11 7 11 7-4 7-11 7-11-7-11-7Z'/><circle cx='12' cy='12' r='3'/></svg>") no-repeat center / contain;
}

/* Estado 'visible' (ojo tachado) */
.login-container .toggle-password.is-visible::before {
  mask: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 3l18 18'/><path d='M10.58 10.58a3 3 0 0 0 4.24 4.24'/><path d='M16.24 7.76A10.94 10.94 0 0 1 23 12s-4 7-11 7a10.94 10.94 0 0 1-5.09-1.41'/><path d='M1 1l7.76 7.76'/></svg>") no-repeat center / contain;
}



