/* =========================
   TABLE CONTAINER (WAJIB)
========================= */

.table-container {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--ms-color-bg-canvas);
    border: 1px solid var(--ms-color-border-subtle);
}


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

.table-scroll {
    flex: 1 1 auto;
    overflow: auto;
    min-height: 0;
    height: 100%;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
}


/* =========================
   TABLE BASE (FLUENT STYLE)
========================= */

.office-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;

    font-family: var(--ms-font);
    font-size: var(--ms-font-size-body);
    line-height: var(--ms-line-height-normal);

    color: var(--ms-color-text-primary);
    background: var(--ms-color-bg-canvas);
}


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

.office-table thead th {
    position: sticky;
    top: 0;
    z-index: calc(var(--ms-z-sticky) - 1);

    background: var(--ms-color-neutral-100);

    padding: var(--ms-space-md);
    font-weight: var(--ms-font-weight-semi-bold);

    text-align: left;
    white-space: nowrap;

    border-bottom: 1px solid var(--ms-color-border-default);

    box-shadow: 0 1px 0 var(--ms-color-border-subtle);
}


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

.office-table td {
    padding: var(--ms-space-sm) var(--ms-space-md);

    border-bottom: 1px solid var(--ms-color-border-subtle);

    vertical-align: middle;

    white-space: nowrap;
    overflow: hidden;

    transition: background var(--ms-motion-fast) var(--ms-ease);
}


/* =========================
   TEXT ELLIPSIS (SAFE)
========================= */

.office-table td.text-ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


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

.office-table tbody tr {
    transition: background var(--ms-motion-fast) var(--ms-ease);
}

/* zebra subtle */
.office-table tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.015);
}

/* hover ala Outlook */
.office-table tbody tr:hover {
    background: var(--ms-color-neutral-100);
}


/* =========================
   COLUMN DIVIDER (SUBTLE)
========================= */

.office-table th:not(:last-child),
.office-table td:not(:last-child) {
    border-right: 1px solid var(--ms-color-border-subtle);
}


/* =========================
   COLUMN WIDTH CONTROL
========================= */

.office-table th:nth-child(1),
.office-table td:nth-child(1) {
    width: 50px;
    text-align: center;
}

.office-table th:nth-child(5),
.office-table td:nth-child(5) {
    width: 120px;
}

.office-table th:nth-child(7),
.office-table td:nth-child(7) {
    width: 100px;
    text-align: center;

    /* 🔥 FIX: jangan ellipsis di kolom action */
    overflow: visible;
}


/* URL column */
.office-table td:nth-child(6) {
    max-width: 320px;
}


/* =========================
   ACTION GROUP
========================= */

.office-table .action-group {
    display: flex;
    justify-content: center;
    gap: 4px;

    opacity: 0.25; /* 🔥 tweak: tidak kosong saat idle */
    transition: opacity var(--ms-motion-fast) var(--ms-ease);
}

/* highlight saat hover row */
.office-table tbody tr:hover .action-group {
    opacity: 1;
}


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

.office-table tbody tr td[colspan] {
    text-align: center;
    color: var(--ms-color-text-muted);
}


/* =========================
   SCROLLBAR (MODERN)
========================= */

.table-scroll::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-scroll::-webkit-scrollbar-thumb {
    background: var(--ms-color-neutral-300);
    border-radius: var(--ms-radius-pill);
}

.table-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--ms-color-neutral-400);
}


/* =========================
   TABLE FOOTER (FIX BOTTOM)
========================= */

.table-footer {
    flex-shrink: 0;
    padding: var(--ms-space-sm) var(--ms-space-md);
    border-top: 1px solid var(--ms-color-border-subtle);
    background: var(--ms-color-bg-canvas);
    position: relative;
    z-index: 2;
}


/* pagination fix */
.table-footer .pagination {
    margin-bottom: 0;
}


/* footer text */
.table-footer .small {
    color: var(--ms-color-text-secondary);
}