/*
 * Estilos propios de VACONT sobre Bootstrap 5.
 * Los colores se definen una sola vez como variables y el resto del
 * archivo los usa, para mantener el mismo aspecto en todas las pantallas.
 */

:root {
    --vc-navy: #0b2265;          /* menu lateral, pie de pagina */
    --vc-navy-2: #15307f;
    --vc-primary: #1d4ed8;       /* botones y enlaces principales */
    --vc-primary-dark: #1e3a8a;
    --vc-success: #15803d;       /* boton "Consultar" */
    --vc-success-dark: #166534;
    --vc-bg: #f4f6fa;            /* fondo de la aplicacion */
    --vc-border: #e4e7ec;
    --vc-text: #101828;
    --vc-muted: #475467;         /* texto secundario: cumple contraste 4.5:1 sobre blanco */
    --vc-danger-bg: #fee4e2;
    --vc-danger-text: #b42318;
    --vc-ok-bg: #dcfae6;
    --vc-ok-text: #067647;
    --vc-warn-bg: #fef0c7;
    --vc-warn-text: #93370d;
    --vc-radius: 12px;

    --bs-body-font-family: Roboto, "Segoe UI", Arial, sans-serif;
    --bs-body-color: var(--vc-text);
    --bs-link-color: var(--vc-primary);
    --bs-link-color-rgb: 29, 78, 216;
    --bs-link-hover-color: var(--vc-primary-dark);
    --bs-link-hover-color-rgb: 30, 58, 138;
    --bs-secondary-color: var(--vc-muted);
}

body {
    background: var(--vc-bg);
}

/* ---------- Botones ---------- */

.btn {
    --bs-btn-padding-y: .625rem;
    --bs-btn-padding-x: 1.25rem;
    --bs-btn-font-weight: 500;
    --bs-btn-border-radius: 8px;
}

.btn-primary {
    --bs-btn-bg: var(--vc-primary);
    --bs-btn-border-color: var(--vc-primary);
    --bs-btn-hover-bg: var(--vc-primary-dark);
    --bs-btn-hover-border-color: var(--vc-primary-dark);
    --bs-btn-active-bg: var(--vc-primary-dark);
    --bs-btn-active-border-color: var(--vc-primary-dark);
    --bs-btn-disabled-bg: var(--vc-primary);
    --bs-btn-disabled-border-color: var(--vc-primary);
}

.btn-success {
    --bs-btn-bg: var(--vc-success);
    --bs-btn-border-color: var(--vc-success);
    --bs-btn-hover-bg: var(--vc-success-dark);
    --bs-btn-hover-border-color: var(--vc-success-dark);
    --bs-btn-active-bg: var(--vc-success-dark);
    --bs-btn-active-border-color: var(--vc-success-dark);
}

/* ---------- Formularios ---------- */

.form-label {
    font-weight: 500;
    font-size: .9375rem;
}

.form-control {
    padding: .625rem .875rem;
    border-color: #d0d5dd;
    border-radius: 8px;
}

.form-control:focus {
    border-color: var(--vc-primary);
    box-shadow: 0 0 0 .2rem rgba(29, 78, 216, .2);
}

/* misma altura que los campos de texto */
.form-select {
    padding: .625rem 2.25rem .625rem .875rem;
    border-color: #d0d5dd;
    border-radius: 8px;
}

/* mas claro que el texto escrito para que no parezca un valor ya ingresado */
.form-control::placeholder {
    color: #667085;
}

/* boton que se ve como un enlace dentro de un texto (ej. abrir una ventana legal) */
.vc-inline-link {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: var(--vc-primary);
    text-decoration: underline;
}

.vc-inline-link:hover {
    color: var(--vc-primary-dark);
}

/* mensajes de jquery-validate */
.form-control.is-invalid ~ .invalid-feedback,
em.invalid-feedback {
    display: block;
    font-style: normal;
}

/* ---------- Tarjetas ---------- */

.vc-card {
    background: #fff;
    border: 1px solid var(--vc-border);
    border-radius: var(--vc-radius);
}

/* ---------- Paginas publicas (login, recuperar contrasena) ---------- */

.vc-public {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #eef3fa;
    /* image-set elige la version webp si el navegador la soporta */
    background-image: url("/static/images/login-hero.jpg");
    background-image: image-set(
        url("/static/images/login-hero.webp") type("image/webp"),
        url("/static/images/login-hero.jpg") type("image/jpeg"));
    background-size: cover;
    background-position: center right;
}

.vc-public-main {
    flex: 1 0 auto;
    display: flex;
    align-items: center;
    padding: 3rem 0;
}

.vc-public-logos img {
    height: 56px;
    width: auto;
}

