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

.gt-table {

    --bs-table-bg: transparent;

    width: 100%;

    border-collapse: separate;
    border-spacing: 0;

    border-radius: 18px;

    overflow: hidden;

   background: var(--gt-surface);

    border: 1px solid rgba(148,163,184,.10);

    box-shadow:
        0 1px 2px rgba(15,23,42,.04),
        0 12px 32px rgba(15,23,42,.035);

    backdrop-filter: blur(8px);
}

/* =========================================================
   HEADER
========================================================= */

.gt-table thead th {

    position: relative;

    background:
        linear-gradient(
            180deg,
            rgba(248,250,252,.98) 0%,
            rgba(241,245,249,.96) 100%
        );

    color: #475569;

    font-size: .74rem;

    font-weight: 700;

    letter-spacing: .08em;

    text-transform: uppercase;

    padding: 1rem 1rem;

    border-bottom: 1px solid rgba(148,163,184,.10);

    white-space: nowrap;

    vertical-align: middle;
}

/* Línea sutil inferior premium */

.gt-table thead th::after {

    content: "";

    position: absolute;

    left: 0;
    bottom: 0;

    width: 100%;
    height: 1px;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(37,99,235,.15),
            transparent
        );
}

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

.gt-table tbody tr {

    transition:
        background .22s ease,
        transform .22s ease,
        box-shadow .22s ease;
}

.gt-table tbody td {

    padding: 1rem 1rem;

    vertical-align: middle;

    border-bottom: 1px solid rgba(226,232,240,.65);

    color: #334155;

    font-size: .93rem;

    transition: all .22s ease;

    background: transparent;
}

/* Última fila */

.gt-table tbody tr:last-child td {

    border-bottom: none;
}

/* =========================================================
   HOVER
========================================================= */

.gt-table tbody tr:hover {

    background:
        linear-gradient(
            90deg,
            rgba(37,99,235,.028),
            rgba(56,189,248,.02)
        );
}

.gt-table tbody tr:hover td {

    color: #0f172a;
}

/* =========================================================
   ROW CLICKABLE
========================================================= */

.gt-table .grid-clickable {

    cursor: pointer;
}

/* =========================================================
   FILTER ROW
========================================================= */

.grid-filter-row td {

    background: #fbfcfe;

    border-bottom: 1px solid rgba(226,232,240,.8);
}

.grid-filter-row input,
.grid-filter-row select {

    width: 100%;

    min-height: 40px;

    border-radius: 12px;

    border: 1px solid rgba(203,213,225,.8);

    background: white;

    padding: .45rem .75rem;

    font-size: .88rem;

    transition: all .2s ease;

    box-shadow: none;
}

.grid-filter-row input:focus,
.grid-filter-row select:focus {

    border-color: rgba(37,99,235,.55);

    background: #fff;

    box-shadow:
        0 0 0 .2rem rgba(37,99,235,.10);

    outline: none;
}

/* =========================================================
   PAGINATION
========================================================= */

.pagination {

    gap: .35rem;
}

.pagination .page-item {

    display: flex;
}

.pagination .page-link {

    min-width: 38px;
    height: 38px;

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

    border: none !important;

    border-radius: 12px !important;

    background: white;

    color: #475569;

    font-size: .9rem;
    font-weight: 600;

    transition: all .22s ease;

    box-shadow:
        0 1px 2px rgba(15,23,42,.04);
}

.pagination .page-link:hover {

    background: rgba(37,99,235,.08);

    color: var(--gt-primary);

    transform: translateY(-1px);
}

.pagination .page-item.active .page-link {

    background:
        linear-gradient(
            135deg,
            var(--gt-primary),
            #3b82f6
        );

    color: white;

    box-shadow:
        0 8px 18px rgba(37,99,235,.28);
}

/* =========================================================
   SUMMARY
========================================================= */

.summary {

    font-size: .88rem;

    color: #64748b;
}

/* =========================================================
   EMPTY
========================================================= */

.empty {

    padding: 3rem 2rem;

    text-align: center;

    color: #94a3b8;

    font-size: .95rem;
}

/* =========================================================
   STATUS BADGE
========================================================= */

.gt-status-badge {

    display: inline-flex;

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

    min-width: 108px;

    padding: .42rem .8rem;

    border-radius: 999px;

    background: var(--badge-color);

    color: white;

    font-size: .72rem;

    font-weight: 700;

    letter-spacing: .05em;

    text-transform: uppercase;

    box-shadow:
        inset 0 1px 1px rgba(255,255,255,.14);
}

/* =========================================================
   DARK MODE
========================================================= */

body.dark-mode .gt-table {

    background: #16202f;

    border-color: rgba(255,255,255,.06);

    box-shadow:
        0 8px 24px rgba(0,0,0,.25);
}

body.dark-mode .gt-table thead th {

    background:
        linear-gradient(
            180deg,
            rgba(30,41,59,.96),
            rgba(15,23,42,.98)
        );

    color: #e2e8f0;

    border-bottom-color: rgba(255,255,255,.06);
}

body.dark-mode .gt-table tbody td {

    color: #cbd5e1;

    border-bottom-color: rgba(255,255,255,.05);
}

body.dark-mode .gt-table tbody tr:hover {

    background:
        linear-gradient(
            90deg,
            rgba(37,99,235,.10),
            rgba(56,189,248,.08)
        );
}

body.dark-mode .grid-filter-row td {

    background: #182334;
}

body.dark-mode .grid-filter-row input,
body.dark-mode .grid-filter-row select {

    background: #0f172a;

    border-color: rgba(255,255,255,.08);

    color: #e2e8f0;
}

body.dark-mode .pagination .page-link {

    background: #1e293b;

    color: #cbd5e1;
}

