/* Tema global de tablas inspirado en modulo Notas */
:root {
    --table-night-0: #020b18;
    --table-night-1: #061528;
    --table-night-2: #08213f;
    --table-line: rgba(246, 196, 77, 0.34);
    --table-line-soft: rgba(246, 196, 77, 0.16);
    --table-gold: #f6c44d;
    --table-gold-hi: #ffd978;
    --table-text: #f7fbff;
    --table-muted: #a9b7ca;
    --table-green: #77e348;
}

.table-container,
.table-responsive,
.table-card,
.table-wrapper,
.table-shell,
.db-table-wrap,
.db-data-table-wrap,
.chart-container:has(table),
.card:has(table),
.panel:has(table),
.section-card:has(table) {
    border: 1px solid var(--table-line) !important;
    border-radius: 14px !important;
    background: linear-gradient(180deg, rgba(6, 22, 43, 0.94), rgba(3, 15, 31, 0.96)) !important;
    color: var(--table-text) !important;
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
    overflow: auto !important;
}

.table-container,
.table-responsive,
.table-card,
.table-wrapper,
.table-shell {
    padding: 0 !important;
}

table,
.table,
.data-table,
.grade-table,
.notes-table,
.boleta-table,
.attendance-month-table,
.db-builder-table,
.db-sidebar-table,
.db-data-table,
.admin-log-table,
.user-log-table,
.permissions-table,
.horario-table {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border: 0 !important;
    border-radius: 14px !important;
    background: transparent !important;
    color: var(--table-text) !important;
    overflow: hidden !important;
}

table thead,
.table thead,
.data-table thead,
.grade-table thead,
.notes-table thead,
.boleta-table thead {
    background: transparent !important;
}

table th,
.table th,
.data-table th,
.grade-table th,
.notes-table th,
.boleta-table th,
.attendance-month-table th,
.db-builder-table th,
.db-sidebar-table th,
.db-data-table th,
.admin-log-table th,
.user-log-table th,
.permissions-table th,
.horario-table th {
    height: 54px !important;
    padding: 10px 14px !important;
    border-top: 0 !important;
    border-left: 0 !important;
    border-bottom: 1px solid var(--table-line) !important;
    border-right: 1px solid var(--table-line-soft) !important;
    background: rgba(4, 17, 35, 0.92) !important;
    color: var(--table-gold-hi) !important;
    font-size: 13px !important;
    font-weight: 900 !important;
    letter-spacing: 0 !important;
    text-transform: uppercase !important;
    text-align: center !important;
    vertical-align: middle !important;
}

table td,
.table td,
.data-table td,
.grade-table td,
.notes-table td,
.boleta-table td,
.attendance-month-table td,
.db-builder-table td,
.db-sidebar-table td,
.db-data-table td,
.admin-log-table td,
.user-log-table td,
.permissions-table td,
.horario-table td {
    height: 56px !important;
    padding: 10px 14px !important;
    border-top: 0 !important;
    border-left: 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-right: 1px solid rgba(246, 196, 77, 0.12) !important;
    background: rgba(7, 27, 52, 0.62) !important;
    color: var(--table-text) !important;
    font-size: 14px !important;
    text-align: center !important;
    vertical-align: middle !important;
}

table tbody tr:nth-child(even) td,
.table tbody tr:nth-child(even) td,
.data-table tbody tr:nth-child(even) td,
.grade-table tbody tr:nth-child(even) td,
.notes-table tbody tr:nth-child(even) td,
.boleta-table tbody tr:nth-child(even) td {
    background: rgba(10, 37, 70, 0.7) !important;
}

table tbody tr:hover td,
.table tbody tr:hover td,
.data-table tbody tr:hover td,
.grade-table tbody tr:hover td,
.notes-table tbody tr:hover td,
.boleta-table tbody tr:hover td {
    background: rgba(246, 196, 77, 0.08) !important;
}

table tbody tr:last-child td,
.table tbody tr:last-child td,
.data-table tbody tr:last-child td {
    border-bottom-color: transparent !important;
}

table th:first-child,
table td:first-child,
.table th:first-child,
.table td:first-child,
.data-table th:first-child,
.data-table td:first-child {
    border-left: 0 !important;
}

table th:last-child,
table td:last-child,
.table th:last-child,
.table td:last-child,
.data-table th:last-child,
.data-table td:last-child {
    border-right: 0 !important;
}

table caption,
.table caption,
.table-title,
.chart-title,
.card-title:has(+ table),
.panel-title:has(+ table) {
    color: var(--table-gold-hi) !important;
    font-weight: 900 !important;
    text-shadow: 0 0 16px rgba(246, 196, 77, 0.18) !important;
}

table a,
.table a,
.data-table a {
    color: var(--table-gold-hi) !important;
}

table small,
.table small,
.data-table small,
table .text-muted,
.table .text-muted,
.data-table .text-muted,
table .text-secondary,
.table .text-secondary,
.data-table .text-secondary {
    color: var(--table-muted) !important;
}

table input,
table select,
table textarea,
.table input,
.table select,
.table textarea,
.data-table input,
.data-table select,
.data-table textarea {
    border: 1px solid rgba(246, 196, 77, 0.42) !important;
    border-radius: 8px !important;
    background: rgba(5, 19, 38, 0.86) !important;
    color: var(--table-text) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08) !important;
}

table select option,
.table select option,
.data-table select option {
    background: var(--table-night-1) !important;
    color: var(--table-text) !important;
}

table button,
.table button,
.data-table button,
.table .btn,
.data-table .btn {
    border: 1px solid var(--table-line) !important;
    background: linear-gradient(180deg, rgba(255, 217, 120, 0.16), rgba(246, 196, 77, 0.08)) !important;
    color: var(--table-gold-hi) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 8px 18px rgba(0,0,0,0.2) !important;
}

table button i,
.table button i,
.data-table button i,
.table .btn i,
.data-table .btn i {
    color: var(--table-gold-hi) !important;
}

.badge,
.pill,
.chip,
.status-chip,
.data-status,
table .badge,
.table .badge,
.data-table .badge {
    border: 1px solid rgba(246, 196, 77, 0.44) !important;
    background: rgba(246, 196, 77, 0.14) !important;
    color: var(--table-gold-hi) !important;
}

.data-status.activo,
.status-badge.activo,
.badge.bg-success,
.badge.text-bg-success,
table .success,
.table .success {
    border-color: rgba(119, 227, 72, 0.72) !important;
    background: rgba(16, 111, 43, 0.36) !important;
    color: #ddffcf !important;
}

.data-status.inactivo,
.status-badge.inactivo,
.badge.bg-danger,
.badge.text-bg-danger,
table .danger,
.table .danger {
    border-color: rgba(255, 82, 82, 0.62) !important;
    background: rgba(120, 28, 42, 0.38) !important;
    color: #ffd4d4 !important;
}

.data-status.retirado,
.status-badge.retirado,
.badge.bg-warning,
.badge.text-bg-warning,
table .warning,
.table .warning {
    border-color: rgba(246, 196, 77, 0.72) !important;
    background: rgba(246, 196, 77, 0.2) !important;
    color: var(--table-gold-hi) !important;
}

@media (max-width: 780px) {
    table,
    .table,
    .data-table,
    .grade-table,
    .notes-table,
    .boleta-table,
    .attendance-month-table,
    .db-builder-table,
    .db-sidebar-table,
    .db-data-table {
        min-width: 760px;
    }

    table th,
    table td,
    .table th,
    .table td,
    .data-table th,
    .data-table td {
        padding: 9px 10px !important;
        font-size: 12px !important;
    }
}