.vc-public-brand {
    width: min(340px, 80%);
    height: auto;
}

.vc-public-subtitle {
    font-size: 1.25rem;
    color: var(--vc-muted);
}

.vc-public-title {
    font-size: clamp(1.5rem, 2.6vw, 2rem);
    font-weight: 500;
    line-height: 1.3;
    color: var(--vc-navy);
    max-width: 30ch;
}

.vc-info-note {
    display: flex;
    gap: .75rem;
    max-width: 30rem;
    padding: 1rem 1.125rem;
    border: 1px solid var(--vc-border);
    border-radius: var(--vc-radius);
    background: rgba(255, 255, 255, .85);
    font-size: .875rem;
    line-height: 1.5;
    color: var(--vc-muted);
}

.vc-info-note .bi {
    font-size: 1.25rem;
    color: var(--vc-primary);
    line-height: 1.2;
}

.vc-auth-card {
    background: #fff;
    border-radius: var(--vc-radius);
    box-shadow: 0 12px 32px rgba(16, 24, 40, .14);
    padding: 2rem;
}

.vc-auth-card h2 {
    font-size: 1.5rem;
    font-weight: 500;
}

/* enlaces sueltos de la tarjeta (olvido su contrasena, volver): subrayado solo al pasar el cursor */
.vc-auth-card a {
    text-decoration: none;
}

.vc-auth-card a:hover {
    text-decoration: underline;
}

/* en pantallas pequenas la foto queda detras de un velo claro para que el texto se lea */
@media (max-width: 991.98px) {
    .vc-public {
        background-image: linear-gradient(rgba(238, 243, 250, .88), rgba(238, 243, 250, .88)), url("/static/images/login-hero.jpg");
        background-image: linear-gradient(rgba(238, 243, 250, .88), rgba(238, 243, 250, .88)),
            image-set(url("/static/images/login-hero.webp") type("image/webp"),
                      url("/static/images/login-hero.jpg") type("image/jpeg"));
    }
}

/* ---------- Estructura de la aplicacion (menu lateral + barra superior) ---------- */

.vc-app {
    display: flex;
    min-height: 100vh;
}

/* en pantallas grandes el menu es fijo; en pequenas es un panel deslizable (offcanvas-lg) */
.vc-sidebar {
    --bs-offcanvas-width: 280px;
    --bs-offcanvas-bg: var(--vc-navy);
    --bs-offcanvas-color: #fff;
    color: #fff;
}

/* en pantallas grandes Bootstrap fuerza fondo transparente en offcanvas-lg,
   por eso el fondo azul y la posicion fija van en este contenedor */
@media (min-width: 992px) {
    .vc-sidebar-shell {
        width: 248px;
        flex-shrink: 0;
        position: sticky;
        top: 0;
        height: 100vh;
        overflow-y: auto;
        background: var(--vc-navy);
    }

    .vc-sidebar {
        min-height: 100%;
    }

    .vc-sidebar .offcanvas-body {
        min-height: 100vh;
    }
}

.vc-sidebar .offcanvas-body {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem 1rem;
    width: 100%;
}

.vc-sidebar-logo {
    height: 40px;
    width: auto;
    margin: 0 .75rem;
    /* el menu es una columna flex: sin esto la imagen se estira a todo el ancho */
    align-self: flex-start;
}

.vc-role {
    padding: .75rem;
    border-radius: 10px;
    background: var(--vc-navy-2);
    font-size: .8125rem;
    line-height: 1.5;
}

.vc-role-label {
    color: #c7d2fe;
}

.vc-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.vc-nav-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-height: 44px;
    padding: .625rem .75rem;
    border-radius: 8px;
    color: #e0e7ff;
    text-decoration: none;
    font-size: .9375rem;
}

.vc-nav-link .bi {
    font-size: 1.125rem;
}

.vc-nav-link:hover {
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

.vc-nav-link.active {
    background: var(--vc-primary-dark);
    color: #fff;
    font-weight: 500;
}

.vc-subnav {
    list-style: none;
    margin: .25rem 0 0;
    padding: 0 0 0 2.25rem;
}

.vc-subnav a {
    display: flex;
    align-items: center;
    min-height: 40px;
    color: #c7d2fe;
    text-decoration: none;
    font-size: .875rem;
}

.vc-subnav a:hover {
    color: #fff;
}

.vc-sidebar-footer {
    margin-top: auto;
    padding: 1rem .75rem 0;
    border-top: 1px solid #2a4494;
    font-size: .75rem;
    line-height: 1.5;
    color: #c7d2fe;
}

.vc-content {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.vc-topbar {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-height: 64px;
    padding: .5rem 1.5rem;
    background: #fff;
    border-bottom: 1px solid var(--vc-border);
}

.vc-topbar .btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--vc-text);
    font-size: 1.375rem;
}

