/* GENERAL */
body {
    overflow-x: hidden;
    font-family: 'Montserrat', 'Poppins', sans-serif;
}

/* NAVBAR-- Encabezado  */
.bg-maroon {
    background-color: #9F2241 !important;
    padding-top: 20px;
    padding-bottom: 20px;
}

header.navbar {
  position: sticky;
  top: 0;
  z-index: 1200 !important;
  background-color: #861F41;
  box-shadow: 0 8px 6px rgba(9, 9, 9, 0.23);
}

.navbar {
    padding: 20px 40px;
    position: relative;
}

/* Contenedor del header: en escritorio que NO se parta en varias filas */
header.navbar .container-fluid{
  flex-wrap: nowrap !important;
}

/* En móvil dejamos que se acomode en 2 filas */
@media (max-width: 991.98px){
  header.navbar .container-fluid{
    flex-wrap: wrap !important;
  }
}

/* Contenedor del título al centro, flexible */
.navbar-title-wrap{
  flex: 1 1 auto;
  min-width: 0;               /* NECESARIO para que ellipsis funcione */
  padding: 0 .75rem;
  text-align: center;
}

/* Título del sistema */
.navbar-title {
    color: #ffffff;
    font-weight: 800;
    font-family: 'Montserrat', 'Poppins', sans-serif;
    letter-spacing: 0.5px;

    /* Tamaño responsivo controlado */
    font-size: clamp(1.2rem, 0.9vw + 1.2rem, 2rem);

    /* Que no crezca infinito: cortamos con … si es muy largo */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    margin: 0;
}

/* Logo encabezado: un poco más grande en escritorio */
.navbar-logo {
    max-height: 50px;          /* antes 75px */
    max-width: 100%;
    width: auto;
    height: auto;
    transition: all 0.3s ease;
    flex-shrink: 0;            /* que no se encoja si falta espacio */
}

/* Contenedor de los botones de usuario (Administrar cuenta) no se encoge */
.navbar-buttons{
  flex-shrink: 0;
}

/* Menú colapsable */
.navbar-collapse {
    justify-content: flex-end;
}

/* BOTONES dorados globales */
.btn {
  background-color: #BC965C !important;
  color: #ffffff !important;
  border: none;
  font-weight: 600;
  padding: 10px 20px;
  transition: background-color 0.3s ease;
  font-family: 'Montserrat', 'Poppins', sans-serif;
}

/* HOVER GENERAL: dorado oscuro (NO vino) */
.btn:hover,
.btn:focus {
  background-color: #a67c45 !important; /* Dorado oscuro */
  color: #ffffff !important;
}

/* Botones base en vino (estáticos) */
.btn-outline-light,
.btn-light,
.btn-secondary,
.btn-danger {
  background-color: #7D1313 !important; /* Vino base */
  color: #ffffff !important;
  border: none !important;
}

/* HOVER en vino SOLO para estos */
.btn-outline-light:hover,
.btn-light:hover,
.btn-secondary:hover,
.btn-danger:hover {
  background-color: #A33B3B !important; /* Vino más claro */
  color: #ffffff !important;
}

/* (Opcional) Botón “Administrar cuenta” en vino */
.btn-admin {
  background-color: #7D1313 !important;
  color: #fff !important;
  border-radius: 20px;
}
.btn-admin:hover,
.btn-admin:focus {
  background-color: #A33B3B !important;
  color: #fff !important;
}

