html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

/* CSS PARA MENU SIDEBAR MENU*/


/* ====== LAYOUT SHELL ====== */
.app-shell {
    display: flex;
    min-height: 100vh;
    background: #f5f7fb;
}

/* ====== SIDEBAR ====== */
.sidebar {
    width: 270px;
    background: #0f172a;
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    transition: width .2s ease, transform .2s ease;
}

.sidebar-brand {
    padding: 18px 18px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.brand-link {
    display: flex;
    gap: 12px;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.brand-logo {
    max-width: 100%;
    height: auto;
    max-height: 48px;
    object-fit: contain;
    border-radius: 10px;
    background: rgba(255,255,255,.06);
    padding: 6px;
}

.brand-title {
    font-weight: 700;
    letter-spacing: .5px;
}

.brand-subtitle {
    font-size: 12px;
    color: rgba(226,232,240,.7);
}

.sidebar-nav {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: auto;
}

.sidebar-item,
.sidebar-item-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    color: rgba(226,232,240,.9);
    text-decoration: none;
    background: transparent;
    border: 0;
    text-align: left;
    width: 100%;
}

    .sidebar-item i,
    .sidebar-item-btn i {
        width: 20px;
        text-align: center;
        opacity: .95;
    }

    .sidebar-item:hover,
    .sidebar-item-btn:hover {
        background: rgba(255,255,255,.08);
        color: #fff;
    }

.sidebar-submenu {
    margin: 6px 0 10px 40px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-subitem {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    color: rgba(226,232,240,.85);
    text-decoration: none;
}

    .sidebar-subitem:hover {
        background: rgba(255,255,255,.08);
        color: #fff;
    }

.sidebar-footer {
    margin-top: auto;
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,.08);
}

.sidebar-user {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255,255,255,.06);
    margin-bottom: 10px;
}

.sidebar-user-name {
    font-weight: 600;
    font-size: 14px;
}

.sidebar-user-role {
    font-size: 12px;
    color: rgba(226,232,240,.7);
}

.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    text-decoration: none;
    color: rgba(226,232,240,.9);
}

    .sidebar-logout:hover {
        background: rgba(239,68,68,.15);
        color: #fff;
    }

/* ====== MAIN ====== */
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    height: 62px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.content {
    padding: 18px;
}

.footer-modern {
    border-top: 1px solid #e5e7eb;
    background: #fff;
    padding: 12px 16px;
    color: #6b7280;
}

/* ====== COLLAPSED (desktop) ====== */
body.sidebar-collapsed .sidebar {
    width: 84px;
}

body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .sidebar-item span,
body.sidebar-collapsed .sidebar-item-btn span,
body.sidebar-collapsed .sidebar-submenu,
body.sidebar-collapsed .sidebar-user-text,
body.sidebar-collapsed .sidebar-logout span {
    display: none;
}

body.sidebar-collapsed .sidebar-item,
body.sidebar-collapsed .sidebar-item-btn,
body.sidebar-collapsed .sidebar-logout {
    justify-content: center;
}

/* ====== MOBILE ====== */
/* Backdrop oscuro para móvil */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
    backdrop-filter: blur(2px);
    transition: opacity 0.3s ease;
    opacity: 0;
}

.sidebar-backdrop.show {
    display: block;
    opacity: 1;
}

@media (max-width: 991px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        z-index: 1000;
        box-shadow: 4px 0 15px rgba(0,0,0,0.2);
    }

    /* Clase para mostrar el sidebar en móvil (controlada por JS) */
    .sidebar.show {
        transform: translateX(0);
    }

    body.sidebar-collapsed .sidebar {
        transform: translateX(0);
        width: 270px;
    }
}

/* HERO */
.hero-card {
    background: linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
    border-radius: 16px;
}

.hero-logo {
    max-width: 260px;
}

.partner-logo {
    max-width: 160px;
}

/* ACCIONES (cards clickeables) */
.action-card {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 16px 16px;
    border-radius: 14px;
    text-decoration: none;
    border: 1px solid rgba(0,0,0,.08);
    background: #fff;
    box-shadow: 0 6px 18px rgba(0,0,0,.06);
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}

    .action-card:hover {
        transform: translateY(-1px);
        box-shadow: 0 10px 28px rgba(0,0,0,.10);
        border-color: rgba(0,0,0,.14);
        text-decoration: none;
    }

.action-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 20px;
}

.action-text {
    flex: 1;
}

.action-title {
    font-weight: 700;
    color: #111827;
}

.action-subtitle {
    font-size: .9rem;
    color: #6b7280;
}

.action-arrow {
    color: #9ca3af;
    font-size: 18px;
}

/* Variantes */
.action-primary .action-icon {
    background: rgba(13,110,253,.12);
    color: #0d6efd;
}

.action-success .action-icon {
    background: rgba(25,135,84,.12);
    color: #198754;
}

.action-dark .action-icon {
    background: rgba(108,117,125,.14);
    color: #495057;
}

/* FOOTER bonito y centrado */
.footer {
    padding: 14px 0;
    background: #fff;
}

    .footer .footer-inner {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        flex-wrap: wrap;
    }

    .footer a {
        text-decoration: none;
    }

        .footer a:hover {
            text-decoration: underline;
        }

