/* =========================
   Estilos generales Nexo
   ========================= */

html {
    /* Mantener comportamiento estable del scroll vertical */
    min-height: 100%;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    min-height: 100vh;
}

/* Íconos SVG (cargados con data-icon) */
.bi,
[data-icon] svg {
    vertical-align: -0.125em;
}

/* =========================
   Layout público (main.php)
   ========================= */

.card-dashboard {
    border-radius: 0.5rem;
}

.card-dashboard a {
    display: block;
}

.card-dashboard a:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

/* =========================
   Panel admin (/admin)
   ========================= */

#admin-wrapper {
    min-height: 100vh;
}

/* Sidebar principal */
#admin-sidebar {
    /* 🔥 Fija el ancho del flex-item: no crece, no se encoge, 240px */
    flex: 0 0 240px;
    width: 240px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;

    /* Evita cambios de ancho al aparecer o desaparecer la scrollbar interna */
    overflow-y: auto;
    scrollbar-gutter: stable;
}

/* Estilo del scrollbar (visual, opcional) */
#admin-sidebar::-webkit-scrollbar {
    width: 8px;
}
#admin-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 4px;
}

/* Enlaces del sidebar */
#admin-sidebar .nav-link {
    padding: 0.45rem 0.75rem;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

/* 🔥 Que el texto del menú NO haga salto de línea */
#admin-sidebar .nav-link span:last-child {
    white-space: nowrap;
}

/* Hover */
#admin-sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.08);
    text-decoration: none;
}

/* Overlay para móvil */
.admin-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 1030;
    display: none;
}
.admin-overlay.show {
    display: block;
}

/* Contenido (lado derecho) */
#admin-content {
    /* 🔥 Que este sí tome todo el espacio restante */
    flex: 1 1 auto;
    min-height: 100vh;
}

/* Dashboard cards */
.card-dashboard {
    border-radius: 0.5rem;
}

/* Título del navbar superior sin salto de línea */
.navbar-title-nowrap {
    white-space: nowrap;
}

/* Responsive: sidebar colapsable en móvil */
@media (max-width: 991.98px) {
    #admin-sidebar {
        position: fixed;
        left: -240px;
        top: 0;
        bottom: 0;
        z-index: 1040;
        transition: left 0.2s ease-in-out;
    }

    #admin-sidebar.show {
        left: 0;
    }

    #admin-content {
        width: 100%;
    }
}

/* =========================
   Accesibilidad
   ========================= */

html {
    font-size: 16px;
}

html[data-text-size="sm"] {
    font-size: 14px;
}

html[data-text-size="md"] {
    font-size: 16px;
}

html[data-text-size="lg"] {
    font-size: 18px;
}

body.theme-dark {
    background-color: #121417 !important;
    color: #e6e9ee;
}

body.theme-dark .bg-light {
    background-color: #1a1f24 !important;
}

body.theme-dark .bg-white {
    background-color: #1f242a !important;
}

body.theme-dark .border-bottom,
body.theme-dark .border-top,
body.theme-dark .border-secondary,
body.theme-dark .border {
    border-color: #2b323a !important;
}

body.theme-dark .card,
body.theme-dark .dropdown-menu,
body.theme-dark .list-group-item,
body.theme-dark .modal-content {
    background-color: #1f242a;
    color: #e6e9ee;
    border-color: #2b323a;
}

body.theme-dark .form-control,
body.theme-dark .form-select {
    background-color: #1b2026;
    border-color: #2b323a;
    color: #e6e9ee;
}

body.theme-dark .form-control::placeholder {
    color: #9aa4b2;
}

body.theme-dark .navbar-light {
    background-color: #1f242a !important;
}

body.theme-dark .navbar-text {
    color: #e6e9ee !important;
}

body.theme-dark .text-muted,
body.theme-dark .text-secondary {
    color: #aab4c1 !important;
}

/* =========================
   Utilidades UI
   ========================= */

.accessibility-menu {
    min-width: 240px;
}

.logo-max-60 {
    max-height: 60px;
}

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

.logo-max-32 {
    max-height: 32px;
}

.logo-max-28 {
    max-height: 28px;
    max-width: 120px;
}

.brand-fallback {
    font-weight: 600;
    color: #343a40;
    font-size: 1.5rem;
}

.avatar-32 {
    width: 32px;
    height: 32px;
    object-fit: cover;
}

.avatar-120 {
    width: 120px;
    height: 120px;
    object-fit: cover;
}

.avatar-placeholder-120 {
    width: 120px;
    height: 120px;
}

.editor-min-400 {
    min-height: 400px;
}

.img-max-200 {
    max-height: 200px;
}

.img-max-80 {
    max-height: 80px;
}

.img-max-48 {
    max-height: 48px;
}

.img-max-400 {
    max-height: 400px;
}

.img-max-420 {
    max-height: 420px;
}

.img-cover-200 {
    height: 200px;
    object-fit: cover;
}

.object-cover {
    object-fit: cover;
}

.content-lead {
    font-size: 1.1rem;
    line-height: 1.9;
}

.media-modal-body {
    height: 400px;
    overflow-y: auto;
}