body.dark-mode .pagination .page-item.active .page-link {

    background: linear-gradient(
        135deg,
        #2563eb,
        #3b82f6
    );
}


/* =========================================================
   ROW STATUS COLOR
========================================================= */

.gt-table tbody tr.gt-row-status {

    position: relative;

    isolation: isolate;
}

/* barra lateral */

.gt-table tbody tr.gt-row-status td:first-child {

    position: relative;

    overflow: hidden;
}

/* glow lateral */

.gt-table tbody tr.gt-row-status td:first-child::before {

    content: "";

    position: absolute;

    top: 10%;
    left: 0;

    width: 4px;
    height: 80%;

    border-radius: 0 999px 999px 0;

    background: var(--gt-row-color, #cbd5e1);

    box-shadow:
        0 0 0 1px rgba(255,255,255,.04),
        0 0 12px color-mix(
            in srgb,
            var(--gt-row-color) 55%,
            transparent
        );

    transition:
        width .22s ease,
        box-shadow .22s ease,
        opacity .22s ease;
}

/* hover */

.gt-table tbody tr.gt-row-status:hover td:first-child::before {

    width: 6px;

    box-shadow:
        0 0 0 1px rgba(255,255,255,.06),
        0 0 18px color-mix(
            in srgb,
            var(--gt-row-color) 75%,
            transparent
        );
}

/* hover fila */

.gt-table tbody tr.gt-row-status:hover {

    transform: translateY(-1px);

    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.02);
}

/* =========================================================
   GRID TOOLBAR
========================================================= */

.gt-grid-toolbar {

    display: flex;

    justify-content: flex-end;

    align-items: stretch;

    gap: 1rem;

    flex-wrap: wrap;
}

/* =========================================================
   GRID CONTROL
========================================================= */

.gt-grid-control {

    min-width: 220px;

    padding: .9rem 1rem;

    border-radius: 16px;

    background: white;

    border: 1px solid rgba(226,232,240,.9);

    box-shadow:
        0 1px 2px rgba(15,23,42,.04),
        0 8px 20px rgba(15,23,42,.03);

    transition: all .22s ease;
}

.gt-grid-control:hover {

    transform: translateY(-1px);

    box-shadow:
        0 8px 24px rgba(15,23,42,.06);
}

/* =========================================================
   LABEL
========================================================= */

.gt-grid-control-label {

    font-size: .72rem;

    font-weight: 700;

    text-transform: uppercase;

    letter-spacing: .08em;

    color: #64748b;

    margin-bottom: .55rem;
}

/* =========================================================
   SELECT
========================================================= */

.gt-grid-select {

    min-height: 42px;

    border-radius: 12px;

    border: 1px solid rgba(203,213,225,.9);

    font-size: .92rem;

    font-weight: 600;

    color: #1e293b;

    background-color: white;

    transition: all .2s ease;
}

.gt-grid-select:focus {

    border-color: rgba(37,99,235,.5);

    box-shadow:
        0 0 0 .22rem rgba(37,99,235,.10);

    outline: none;
}

/* =========================================================
   HELP TEXT
========================================================= */

.gt-grid-control-help {

    margin-top: .55rem;

    font-size: .74rem;

    line-height: 1.4;

    color: #94a3b8;
}

/* =========================================================
   DARK MODE
========================================================= */

body.dark-mode .gt-grid-control {

    background: #16202f;

    border-color: rgba(255,255,255,.06);

    box-shadow:
        0 8px 24px rgba(0,0,0,.25);
}

body.dark-mode .gt-grid-control-label {

    color: rgba(255,255,255,.72);
}

body.dark-mode .gt-grid-select {

    background: #0f172a;

    border-color: rgba(255,255,255,.08);

    color: #e2e8f0;
}

body.dark-mode .gt-grid-control-help {

    color: rgba(255,255,255,.45);
}

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

@media (max-width: 768px) {

    .gt-grid-toolbar {

        flex-direction: row;

        gap: .75rem;

        align-items: stretch;
    }

    .gt-grid-control {

        flex: 1;

        min-width: 0;

        padding: .7rem .8rem;

        border-radius: 14px;
    }

    .gt-grid-control-label {

        font-size: .64rem;

        margin-bottom: .35rem;
    }

    .gt-grid-select {

        min-height: 38px;

        font-size: .82rem;
    }

    .gt-grid-control-help {

        display: none;
    }
}

/* =========================================================
   GRID FOOTER
========================================================= */

.gt-grid-footer {

    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 1rem;

    margin-top: 1rem;

    flex-wrap: wrap;
}

/* =========================================================
   PAGINATION
========================================================= */

.pagination {

    gap: .35rem;

    flex-wrap: wrap;

    justify-content: center;

    margin-bottom: 0;
}

.pagination .page-item {

    display: flex;

    flex-shrink: 0;
}

.pagination .page-link {

    min-width: 38px;
    height: 38px;

    padding: 0 .7rem;

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

    border: none !important;

    border-radius: 12px !important;

    background: white;

    color: #475569;

    font-size: .9rem;

    font-weight: 600;

    transition: all .22s ease;

    box-shadow:
        0 1px 2px rgba(15,23,42,.04);
}

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

@media (max-width: 768px) {

    .gt-grid-footer {

        flex-direction: column;

        align-items: center;

        text-align: center;
    }

    .pagination {

        gap: .25rem;
    }

    .pagination .page-link {

        min-width: 34px;

        height: 34px;

        padding: 0 .55rem;

        font-size: .8rem;

        border-radius: 10px !important;
    }

    .summary {

        width: 100%;

        font-size: .78rem;

        text-align: center;
    }
}