/* =========================================================
   CONFIGURACIÓN GENERAL
   ========================================================= */

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;

    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;

    color: #18304b;
    background-color: #f5f7fb;
}

main {
    min-height: calc(100vh - 72px);
}

main.container {
    width: 100%;
    max-width: 1320px;
}


/* =========================================================
   BARRA DE NAVEGACIÓN
   ========================================================= */

.navbar {
    min-height: 72px;
    padding-top: 8px;
    padding-bottom: 8px;

    background-color: #095aa5 !important;
}

.navbar > .container {
    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 56px;
}


/* =========================================================
   LOGO Y MARCA
   ========================================================= */

.navbar-brand {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px;

    min-width: 0;
    height: 54px;

    margin: 0 16px 0 0;
    padding: 0;

    color: #ffffff !important;
    text-decoration: none;
}

.navbar-brand:hover,
.navbar-brand:focus {
    color: #ffffff !important;
}

.navbar-logo-box {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: 70px !important;
    height: 54px !important;
    min-width: 70px !important;
    min-height: 54px !important;
    max-width: 70px !important;
    max-height: 54px !important;
    flex: 0 0 70px !important;

    margin: 0;
    padding: 5px;

    overflow: hidden;

    background-color: #ffffff !important;
    border-radius: 7px;

    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
}

.navbar-logo {
    display: block !important;

    width: 60px !important;
    height: 44px !important;
    min-width: 60px !important;
    min-height: 44px !important;
    max-width: 60px !important;
    max-height: 44px !important;

    margin: 0 !important;
    padding: 0 !important;

    object-fit: contain !important;
    object-position: center !important;
}

.navbar img.navbar-logo,
.navbar-brand img.navbar-logo,
.navbar-logo-box img {
    width: 60px !important;
    height: 44px !important;
    max-width: 60px !important;
    max-height: 44px !important;
}

.navbar-title {
    display: inline-block;

    color: #ffffff;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}


/* =========================================================
   MENÚ PRINCIPAL
   ========================================================= */

.navbar-collapse {
    align-items: center;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 3px;
}

.navbar .nav-item {
    display: flex;
    align-items: center;
}

.navbar .nav-link {
    display: inline-flex;
    align-items: center;

    min-height: 40px;
    padding: 8px 12px;

    color: rgba(255, 255, 255, 0.86);
    text-decoration: none;

    border-radius: 7px;

    transition:
        color 0.2s ease,
        background-color 0.2s ease;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus,
.navbar .nav-link.active {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.14);
}


/* =========================================================
   BOTÓN DEL MENÚ MÓVIL
   ========================================================= */

.navbar-toggler {
    padding: 5px 8px;

    border-color: rgba(255, 255, 255, 0.55);
    border-radius: 7px;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.2);
}


/* =========================================================
   ZONA DERECHA Y CERRAR SESIÓN
   ========================================================= */

.logout-area {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;

    margin: 0 0 0 auto !important;
    padding: 0 !important;

    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

header.navbar form.logout-form,
.navbar form.logout-form,
form.logout-form {
    display: contents !important;

    width: auto !important;
    min-width: 0 !important;

    margin: 0 !important;
    padding: 0 !important;

    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

header.navbar button.logout-button,
.navbar button.logout-button,
button.logout-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: auto !important;
    min-width: 76px !important;
    height: 38px !important;

    margin: 0 !important;
    padding: 7px 17px !important;

    color: #ffffff !important;
    background: transparent !important;

    border: 1px solid rgba(255, 255, 255, 0.9) !important;
    border-radius: 7px !important;

    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1;

    box-shadow: none !important;
    cursor: pointer;

    transition:
        color 0.2s ease,
        background-color 0.2s ease,
        border-color 0.2s ease;
}

header.navbar button.logout-button:hover,
header.navbar button.logout-button:focus,
.navbar button.logout-button:hover,
.navbar button.logout-button:focus,
button.logout-button:hover,
button.logout-button:focus {
    color: #095aa5 !important;
    background: #ffffff !important;
    border-color: #ffffff !important;
    outline: none;
}


/* =========================================================
   TÍTULOS
   ========================================================= */

h1,
h2,
h3,
h4,
h5,
h6 {
    color: #18304b;
}

.text-muted {
    color: #68778a !important;
}


/* =========================================================
   TARJETAS
   ========================================================= */

.card {
    overflow: hidden;

    background-color: #ffffff;
    border-radius: 12px;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-3px);

    box-shadow:
        0 9px 24px rgba(0, 0, 0, 0.12) !important;
}

