.fi-modal-content {
    max-width: 80rem !important; /* Ajusta el ancho del modal */
}

/* ── Tablas compactas en TODO el panel — menos padding vertical por fila ──── */
.fi-ta-text,
.fi-ta-checkbox,
.fi-ta-color,
.fi-ta-icon,
.fi-ta-image,
.fi-ta-select,
.fi-ta-text-input,
.fi-ta-toggle,
.fi-ta-actions-cell > div,
.fi-ta-selection-cell > div {
    padding-top: 0.4rem !important;
    padding-bottom: 0.4rem !important;
}

/* Encabezados de tabla un poco más compactos para acompañar */
.fi-ta-header-cell {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

/* Global — redondeo sutil 4px en todo el panel */
.fi-ta,
.fi-ta-ctn,
.fi-input,
.fi-input-wrp,
.fi-btn,
.fi-badge,
.fi-section,
.fi-section-content-ctn,
.fi-dropdown-panel,
.fi-modal-window,
[class*="rounded"] {
    border-radius: 4px !important;
}

/* Excepción: mantener círculos/pastillas reales (avatares, toggles, indicadores) */
.rounded-full,
[class*="rounded-full"],
.fi-avatar,
.fi-toggle,
.fi-toggle * {
    border-radius: 9999px !important;
}

/* ── Sidebar scrollbar — corporate thin style ───────────────────────────── */
.fi-sidebar-nav,
.fi-sidebar {
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.35) transparent;
}

.fi-sidebar-nav::-webkit-scrollbar,
.fi-sidebar::-webkit-scrollbar {
    width: 3px;
    background: transparent;
}

.fi-sidebar-nav::-webkit-scrollbar-track,
.fi-sidebar::-webkit-scrollbar-track {
    background: transparent;
    margin-block: 6px;
}

.fi-sidebar-nav::-webkit-scrollbar-thumb,
.fi-sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(99, 102, 241, 0.35);
    border-radius: 2px;
    transition: background-color 0.2s ease;
}

.fi-sidebar-nav:hover::-webkit-scrollbar-thumb,
.fi-sidebar:hover::-webkit-scrollbar-thumb {
    background-color: rgba(99, 102, 241, 0.6);
}

.fi-sidebar-nav::-webkit-scrollbar-thumb:hover,
.fi-sidebar::-webkit-scrollbar-thumb:hover {
    background-color: rgba(129, 140, 248, 0.85);
}
/* ── Tipografía compacta del menú principal para ganar ancho ──────────────── */
.fi-sidebar-item-label {
    font-size: 0.8rem;
    line-height: 1.1rem;
}
.fi-sidebar-group-label {
    font-size: 0.68rem;
    letter-spacing: 0.03em;
}
.fi-sidebar-item-icon,
.fi-sidebar-group-icon {
    width: 1.15rem;
    height: 1.15rem;
}

/* IPPBX cluster — barra de sub-navegación lateral más angosta (default w-72 = 18rem) */
.fi-page-sub-navigation-sidebar-ctn {
    position: relative;
    width: 11rem;
    flex: 0 0 11rem;
    transition: width 0.18s ease, flex-basis 0.18s ease;
}
.fi-page-sub-navigation-sidebar-ctn .fi-sidebar-item-label {
    font-size: 0.78rem;
    line-height: 1.05rem;
}
.fi-page-sub-navigation-sidebar-ctn .fi-sidebar-group-label {
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.7;
}

/* Botón colapsar / expandir */
.ippbx-subnav-toggle {
    align-self: flex-end;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    margin-bottom: 0.25rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1;
    color: rgba(99, 102, 241, 0.95);
    background: rgba(99, 102, 241, 0.10);
    transition: background-color 0.15s ease;
}
.ippbx-subnav-toggle:hover {
    background: rgba(99, 102, 241, 0.20);
}

/* Estado colapsado: solo íconos */
.fi-page-sub-navigation-sidebar-ctn.ippbx-subnav-collapsed {
    width: 3.5rem;
    flex: 0 0 3.5rem;
}
.ippbx-subnav-collapsed .fi-sidebar-item-label,
.ippbx-subnav-collapsed .fi-sidebar-group-label,
.ippbx-subnav-collapsed .fi-sidebar-group-collapse-button {
    display: none;
}
.ippbx-subnav-collapsed .fi-sidebar-item-button {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}
.ippbx-subnav-collapsed .ippbx-subnav-toggle {
    align-self: center;
}

/* Cluster IPPBX — encabezado compacto y mejor aprovechamiento vertical.
   Acotado a páginas con sub-navegación lateral para no afectar el resto del panel. */
