/* ================================================================
   PORTAL - HOJA DE ESTILOS UNIFICADA
   Paleta: Fondo blanco, acentos verde (#4B8B4E) y amarillo (#F6E05E)
   ================================================================ */

/* ----------------------------------------------------------------
   VARIABLES DE COLOR
   ---------------------------------------------------------------- */
:root {
    --verde-principal: #4B8B4E;
    --verde-oscuro: #357038;
    --verde-claro: #E6F2E8;
    --verde-hover: #2D6B30;
    --amarillo: #F6E05E;
    --amarillo-oscuro: #D4AF00;
    --amarillo-claro: #FFFBDC;
    --blanco: #ffffff;
    --fondo: #f8f9fa;
    --fondo-alt: #f1f5f1;
    --borde: #E6F2E8;
    --texto-principal: #2D3748;
    --texto-secundario: #4A5568;
    --texto-muted: #718096;
    --sombra-suave: 0 4px 6px rgba(0,0,0,0.04);
    --sombra-hover: 0 12px 20px rgba(75, 139, 78, 0.12);
    --radio: 12px;
    --radio-lg: 16px;
    --radio-pill: 50px;
}

/* ----------------------------------------------------------------
   BASE
   ---------------------------------------------------------------- */
body, html {
    height: 100%;
}

body {
    background-color: var(--fondo);
    color: var(--texto-principal);
    background-image: none;
}

/* ----------------------------------------------------------------
   TIPOGRAFÍA
   ---------------------------------------------------------------- */
h1 {
    color: var(--verde-principal);
    font-weight: 700;
    text-shadow: none;
}

h2 {
    color: var(--verde-principal);
    font-weight: 600;
}

h3 {
    color: var(--texto-principal);
    font-weight: 600;
    text-shadow: none;
}

h4, h5 {
    color: var(--texto-principal);
    font-weight: 600;
}

p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--texto-secundario);
    margin: 0;
}

/* ----------------------------------------------------------------
   ENLACES
   ---------------------------------------------------------------- */
a {
    cursor: pointer;
    font-size: 14px;
    line-height: 1.7;
    color: var(--verde-principal);
    transition: color 0.3s;
}

    a:hover {
        color: var(--verde-hover);
        text-decoration: none;
    }

    a:focus {
        outline: none !important;
    }

/* ----------------------------------------------------------------
   TABLAS
   ---------------------------------------------------------------- */
th {
    background-color: var(--verde-principal);
    color: var(--blanco);
    font-weight: 600;
    padding: 10px 12px;
}

td {
    background-color: var(--blanco);
    color: var(--texto-principal);
    padding: 8px 12px;
}

tr:nth-child(even) td {
    background-color: var(--verde-claro);
}

tr:hover td {
    background-color: var(--amarillo-claro);
}

/* ----------------------------------------------------------------
   OVERRIDES BOOTSTRAP - texto primary / secondary
   ---------------------------------------------------------------- */
.text-primary {
    color: var(--verde-principal) !important;
}

.text-secondary {
    color: var(--texto-secundario) !important;
}

.text-muted {
    color: var(--texto-muted) !important;
}

.titulo-listado {
    font-weight: 500;
    font-size: 20px; 
    letter-spacing: 0.5px;
}
/* ----------------------------------------------------------------
   CONTENEDORES / BOXES
   ---------------------------------------------------------------- */
.box {
    background-color: var(--blanco);
    border: 1px solid var(--borde);
    border-radius: var(--radio-lg);
    padding: 20px;
    display: flex;
    box-shadow: var(--sombra-suave);
}

.box-modal {
    background-color: var(--blanco);
    border: 1px solid var(--borde);
    border-radius: var(--radio-lg);
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

/* ----------------------------------------------------------------
   CARDS DE ACCESO (panel principal post-login)
   ---------------------------------------------------------------- */
.card-acceso {
    background-color: var(--blanco);
    border: 1px solid var(--borde);
    border-radius: var(--radio-lg);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--sombra-suave);
    min-height: 200px;
}

    .card-acceso:hover {
        transform: translateY(-5px);
        box-shadow: var(--sombra-hover);
        border-color: var(--verde-principal);
    }

    .card-acceso img,
    .card-acceso .icono-verde {
        transition: transform 0.3s ease, filter 0.3s ease;
        max-height: 100%;
        max-width: 100%;
    }