.vc-topbar .btn-icon:hover {
    background: var(--vc-bg);
}

.vc-main {
    width: 100%;
    max-width: 1200px;
    padding: 2rem 1.5rem;
}

@media (min-width: 992px) {
    .vc-main {
        padding: 2rem 2.5rem;
    }
}

.vc-page-title {
    font-size: 1.75rem;
    font-weight: 500;
    margin: 0;
}

.vc-legal-links {
    margin-top: auto;
    padding: 1.5rem;
    font-size: .8125rem;
    color: var(--vc-muted);
}

/* ---------- Indicador de SIGA ---------- */

.vc-siga {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    padding: .375rem .75rem;
    border-radius: 999px;
    font-size: .8125rem;
    font-weight: 500;
    white-space: nowrap;
    background: #f2f4f7;
    color: var(--vc-muted);
}

.vc-siga.is-ok {
    background: var(--vc-ok-bg);
    color: var(--vc-ok-text);
}

.vc-siga.is-down {
    background: var(--vc-danger-bg);
    color: var(--vc-danger-text);
}

/* ---------- Tarjetas de accion del dashboard ---------- */

.vc-action-card {
    height: 100%;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.vc-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    font-size: 1.5rem;
    color: #fff;
}

.vc-icon-primary {
    background: var(--vc-primary);
}

.vc-icon-success {
    background: var(--vc-success);
}

.vc-action-card h2 {
    font-size: 1.125rem;
    font-weight: 500;
    margin: 0 0 .25rem;
}

/* zona de arrastrar y soltar: el input file real queda oculto pero accesible por su etiqueta */
.vc-dropzone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    padding: 1.5rem 1rem;
    border: 2px dashed #b9c3d6;
    border-radius: 10px;
    background: #f8fafc;
    text-align: center;
    color: var(--vc-muted);
    transition: border-color .15s, background-color .15s;
}

.vc-dropzone .bi-cloud-arrow-up {
    font-size: 2rem;
    color: var(--vc-primary);
}

.vc-dropzone.is-dragover {
    border-color: var(--vc-primary);
    background: #eef2ff;
}

.vc-dropzone.has-file {
    border-style: solid;
    border-color: var(--vc-primary);
    background: #fff;
}

/* sin SIGA: la zona se ve apagada y no acepta archivos */
.vc-dropzone.is-disabled {
    opacity: .55;
    cursor: not-allowed;
}

.vc-dropzone.is-disabled .vc-file-label {
    pointer-events: none;
}

.vc-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}

.vc-file-input:focus-visible + .vc-file-label {
    outline: 3px solid rgba(29, 78, 216, .4);
    outline-offset: 2px;
}

.vc-file-name {
    font-weight: 500;
    color: var(--vc-text);
    word-break: break-all;
}

/* ---------- Etiquetas de estado ---------- */

.vc-pill {
    display: inline-block;
    padding: .25rem .625rem;
    border-radius: 999px;
    font-size: .8125rem;
    font-weight: 500;
    white-space: nowrap;
}

.vc-pill-danger {
    background: var(--vc-danger-bg);
    color: var(--vc-danger-text);
}

.vc-pill-ok {
    background: var(--vc-ok-bg);
    color: var(--vc-ok-text);
}

.vc-pill-neutral {
    background: #f2f4f7;
    color: var(--vc-muted);
}

/* ---------- Tablas ---------- */

.vc-table {
    --bs-table-bg: transparent;
    margin: 0;
    font-size: .875rem;
}

.vc-table th {
    font-size: .8125rem;
    font-weight: 500;
    color: var(--vc-muted);
    white-space: nowrap;
}

.vc-table td,
.vc-table th {
    padding: .75rem;
    vertical-align: middle;
}

/* ---------- Pantalla de resultados ---------- */

.vc-stat {
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 100%;
    padding: 1.25rem;
}

.vc-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.1;
}

.vc-stat-label {
    font-size: .875rem;
    color: var(--vc-muted);
}

.vc-stat .vc-icon {
    width: 48px;
    height: 48px;
    font-size: 1.375rem;
}

.vc-icon-soft-primary {
    background: #eef2ff;
    color: var(--vc-primary);
}

.vc-icon-soft-danger {
    background: var(--vc-danger-bg);
    color: var(--vc-danger-text);
}

.vc-icon-soft-ok {
    background: var(--vc-ok-bg);
    color: var(--vc-ok-text);
}