.card-header {
    border-bottom: 0;
}

.card-header.bg-primary {
    background-color: #095aa5 !important;
}

.card-header h1,
.card-header h2,
.card-header h3,
.card-header h4,
.card-header h5,
.card-header h6 {
    color: #ffffff;
}

.card-body {
    padding: 22px;
}

.card-footer {
    background-color: #ffffff;
    border-top: 1px solid #e8edf3;
}


/* =========================================================
   TARJETAS DEL DASHBOARD
   ========================================================= */

.dashboard-action-card {
    min-height: 180px;

    color: #18304b;
    border-radius: 18px;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.dashboard-action-card:hover {
    transform: translateY(-4px);

    box-shadow:
        0 14px 32px rgba(24, 48, 75, 0.16) !important;
}


/* =========================================================
   BOTONES
   ========================================================= */

.btn {
    border-radius: 7px;
    font-weight: 500;
}

.btn-primary {
    color: #ffffff;
    background-color: #095aa5;
    border-color: #095aa5;
}

.btn-primary:hover,
.btn-primary:focus {
    color: #ffffff;
    background-color: #074b8a;
    border-color: #074b8a;
}

.btn-outline-primary {
    color: #095aa5;
    border-color: #095aa5;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    color: #ffffff;
    background-color: #095aa5;
    border-color: #095aa5;
}

.btn-success {
    color: #ffffff;
    background-color: #198754;
    border-color: #198754;
}

.btn-success:hover,
.btn-success:focus {
    color: #ffffff;
    background-color: #157347;
    border-color: #146c43;
}

.btn-outline-success {
    color: #198754;
    border-color: #198754;
}

.btn-outline-success:hover,
.btn-outline-success:focus {
    color: #ffffff;
    background-color: #198754;
    border-color: #198754;
}

.btn-danger {
    color: #ffffff;
}

.button {
    display: inline-block;

    padding: 10px 16px;

    color: #ffffff;
    background-color: #095aa5;

    border: 0;
    border-radius: 7px;

    text-decoration: none;
}


/* =========================================================
   FORMULARIOS
   ========================================================= */

main form:not(.logout-form) {
    background-color: #ffffff;
}

.form-control,
.form-select {
    min-height: 42px;

    padding: 9px 12px;

    border-color: #ced6df;
    border-radius: 7px;
}

.form-control:focus,
.form-select:focus {
    border-color: #095aa5;

    box-shadow:
        0 0 0 0.2rem rgba(9, 90, 165, 0.15);
}

.form-check-input:checked {
    background-color: #095aa5;
    border-color: #095aa5;
}

label,
.form-label {
    color: #18304b;
    font-weight: 500;
}

textarea.form-control {
    min-height: 100px;
}


/* =========================================================
   TABLAS
   ========================================================= */

.table-responsive {
    overflow-x: auto;

    background-color: #ffffff;
    border-radius: 10px;

    box-shadow:
        0 2px 10px rgba(0, 0, 0, 0.06);
}

.table {
    width: 100%;
    margin-bottom: 0;

    vertical-align: middle;
}

.table thead th {
    color: #18304b;
    background-color: #edf3f9;

    border-bottom: 2px solid #d8e1eb;
}

.table td,
.table th {
    padding: 11px 12px;
}

.table tbody tr:hover {
    background-color: #f7faff;
}

table:not(.table) {
    width: 100%;

    background-color: #ffffff;
    border-collapse: collapse;
    border-radius: 10px;
}

table:not(.table) th,
table:not(.table) td {
    padding: 10px;

    text-align: left;

    border-bottom: 1px solid #dddddd;
}


/* =========================================================
   ALERTAS Y MENSAJES
   ========================================================= */

.alert {
    border-radius: 9px;
}

.ok {
    padding: 12px;

    background-color: #dff5e5;
    border-radius: 7px;
}

.error {
    padding: 12px;

    background-color: #ffe4e4;
    border-radius: 7px;
}


/* =========================================================
   INSIGNIAS
   ========================================================= */

.badge {
    font-weight: 600;
}

.text-bg-primary {
    background-color: #095aa5 !important;
}


/* =========================================================
   FORMULARIOS ANGOSTOS
   ========================================================= */

.narrow {
    width: 100%;
    max-width: 620px;

    margin-right: auto;
    margin-left: auto;
}


/* =========================================================
   LOGIN
   ========================================================= */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    min-height: calc(100vh - 72px);
    padding: 48px 24px;

    background-color: #f4f7fb;
}

