/* ==============================================
   TABLE — Seção de tabela/grid com header
   Centralizado: todas as listagens da app.
   ============================================== */

/* ── Wrapper da seção ── */
.custom-table-section {
    background: white;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

/* ── Header: título + toggle de visualização ── */
.custom-table-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ── Título da seção ── */
.custom-table-title {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.custom-table-title i {
    font-size: 0.7rem;
    color: var(--primary-color);
    opacity: 0.8;
}

/* ── Toggle tabela/grid ── */
.view-toggle {
    display: flex;
    gap: 3px;
    background: #F1F5F9;
    border-radius: 8px;
    padding: 3px;
}

.view-btn {
    padding: 0.3rem 0.6rem;
    border: none;
    border-radius: 5px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.view-btn.active {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* ── Tabela ── */
.custom-table {
    width: 100%;
    border-collapse: collapse;
}

.custom-table th {
    background: #FAFAFA;
    padding: 0.75rem 1.25rem;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
}

.custom-table th.middle {
    text-align: center;
}

.custom-table td {
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid #F8F9FA;
    font-size: 0.875rem;
    color: var(--body-text);
    vertical-align: middle;
}

.custom-table tr:last-child td {
    border-bottom: none;
}

.custom-table tr:hover td {
    background: #FAFBFC;
}

.custom-table td.code {
    max-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-table td.name {
    max-width: 18rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
}

.custom-table td.middle {
    text-align: center;
}

/* ── Responsive base ── */
@media (max-width: 768px) {
    .custom-table {
        font-size: 0.8rem;
    }

    .custom-table th,
    .custom-table td {
        padding: 0.625rem 0.875rem;
    }
}

/* ─────────────────────────────────
   Colunas responsivas
   Aplique no <th> e no <td> da mesma coluna.
   col-xl → oculta em < 1200px
   col-lg → oculta em < 992px
   col-md → oculta em < 768px
   ───────────────────────────────── */
@media (max-width: 1199px) {
    .custom-table th.col-xl,
    .custom-table td.col-xl { display: none; }
}

@media (max-width: 991px) {
    .custom-table th.col-lg,
    .custom-table td.col-lg { display: none; }
}

@media (max-width: 767px) {
    .custom-table th.col-md,
    .custom-table td.col-md { display: none; }
}