/* codigo devuelto por la validacion (E010, S000...) */
.vc-code {
    display: inline-block;
    padding: .125rem .5rem;
    border-radius: 6px;
    background: #f2f4f7;
    color: var(--vc-text);
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: .8125rem;
}

.vc-result-message {
    font-weight: 500;
    color: var(--vc-text);
}

.vc-result-description {
    font-size: .8125rem;
    color: var(--vc-muted);
}

/* filas con borde de color a la izquierda segun haya o no tramite pendiente */
.vc-results tbody tr.is-pending td:first-child {
    box-shadow: inset 4px 0 0 var(--vc-danger-text);
}

.vc-results tbody tr.is-clear td:first-child {
    box-shadow: inset 4px 0 0 var(--vc-ok-text);
}

.vc-results td {
    white-space: normal;
}

.vc-results .vc-col-container {
    font-weight: 500;
    white-space: nowrap;
}

.vc-search-results {
    min-width: 280px;
}

/* en pantallas estrechas la tabla se desplaza de lado en vez de comprimirse */
.vc-results {
    min-width: 760px;
}

/* DataTables 2.3 pone la tabla directamente en la fila .dt-layout-table:
   el desplazamiento horizontal va en esa fila para que no se salga de la tarjeta */
.dt-container .dt-layout-table {
    min-width: 0;
    overflow-x: auto;
}

/* controles de DataTables con el estilo de la aplicacion */
.dt-container .dt-paging .page-link {
    border-radius: 8px;
    margin: 0 .125rem;
}

/* columnas numericas: DataTables pone el icono de ordenar a la izquierda del
   titulo y parece de la columna anterior; se deja a la derecha como en las demas */
table.dataTable.vc-table th.dt-type-numeric div.dt-column-header {
    flex-direction: row;
    justify-content: flex-end;
    gap: .5rem;
}

.pagination {
    --bs-pagination-color: var(--vc-primary);
    --bs-pagination-hover-color: var(--vc-primary-dark);
    --bs-pagination-active-bg: var(--vc-primary);
    --bs-pagination-active-border-color: var(--vc-primary);
}

.dt-container .dt-info {
    font-size: .875rem;
    color: var(--vc-muted);
}

.vc-progress {
    height: 12px;
    border-radius: 999px;
}

.vc-progress .progress-bar {
    background: var(--vc-primary);
}

/* ---------- Pantallas de administracion ---------- */

/* iniciales del usuario en un circulo */
.vc-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e0e7ff;
    color: var(--vc-primary-dark);
    font-size: .8125rem;
    font-weight: 700;
}

.vc-avatar-lg {
    width: 64px;
    height: 64px;
    font-size: 1.375rem;
}

.vc-pill-warn {
    background: var(--vc-warn-bg);
    color: var(--vc-warn-text);
}

.vc-pill-info {
    background: #eef2ff;
    color: var(--vc-primary-dark);
}

/* toda la fila lleva al perfil (enlace "stretched-link" en el nombre) */
.vc-table tr.vc-row-link {
    position: relative;
}

.vc-table tr.vc-row-link:hover > * {
    background: #f8fafc;
}

/* enlaces dentro de una fila clicable que deben seguir funcionando por separado */
.vc-table tr.vc-row-link .vc-above-link {
    position: relative;
    z-index: 2;
}

/* ficha de datos del perfil */
.vc-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 0;
    padding-top: 1.25rem;
    border-top: 1px solid var(--vc-border);
}

.vc-details dt {
    font-size: .8125rem;
    font-weight: 400;
    color: var(--vc-muted);
}

.vc-details dd {
    margin: 0;
    font-weight: 500;
    word-break: break-word;
}

.vc-danger-zone {
    border-color: #f4c7c3;
}

.vc-danger-zone h2 {
    color: var(--vc-danger-text);
}

/* formularios de alta */
.vc-form-card {
    max-width: 760px;
}

.vc-form-section + .vc-form-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--vc-border);
}

.vc-form-section h2 {
    font-size: 1.0625rem;
    font-weight: 500;
}

/* ---------- Pie de pagina azul ---------- */

.vc-footer {
    flex-shrink: 0;
    background: var(--vc-navy);
    color: #e0e7ff;
    font-size: .875rem;
}

/* logos en version blanca (Georgia Tech Panama, Gabinete Logistico), directamente sobre el pie azul */
.vc-footer-gt {
    height: 44px;
    width: auto;
}

.vc-footer a,
.vc-footer .btn-link {
    color: #e0e7ff;
    text-decoration: none;
    font-size: .875rem;
    padding: .5rem .25rem;
}

.vc-footer a:hover,
.vc-footer .btn-link:hover {
    color: #fff;
    text-decoration: underline;
}
