/* =========================
📦 TABLE WRAPPER
========================= */

.adpai-table-wrapper{

    background:#fff;

    border-radius:24px;

    border:1px solid #edf2f7;

    overflow:hidden;

    box-shadow:
        0 2px 10px rgba(0,0,0,.04);

    margin-bottom:24px;
}

/* =========================
🧠 TOOLBAR
========================= */

.adpai-table-toolbar{

    display:flex;

    align-items:center;

    justify-content:space-between;

    gap:20px;

    padding:22px;

    border-bottom:
        1px solid #edf2f7;

    flex-wrap:wrap;
}

/* LEFT */

.table-toolbar-left{

    display:flex;

    flex-direction:column;

    gap:6px;
}

#table-title{

    margin:0;

    font-size:22px;

    font-weight:800;

    color:#111827;
}

#table-count{

    color:#6b7280;

    font-size:14px;
}

/* RIGHT */

.table-toolbar-right{

    display:flex;

    align-items:center;

    gap:12px;

    flex-wrap:wrap;
}

/* =========================
🔍 SEARCH
========================= */

#table-search{

    width:260px;

    height:48px;

    border-radius:14px;

    border:1px solid #d1d5db;

    padding:0 16px;

    font-size:14px;

    background:#fff;

    transition:.2s ease;
}

#table-search:focus{

    outline:none;

    border-color:#111827;
}

/* =========================
🎯 SELECTS
========================= */

#table-mode,
#table-status-filter{

    height:48px;

    border-radius:14px;

    border:1px solid #d1d5db;

    padding:0 14px;

    background:#fff;

    font-size:14px;

    cursor:pointer;
}

/* =========================
📊 TABLE
========================= */

.adpai-table{

    width:100%;

    border-collapse:collapse;
}

/* HEADER */

.adpai-table thead{

    background:#f9fafb;
}

.adpai-table th{

    text-align:left;

    padding:18px 20px;

    font-size:13px;

    font-weight:700;

    color:#6b7280;

    text-transform:uppercase;

    letter-spacing:.03em;

    border-bottom:
        1px solid #edf2f7;

    white-space:nowrap;
}

/* BODY */

.adpai-table td{

    padding:18px 20px;

    border-bottom:
        1px solid #f3f4f6;

    color:#111827;

    font-size:14px;

    vertical-align:middle;
}

/* ROW */

.adpai-table tbody tr{

    transition:.18s ease;

    cursor:pointer;
}

.adpai-table tbody tr:hover{

    background:#f9fafb;
}

/* ACTIVE ROW */

.adpai-table tbody tr.active{

    background:#f3f4f6;
}

/* =========================
🏷 STATUS
========================= */

.status-badge{

    display:inline-flex;

    align-items:center;

    justify-content:center;

    height:32px;

    padding:0 12px;

    border-radius:999px;

    font-size:12px;

    font-weight:700;
}

.status-good{

    background:#dcfce7;

    color:#166534;
}

.status-medium{

    background:#fef3c7;

    color:#92400e;
}

.status-bad{

    background:#fee2e2;

    color:#991b1b;
}

/* =========================
📦 EMPTY
========================= */

.table-empty-state{

    padding:60px 20px;

    text-align:center;
}

.empty-icon{

    width:70px;
    height:70px;

    margin:auto auto 18px;

    border-radius:22px;

    background:#f3f4f6;

    display:flex;

    align-items:center;

    justify-content:center;

    color:#6b7280;

    font-size:26px;
}

.table-empty-state h4{

    margin:0 0 10px;

    font-size:20px;

    color:#111827;
}

.table-empty-state p{

    margin:0;

    color:#6b7280;

    line-height:1.7;
}

/* =========================
📦 FOOTER
========================= */

.adpai-table-footer{

    display:flex;

    align-items:center;

    justify-content:space-between;

    gap:20px;

    padding:20px 22px;

    border-top:
        1px solid #edf2f7;

    flex-wrap:wrap;
}

/* =========================
🎯 ACTIONS
========================= */

.table-footer-right{

    display:flex;

    align-items:center;

    gap:12px;
}

/* =========================
🔘 BUTTONS
========================= */

.btn-secondary{

    height:46px;

    padding:0 18px;

    border-radius:14px;

    border:none;

    background:#f3f4f6;

    color:#111827;

    font-weight:600;

    cursor:pointer;

    display:flex;

    align-items:center;

    gap:10px;

    transition:.2s ease;
}

.btn-secondary:hover{

    background:#111827;

    color:#fff;
}

/* =========================
📱 MOBILE
========================= */

@media(max-width:1024px){

    .adpai-table-wrapper{

        overflow-x:auto;
    }

    .adpai-table{

        min-width:1100px;
    }
}

@media(max-width:768px){

    .adpai-table-toolbar{

        flex-direction:column;

        align-items:stretch;
    }

    .table-toolbar-right{

        width:100%;
    }

    #table-search{

        width:100%;
    }

    #table-mode,
    #table-status-filter{

        flex:1;
    }

    .adpai-table-footer{

        flex-direction:column;

        align-items:stretch;
    }

    .table-footer-right{

        width:100%;
    }

    .btn-secondary{

        flex:1;
        justify-content:center;
    }
}