/* ===== Sticky footer (footer al fondo siempre) ===== */
html, body {
    height: 100%;
}

.app-shell {
    min-height: 100vh;
    display: flex; /* sidebar + main en fila */
}

.app-main {
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column; /* topbar, content, footer en columna */
}

main.content {
    flex: 1 0 auto; /* crece y empuja el footer */
}

footer.footer {
    flex-shrink: 0; /* no se encoge */
}

/* Footer centrado y bonito */
.footer {
    padding: 14px 0;
    background: #fff;
}

    .footer .footer-inner {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
    }

    .footer a {
        text-decoration: none;
    }

        .footer a:hover {
            text-decoration: underline;
        }

/* ===== Sidebar: estado normal ===== */
.sidebar {
    width: 260px;
    transition: width .2s ease, transform .2s ease;
}

/* El main ocupa el resto */
.app-main {
    transition: margin-left .2s ease;
}

/* ===== Desktop: colapsado ===== */
body.sidebar-collapsed .sidebar {
    width: 84px; /* ancho cuando colapsa */
}

    body.sidebar-collapsed .sidebar .brand-text,
    body.sidebar-collapsed .sidebar .sidebar-nav span,
    body.sidebar-collapsed .sidebar .sidebar-user-text,
    body.sidebar-collapsed .sidebar .sidebar-submenu {
        display: none !important; /* oculta textos */
    }

    body.sidebar-collapsed .sidebar .sidebar-item,
    body.sidebar-collapsed .sidebar .sidebar-subitem {
        justify-content: center;
        gap: 0;
    }

    body.sidebar-collapsed .sidebar i {
        margin: 0 !important;
    }

/* ===== Mobile: sidebar tipo “drawer” ===== */
@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        transform: translateX(-100%); /* oculto por defecto */
        z-index: 1050;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0); /* abierto */
    }

    /* Cuando es mobile, no conviene colapsar a 84px: use drawer */
    body.sidebar-collapsed .sidebar {
        width: 260px;
    }

    /* opcional: overlay */
    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.35);
        z-index: 1040;
        display: none;
    }

    body.sidebar-open .sidebar-overlay {
        display: block;
    }
}
/* ===== Registros: tabla moderna ===== */
.table-modern {
    border: 1px solid rgba(0,0,0,.06);
    border-radius: 14px;
    overflow: hidden;
}

    .table-modern thead {
        background: #0b2a57; /* azul marino */
        color: #fff;
    }

        .table-modern thead th {
            font-weight: 700;
            font-size: .85rem;
            border-bottom: none !important;
            vertical-align: middle;
        }

.th-link {
    color: #fff;
    text-decoration: none;
    opacity: .95;
}

    .th-link:hover {
        opacity: 1;
        text-decoration: underline;
    }

.w-fit {
    width: fit-content;
}

/* Badges suaves */
.badge-soft-success {
    background: rgba(25,135,84,.12);
    color: #198754;
}

.badge-soft-danger {
    background: rgba(220,53,69,.12);
    color: #dc3545;
}

.badge-soft-warning {
    background: rgba(255,193,7,.18);
    color: #856404;
}

.badge-soft-secondary {
    background: rgba(108,117,125,.14);
    color: #6c757d;
}

/* Cards */
.card {
    border-radius: 16px;
}
.select2-container--bootstrap-5 .select2-selection {
    min-height: 38px;
    padding: .375rem .75rem;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    line-height: 1.5;
}

.card {
    border-radius: 16px;
}

/* ===== Catálogos: vistas amigables ===== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 1rem;
}

.page-subtitle {
    color: #6b7280;
    font-size: .92rem;
}

.module-card {
    border: 0;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
}

.module-table thead th {
    background: #f8fafc;
    color: #334155;
    font-weight: 700;
}

.module-actions {
    display: flex;
    gap: .45rem;
    justify-content: flex-end;
}

.detail-list dt {
    font-weight: 600;
    color: #475569;
}

.detail-list dd {
    color: #0f172a;
}

.form-hint {
    font-size: .82rem;
    color: #64748b;
}

/* ===== Login ===== */
.login-shell {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 55%, #0ea5e9 100%);
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: min(980px, 100%);
    border-radius: 20px;
    overflow: hidden;
    border: 0;
    box-shadow: 0 28px 60px rgba(2, 6, 23, .35);
}

.login-brand {
    background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
}

.login-brand img {
    max-width: 210px;
}
/* Select2 con Bootstrap 5: altura y alineación */
.select2-container--bootstrap-5 .select2-selection {
    min-height: 38px;
    padding: .375rem .75rem;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    line-height: 1.5;
}

.card {
    border-radius: 16px;
}

/* Responsividad para Login.cshtml */
@media (max-width: 900px) {
    .login-wrapper .login-card {
        flex-direction: column;
    }
    .login-wrapper .login-left {
        display: none !important; 
    }
    .login-wrapper .login-right {
        padding: 2.5rem 1.5rem !important;
    }
    .login-wrapper .mobile-system-desc {
        display: block !important; 
    }
}
