/*
 * The panel's list tables, as Gettaxii's finished lists look on the same
 * Taxido theme: muted uppercase headings with one sort caret, a rounded
 * container, tall zebra rows, record numbers as green pills, people as an
 * initial avatar beside their name and contact line, and a square eye button
 * for View in a right-aligned Action column.
 *
 * Every rule hangs off .table-main, the theme's list wrapper, so each list in
 * the panel takes it without opting in. The markup pieces (pill, person, view
 * button, timestamp, empty row) live in templates/admin/fragments/table.html.
 */

.table-main {
    --tbl-line: #eceef0;
    --tbl-muted: #8a9099;
    --tbl-text: #171c26;
    --tbl-zebra: #f7f8f8;
    --tbl-pill-bg: rgba(25, 150, 117, .12);
}

/* The container: one rounded box, the table clipped to its corners. */
.table-main .table-responsive {
    border: 1px solid var(--tbl-line);
    border-radius: 12px;
}

/* Headings: small, uppercase, muted, on one line. */
.table-main .table-responsive .table thead th,
.table-main .table-responsive .table tfoot th {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .4px;
    text-transform: uppercase;
    color: var(--tbl-muted);
    white-space: nowrap;
}
.table-main .table-responsive .table thead a,
.table-main .table-responsive .table tfoot a { color: var(--tbl-muted); }
.table-main .table-responsive .table thead th.sorting-hover a:hover { color: var(--tbl-text); }

/*
 * One caret per sortable heading. The theme drew a pair of triangles on
 * every sortable column; an unsorted column now shows a faint ▾, and the
 * sorted one shows which way it runs.
 */
.table-main .sorting-indicators { display: inline-flex; align-items: center; }
.table-main .sorting-indicators .sorting-indicator { position: static; display: inline-block; width: auto; height: auto; }
.table-main .sorting-indicators .sorting-indicator::after { content: none !important; }
.table-main .sorting-indicators .sorting-indicator::before {
    content: "▾" !important;
    position: static !important;
    border: 0 !important;
    transform: none !important;
    font-size: 12px;
    line-height: 1;
    color: currentColor;
    opacity: .45;
}
.table-main .sorting-indicators .sorting-indicator.asc:not(.desc)::before { content: "▴" !important; opacity: 1; }
.table-main .sorting-indicators .sorting-indicator.desc:not(.asc)::before { opacity: 1; }

