/* Tables, chips, urgency bars, avatars, tooltip */

/* ---------- tables ---------- */
.tc-table,
table.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    box-shadow: var(--sh-xs);
    overflow: hidden;
    color: var(--text-2);
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-2);
    --bs-table-striped-bg: var(--surface-2);
    --bs-table-hover-bg: var(--surface-2);
    --bs-table-border-color: var(--border);
}

.tc-table thead th,
table.table thead th {
    background: var(--surface-2) !important;
    color: var(--muted) !important;
    font: 600 11px/1.2 var(--font) !important;
    letter-spacing: 0.07em;
    text-transform: uppercase !important;
    padding: 11px 14px !important;
    border: 0 !important;
    border-bottom: 1px solid var(--border) !important;
    white-space: nowrap;
}

.tc-table tbody td,
table.table tbody td {
    padding: 12px 14px !important;
    border: 0 !important;
    border-bottom: 1px solid var(--border) !important;
    vertical-align: middle;
    font-size: 13px;
    color: var(--text-2);
    background: transparent;
}

.tc-table tbody tr:last-child td,
table.table tbody tr:last-child td {
    border-bottom: 0 !important;
}

.tc-table tbody tr,
table.table tbody tr {
    transition: background-color 120ms ease;
}

.tc-table tbody tr:hover,
table.table tbody tr:hover {
    background: var(--surface-2);
}

.tc-table tbody tr.table-row {
    height: auto !important;
}

.tc-table .cell-border-red,
.cell-border-red {
    box-shadow: inset 3px 0 0 var(--crit);
}

.tc-table .cell-border-yellow,
.cell-border-yellow {
    box-shadow: inset 3px 0 0 var(--amber-line);
}

.tc-table .cell-border-green,
.cell-border-green {
    box-shadow: inset 3px 0 0 var(--ok);
}

.tc-table .cell-border-blue,
.cell-border-blue {
    box-shadow: inset 3px 0 0 var(--accent);
}

.tc-table .cell-border-grey,
.tc-table .cell-border-gray {
    box-shadow: inset 3px 0 0 var(--faint);
}

.table-responsive {
    border-radius: var(--r);
}

.status-chip {
    text-transform: none !important;
    letter-spacing: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 9px;
    border-radius: 999px;
    font: 600 11.5px/18px var(--font);
    border: 1px solid var(--border);
    background: var(--surface-3);
    color: var(--text-2);
    white-space: nowrap;
}

.status-chip::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex: none;
}

.status-chip.is-crit {
    background: var(--crit-soft);
    border-color: var(--crit-line);
    color: var(--crit);
}

.status-chip.is-warn {
    background: var(--warn-soft);
    border-color: var(--warn-line);
    color: var(--warn);
}

.status-chip.is-ok {
    background: var(--ok-soft);
    border-color: var(--ok-line);
    color: var(--ok);
}

.status-chip.is-info {
    background: var(--info-soft);
    border-color: var(--info-line);
    color: var(--info);
}

td.cell-with-chip {
    color: inherit !important;
}

.person-photo {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
}

.pagination-container {
    padding: 12px 4px 0;
}

.pagination-btn,
.page-link {
    border: 1px solid var(--border-strong) !important;
    background: var(--surface) !important;
    color: var(--text) !important;
    padding: 4px 10px;
    font-size: 12.5px;
}

.pagination-btn:hover,
.page-link:hover {
    background: var(--surface-3) !important;
}

.page-item.active .page-link {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: var(--on-accent) !important;
}

/* urgency: signal bars */
.urgency-chip {
    text-transform: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font: 500 13px var(--font);
    color: var(--text);
    white-space: nowrap;
}

.urgency-bars {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 14px;
}

.urgency-bars i {
    width: 3px;
    border-radius: 1px;
    background: var(--surface-4);
}

.urgency-bars i:nth-child(1) {
    height: 5px;
}

.urgency-bars i:nth-child(2) {
    height: 8px;
}

.urgency-bars i:nth-child(3) {
    height: 11px;
}

.urgency-bars i:nth-child(4) {
    height: 14px;
}

