.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #e0ecf8;
  padding: 0.3rem 0.8rem;
  border-radius: 6px;
  margin-bottom: 0.1rem;
}

.logo {
  max-height: 50px;
}

.titulo-hospital h1, .titulo-hospital h2 {
  font-size: 1.1rem;
  margin: 0.1rem 0;
}

.titulo-hospital {
  flex-grow: 1;
  text-align: center;
  color: var(--azul-institucional);
}

.usuario-info {
  text-align: right;
  font-size: 0.85rem;
  color: var(--texto);
}

/* Paleta institucional */
:root {
  --azul-institucional: #005baa;
  --azul-oscuro: #004080;
  --gris-claro: #f4f4f4;
  --blanco: #ffffff;
  --texto: #333333;
}

/* Fondo general */
body {
  font-family: Arial, sans-serif;
  background: linear-gradient(to bottom right, var(--gris-claro), #e0ecf8);
  padding: 0.8rem;
  color: var(--texto);
}

.main-content {
  margin-left: 220px;
  margin-right: 20px;
  padding: 10px 20px;
  position: relative;
  overflow: visible;
}

/* Fuerza que las celdas no se salgan */
#tablaCPC th,
#tablaCPC td {
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 0.85rem;
  padding: 6px 8px;
  max-width: 250px; /* 👈 límite para que no se disparen */
}



.table-container {
  padding-left: 20px;
  padding-right: 10px; 
  margin-top: 0.5rem;
}

.table-responsive {
  overflow-x: auto;
  width: 100%;
}

table td {
  white-space: nowrap;
  text-overflow: ellipsis;
}
.presupuesto-table th,
.presupuesto-table td {
  padding: 0.4rem;
  font-size: 0.85rem;
}

/* Contenedor de formularios */
.form-container {
  background-color: var(--blanco);
  border-radius: 8px;
  padding: 1.5rem;
  max-width: 500px;
  margin: auto;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* Campos de entrada */
input[type="text"],
input[type="password"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 0.6rem;
  margin-top: 0.4rem;
  margin-bottom: 0.8rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* Botones */
button {
  background-color: var(--azul-institucional);
  color: var(--blanco);
  font-weight: bold;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 4px;
  cursor: pointer;
}

button:hover {
  background-color: var(--azul-oscuro);
}

/* Títulos */
h1, h2{
  color: var(--azul-institucional);
  text-align: center;
  margin: 0.1rem 0;
  margin-top: 0.1rem;
  margin-bottom: 0.1rem;
}

h3 {
  margin-top: 0.1rem;
  margin-bottom: 0.1rem;
  text-align: center;
}

/* Logo institucional */
.logo {
  display: block;
  margin: 0 auto 1rem auto;
  max-width: 220px;
}

/* Enlaces */
a {
  color: var(--azul-institucional);
  text-decoration: none;
  font-weight: bold;
}

a:hover {
  text-decoration: underline;
}

/* Barra lateral */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 220px;
  height: 100%;
   background-color: #3e89cf;
  z-index: 1000;
}

.sidebar-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.sidebar-logo {
  max-width: 70px;
  margin-bottom: 0.2rem;
}

.sidebar-menu {
  list-style: none;
  padding: 0;
}

.sidebar-menu li {
  margin-bottom: 0.4rem;
}

.sidebar-menu a {
  color: white;
  text-decoration: none;
  font-weight: bold;
  display: block;
  padding: 0.3rem;
  font-size: 0.85rem;
  border-radius: 4px;
  transition: background 0.3s;
}

.sidebar-menu a:hover {
  background-color: #003f7d;
}

/* Dashboard */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.dashboard-card {
  background-color: var(--blanco);
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 1rem;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: transform 0.2s, box-shadow 0.2s;
  color: var(--texto);
}

.dashboard-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.dashboard-card.logout {
  background-color: #ffe5e5;
  border-color: #ffcccc;
}

/* Tabla */
.presupuesto-table {
  width: 100%;
  border-collapse: collapse;
}

.presupuesto-table th {
  background-color: #005baa;
  color: white;
  padding: 0.6rem;
  text-align: left;
}

.presupuesto-table td {
  padding: 0.6rem;
  border-bottom: 1px solid #ddd;
}

.presupuesto-table tr:nth-child(even) {
  background-color: #f9f9f9;
}

.presupuesto-table td:last-child {
  text-align: center;
}

.presupuesto-table .cup-asignado {
  color: green;
  font-weight: bold;
}

.presupuesto-table .cup-no {
  color: red;
  font-weight: bold;
}

button {
  background-color: var(--azul-institucional);
  color: var(--blanco);
  font-weight: bold;
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
}

button:hover {
  background-color: var(--azul-oscuro);
}

.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex; justify-content: center; align-items: center;
  z-index: 999;
}

.modal-content {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  width: 400px;
 
}

.cerrar-modal {
  position: absolute;
  top: 10px; right: 15px;
  cursor: pointer;
  font-size: 1.2rem;
}

#tablaCPC th,
#tablaCPC td {
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 0.85rem;
  padding: 0.4rem 0.6rem;
}

#tablaCPC_wrapper {
  overflow-x: auto; 
  
}

/* Evita que la primera columna quede oculta detrás de la sidebar */
.dtfc-fixed-left {
  left: 220px;
}


/* Estilos de celdas fijas */
.dtfc-fixed-left th,
.dtfc-fixed-left td {
    background: #f8f9fa; /* gris claro */
    z-index: 2;
}


#tablaCPC th:nth-child(1),
#tablaCPC td:nth-child(1) {
  min-width: 140px;
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#tablaCPC th:nth-last-child(3),
#tablaCPC td:nth-last-child(3) {
  width: 100px; /* Valor Ejecutado */
}

#tablaCPC th:nth-last-child(2),
#tablaCPC td:nth-last-child(2) {
  width: 90px; /* Código CPC */
}

#tablaCPC th:nth-last-child(1),
#tablaCPC td:nth-last-child(1) {
  width: 80px; /* Acción */
}

th {
  visibility: visible;
}
.dtfc-fixed-left th {
  overflow: visible;
}

#tablaCPC th:nth-child(1),
#tablaCPC td:nth-child(1) {
  min-width: 120px;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dtfc-fixed-left th,
.dtfc-fixed-left td {
  min-width: 100px;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#tablaCPC th:nth-child(4),
#tablaCPC td:nth-child(4) {
  min-width: 100px;
  max-width: 120px;
  text-align: center;
  white-space: nowrap;
}


    table.dataTable th, table.dataTable td {
        white-space: nowrap;          /* evita que los textos se partan */
        text-overflow: ellipsis;      /* muestra "..." si el texto es largo */
        overflow: hidden;
        max-width: 250px;             /* ancho máximo razonable por celda */
        vertical-align: middle;
    }

    table.dataTable {
        width: 100% !important;
    }

    .dataTables_wrapper {
        padding: 10px;
        font-size: 0.9rem;
    }

    /* Ajuste para pantallas pequeñas */
    @media (max-width: 992px) {
        table.dataTable th, table.dataTable td {
            white-space: normal;
            max-width: unset;
        }
    }