/* Rows: tall, zebra striped, contents centred on the row. */
.table-main .table-responsive .table tbody tr:nth-child(odd) { background-color: var(--tbl-zebra); }
.table-main .table-responsive .table tbody tr:nth-child(2n) { background-color: #fff; }
.table-main .table-responsive .table tbody td { height: 70px; vertical-align: middle; color: #171c26cc; }
.table-main .table-responsive .table tr.no-items td { height: auto; }

/* The Action column sits at the right edge, heading and buttons alike. */
.table-main .table-responsive .table th.col-action,
.table-main .table-responsive .table td.col-action { text-align: right; }
.table-main .table-responsive .table td.col-action .action-buttons { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; }

/* A record's number: a green pill that opens it (fragments/table :: idPill). */
.id-pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    background: var(--tbl-pill-bg, rgba(25, 150, 117, .12));
    color: var(--primary-color);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    text-decoration: none;
}
a.id-pill:hover { background: rgba(25, 150, 117, .2); color: var(--primary-color); }

/* A person (fragments/table :: personCell): avatar, bold name, muted contact line. */
.person-cell { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.table-main .table-responsive .table .person-cell .initial-letter { flex: none; }
.person-cell .person-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.person-cell .person-name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--tbl-text, #171c26);
    white-space: nowrap;
    text-transform: capitalize;
}
.person-cell a.person-name:hover { color: var(--primary-color); }
.person-cell .person-sub { font-size: 13px; line-height: 1.3; color: var(--tbl-muted, #8a9099); white-space: nowrap; }
/* Row actions under a person, as the theme draws them under a title. */
.table-main .table-responsive .table .person-cell .row-actions,
.table-main .table-responsive .table td.col-action .row-actions { display: flex; align-items: center; line-height: 1; margin-top: 6px; }
.table-main .table-responsive .table .person-cell .row-actions li,
.table-main .table-responsive .table td.col-action .row-actions li { line-height: 1; font-size: 13px; }
.table-main .table-responsive .table .person-cell .row-actions li + li,
.table-main .table-responsive .table td.col-action .row-actions li + li { border-left: 1px solid #ddd; padding-left: 6px; margin-left: 6px; }
.table-main .table-responsive .table .person-cell .row-actions li a,
.table-main .table-responsive .table td.col-action .row-actions li a,
.table-main .table-responsive .table .person-cell .row-actions li button,
.table-main .table-responsive .table td.col-action .row-actions li button { font-weight: 400; color: #777; }
.table-main .table-responsive .table .person-cell .row-actions li.delete :is(a, button),
.table-main .table-responsive .table td.col-action .row-actions li.delete :is(a, button) { color: #ff5443; }
.person-cell .person-text > .badge { align-self: flex-start; }

/* View (fragments/table :: viewButton): a square light-grey eye. */
.view-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: rgba(23, 28, 38, .08);
    color: var(--tbl-text, #171c26);
    font-size: 16px;
    line-height: 1;
    text-decoration: none;
}
.view-btn:hover { background: var(--tbl-pill-bg, rgba(25, 150, 117, .12)); color: var(--primary-color); }

/*
 * Title cells.
 *
 * The theme sets line-height 1 on a row's title block, so a name and the
 * phone or email under it touched, and a narrow column broke "Guest Map
 * Driver" one word per line with the number squeezed beneath. The title and
 * the contact line each keep to one line; text cells (a notice's message, a
 * log's address) opt out with .is-text, which also keeps their own case — the
 * theme capitalises names, and turned "ops@vexora.in" into "Ops@Vexora.In".
 */
.table-main .table-responsive .table .user-detail > :is(a, strong, span, small, div):not(.row-actions) { line-height: 1.35; }
.table-main .table-responsive .table .user-detail:not(.is-text) > :is(a, strong, span):first-child { white-space: nowrap; }
.table-main .table-responsive .table .user-detail .email,
.table-main .table-responsive .table .user-detail > small { white-space: nowrap; }
.table-main .table-responsive .table .user-detail.is-text { text-transform: none; }

/* "Delete Permanently" is one action, so it never splits over two lines. */
.table-main .table-responsive .table .row-actions li { white-space: nowrap; }

/* A timestamp is one thing, so it stays on one line (fragments/table :: when). */
.table-main .table-responsive .table td.when { white-space: nowrap; }

/* A ride a row refers to (fragments/table :: rideRef): its pill, then the route clamped to two lines. */
.ride-ref .route {
    min-width: 190px;
    max-width: 240px;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 6px;
}

/* The bar above a list: its count on the right reads as a heading for the table. */
.table-main .table-top-panel .total-data span { font-weight: 600; color: var(--tbl-text, #171c26); }

/* The gap mark in a windowed pager is not a link. */
.pagination .page-item.gap .page-link { background: none; border-color: transparent; cursor: default; }

.dark .table-main { --tbl-line: #40404080; --tbl-text: #eee; --tbl-zebra: #ffffff08; }
.dark .table-main .table-responsive .table tbody tr:nth-child(2n) { background-color: transparent; }
.dark .view-btn { background: #ffffff14; color: #eee; }
.view-btn.is-danger { background: rgba(255, 84, 67, .14); color: #e5483a; }
.view-btn.is-danger:hover { background: rgba(255, 84, 67, .24); color: #d7191c; }
.table-main .table-responsive .table td.col-action .row-actions { justify-content: flex-end; margin-top: 0; }

/* A thumbnail whose file is missing (js/admin-extras.js swaps it in). */
.table-image-missing {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background: rgba(23, 28, 38, .06);
    color: #9aa1aa;
    font-size: 18px;
    flex: none;
}

/* A column of running text (a slide's wording, a message) keeps a readable width. */
.table-main .table-responsive .table .col-wide { min-width: 280px; white-space: normal; }

/* Chats: the last line of a conversation, clamped so a long message keeps the row short. */
.chat-last span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 360px; }