.icono-verde {
    filter: invert(56%) sepia(68%) saturate(450%) hue-rotate(95deg) brightness(102%) contrast(101%);
}

.card-acceso:hover .icono-verde {
    filter: invert(40%) sepia(85%) saturate(1200%) hue-rotate(110deg) brightness(95%) contrast(105%);
    transform: scale(1.1);
}

/* Título del acceso dentro de la card */
.box-acceso {
    background-color: var(--blanco);
    border: 1px solid var(--borde);
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: var(--radio-lg);
    width: 300px;
    height: 200px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--texto-principal);
    transition: all 0.3s;
    box-shadow: var(--sombra-suave);
}

    .box-acceso:hover {
        background-color: var(--verde-claro);
        border-color: var(--verde-principal);
        box-shadow: var(--sombra-hover);
    }

/* ----------------------------------------------------------------
   BOTONES
   ---------------------------------------------------------------- */

.btn {
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 12px; 
    padding: 8px 20px;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}


.btn-success {
    background-color: var(--verde-principal) !important;
    color: var(--blanco) !important;
    font-weight: 700;
    border-radius: var(--radio);
    transition: all 0.2s ease-in-out;
}

    .btn-success:hover, .btn-success:focus {
        background-color: var(--verde-oscuro) !important;
        transform: translateY(-1px);
    }

.btn-warning {
    background-color: var(--amarillo) !important;
    color: var(--texto-principal) !important;
    font-weight: 700;
    border-radius: var(--radio);
    transition: all 0.2s ease-in-out;
}

    .btn-warning:hover, .btn-warning:focus {
        background-color: var(--amarillo-oscuro) !important;
        color: var(--blanco) !important;
        transform: translateY(-1px);
    }


.btn-primary {
    background-color: var(--verde-oscuro) !important;
    color: var(--blanco) !important;
    font-weight: 700;
    border-radius: var(--radio);
}

.btn-fa {
    background-color: rgba(75, 139, 78, 0.1) !important;
    border-radius: var(--radio-pill) !important;
    color: var(--verde-principal) !important;
    font-size: 14px;
    padding: 8px 15px;
    transition: all 0.3s;
}

    .btn-fa:hover {
        background-color: rgba(75, 139, 78, 0.25) !important;
        color: var(--verde-hover) !important;
    }
/* ----------------------------------------------------------------
   FORMULARIOS
   ---------------------------------------------------------------- */
.form-control {
    border: 1px solid #CBD5E0;
    border-radius: 8px;
    color: var(--texto-principal);
    background-color: var(--blanco);
    transition: border-color 0.2s, box-shadow 0.2s;
}

    .form-control:focus {
        border-color: var(--verde-principal);
        box-shadow: 0 0 0 3px rgba(75, 139, 78, 0.15);
        outline: none;
    }

.form-group label,
.form-group span {
    color: var(--texto-principal);
}


.has-error .form-control {
    border-color: #E53E3E;
}

    .has-error .form-control:focus {
        box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.15);
    }

/* ----------------------------------------------------------------
   MODAL
   ---------------------------------------------------------------- */
.modal-backdrop {
    opacity: .4;
    z-index: 999999;
}

.modal-content {
    border-radius: var(--radio-lg);
    border: 1px solid var(--borde);
    box-shadow: 0 10px 40px rgba(0,0,0,0.12);
}

.modal-header {
    background-color: var(--verde-claro);
    border-bottom: 1px solid var(--borde);
    border-radius: var(--radio-lg) var(--radio-lg) 0 0;
}

    .modal-header .modal-title {
        color: var(--verde-principal);
        font-weight: 700;
    }

.modal-footer {
    border-top: 1px solid var(--borde);
}


.modal-xlg .modal-dialog {
    width: 95% !important;
    max-width: 1600px !important; 
}


.modal-xlg .modal-body {
    padding: 15px;
    overflow-x: hidden;
}