.login-wrapper {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
}

.login-card {
    width: 100%;
    margin: 0;

    background-color: #ffffff;
    border-radius: 18px;

    box-shadow:
        0 12px 35px rgba(24, 48, 75, 0.14);
}

.login-card:hover {
    transform: none;
}

.login-card .card-body {
    width: 100%;
    padding: 54px 72px;
}

.login-card form {
    width: 100%;
    margin: 0;
    padding: 0;

    background: transparent !important;
}

.login-card .form-control {
    width: 100%;
    min-height: 54px;
    padding: 12px 16px;

    border-radius: 10px;
}

.login-card .btn {
    min-height: 54px;

    border-radius: 10px;
    font-weight: 600;
}

@media (max-width: 767.98px) {
    .login-page {
        padding: 24px 14px;
    }

    .login-wrapper {
        max-width: 100%;
    }

    .login-card .card-body {
        padding: 30px 24px;
    }
}

/* =========================================================
   CLASES ANTIGUAS
   ========================================================= */

.grid {
    display: grid;

    grid-template-columns:
        repeat(auto-fit, minmax(220px, 1fr));

    gap: 18px;
}

.grid article {
    padding: 22px;

    background-color: #ffffff;
    border-radius: 10px;

    box-shadow:
        0 2px 10px rgba(0, 0, 0, 0.06);
}

.grid b {
    display: block;
    font-size: 2rem;
}


/* =========================================================
   PANTALLAS MEDIANAS
   ========================================================= */

@media (max-width: 1199.98px) {
    .navbar .nav-link {
        padding-right: 8px;
        padding-left: 8px;

        font-size: 0.92rem;
    }

    .navbar-title {
        font-size: 1.05rem;
    }
}


/* =========================================================
   MENÚ MÓVIL
   ========================================================= */

@media (max-width: 991.98px) {
    .navbar {
        min-height: auto;
    }

    .navbar > .container {
        min-height: 52px;
    }

    .navbar-brand {
        height: 50px;
        margin-right: 8px;
    }

    .navbar-collapse {
        width: 100%;

        padding-top: 14px;
        padding-bottom: 6px;
    }

    .navbar-nav {
        align-items: stretch;

        gap: 4px;

        margin-right: 0 !important;
        margin-bottom: 14px !important;
        margin-left: 0 !important;
    }

    .navbar .nav-item {
        width: 100%;
    }

    .navbar .nav-link {
        width: 100%;
        padding: 10px 12px;
    }

    .logout-area {
        width: 100% !important;

        justify-content: stretch !important;

        margin-top: 8px !important;
    }

    .navbar button.logout-button,
    header.navbar button.logout-button,
    button.logout-button {
        width: 100% !important;
    }
}


/* =========================================================
   CELULARES
   ========================================================= */

@media (max-width: 575.98px) {
    .navbar {
        padding-top: 6px;
        padding-bottom: 6px;
    }

    .navbar-logo-box {
        width: 62px !important;
        height: 48px !important;
        min-width: 62px !important;
        min-height: 48px !important;
        max-width: 62px !important;
        max-height: 48px !important;
        flex-basis: 62px !important;
    }

    .navbar-logo,
    .navbar img.navbar-logo,
    .navbar-brand img.navbar-logo,
    .navbar-logo-box img {
        width: 52px !important;
        height: 38px !important;
        min-width: 52px !important;
        min-height: 38px !important;
        max-width: 52px !important;
        max-height: 38px !important;
    }

    .navbar-title {
        font-size: 1rem;
    }

    main.container {
        padding-right: 14px;
        padding-left: 14px;
    }

    .card-body {
        padding: 18px;
    }

    .table td,
    .table th {
        padding: 9px;
    }

    .login-page {
        align-items: flex-start;

        min-height: calc(100vh - 60px);
        padding: 24px 0;
    }

    .login-wrapper {
        max-width: 100%;
    }

    .login-card {
        border-radius: 14px;
    }

    .login-card .card-body {
        min-height: auto;
        padding: 24px !important;
    }
}