/**
 * =============================================================================
 * BOOTSTRAP TABLE - CSS CENTRALIZADO
 * =============================================================================
 * Estilos compartilhados para o plugin Bootstrap Table
 *
 * Conteúdo:
 * - Container da tabela
 * - Estilos base do Bootstrap Table
 * - Paginação
 * - Toolbar de busca
 * - Indicadores de status
 * - Responsividade
 * =============================================================================
 */

/* =============================================================================
   1. VARIÁVEIS CSS
   ============================================================================= */

.bootstrap-table,
.tabela-container {
    /* Cores de Interface */
    --bt-surface: var(--color-surface, #f8f9fa);
    --bt-surface-hover: var(--color-surface-hover, #f8f9fa);
    --bt-border: var(--color-border, #dee2e6);
    --bt-border-input: var(--color-border, #ced4da);

    /* Cores de Status */
    --bt-success: var(--color-success, #198754);
    --bt-danger: var(--color-danger, #dc3545);
    --bt-info: var(--color-info, #0dcaf0);
    --bt-warning: #fd7e14;
    --bt-purple: #6f42c1;

    /* Tipografia: usando clamp() para responsividade */
    --bt-font-xs: clamp(0.7rem, 0.65rem + 0.15vw, 0.75rem);
    --bt-font-sm: clamp(0.75rem, 0.7rem + 0.15vw, 0.8rem);
    --bt-font-base: clamp(0.8rem, 0.75rem + 0.15vw, 0.85rem);
    --bt-font-md: clamp(0.825rem, 0.775rem + 0.15vw, 0.875rem);
    --bt-font-lg: clamp(0.85rem, 0.8rem + 0.15vw, 0.9rem);
    --bt-font-weight: 600;

    /* Espaçamentos: usando clamp() para responsividade */
    --bt-space-xs: clamp(0.15rem, 0.1rem + 0.15vw, 0.25rem);
    --bt-space-sm: clamp(0.25rem, 0.2rem + 0.2vw, 0.375rem);
    --bt-space-md: clamp(0.375rem, 0.3rem + 0.25vw, 0.5rem);
    --bt-space-lg: clamp(0.5rem, 0.4rem + 0.35vw, 0.75rem);
    --bt-space-xl: clamp(0.75rem, 0.6rem + 0.5vw, 1rem);

    /* Bordas */
    --bt-radius: 0.25rem;

    /* Sombras */
    --bt-shadow: var(--shadow-card, 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075));
}

/* =============================================================================
   2. CONTAINER DA TABELA
   ============================================================================= */

.tabela-container {
    border: none;
    box-shadow: var(--bt-shadow);
}

/* =============================================================================
   3. BOOTSTRAP TABLE - ESTILOS BASE
   ============================================================================= */

.bootstrap-table .fixed-table-container {
    border: none;
}

.bootstrap-table .table {
    margin-bottom: 0;
}

.bootstrap-table .table thead th {
    background-color: var(--bt-surface);
    font-weight: var(--bt-font-weight);
    font-size: var(--bt-font-base);
    border-bottom: 2px solid var(--bt-border);
    white-space: nowrap;
}

.bootstrap-table .table tbody td {
    vertical-align: middle;
    font-size: var(--bt-font-lg);
}

.bootstrap-table .table tbody tr:hover {
    background-color: var(--bt-surface-hover);
}

/* =============================================================================
   4. PAGINAÇÃO
   ============================================================================= */

.bootstrap-table .fixed-table-pagination {
    padding: var(--bt-space-lg) var(--bt-space-xl);
    background-color: var(--bt-surface);
    border-top: 1px solid var(--bt-border);
}

.bootstrap-table .pagination {
    margin: 0;
}

.bootstrap-table .page-link {
    padding: var(--bt-space-sm) var(--bt-space-lg);
    font-size: var(--bt-font-md);
    color: var(--bt-success);
}

.bootstrap-table .page-item.active .page-link {
    background-color: var(--bt-success);
    border-color: var(--bt-success);
}

/* =============================================================================
   5. TOOLBAR DE BUSCA
   ============================================================================= */

.bootstrap-table .fixed-table-toolbar {
    padding: var(--bt-space-lg) var(--bt-space-xl);
    background-color: var(--bt-surface);
    border-bottom: 1px solid var(--bt-border);
}

.bootstrap-table .search input {
    font-size: var(--bt-font-md);
}

/* =============================================================================
   6. INDICADORES DE STATUS
   ============================================================================= */

.status-aberto,
.status-andamento,
.status-concluido,
.status-cancelado,
.status-aguardando,
.status-orcamento {
    font-weight: var(--bt-font-weight);
}

.status-aberto {
    color: var(--bt-info);
}

.status-andamento {
    color: var(--bt-warning);
}

.status-concluido,
.status-aguardando {
    color: var(--bt-success);
}

.status-cancelado {
    color: var(--bt-danger);
}

.status-orcamento {
    color: var(--bt-purple);
}

/* =============================================================================
   7. INPUTS NA EDIÇÃO
   ============================================================================= */

.bootstrap-table .table input[type="text"],
.bootstrap-table .table input[type="number"] {
    border: 1px solid var(--bt-border-input);
    border-radius: var(--bt-radius);
    padding: var(--bt-space-xs) var(--bt-space-md);
    font-size: var(--bt-font-md);
}

/* =============================================================================
   8. RESPONSIVIDADE
   NOTA: Media query de tipografia removida - valores via clamp()
   ============================================================================= */

/* Estrutural: search 100% width em mobile */
@media (max-width: 576px) {
    .bootstrap-table .fixed-table-toolbar .search {
        width: 100%;
    }

    .bootstrap-table .fixed-table-toolbar .search input {
        width: 100% !important;
    }
}