.table-responsive-custom {
    width: 100%;
    overflow-x: auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.tabla-usuarios {
    min-width: 900px;
    margin-bottom: 0;
}

    .tabla-usuarios thead th {
        background: var(--verde-principal);
        color: var(--blanco);
        font-weight: 600;
        padding: 12px;
        border: none;
        white-space: nowrap;
    }


    .tabla-usuarios td {
        padding: 10px 12px;
        vertical-align: middle;
        border-top: 1px solid #f1f1f1;
        white-space: nowrap;
    }

.acciones-col {
    width: 200px;
}

.acciones-btns {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

    .acciones-btns img {
        width: 20px;
        height: 20px;
    }

.tabla-usuarios-wrapper {
    margin-top: 20px;
}

@media (max-width: 767px) {
    .tabla-usuarios-wrapper {
        margin-top: 60px;
    }
}


/* ----------------------------------------------------------------
   ALERTAS / NOTIFICACIONES
   ---------------------------------------------------------------- */
.alert-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
}

.alert-success {
    background-color: var(--verde-claro);
    border-color: var(--verde-principal);
    color: var(--verde-oscuro);
}

.alert-warning {
    background-color: var(--amarillo-claro);
    border-color: var(--amarillo-oscuro);
    color: #7B6200;
}

.alert-info {
    background-color: #EBF8FF;
    border-color: #90CDF4;
    color: #2B6CB0;
}
/* ----------------------------------------------------------------
   NAVBAR / HEADER
   ---------------------------------------------------------------- */
.navbar {
    background-color: var(--blanco);
    border-bottom: 3px solid var(--amarillo);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.navbar-brand {
    color: var(--verde-principal) !important;
    font-weight: 700;
    font-size: 18px;
}

.navbar-nav > li > a {
    color: var(--texto-principal) !important;
    font-weight: 600;
    transition: color 0.2s;
}

    .navbar-nav > li > a:hover,
    .navbar-nav > li.active > a {
        color: var(--verde-principal) !important;
        border-bottom: 2px solid var(--amarillo);
    }

/* ----------------------------------------------------------------
   HEADER PRINCIPAL (usuario logueado)
   ---------------------------------------------------------------- */
.main-header {
    background-color: #4B8B4E;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.header-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    box-sizing: border-box;
}

/* --- Identidad Visual --- */
.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0; /* permite que el texto se recorte si es necesario */
}

.logo-container {
    height: 44px;
    width: 44px;
    min-width: 44px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    overflow: hidden;
}

    .logo-container img {
        max-height: 100%;
        max-width: 100%;
        object-fit: contain;
    }

.brand-text {
    display: flex;
    flex-direction: column;
    color: white;
    min-width: 0;
}

.brand-sub {
    font-size: 11px;
    opacity: 0.8;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-main {
    font-size: 17px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Acciones y Botones --- */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.button-group {
    display: flex;
    gap: 6px;
}

.btn-header-yellow {
    background-color: #F6E05E;
    color: #2D3748;
    border: none;
    padding: 7px 13px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
}

    .btn-header-yellow:hover {
        background-color: #ECC94B;
        transform: translateY(-1px);
    }

.btn-header-white {
    background-color: white;
    color: #4B8B4E;
    border: none;
    padding: 7px 13px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
}

    .btn-header-white:hover {
        background-color: #f0f0f0;
    }

.user-pill {
    background: rgba(255,255,255,0.15);
    padding: 5px 12px;
    border-radius: 20px;
    color: white;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 7px;
    border: 1px solid rgba(255,255,255,0.25);
    white-space: nowrap;
    overflow: hidden;
    max-width: 180px;
}

.user-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ----------------------------------------------------------------
   RESPONSIVE
   ---------------------------------------------------------------- */

/* Tablet: ocultamos texto de botones, achicamos brand */
@media (max-width: 900px) {
    .brand-main {
        font-size: 14px;
    }

    .brand-sub {
        font-size: 10px;
    }

    .btn-text {
        display: none;
    }

    .btn-header-yellow,
    .btn-header-white {
        padding: 7px 10px;
    }

    .user-pill {
        max-width: 130px;
    }
}

/* Mobile: dos filas, compacto */
@media (max-width: 600px) {
    .header-container {
        flex-direction: column;
        align-items: stretch;
        padding: 10px 14px;
        gap: 8px;
    }

    .header-brand {
        justify-content: flex-start;
    }

    .brand-main {
        font-size: 13px;
    }

    .brand-sub {
        font-size: 10px;
    }

    .header-actions {
        justify-content: space-between;
        width: 100%;
    }

    .button-group {
        gap: 5px;
    }

    .btn-header-yellow,
    .btn-header-white {
        padding: 6px 10px;
        font-size: 12px;
        border-radius: 6px;
    }

    .btn-text {
        display: none;
    }

    .user-pill {
        max-width: 120px;
        padding: 5px 10px;
        font-size: 12px;
    }
}
/* ----------------------------------------------------------------
   SECCIÓN HEADING CON ACENTO AMARILLO
   (usado en el login de organismos)
   ---------------------------------------------------------------- */
.section-heading {
    color: var(--verde-principal);
    font-weight: 700;
    border-left: 5px solid var(--amarillo);
    padding-left: 15px;
    margin-bottom: 25px;
    text-transform: uppercase;
    font-size: 16px;
    letter-spacing: 1px;
}

/* ----------------------------------------------------------------
   PANEL / CARD GENÉRICO
   ---------------------------------------------------------------- */
.panel {
    border: 1px solid var(--borde);
    border-radius: var(--radio-lg);
    box-shadow: var(--sombra-suave);
}

.panel-heading {
    background-color: var(--verde-claro);
    color: var(--verde-principal);
    font-weight: 700;
    border-radius: var(--radio-lg) var(--radio-lg) 0 0;
    border-bottom: 1px solid var(--borde);
}

.panel-default > .panel-heading {
    background-color: var(--verde-claro);
    color: var(--verde-principal);
    border-color: var(--borde);
}

/* ----------------------------------------------------------------
   HIGHLIGHT / BADGE / ETIQUETAS
   ---------------------------------------------------------------- */
.badge {
    background-color: var(--verde-principal);
    color: var(--blanco);
    border-radius: var(--radio-pill);
}

.label-primary,
.badge-primary {
    background-color: var(--verde-principal);
}

.label-warning,
.badge-warning {
    background-color: var(--amarillo);
    color: var(--texto-principal);
}

/* ----------------------------------------------------------------
   IMPRESIÓN
   ---------------------------------------------------------------- */
.imprimible {
    display: none;
}

@media print {
    .imprimible {
        display: block !important;
    }

    .no-imprimible {
        display: none;
    }

    body {
        background-color: white;
    }
}

/* ----------------------------------------------------------------
   ANIMACIÓN DE ENTRADA
   ---------------------------------------------------------------- */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}
/* =========================
   MODAL – BASE MODERNA
   ========================= */

.modal-content-custom {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    padding: 0;
}

/* HEADER */
.modal-header-custom {
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

    .modal-header-custom h3,
    .modal-header-custom h4 {
        margin: 0;
        font-weight: 500;
        letter-spacing: 0.3px;
        color: var(--verde-principal);
    }

/* BODY */
.modal-body-custom {
    padding: 20px;
}

/* FOOTER */
.modal-footer-custom {
    padding: 14px 20px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background-color: #fafafa;
    border-radius: 0 0 10px 10px;
}

/* ----------------------------------------------------------------
   RESPONSIVE
   ---------------------------------------------------------------- */
@media (max-width: 768px) {
    .box-acceso {
        width: 100%;
        height: 140px;
    }

    .card-acceso {
        min-height: 160px;
        padding: 20px 15px;
    }

}




/* Selector de tipo de registro */
.registro-opciones {
    margin-bottom: 25px;
}

.registro-opciones-titulo {
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.registro-opciones-botones {
    display: flex;
    gap: 12px;
}

.registro-opcion {
    flex: 1;
    padding: 14px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    background: #fff;
    transition: all 0.25s ease;
    font-weight: 500;
}

    .registro-opcion.active {
        background: #4B8B4E;
        color: #fff;
        border-color: #4B8B4E;
    }

@media (max-width: 767px) {
    .registro-opciones-botones {
        flex-direction: column;
    }

    .registro-opcion {
        width: 100%;
    }
}


.footer-registro {
    display: flex;
    align-items: center;
    gap: 20px;
}

.footer-left {
    flex: 1;
}

.footer-actions {
    display: flex;
    gap: 10px;
    margin-left: auto; 
}


@media (max-width: 767px) {
    .footer-registro {
        flex-wrap: wrap;
    }

    .footer-left {
        width: 100%;
        order: 1;
    }

    .footer-actions {
        width: 100%;
        order: 2;
        justify-content: flex-end;
    }

        .footer-actions .btn {
            min-width: 120px;
        }
}
