/* ========================================
   TABLES CSS
   Tablas globales reutilizables
======================================== */

/* ========================================
   TABLE WRAPPER
======================================== */

.table-wrapper {

    background: var(--card-bg);

    border-radius: var(--radius-lg);

    border: 1px solid var(--border);

    box-shadow: var(--shadow-sm);

    overflow: hidden;

    margin-bottom: 24px;
}

/* ========================================
   TABLE RESPONSIVE
======================================== */

.table-responsive {

    border-radius: inherit;
}

/* ========================================
   TABLE
======================================== */

.home-table {

    margin-bottom: 0;

    min-width: 760px;

    vertical-align: middle;
}

/* ========================================
   TABLE HEAD
======================================== */

.home-table thead {

    background: #f8fafc;

    border-bottom: 1px solid var(--border);
}

/* HEAD CELLS */

.home-table th {

    border: none;

    padding: 18px 20px;

    font-size: 13px;

    font-weight: 700;

    text-transform: uppercase;

    letter-spacing: 0.04em;

    color: #64748b;

    white-space: nowrap;
}

/* ========================================
   TABLE BODY
======================================== */

.home-table tbody tr {

    transition: var(--transition);

    border-bottom: 1px solid #f1f5f9;
}

/* LAST ROW */

.home-table tbody tr:last-child {
    border-bottom: none;
}

/* HOVER */

.home-table tbody tr:hover {

    background: #f8fbff;
}

/* ========================================
   TABLE CELLS
======================================== */

.home-table td {

    padding: 18px 20px;

    border: none;

    vertical-align: middle;
}

/* ========================================
   TABLE TITLE
======================================== */

.table-title {

    font-weight: 700;

    color: var(--text);

    transition: var(--transition);
}

.table-title:hover {

    color: var(--primary);
}

/* ========================================
   TABLE SUBTITLE
======================================== */

.table-subtitle {

    color: var(--muted);

    font-size: 13px;

    margin-top: 2px;
}

/* ========================================
   TABLE ICON
======================================== */

.table-icon {

    width: 50px;
    height: 50px;

    border-radius: 14px;

    background: #eff6ff;

    color: var(--primary);

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 20px;

    flex-shrink: 0;
}

/* ========================================
   ACTION BUTTONS
======================================== */

.action-btn {

    border-radius: 10px;

    padding: 8px 14px;

    font-weight: 600;

    transition: var(--transition);
}

/* ========================================
   TABLE BADGES
======================================== */

.table-badge {

    display: inline-flex;

    align-items: center;

    gap: 8px;

    padding: 8px 14px;

    border-radius: 999px;

    font-size: 13px;

    font-weight: 700;
}

/* COLORS */

.table-badge.primary {

    background: #eff6ff;

    color: var(--primary);
}

.table-badge.success {

    background: #ecfdf5;

    color: #15803d;
}

.table-badge.warning {

    background: #fffbeb;

    color: #b45309;
}

.table-badge.danger {

    background: #fef2f2;

    color: #dc2626;
}

.table-badge.dark {

    background: #f3f4f6;

    color: #111827;
}

/* ========================================
   MONEY CELLS
======================================== */

.money-positive {

    color: #15803d;

    font-weight: 700;
}

.money-negative {

    color: #dc2626;

    font-weight: 700;
}

.money-neutral {

    color: var(--text);

    font-weight: 700;
}

/* ========================================
   TABLE ACTIONS
======================================== */

.table-actions {

    display: flex;

    justify-content: flex-end;

    gap: 8px;

    flex-wrap: wrap;
}

/* ========================================
   EMPTY TABLE STATE
======================================== */

.empty-table {

    text-align: center;

    padding: 60px 20px;
}

.empty-table-icon {

    width: 80px;
    height: 80px;

    margin: 0 auto 18px;

    border-radius: 20px;

    background: #eff6ff;

    color: var(--primary);

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 34px;
}

.empty-table h5 {

    font-weight: 700;

    color: var(--text);

    margin-bottom: 10px;
}

.empty-table p {

    color: var(--muted);

    margin-bottom: 20px;
}

/* ========================================
   TABLE HEADER SECTION
======================================== */

.table-section-header {

    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 16px;

    flex-wrap: wrap;

    margin-bottom: 20px;
}

/* ========================================
   TABLE SEARCH
======================================== */

.table-search {

    max-width: 320px;
}

.table-search input {

    border-radius: 12px;

    border: 1px solid var(--border);

    padding: 10px 14px;

    width: 100%;

    background: white;
}

/* ========================================
   TABLE FOOTER
======================================== */

.table-footer {

    padding: 18px 20px;

    border-top: 1px solid var(--border);

    background: #fafafa;
}

/* ========================================
   SMALL TABLE
======================================== */

.table-sm-custom th,
.table-sm-custom td {

    padding: 14px 16px;
}

/* ========================================
   BORDERED TABLE
======================================== */

.table-bordered-custom {

    border: 1px solid var(--border);

    border-radius: 16px;

    overflow: hidden;
}

/* ========================================
   MOBILE
======================================== */

@media (max-width: 768px) {

    .home-table {

        min-width: 680px;
    }

    .home-table th {

        padding: 14px 16px;

        font-size: 12px;
    }

    .home-table td {

        padding: 14px 16px;

        font-size: 14px;
    }

    .table-icon {

        width: 42px;
        height: 42px;

        font-size: 18px;
    }

    .table-badge {

        font-size: 12px;

        padding: 7px 12px;
    }

    .table-actions {

        justify-content: flex-start;
    }

    .action-btn {

        padding: 7px 12px;

        font-size: 13px;
    }

}

@media (max-width: 480px) {

    .home-table {

        min-width: 620px;
    }

}