.fi-page:has(.fi-page-sub-navigation-sidebar-ctn) > section {
    padding-top: 1rem;
    padding-bottom: 1.25rem;
    gap: 0.85rem;
}
.fi-page:has(.fi-page-sub-navigation-sidebar-ctn) .fi-header {
    padding-bottom: 0.6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.fi-page:has(.fi-page-sub-navigation-sidebar-ctn) .fi-header-heading {
    font-size: 1.15rem;
    line-height: 1.6rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}
/* La sub-navegación arranca alineada con el contenido, sin margen extra arriba */
.fi-page:has(.fi-page-sub-navigation-sidebar-ctn) .fi-page-sub-navigation-sidebar {
    padding-top: 0.25rem;
}

/* Colapse primario (sidebar) con el mismo estilo que el secundario (.ippbx-subnav-toggle) */
.fi-sidebar-header .fi-icon-btn {
    color: rgba(99, 102, 241, 0.95);
    background: rgba(99, 102, 241, 0.10);
    border-radius: 4px;
    transition: background-color 0.15s ease;
}
.fi-sidebar-header .fi-icon-btn:hover {
    background: rgba(99, 102, 241, 0.20);
}
.fi-sidebar-header .fi-icon-btn svg {
    color: rgba(99, 102, 241, 0.95);
}

/* ── Formularios compactos — campos, labels y selects más pequeños ─────────── */
@media (min-width: 640px) {
    /* Inputs de texto y número */
    .fi-fo-text-input .fi-input,
    .fi-fo-numeric-input .fi-input,
    .fi-fo-textarea textarea,
    .fi-fo-date-time-picker input {
        font-size: 0.70rem;
        line-height: 1.3;
        padding-top: 0.35rem;
        padding-bottom: 0.35rem;
    }

    /* Labels de campo */
    .fi-fo-field-wrp-label {
        font-size: 0.68rem;
    }

    /* Helper text */
    .fi-fo-field-wrp-helper-text {
        font-size: 0.62rem;
    }

    /* Select nativo */
    .fi-fo-select select,
    .fi-select-input {
        font-size: 0.70rem;
        padding-top: 0.35rem;
        padding-bottom: 0.35rem;
    }

    /* Choices.js (selects buscables) */
    .choices__inner {
        font-size: 0.70rem !important;
        padding: 0.25rem 0.5rem !important;
        min-height: unset !important;
    }
    .choices__list--single .choices__item,
    .choices__list--multiple .choices__item,
    .choices__list--dropdown .choices__item {
        font-size: 0.70rem !important;
    }
    .choices__input {
        font-size: 0.70rem !important;
    }

    /* Placeholder de campos Filament */
    .fi-fo-placeholder {
        font-size: 0.70rem;
    }

    /* Repeater — etiqueta de sección y botón agregar */
    .fi-fo-repeater .fi-fo-field-wrp-label {
        font-size: 0.68rem;
    }
    .fi-fo-repeater-add-action .fi-btn {
        font-size: 0.68rem;
        padding: 0.2rem 0.6rem;
    }
}

/* ── Troncal SMS API Reference — bloques de código (cURL / JSON) ──────────── */
.troncal-code {
    margin: 0.75rem 0;
    overflow: hidden;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background-color: #0b1220;
}
.troncal-code-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 0.75rem 0;
}
.troncal-code-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    border: 0;
    cursor: pointer;
    transition: background-color 0.15s ease;
}
.troncal-code-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}
.troncal-code-btn svg {
    width: 0.875rem;
    height: 0.875rem;
}
.troncal-code pre {
    margin: 0;
    padding: 1rem;
    overflow-x: auto;
    font-size: 0.75rem;
    line-height: 1.6;
    color: #e2e8f0;
}
.troncal-code .tok-url {
    color: #38bdf8;
}
.troncal-code .tok-str {
    color: #34d399;
}
.troncal-code .tok-lit {
    color: #fbbf24;
}

/* ── CRM Bandeja — resaltado de correos no leídos ──────────────────────────── */
.rv-bandeja-item {
    border-left: 4px solid transparent;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}
.rv-bandeja-item--unread {
    border-left-color: #f59e0b;
    background-color: rgba(245, 158, 11, 0.07);
}
.dark .rv-bandeja-item--unread {
    border-left-color: #fbbf24;
    background-color: rgba(251, 191, 36, 0.09);
}
.rv-bandeja-item--selected {
    background-color: rgba(99, 102, 241, 0.08);
}
.dark .rv-bandeja-item--selected {
    background-color: rgba(129, 140, 248, 0.14);
}
.rv-bandeja-unread-dot {
    display: inline-block;
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 9999px;
    background-color: #f59e0b;
}
.dark .rv-bandeja-unread-dot {
    background-color: #fbbf24;
}
