/*
 * Modo compacto para telas de notebook (<= 1399px, ex.: 1280/1366).
 * O tema inteiro é dimensionado em rem, então reduzir a fonte raiz
 * encolhe fonte, paddings, cards e botões proporcionalmente.
 * Ajuste fino: mude os 14px abaixo (15px = mais suave, 13px = mais denso).
 */
@media (max-width: 1399.98px) {
    html {
        font-size: 14px;
    }

    /*
     * Listagens (.default-table-area): o tema fixa os paddings das células
     * em px (15px/25px), que não escalam com a fonte raiz. Os !important
     * são necessários para vencer as variantes do tema (.style-two,
     * .recent-orders etc.) e os 25px !important da primeira/última coluna.
     */
    .default-table-area .table-responsive .table thead tr th,
    .default-table-area .table-responsive .table tbody tr td {
        padding: 8px 10px !important;
    }

    .default-table-area .table-responsive .table thead tr th:first-child,
    .default-table-area .table-responsive .table tbody tr td:first-child {
        padding-left: 14px !important;
    }

    .default-table-area .table-responsive .table thead tr th:last-child,
    .default-table-area .table-responsive .table tbody tr td:last-child {
        padding-right: 14px !important;
    }

    /* Rodapé "mostrando X de Y" + paginação das listagens */
    .default-table-area .showing-wrap {
        padding: 8px 14px;
    }

    /* Tabelas Bootstrap comuns (fora do padrão do tema) */
    .table > :not(caption) > * > * {
        padding: 0.35rem 0.5rem;
    }

    /*
     * Inputs: o tema fixa .form-control em height: 50px (px, não escala)
     * com variantes h-55/h-60. Volta à altura fluida padrão do Bootstrap
     * (~34px nesta faixa), dirigida por fonte + padding.
     */
    .form-control {
        height: auto;
        min-height: calc(1.5em + 0.75rem + 2px);
        padding: 0.4rem 0.75rem;
        font-size: 0.88rem;
    }

    .form-control.h-55,
    .form-control.h-60 {
        height: auto !important;
    }

    textarea.form-control {
        height: auto;
    }
}

/*
 * Sidebar compacta — só no desktop de notebook (1200–1399px).
 * Abaixo de 1200px a sidebar vira drawer (off-canvas) e o conteúdo já
 * ocupa 100%, então nada muda lá. O tema fixa tudo em px: largura 270px,
 * 25px entre itens e links com padding 12px.
 */
@media (min-width: 1200px) and (max-width: 1399.98px) {
    .sidebar-area {
        width: 230px;
    }

    .sidebar-area .logo {
        padding: 14px 16px;
    }

    /* O tema usa padding-left: 262px nessa faixa; acompanha a largura nova.
       O seletor com atributo não atropela o estado recolhido (sidebar-hide). */
    [sidebar-data-theme=sidebar-show] .main-content {
        padding-left: 240px;
    }

    .layout-menu {
        padding: 12px 14px 40px;
    }

    .menu-vertical .menu-item {
        margin-bottom: 6px;
    }

    .menu-vertical .menu-item .menu-link {
        padding: 8px 10px;
        font-size: 13px;
    }

    .menu-vertical .menu-item .menu-link .menu-icon {
        font-size: 18px;
    }

    /* Seta dos submenus: o tema fixa top em px para a altura antiga do link */
    .menu-vertical .menu-item .menu-link.menu-toggle::after,
    .menu-vertical .menu-item.open .menu-link.menu-toggle::after,
    .menu-vertical .menu-sub .menu-item.after-sub-menu .menu-link.menu-toggle::after {
        top: 15px !important;
    }

    .menu-vertical .menu-sub .menu-item .menu-link {
        padding: 7px 16px 7px 30px;
        font-size: 13px;
    }

    .menu-vertical .menu-sub .menu-item .menu-link::before {
        left: 12px;
    }
}

/*
 * Seletor de organização no header: o max-width do label vivia inline no
 * Blade e foi movido para cá. Em telas grandes (>= 1400px) o nome da
 * organização ativa ganha destaque (fonte maior e mais espaço).
 */
.organization-switcher .org-current-label {
    max-width: 180px;
}

@media (min-width: 1400px) {
    .organization-switcher .org-current-label {
        font-size: 1.35rem;
        font-weight: 600;
        max-width: 380px;
    }
}