.urgency-chip.u-crit .urgency-bars i.on {
    background: #d92d20;
}

.urgency-chip.u-high .urgency-bars i.on {
    background: #ea580c;
}

.urgency-chip.u-med .urgency-bars i.on {
    background: #f59e0b;
}

.urgency-chip.u-low .urgency-bars i.on {
    background: #3b82f6;
}

.urgency-chip.u-minor .urgency-bars i.on {
    background: var(--faint);
}

.urgency-chip.u-med,
.urgency-chip.u-low,
.urgency-chip.u-minor {
    color: var(--text-2);
}

html[data-theme="dark"] .urgency-bars i {
    background: var(--border-strong);
}

/* assigned to: overlapping avatars */
.avatar-stack {
    display: inline-flex;
    align-items: center;
    padding-left: 4px;
}

.avatar-stack-item {
    position: relative;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    margin-left: -6px;
    border-radius: 50%;
    border: 2px solid var(--surface);
    color: #fff !important;
    font: 700 10px/1 var(--font);
    letter-spacing: 0.02em;
    text-decoration: none !important;
    transition: transform 120ms var(--ease-out);
}

.avatar-stack-item:first-child {
    margin-left: 0;
}

.avatar-stack-item:hover,
.avatar-stack-item:focus-visible {
    transform: translateY(-1px);
    z-index: 3;
}

.avatar-hue-0 {
    background: #9b4a6c;
}

.avatar-hue-1 {
    background: #7b5cc6;
}

.avatar-hue-2 {
    background: #b4643a;
}

.avatar-hue-3 {
    background: #3f5f86;
}

.avatar-hue-4 {
    background: #2e7d6b;
}

.avatar-hue-5 {
    background: #a83d4c;
}

.avatar-hue-6 {
    background: #5d6b2e;
}

.avatar-hue-7 {
    background: #4a54c4;
}

.hover-tooltip {
    position: fixed;
    z-index: 2100;
    padding: 5px 8px;
    border-radius: 6px;
    background: var(--text);
    color: var(--bg);
    font: 500 12px var(--font);
    white-space: nowrap;
    box-shadow: var(--sh-md);
    pointer-events: none;
    transform: translate(-50%, -100%);
    animation: hover-tooltip-in 120ms var(--ease-out) both;
}

.hover-tooltip[hidden] {
    display: none;
}

@keyframes hover-tooltip-in {
    from {
        opacity: 0;
        margin-top: 3px;
    }

    to {
        opacity: 1;
        margin-top: 0;
    }
}

/* "+N" after 5 pictures */
.avatar-stack-item.avatar-stack-more {
    background: var(--surface-3);
    color: var(--text-2) !important;
    font: 600 10.5px/1 var(--font);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
    cursor: default;
}

/* shell tooltip */
.hover-tooltip.avatar-tooltip {
    width: max-content;
    max-width: none;
    padding: 5px 8px;
    border-radius: 6px;
    font: 500 12px var(--font);
    white-space: nowrap;
    opacity: 1;
    transform: translate(-50%, -100%);
    transition: none;
}

.hover-tooltip.avatar-tooltip.is-list {
    max-width: min(340px, calc(100vw - 16px));
    white-space: pre-line;
    text-align: left;
    line-height: 1.5;
    padding: 7px 10px;
}

.list-chip-more[data-tooltip-list]:focus-visible,
.avatar-stack-more:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

@media (max-width: 991.98px) {
    .app-shell-drawer-handle {
        display: none;
    }

    .app-shell-topbar .app-shell-search {
        width: 40px;
        padding: 0;
        justify-content: center;
        cursor: pointer;
    }

    .app-shell-topbar .app-shell-search:not(.is-open) .app-shell-search-input,
    .app-shell-topbar .app-shell-search kbd {
        display: none;
    }

    /* open search spans the top bar */
    .app-shell-topbar .app-shell-search.is-open {
        position: fixed;
        top: 12px;
        left: 12px;
        right: 12px;
        z-index: 2000;
        width: auto;
        padding: 0 11px;
        justify-content: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-shell-drawer-handle,
    .app-shell-drawer-handle svg,
    .summary-progress span {
        transition: none;
    }
}