.media-selector-frame {
    width: 100%;
    height: 100%;
    border: none;
}

.scroll-200 {
    max-height: 200px;
    overflow-y: auto;
}

.scroll-300 {
    max-height: 300px;
    overflow-y: auto;
}

.scroll-400 {
    max-height: 400px;
    overflow-y: auto;
}

.table-col-40 {
    width: 40%;
}

.truncate-250 {
    max-width: 250px;
}

.progress-h-20 {
    height: 20px;
}

.progress-h-25 {
    height: 25px;
}

.cursor-grab {
    cursor: grab;
}

.is-hidden {
    display: none;
}

.font-24 {
    font-size: 24px;
}

.text-max-520 {
    max-width: 520px;
}

.text-max-420 {
    max-width: 420px;
}

.icon-circle-80 {
    width: 80px;
    height: 80px;
}

.icon-circle-42 {
    width: 42px;
    height: 42px;
    font-size: 0.75rem;
}

.spinner-lg {
    width: 3rem;
    height: 3rem;
}

.col-80 {
    width: 80px;
}

.min-w-260 {
    min-width: 260px;
}

.min-h-240 {
    min-height: 240px;
}

.font-70 {
    font-size: 0.7rem;
}

.code-sample {
    font-size: 0.85em;
}

.text-875 {
    font-size: 0.875rem;
}

.pre-wrap {
    white-space: pre-wrap;
    word-break: break-word;
}

.media-card {
    transition: transform 0.15s, box-shadow 0.15s;
}

.media-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.media-thumb {
    aspect-ratio: 1;
    background-size: cover;
    background-position: center;
    background-color: #f8f9fa;
}

.media-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #6c757d;
}

.drop-zone {
    border-style: dashed !important;
    transition: background-color 0.2s, border-color 0.2s;
}

.drop-zone.dragover {
    background-color: #e7f3ff;
    border-color: #0d6efd !important;
}

.ql-editor {
    min-height: 350px;
    font-size: 16px;
    line-height: 1.6;
}

.ql-container {
    font-family: inherit;
}

.full-width-hero {
    height: 50vh;
    min-height: 300px;
}

.hero-gradient-overlay {
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
}

.text-umg-primary {
    color: var(--umg-primary);
}

.umg-hero-title {
    font-weight: 700;
    letter-spacing: -0.03em;
    font-size: clamp(2.5rem, 4vw, 3.6rem);
}

.bg-umg-blue-soft {
    background: rgba(26, 79, 224, 0.08);
}

.bg-umg-amber-soft {
    background: rgba(255, 178, 0, 0.12);
}

.bg-umg-slate-soft {
    background: rgba(15, 23, 42, 0.08);
}

.icon-size-1-1 {
    font-size: 1.1rem;
}

.icon-size-1 {
    font-size: 1rem;
}

.icon-size-1-2 {
    font-size: 1.2rem;
}

body.theme-dark .table {
    color: #e6e9ee;
    background-color: #1f242a;
}

body.theme-dark .table thead th {
    color: #e6e9ee;
    background-color: #1b2026;
    border-color: #2b323a;
}

body.theme-dark .table-light {
    --bs-table-bg: #1b2026;
    --bs-table-color: #e6e9ee;
}

body.theme-dark .table > :not(caption) > * > * {
    background-color: #1f242a;
    border-color: #2b323a;
    color: #e6e9ee;
}

body.theme-dark .table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: #1a1f24;
}

body.theme-dark .table-hover > tbody > tr:hover > * {
    background-color: #232a31;
}

body.theme-dark a:not(.btn) {
    color: #9cc7ff;
}

body.theme-dark a:not(.btn):hover {
    color: #c0dbff;
}

body.theme-dark .page-content,
body.theme-dark .content {
    color: #e6e9ee;
}

body.theme-dark .lead {
    color: #d1d8e3;
}

body.theme-dark .badge.bg-light {
    background-color: #2b323a !important;
    color: #e6e9ee !important;
    border-color: #3a424c !important;
}

body.theme-dark .shadow-sm {
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.45) !important;
}

.accessibility-menu .btn {
    min-width: 2.5rem;
}

.accessibility-floating {
    position: fixed;
    top: 0.75rem;
    right: 1rem;
    z-index: 1080;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.accessibility-floating > .lang-toggle,
.accessibility-floating > .btn,
.accessibility-floating > .dropdown > .btn {
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

.accessibility-floating .lang-toggle {
    width: auto;
    padding: 0 0.4rem;
    /* gap: 0.4rem; */
    font-weight: 600;
    letter-spacing: 0.04em;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.accessibility-floating .lang-toggle [data-icon] {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.accessibility-floating .lang-toggle [data-icon] svg {
    display: block;
}

.accessibility-floating .lang-toggle__text {
    font-size: 0.75rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.menu-item {
    user-select: none;
}

.accessibility-floating [data-icon] svg {
    display: block;
}

.accessibility-floating .btn[data-bs-toggle="dropdown"]:hover {
    background-color: #0b5ed7;
    border-color: #0b5ed7;
    color: #fff;
}