/* SIDEBAR */
.sidebar-bg {
    background: #D7BA99;
    padding-top: 1rem;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* ==== BOTONES DEL MENÚ LATERAL ==== */
.sidebar-bg .nav-link {
    background-color: #ffffff;
    border-left: 6px solid #a06b2c;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333 !important;
    transition: all 0.25s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
    text-decoration: none;
    display: block;
    font-family: 'Montserrat', 'Poppins', sans-serif;
}

.sidebar-bg .nav-link:hover {
    background-color: #fef1f0;
    border-left-color: #760603;
    color: #760603 !important;
    transform: translateX(2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.sidebar-bg .nav-link:focus,
.sidebar-bg .nav-link.active {
    background-color: #fcebea;
    border-left-color: #760603;
    color: #760603 !important;
    font-weight: 700;
}

/* Íconos */
.bi-pencil-square {
    font-size: 1.5rem;
}

/* FOOTER */
footer {
    background: #E9E8E8;
    color: #861F41;
    padding: 30px 15px;
    text-align: center;
    width: 100%;
    border-top: 2px solid #ccc;
    box-shadow: inset 0 3px 10px rgba(0, 0, 0, 0.07);
    position: relative;
    font-family: 'Montserrat', 'Poppins', sans-serif;
}

footer .container {
    max-width: 100%;
    padding: 0;
}

footer i {
    color: #BC965C;
    text-decoration: none;
    font-weight: 500;
}

footer a:hover {
    text-decoration: underline;
    color: #8a6d3b;
}

footer p {
    margin-bottom: 8px;
}

footer small {
    font-size: 0.85rem;
}

/* RESPONSIVE DESIGN */
@media (max-width: 991.98px) {
    .navbar-title {
        font-size: 22px;
        text-align: center;
        width: 100%;
        margin-bottom: 10px;

        /* En móvil sí dejamos que se parta en 2 líneas si hace falta */
        white-space: normal;
        text-overflow: clip;
    }

    .navbar-logo {
        max-height: 50px;   /* un poquito más grande que antes (50) */
        margin: 0 auto;
    }

    .navbar-buttons {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        margin-top: 15px;
    }

    .dropdown {
        display: block !important;
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 576px) {
    /* Compactar encabezado en móviles y evitar que se “corte” */
    .bg-maroon {
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .navbar {
        padding: 6px 10px;
    }

    .navbar-title {
        font-size: 18px;
        text-align: center;
        line-height: 1.1;
    }

    .navbar-logo {
        max-height: 40px;
    }

    footer {
        padding: 20px 10px;
        font-size: 0.85rem;
    }
}

body,
main {
    margin: 0;
    padding: 0;
}

main.flex-grow-1 {
    padding-top: 0 !important;
    margin-top: 0;
    min-height: calc(100vh - 160px);
}

/* Estilos acordeon item */
.accordion-item {
  border: 1px solid #7d1625;
  border-radius: 0.5rem;
  overflow: hidden;
  margin-bottom: 1rem;
}

.accordion-button {
  background-color: #f8eaea;
  color: #7d1625;
  font-weight: 600;
}

.accordion-button:not(.collapsed) {
  background: linear-gradient(90deg, #7d1625, #a01f2f);
  color: white;
  box-shadow: none;
}

.accordion-button:focus {
  box-shadow: none;
  border-color: #7d1625;
}

.accordion-body {
  background-color: #fff; /* Contenido blanco para contraste */
  color: #333;
}

.accordion .badge {
  font-size: 0.8rem;
}

.accordion-button:hover {
  filter: brightness(1.08);
  transition: all 0.3s ease-in-out;
}

/* ESTILOS TABLAS MIS ACCIONES */
table.table {
  border: 1px solid #7d1625;
  border-radius: 0.5rem;
  overflow: hidden;
  background-color: #fff;
}

table.table th {
  background-color: #f8f9fa;
  color: #7d1625;
  font-weight: 600;
  border: 1px solid #ddd;
  text-align: center;
}

table.table td {
  vertical-align: middle;
  border: 1px solid #eee;
  padding: 0.75rem;
  font-size: 0.95rem;
}

.badge {
  font-size: 0.8rem;
  padding: 0.4em 0.6em;
  border-radius: 1rem;
}

.btn-outline-info {
  border-color: #BC965C;
  color: #7d1625;
  font-weight: 500;
}

.btn-outline-info:hover {
  background-color: #BC965C;
  color: white;
}

.btn-warning {
  background-color: #BC965C;
  color: white;
  font-weight: 500;
  border: none;
}

.btn-warning:hover {
  background-color: #a37f4c;
}

/* ESTILOS HISTORIAL DE AVANCES */
.card-toggle {
  border: 1px solid #7d1625;
  border-radius: 0.75rem;
  background-color: #f8f9fa;
  box-shadow: none;
  overflow: hidden;
}

.card-header {
  background-color: #f8f9fa;
  color: #7d1625;
  font-weight: 600;
  border-radius: 0.75rem 0.75rem 0 0;
  padding: 0.8rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.info-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-toggle {
  background-color: #BC965C;
  color: white;
  font-weight: bold;
  padding: 0.4rem 1rem;
  border-radius: 0.5rem;
  transition: background-color 0.2s ease-in-out;
  font-size: 0.9rem;
}

.btn-toggle:hover {
  background-color: #a37f4c;
}

.badge-avance {
  background-color: #fce9ea;
  color: #7d1625;
}

.card-body {
  background-color: #fdf9f3;
  padding: 1rem 1.5rem;
  border-radius: 0 0 0.75rem 0.75rem; /* Parte de abajo */
}

.col-evidencias {
  min-width: 180px;
  white-space: normal;
}

/* MODALES por encima del header */
.modal-backdrop {
  z-index: 1040 !important;
}

.modal,
.modal-dialog {
  z-index: 1050 !important;
}

/* En móviles: que los modals tapen también el encabezado */
@media (max-width: 991.98px){
  header.navbar{
    position: static;          /* deja de ser sticky */
    z-index: 0 !important;     /* por debajo de modal/backdrop */
  }
}
