/*
 * FieldNiq panel theme
 * ─────────────────────────────────────────────────────────────────────────────
 * Layered on top of Filament's own compiled CSS rather than replacing it: the
 * project's Vite pipeline is Tailwind v4 while Filament 3 themes need Tailwind
 * v3, and production serves committed assets (no `npm run build` on deploy).
 *
 * Registered in TenantAdminPanelProvider as a Filament asset, published with
 * `php artisan filament:assets` to public/css/app/fieldniq-theme.css, and
 * linked through the STYLES_AFTER hook so it loads after Filament's theme.
 *
 * Rules target Filament's semantic `fi-*` classes. Most selectors carry two
 * classes so they win against Tailwind's `dark:` variants (also two) by source
 * order, without !important. Tailwind ring/shadow utilities are adjusted via
 * their `--tw-*` variables so the ring and the shadow keep composing.
 *
 * Sections
 *   1. Tokens          5. Surfaces & controls
 *   2. Base            6. Tables, badges, overlays
 *   3. Sidebar         7. Today's Overview (ops-*)
 *   4. Topbar & header 8. Motion
 */

/* ── 1. Tokens ──────────────────────────────────────────────────────────── */

:root {
    --fq-bg: #f4f7fb;
    --fq-surface: #ffffff;
    --fq-surface-2: #f8fafc;
    --fq-surface-3: #f1f5f9;
    --fq-border: #e2e8f0;
    --fq-border-strong: #cbd5e1;
    --fq-text: #0f172a;
    --fq-text-2: #334155;
    --fq-muted: #64748b;
    --fq-subtle: #94a3b8;

    --fq-primary: #2563eb;
    --fq-primary-hover: #1d4ed8;
    --fq-primary-soft: rgb(37 99 235 / 0.08);

    --fq-success: #059669;
    --fq-success-dot: #10b981;
    --fq-success-soft: #ecfdf5;
    --fq-warning: #b45309;
    --fq-warning-dot: #f59e0b;
    --fq-warning-soft: #fffbeb;
    --fq-danger: #be123c;
    --fq-danger-dot: #f43f5e;
    --fq-danger-soft: #fff1f2;
    --fq-info: #1d4ed8;
    --fq-info-dot: #3b82f6;
    --fq-info-soft: #eff6ff;
    --fq-violet: #6d28d9;
    --fq-violet-dot: #8b5cf6;
    --fq-violet-soft: #f5f3ff;
    --fq-cyan: #0e7490;
    --fq-cyan-dot: #06b6d4;
    --fq-cyan-soft: #ecfeff;
    --fq-neutral: #475569;
    --fq-neutral-dot: #94a3b8;
    --fq-neutral-soft: #f1f5f9;

    --fq-shadow-xs: 0 1px 2px 0 rgb(15 23 42 / 0.04);
    --fq-shadow-sm: 0 1px 2px 0 rgb(15 23 42 / 0.04), 0 1px 3px 0 rgb(15 23 42 / 0.04);
    --fq-shadow-md: 0 1px 2px 0 rgb(15 23 42 / 0.04), 0 8px 24px -8px rgb(15 23 42 / 0.12);
    --fq-shadow-lg: 0 2px 4px 0 rgb(15 23 42 / 0.04), 0 24px 48px -12px rgb(15 23 42 / 0.22);

    --fq-radius: 14px;
    --fq-radius-sm: 10px;
    --fq-ease: cubic-bezier(0.2, 0.7, 0.2, 1);

    /* Sidebar: same light surface as the page, so it reads as one app; the
       active item carries the same blue as a selected tab. */
    --fq-side-bg: #ffffff;
    --fq-side-border: #e2e8f0;
    --fq-side-text: #334155;
    --fq-side-text-hover: #0f172a;
    --fq-side-muted: #64748b;
    --fq-side-icon: #94a3b8;
    --fq-side-hover: #f1f5f9;
    --fq-side-active-bg: #eff6ff;
    --fq-side-active-text: #1d4ed8;
    --fq-side-active-icon: #2563eb;
}

.dark {
    --fq-bg: #070b14;
    --fq-surface: #0f172a;
    --fq-surface-2: #131c2f;
    --fq-surface-3: #1a2438;
    --fq-border: rgb(148 163 184 / 0.13);
    --fq-border-strong: rgb(148 163 184 / 0.24);
    --fq-text: #f1f5f9;
    --fq-text-2: #cbd5e1;
    --fq-muted: #94a3b8;
    --fq-subtle: #64748b;

    --fq-primary: #60a5fa;
    --fq-primary-hover: #93c5fd;
    --fq-primary-soft: rgb(96 165 250 / 0.12);

    --fq-success: #34d399;
    --fq-success-soft: rgb(16 185 129 / 0.13);
    --fq-warning: #fbbf24;
    --fq-warning-soft: rgb(245 158 11 / 0.13);
    --fq-danger: #fb7185;
    --fq-danger-soft: rgb(244 63 94 / 0.13);
    --fq-info: #93c5fd;
    --fq-info-soft: rgb(59 130 246 / 0.14);
    --fq-violet: #c4b5fd;
    --fq-violet-soft: rgb(139 92 246 / 0.15);
    --fq-cyan: #67e8f9;
    --fq-cyan-soft: rgb(6 182 212 / 0.13);
    --fq-neutral: #cbd5e1;
    --fq-neutral-dot: #64748b;
    --fq-neutral-soft: rgb(148 163 184 / 0.12);

    --fq-shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --fq-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.35);
    --fq-shadow-md: 0 1px 2px 0 rgb(0 0 0 / 0.3), 0 12px 28px -10px rgb(0 0 0 / 0.6);
    --fq-shadow-lg: 0 2px 4px 0 rgb(0 0 0 / 0.3), 0 28px 56px -12px rgb(0 0 0 / 0.7);

    --fq-side-bg: #0b1222;
    --fq-side-border: rgb(148 163 184 / 0.12);
    --fq-side-text: #cbd5e1;
    --fq-side-text-hover: #f8fafc;
    --fq-side-muted: #94a3b8;
    --fq-side-icon: #64748b;
    --fq-side-hover: rgb(255 255 255 / 0.05);
    --fq-side-active-bg: rgb(59 130 246 / 0.16);
    --fq-side-active-text: #bfdbfe;
    --fq-side-active-icon: #60a5fa;
}

/* ── 2. Base ────────────────────────────────────────────────────────────── */

.fi-body {
    background-color: var(--fq-bg);
    color: var(--fq-text);
    /* Inter: single-storey a off, open digits, tabular-friendly 1. */
    font-feature-settings: 'cv11', 'ss03';
}

.dark .fi-body {
    background-color: var(--fq-bg);
}

.fi-body ::selection {
    background-color: rgb(37 99 235 / 0.18);
}

/* Product Catalog is a header-less group: only its single item shows. */
.fi-sidebar-group[data-group-label='Product Catalog'] .fi-sidebar-group-button {
    display: none;
}

/* ── 3. Sidebar ─────────────────────────────────────────────────────────── */

.fi-body .fi-sidebar {
    background-color: var(--fq-side-bg);
    border-inline-end: 1px solid var(--fq-side-border);
}

.fi-sidebar .fi-sidebar-header {
    background-color: var(--fq-side-bg);
    --tw-ring-color: transparent;
    --tw-shadow: 0 0 #0000;
    border-bottom: 1px solid var(--fq-side-border);
}

.fi-body .fi-sidebar .fi-icon-btn {
    color: var(--fq-side-icon);
}

.fi-body .fi-sidebar .fi-icon-btn:hover,
.fi-body .fi-sidebar .fi-icon-btn:focus-visible {
    color: var(--fq-side-text-hover);
    background-color: var(--fq-side-hover);
}

.fi-sidebar .fi-sidebar-nav {
    padding-block: 1rem 1.5rem;
    row-gap: 1rem;
    scrollbar-width: thin;
    scrollbar-color: rgb(148 163 184 / 0.35) transparent;
}

.fi-sidebar .fi-sidebar-nav-groups {
    row-gap: 1rem;
}

.fi-sidebar .fi-sidebar-group {
    row-gap: 0.125rem;
}

.fi-sidebar .fi-sidebar-group-items {
    row-gap: 0.125rem;
}

.fi-sidebar .fi-sidebar-group-button {
    padding-block: 0.25rem;
}

.fi-sidebar .fi-sidebar-group-label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fq-side-muted);
}

.fi-sidebar .fi-sidebar-item-button {
    padding-block: 0.4375rem;
    border-radius: var(--fq-radius-sm);
    transition: background-color 0.15s var(--fq-ease);
}

.fi-body .fi-sidebar .fi-sidebar-item-button:hover {
    background-color: var(--fq-side-hover);
}

.fi-body .fi-sidebar .fi-sidebar-item-button:focus-visible {
    background-color: var(--fq-side-hover);
    outline: 2px solid rgb(var(--primary-500));
    outline-offset: -2px;
}

.fi-sidebar .fi-sidebar-item-label {
    color: var(--fq-side-text);
    transition: color 0.15s var(--fq-ease);
}

.fi-sidebar .fi-sidebar-item-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--fq-side-icon);
    transition: color 0.15s var(--fq-ease);
}

.fi-sidebar .fi-sidebar-item-button:hover .fi-sidebar-item-label {
    color: var(--fq-side-text-hover);
}

.fi-sidebar .fi-sidebar-item-button:hover .fi-sidebar-item-icon {
    color: var(--fq-side-muted);
}

/* Active: the selected-tab blue, a bold label and an accent bar — readable at
   a glance, also in the collapsed icon-only sidebar. */
.fi-body .fi-sidebar .fi-sidebar-item.fi-active > .fi-sidebar-item-button {
    background-color: var(--fq-side-active-bg);
}

.fi-sidebar .fi-sidebar-item.fi-active > .fi-sidebar-item-button::before {
    content: '';
    position: absolute;
    inset-block: 0.5rem;
    inset-inline-start: 0;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background-color: var(--fq-side-active-icon);
}

.fi-sidebar .fi-sidebar-item.fi-active .fi-sidebar-item-label {
    color: var(--fq-side-active-text);
    font-weight: 600;
}

.fi-sidebar .fi-sidebar-item.fi-active .fi-sidebar-item-icon {
    color: var(--fq-side-active-icon);
}

.fi-body .fi-sidebar .fi-badge {
    min-width: 1.375rem;
    justify-content: center;
}

/* ── 4. Topbar & page header ────────────────────────────────────────────── */

.fi-topbar > nav {
    background-color: rgb(255 255 255 / 0.78);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    box-shadow: 0 1px 0 0 var(--fq-border);
}

.dark .fi-topbar > nav {
    background-color: rgb(10 16 29 / 0.72);
}

.fi-topbar .fi-global-search-field .fi-input-wrp {
    background-color: var(--fq-surface-3);
    --tw-ring-color: transparent;
    --tw-shadow: 0 0 #0000;
    border-radius: var(--fq-radius-sm);
}

.fi-topbar .fi-global-search-field .fi-input-wrp:hover {
    --tw-ring-color: var(--fq-border-strong);
}

.fi-topbar .fi-global-search-field .fi-input-wrp:focus-within {
    background-color: var(--fq-surface);
    --tw-ring-color: rgb(var(--primary-500));
    --tw-shadow: 0 0 0 4px rgba(var(--primary-500), 0.14);
}

.fi-topbar .fi-user-menu .fi-avatar,
.fi-topbar .fi-user-menu img {
    box-shadow:
        0 0 0 2px var(--fq-surface),
        0 0 0 3.5px rgba(var(--primary-500), 0.35);
    transition: box-shadow 0.15s var(--fq-ease);
}

.fi-topbar .fi-user-menu button:hover .fi-avatar,
.fi-topbar .fi-user-menu button:focus-visible .fi-avatar {
    box-shadow:
        0 0 0 2px var(--fq-surface),
        0 0 0 3.5px rgb(var(--primary-500));
}

/* Global search: wide enough for its placeholder; the ⌘K hint as a key cap. */
@media (min-width: 1024px) {
    .fi-topbar .fi-global-search-field {
        width: 19rem;
    }
}

.fi-topbar .fi-global-search-field .fi-input-wrp-suffix {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--fq-muted);
}

/* Org · date · on-shift chip, left of the topbar (lg and up). */
.fq-topbar-context {
    display: none;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    font-size: 0.8125rem;
    color: var(--fq-muted);
}

@media (min-width: 1024px) {
    .fq-topbar-context {
        display: flex;
    }
}

.fq-topbar-org {
    max-width: 16rem;
    overflow: hidden;
    font-weight: 600;
    color: var(--fq-text);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fq-topbar-sep {
    width: 1px;
    height: 1rem;
    background-color: var(--fq-border-strong);
}

.fq-topbar-date {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.fq-topbar-shift {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    background-color: var(--fq-surface-3);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--fq-text-2);
    text-decoration: none;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    transition:
        background-color 0.15s var(--fq-ease),
        color 0.15s var(--fq-ease);
}

.fq-topbar-shift:hover {
    background-color: var(--fq-primary-soft);
    color: var(--fq-primary);
}

.fq-topbar-shift:focus-visible {
    outline: 2px solid rgb(var(--primary-500));
    outline-offset: 2px;
}

.fq-topbar-dot {
    width: 7px;
    height: 7px;
    border-radius: 9999px;
    background-color: var(--fq-subtle);
}

.fq-topbar-dot.is-live {
    background-color: var(--fq-success-dot);
    box-shadow: 0 0 0 3px rgb(16 185 129 / 0.18);
}

/* Name + role beside the avatar (md and up). */
.fq-user-identity {
    display: none;
    flex-direction: column;
    align-items: flex-end;
    margin-inline-end: -0.5rem;
    line-height: 1.2;
}

@media (min-width: 768px) {
    .fq-user-identity {
        display: flex;
    }
}

.fq-user-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--fq-text);
}

.fq-user-role {
    font-size: 0.6875rem;
    color: var(--fq-muted);
}

.fi-header .fi-header-heading {
    font-size: clamp(1.5rem, 1.2rem + 1vw, 1.875rem);
    font-weight: 700;
    letter-spacing: -0.028em;
    color: var(--fq-text);
}

.fi-header .fi-header-subheading {
    margin-top: 0.375rem;
    font-size: 0.875rem;
    color: var(--fq-muted);
}

/* ── 5. Surfaces & controls ─────────────────────────────────────────────── */

/* Cards keep Filament's ring + shadow utilities; only their colours change. */
.fi-body :is(.fi-section, .fi-ta-ctn, .fi-wi-stats-overview-stat, .fi-fo-tabs, .fi-in-tabs, .fi-fo-wizard) {
    --tw-ring-color: var(--fq-border);
    --tw-shadow: var(--fq-shadow-sm);
}

.fi-body .fi-section-header-heading {
    letter-spacing: -0.01em;
}

.fi-btn {
    transition:
        background-color 0.15s var(--fq-ease),
        box-shadow 0.15s var(--fq-ease),
        color 0.15s var(--fq-ease),
        transform 0.1s var(--fq-ease);
}

.fi-btn:active:not(:disabled) {
    transform: translateY(0.5px);
}

.fi-body .fi-btn.fi-btn-color-primary:not(.fi-btn-outlined) {
    --tw-shadow:
        0 1px 2px 0 rgba(var(--primary-700), 0.28),
        inset 0 1px 0 0 rgb(255 255 255 / 0.14);
}

.fi-body .fi-btn.fi-btn-color-gray {
    --tw-ring-color: var(--fq-border-strong);
}

.dark .fi-btn.fi-btn-color-gray {
    --tw-ring-color: var(--fq-border-strong);
}

.fi-input-wrp {
    transition:
        box-shadow 0.15s var(--fq-ease),
        background-color 0.15s var(--fq-ease);
}

.fi-body .fi-input-wrp:not([class*='ring-danger']) {
    --tw-ring-color: var(--fq-border-strong);
}

.fi-body .fi-input-wrp:not([class*='ring-danger']):focus-within {
    --tw-ring-color: rgb(var(--primary-500));
    --tw-shadow: 0 0 0 4px rgba(var(--primary-500), 0.13);
}

.fi-body .fi-checkbox-input:focus-visible,
.fi-body .fi-radio-input:focus-visible {
    --tw-ring-color: rgb(var(--primary-500));
}

/* ── 6. Tables, badges, overlays ────────────────────────────────────────── */

.fi-ta-ctn .fi-ta-header-cell-label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--fq-muted);
}

.fi-ta-ctn .fi-ta-table {
    font-variant-numeric: tabular-nums;
}

.fi-ta-ctn .fi-ta-table > thead > tr {
    background-color: var(--fq-surface-2);
}

.fi-ta-ctn .fi-ta-row {
    transition: background-color 0.12s var(--fq-ease);
}

.fi-ta-ctn .fi-ta-row:hover {
    background-color: rgba(var(--primary-500), 0.035);
}

.dark .fi-ta-ctn .fi-ta-row:hover {
    background-color: rgb(255 255 255 / 0.03);
}

.fi-ta-ctn .fi-ta-empty-state-icon-ctn {
    background-color: var(--fq-primary-soft);
}

.fi-ta-ctn .fi-ta-empty-state-icon {
    color: var(--fq-primary);
}

.fi-body .fi-badge {
    border-radius: 9999px;
    font-weight: 600;
}

.fi-body .fi-dropdown-panel {
    border-radius: 12px;
    --tw-ring-color: var(--fq-border);
    --tw-shadow: var(--fq-shadow-lg);
}

.fi-body .fi-modal-window:not(.fi-modal-slide-over-window) {
    border-radius: 16px;
}

.fi-body .fi-modal-window {
    --tw-shadow: var(--fq-shadow-lg);
}

.fi-body .fi-modal-close-overlay {
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

.fi-body .fi-no-notification {
    border-radius: var(--fq-radius);
    --tw-shadow: var(--fq-shadow-lg);
    --tw-ring-color: var(--fq-border);
}

.fi-body .fi-pagination-item-button {
    font-variant-numeric: tabular-nums;
}

/* One type scale for every table. Plain cells are 13px in a soft slate;
   whatever weight a column asks for, emphasis tops out at medium (500) — a
   name or ID is one notch above the row, never a heading. Coloured columns
   (badges, ->color()) keep their own colour. */
.fi-ta-ctn .fi-ta-text-item-label {
    font-size: 0.8125rem;
    line-height: 1.25rem;
}

.fi-body .fi-ta-ctn .fi-ta-text-item-label.text-gray-950 {
    color: var(--fq-text-2);
}

.fi-body .fi-ta-ctn .fi-ta-text-item-label:is(.font-medium, .font-semibold, .font-bold, .font-extrabold, .font-black) {
    font-weight: 500;
    color: var(--fq-text);
}

/* Second line under a cell (->description()). */
.fi-ta-ctn .fi-ta-text :is(p, span).text-sm.text-gray-500 {
    font-size: 0.75rem;
}

/* Text cells: a touch denser, numerals aligned. */
.fi-ta-ctn .fi-ta-text {
    padding-block: 0.75rem;
}

.fi-ta-ctn .fi-ta-text-item {
    font-variant-numeric: tabular-nums;
}

/* Badges keep their full label in table cells ("Ope…" otherwise); a wide
   table scrolls instead. */
.fi-ta-ctn .fi-ta-cell .fi-badge {
    flex-shrink: 0;
    min-width: max-content;
}

/* Row actions stay in reach when a table is wider than the screen: the
   actions column sticks to the right edge while the data scrolls under it. */
.fi-ta-ctn :is(.fi-ta-actions-cell, .fi-ta-actions-header-cell) {
    position: sticky;
    inset-inline-end: 0;
    z-index: 1;
    background-color: var(--fq-surface);
    box-shadow: -1px 0 0 0 var(--fq-border);
}

.fi-ta-ctn .fi-ta-actions-header-cell {
    background-color: var(--fq-surface-2);
}

.fi-ta-ctn .fi-ta-row:hover .fi-ta-actions-cell {
    background-image: linear-gradient(rgba(var(--primary-500), 0.035), rgba(var(--primary-500), 0.035));
}

.dark .fi-ta-ctn .fi-ta-row:hover .fi-ta-actions-cell {
    background-image: linear-gradient(rgb(255 255 255 / 0.03), rgb(255 255 255 / 0.03));
}

/* Filter trigger: no "0" badge while unfiltered; a solid one when filtering. */
.fi-ta-ctn .fq-unfiltered .fi-icon-btn-badge-ctn {
    display: none;
}

.fi-ta-ctn .fq-filtered .fi-badge {
    background-color: rgb(var(--primary-600));
    color: #ffffff;
    --tw-ring-color: transparent;
}

/* Pagination: page size bottom-left; record count and pages on the right. */
@media (min-width: 640px) {
    .fi-ta-ctn .fi-pagination {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.75rem 1rem;
    }

    .fi-ta-ctn .fi-pagination > :has(.fi-pagination-records-per-page-select) {
        order: -1;
    }

    .fi-ta-ctn .fi-pagination-overview {
        margin-inline-start: auto;
        color: var(--fq-muted);
        font-variant-numeric: tabular-nums;
    }
}

/* "Resource > List" says nothing the page title doesn't; view/edit pages keep
   their breadcrumbs as the way back. */
.fi-resource-list-records-page .fi-breadcrumbs {
    display: none;
}

/* Resource tabs line up with the table's left edge and scroll, not wrap. */
.fi-resource-list-records-page .fi-tabs:not(.fi-contained) {
    margin-inline: 0;
    scrollbar-width: none;
}

.fi-resource-list-records-page .fi-tabs-item {
    flex: none;
    white-space: nowrap;
}

/* Attendance summary footer: one compact line for the whole filtered view. */
.fi-ta-ctn .fq-ta-summary-cell {
    padding: 0.875rem 1rem;
    border-top: 1px solid var(--fq-border);
}

.fq-ta-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 2rem;
}

.fq-ta-summary-scope {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    font-size: 0.75rem;
    color: var(--fq-muted);
    font-variant-numeric: tabular-nums;
}

.fq-ta-summary-title {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--fq-text-2);
}

.fq-ta-summary-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 2rem;
    margin-inline-start: auto;
}

.fq-ta-summary-stats dt {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--fq-muted);
}

.fq-ta-summary-stats dd {
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--fq-text);
    font-variant-numeric: tabular-nums;
}

.fq-ta-summary-flag {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.3rem 0.625rem;
    border: 1px solid rgb(245 158 11 / 0.35);
    border-radius: 9999px;
    background-color: var(--fq-warning-soft);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--fq-warning);
    text-decoration: none;
    transition: background-color 0.15s var(--fq-ease);
}

.fq-ta-summary-flag:hover {
    background-color: rgb(245 158 11 / 0.2);
}

.fq-ta-summary-flag:focus-visible {
    outline: 2px solid #f59e0b;
    outline-offset: 2px;
}

.fq-ta-summary-flag-icon {
    width: 1rem;
    height: 1rem;
}

/* Person cell: initials avatar + name + code (App\Support\Avatar::person). */
.fq-person {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-width: 0;
}

.fq-avatar {
    display: grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 9999px;
    background-color: var(--av, #64748b);
    background-image: linear-gradient(140deg, rgb(255 255 255 / 0.2), rgb(255 255 255 / 0));
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.15);
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #ffffff;
    flex: none;
}

.fq-person-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.25;
}

/* Names sit one notch above the cells around them, not a heading: explicit
   size so a link or a larger parent can't inflate them. */
.fq-person-name {
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.3;
    color: var(--fq-text);
}

.fq-person-meta {
    font-size: 0.6875rem;
    color: var(--fq-subtle);
    font-variant-numeric: tabular-nums;
}

/* Business cell (customers): a neutral monogram tile — businesses get a square,
   people get a coloured circle — with name and a muted second line. */
.fq-org {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.fq-org-mark {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    background-color: var(--fq-surface-3);
    box-shadow: inset 0 0 0 1px var(--fq-border);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--fq-muted);
    flex: none;
}

.fq-org-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.3;
}

.fq-org-name {
    font-weight: 500;
    color: var(--fq-text);
}

.fq-org-meta {
    max-width: 22rem;
    overflow: hidden;
    font-size: 0.75rem;
    color: var(--fq-subtle);
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Stat cards: same voice as the Overview KPI cards. */
.fi-body .fi-wi-stats-overview-stat {
    border-radius: var(--fq-radius);
    transition:
        transform 0.2s var(--fq-ease),
        box-shadow 0.2s var(--fq-ease);
}

.fi-body a.fi-wi-stats-overview-stat:hover {
    transform: translateY(-2px);
    --tw-shadow: var(--fq-shadow-md);
}

.fi-body .fi-wi-stats-overview-stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--fq-muted);
}

.fi-body .fi-wi-stats-overview-stat-value {
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    color: var(--fq-text);
}

.fi-body .fi-wi-stats-overview-stat-icon {
    box-sizing: content-box;
    padding: 0.375rem;
    border-radius: 9px;
    background-color: var(--fq-surface-3);
    color: var(--fq-muted);
}

/* ── 7. Today's Overview ────────────────────────────────────────────────── */

/* Header subheading: date · live "updated" stamp. */
.ops-sub {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.625rem;
}

.ops-sub-sep {
    width: 3px;
    height: 3px;
    border-radius: 9999px;
    background-color: var(--fq-subtle);
}

.ops-sub-live {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-variant-numeric: tabular-nums;
}

.ops-live-dot {
    position: relative;
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 9999px;
    background-color: var(--fq-success-dot);
    flex: none;
}

.ops-live-dot::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background-color: inherit;
    animation: ops-ping 2s var(--fq-ease) infinite;
}

.ops {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    transition: opacity 0.2s var(--fq-ease);
}

/* While Refresh is in flight. */
.ops.ops-is-loading .ops-kpis,
.ops.ops-is-loading .ops-card {
    opacity: 0.55;
    pointer-events: none;
}

/* Approval banner */
.ops-approve {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    padding: 0.75rem 0.875rem 0.75rem 0.875rem;
    border-radius: var(--fq-radius);
    background: linear-gradient(90deg, #fffbeb, #fff7ed);
    border: 1px solid #fde68a;
    box-shadow: var(--fq-shadow-xs);
}

.dark .ops-approve {
    background: linear-gradient(90deg, rgb(245 158 11 / 0.12), rgb(245 158 11 / 0.05));
    border-color: rgb(245 158 11 / 0.28);
}

.ops-approve-ico {
    position: relative;
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 10px;
    background-color: #fef3c7;
    color: #d97706;
    flex: none;
}

.dark .ops-approve-ico {
    background-color: rgb(245 158 11 / 0.18);
    color: #fbbf24;
}

.ops-approve-ico svg {
    width: 1.125rem;
    height: 1.125rem;
}

.ops-approve-ico::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 9px;
    height: 9px;
    border-radius: 9999px;
    background-color: #f59e0b;
    box-shadow: 0 0 0 2px #fffbeb;
}

.dark .ops-approve-ico::after {
    box-shadow: 0 0 0 2px #1f1a10;
}

.ops-approve-body {
    flex: 1 1 12rem;
    min-width: 0;
}

.ops-approve-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #78350f;
    line-height: 1.3;
}

.dark .ops-approve-title {
    color: #fde68a;
}

.ops-approve-sub {
    font-size: 0.75rem;
    color: #92400e;
    opacity: 0.85;
}

.dark .ops-approve-sub {
    color: #fcd34d;
    opacity: 0.75;
}

.ops-approve-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ops-approve-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.5rem 0.375rem 0.375rem;
    border-radius: 9999px;
    background-color: #ffffff;
    border: 1px solid #fcd34d;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #92400e;
    text-decoration: none;
    box-shadow: var(--fq-shadow-xs);
    transition:
        background-color 0.15s var(--fq-ease),
        border-color 0.15s var(--fq-ease),
        transform 0.15s var(--fq-ease),
        box-shadow 0.15s var(--fq-ease);
}

.ops-approve-link:hover {
    background-color: #fef3c7;
    border-color: #f59e0b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px -4px rgb(245 158 11 / 0.45);
}

.ops-approve-link:focus-visible {
    outline: 2px solid #f59e0b;
    outline-offset: 2px;
}

.dark .ops-approve-link {
    background-color: rgb(0 0 0 / 0.25);
    border-color: rgb(245 158 11 / 0.4);
    color: #fde68a;
}

.dark .ops-approve-link:hover {
    background-color: rgb(245 158 11 / 0.16);
}

.ops-approve-count {
    display: inline-grid;
    place-items: center;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 0.4rem;
    border-radius: 9999px;
    background-color: #f59e0b;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.dark .ops-approve-count {
    color: #1c1405;
}

.ops-approve-link svg {
    width: 0.875rem;
    height: 0.875rem;
    opacity: 0.7;
    transition: transform 0.15s var(--fq-ease);
}

.ops-approve-link:hover svg {
    transform: translateX(2px);
}

/* KPI cards */
/* Flex, not grid: when five cards wrap 3 + 2, the last row stretches to the
   full width instead of leaving an empty slot. */
.ops-kpis {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.ops-kpis > .ops-kpi {
    flex: 1 1 12.5rem;
}

.ops-kpi {
    --kpi: var(--fq-primary);
    --kpi-dot: var(--fq-info-dot);
    --kpi-soft: var(--fq-info-soft);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    min-width: 0;
    padding: 1rem 1.125rem 1.05rem;
    border-radius: var(--fq-radius);
    background-color: var(--fq-surface);
    border: 1px solid var(--fq-border);
    box-shadow: var(--fq-shadow-sm);
    overflow: hidden;
    transition:
        transform 0.2s var(--fq-ease),
        box-shadow 0.2s var(--fq-ease),
        border-color 0.2s var(--fq-ease);
}

/* A whisper of the card's accent in the top corner. */
.ops-kpi::before {
    content: '';
    position: absolute;
    inset: -40% -30% auto auto;
    width: 9rem;
    height: 9rem;
    border-radius: 9999px;
    background: radial-gradient(closest-side, var(--kpi-soft), transparent);
    opacity: 0.9;
    pointer-events: none;
}

.ops-kpi:hover {
    transform: translateY(-2px);
    box-shadow: var(--fq-shadow-md);
    border-color: var(--fq-border-strong);
}

.ops-kpi--present {
    --kpi: var(--fq-success);
    --kpi-dot: var(--fq-success-dot);
    --kpi-soft: var(--fq-success-soft);
}

.ops-kpi--absent {
    --kpi: var(--fq-danger);
    --kpi-dot: var(--fq-danger-dot);
    --kpi-soft: var(--fq-danger-soft);
}

.ops-kpi--visits {
    --kpi: var(--fq-info);
    --kpi-dot: var(--fq-info-dot);
    --kpi-soft: var(--fq-info-soft);
}

.ops-kpi--orders {
    --kpi: var(--fq-violet);
    --kpi-dot: var(--fq-violet-dot);
    --kpi-soft: var(--fq-violet-soft);
}

.ops-kpi--distance {
    --kpi: var(--fq-cyan);
    --kpi-dot: var(--fq-cyan-dot);
    --kpi-soft: var(--fq-cyan-soft);
}

.ops-kpi-head {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.ops-kpi-ico {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 9px;
    background-color: var(--kpi-soft);
    color: var(--kpi);
    flex: none;
}

.ops-kpi-ico svg {
    width: 1.125rem;
    height: 1.125rem;
}

.ops-kpi-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--fq-muted);
}

.ops-kpi-body {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem;
}

.ops-kpi-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.035em;
    color: var(--fq-text);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.ops-kpi-unit {
    margin-left: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--fq-subtle);
}

.ops-kpi-foot {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 1.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--fq-muted);
    font-variant-numeric: tabular-nums;
    /* Feet line up across a row of equal-height cards. */
    margin-top: auto;
}

.ops-kpi-foot strong {
    font-weight: 600;
    color: var(--fq-text-2);
}

.ops-kpi-amount {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--kpi);
}

/* Progress ring (Present) — pathLength=100 so the dash is the percentage. */
/* Pinned top-right so the Present value sits on the same line as its peers. */
.ops-ring {
    position: absolute;
    top: 0.875rem;
    right: 1rem;
    width: 3.25rem;
    height: 3.25rem;
}

.ops-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.ops-ring-track {
    stroke: var(--fq-surface-3);
}

.ops-ring-value {
    stroke: var(--kpi-dot);
    stroke-linecap: round;
    animation: ops-ring 0.9s var(--fq-ease) both;
    animation-delay: 0.15s;
}

.ops-ring-label {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--kpi);
    font-variant-numeric: tabular-nums;
}

/* Thin meter bar (Absent share, beat coverage). */
.ops-meter {
    position: relative;
    height: 6px;
    border-radius: 9999px;
    background-color: var(--fq-surface-3);
    overflow: hidden;
}

.ops-meter > span {
    position: absolute;
    inset: 0 auto 0 0;
    border-radius: inherit;
    background-color: var(--kpi-dot);
    transform-origin: left center;
    animation: ops-grow 0.8s var(--fq-ease) both;
    animation-delay: 0.2s;
}

.ops-kpi .ops-meter {
    flex: 1;
}

/* Team activity card */
.ops-card {
    border-radius: var(--fq-radius);
    background-color: var(--fq-surface);
    border: 1px solid var(--fq-border);
    box-shadow: var(--fq-shadow-sm);
    overflow: hidden;
}

.ops-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    padding: 1rem 1.125rem 0.875rem;
}

.ops-card-title {
    font-size: 1rem;
    font-weight: 650;
    letter-spacing: -0.01em;
    color: var(--fq-text);
}

.ops-card-sub {
    margin-top: 0.125rem;
    font-size: 0.75rem;
    color: var(--fq-muted);
}

.ops-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.ops-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.1875rem;
    border-radius: 11px;
    background-color: var(--fq-surface-3);
}

.ops-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.3rem 0.625rem;
    border-radius: 8px;
    border: 0;
    background: transparent;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--fq-muted);
    cursor: pointer;
    transition:
        background-color 0.15s var(--fq-ease),
        color 0.15s var(--fq-ease),
        box-shadow 0.15s var(--fq-ease);
}

.ops-chip:hover {
    color: var(--fq-text);
}

.ops-chip:focus-visible {
    outline: 2px solid rgb(var(--primary-500));
    outline-offset: 1px;
}

.ops-chip[aria-pressed='true'] {
    background-color: var(--fq-surface);
    color: var(--fq-text);
    box-shadow: var(--fq-shadow-sm), 0 0 0 1px var(--fq-border);
}

.dark .ops-chip[aria-pressed='true'] {
    background-color: var(--fq-surface-2);
}

.ops-chip i {
    width: 6px;
    height: 6px;
    border-radius: 9999px;
}

.ops-chip b {
    font-weight: 600;
    color: var(--fq-subtle);
    font-variant-numeric: tabular-nums;
}

.ops-chip[aria-pressed='true'] b {
    color: var(--fq-muted);
}

.ops-search {
    position: relative;
    display: flex;
    align-items: center;
}

.ops-search svg {
    position: absolute;
    left: 0.625rem;
    width: 1rem;
    height: 1rem;
    color: var(--fq-subtle);
    pointer-events: none;
}

.ops-search input {
    width: 11rem;
    height: 2.125rem;
    padding: 0 0.75rem 0 2rem;
    border-radius: 10px;
    border: 1px solid var(--fq-border-strong);
    background-color: var(--fq-surface);
    font-size: 0.8125rem;
    color: var(--fq-text);
    transition:
        border-color 0.15s var(--fq-ease),
        box-shadow 0.15s var(--fq-ease),
        width 0.2s var(--fq-ease);
}

.ops-search input::placeholder {
    color: var(--fq-subtle);
}

.ops-search input:focus {
    outline: none;
    border-color: rgb(var(--primary-500));
    box-shadow: 0 0 0 4px rgba(var(--primary-500), 0.13);
}

/* Team status mix */
.ops-mix {
    display: flex;
    height: 6px;
    margin: 0 1.125rem 0.875rem;
    gap: 3px;
}

.ops-mix > span {
    border-radius: 9999px;
    transform-origin: left center;
    animation: ops-grow 0.8s var(--fq-ease) both;
    animation-delay: 0.25s;
}

/* Status dots (pills, chips, mix bar share one palette) */
.ops-tone-in { --tone: var(--fq-success); --tone-dot: var(--fq-success-dot); --tone-soft: var(--fq-success-soft); }
.ops-tone-out { --tone: var(--fq-neutral); --tone-dot: var(--fq-neutral-dot); --tone-soft: var(--fq-neutral-soft); }
.ops-tone-leave { --tone: var(--fq-info); --tone-dot: var(--fq-info-dot); --tone-soft: var(--fq-info-soft); }
.ops-tone-absent { --tone: var(--fq-danger); --tone-dot: var(--fq-danger-dot); --tone-soft: var(--fq-danger-soft); }
.ops-tone-stale { --tone: var(--fq-warning); --tone-dot: var(--fq-warning-dot); --tone-soft: var(--fq-warning-soft); }

.ops-mix > .ops-tone-in,
.ops-mix > .ops-tone-out,
.ops-mix > .ops-tone-leave,
.ops-mix > .ops-tone-absent {
    background-color: var(--tone-dot);
}

.ops-chip i {
    background-color: var(--tone-dot, var(--fq-subtle));
}

.ops-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.1875rem 0.625rem 0.1875rem 0.5rem;
    border-radius: 9999px;
    background-color: var(--tone-soft);
    color: var(--tone);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.25rem;
    white-space: nowrap;
}

.ops-pill i {
    width: 6px;
    height: 6px;
    border-radius: 9999px;
    background-color: var(--tone-dot);
}

.ops-pill.ops-tone-in i,
.ops-pill.ops-pill-live i {
    box-shadow: 0 0 0 3px rgb(16 185 129 / 0.2);
}

/* Table */
.ops-scroll {
    overflow-x: auto;
    border-top: 1px solid var(--fq-border);
    -webkit-overflow-scrolling: touch;
}

.ops-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
}

.ops-table th {
    padding: 0.625rem 1rem;
    text-align: left;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--fq-muted);
    background-color: var(--fq-surface-2);
    border-bottom: 1px solid var(--fq-border);
    white-space: nowrap;
}

.ops-table th.ops-num,
.ops-table td.ops-num {
    text-align: right;
}

.ops-table td {
    padding: 0.625rem 1rem;
    border-bottom: 1px solid var(--fq-border);
    vertical-align: middle;
    white-space: nowrap;
    color: var(--fq-text-2);
    background-color: var(--fq-surface);
    transition: background-color 0.12s var(--fq-ease);
}

.ops-table tbody tr:last-of-type td {
    border-bottom: 0;
}

.ops-table tbody tr:hover td {
    background-color: var(--fq-surface-2);
}

/* Employee column stays put while the rest scrolls on narrow screens. */
.ops-table :is(th, td):first-child {
    position: sticky;
    left: 0;
    z-index: 1;
}

@media (max-width: 767px) {
    .ops-table :is(th, td):first-child {
        box-shadow: 1px 0 0 0 var(--fq-border);
    }
}

.ops-emp {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 11rem;
}

.ops-avatar {
    position: relative;
    display: grid;
    place-items: center;
    width: 2.125rem;
    height: 2.125rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #ffffff;
    background-color: var(--av);
    background-image: linear-gradient(140deg, rgb(255 255 255 / 0.22), rgb(255 255 255 / 0));
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.15);
    flex: none;
}

.ops-avatar-dot {
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 10px;
    height: 10px;
    border-radius: 9999px;
    background-color: var(--tone-dot);
    box-shadow: 0 0 0 2px var(--fq-surface);
}

.ops-emp-name {
    display: block;
    font-weight: 500;
    line-height: 1.3;
    color: var(--fq-text);
    text-decoration: none;
    border-radius: 4px;
    transition: color 0.12s var(--fq-ease);
}

.ops-emp-name:hover {
    color: var(--fq-primary);
}

.ops-emp-name:focus-visible,
.ops-link:focus-visible,
.ops-row-action:focus-visible {
    outline: 2px solid rgb(var(--primary-500));
    outline-offset: 2px;
}

.ops-emp-sub {
    display: block;
    margin-top: 1px;
    font-size: 0.75rem;
    line-height: 1.25;
    color: var(--fq-subtle);
}

.ops-time {
    font-weight: 500;
    color: var(--fq-text);
}

.ops-time-out {
    color: var(--fq-muted);
}

.ops-time small {
    margin-left: 0.25rem;
    font-size: 0.6875rem;
    color: var(--fq-subtle);
}

.ops-dash {
    color: var(--fq-border-strong);
}

.ops-count {
    font-weight: 600;
    color: var(--fq-text);
}

.ops-orders {
    font-weight: 700;
    color: var(--fq-violet);
}

.ops-cell-stack {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.2rem;
}

.ops-beat {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.6875rem;
    color: var(--fq-subtle);
}

.ops-beat .ops-meter {
    --kpi-dot: var(--fq-info-dot);
    width: 2.75rem;
    height: 4px;
}

.ops-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 600;
    color: var(--fq-primary);
    text-decoration: none;
    border-radius: 4px;
}

.ops-link svg {
    width: 0.875rem;
    height: 0.875rem;
    opacity: 0.7;
}

.ops-link:hover {
    color: var(--fq-primary-hover);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.ops-row-action {
    display: inline-grid;
    place-items: center;
    width: 1.875rem;
    height: 1.875rem;
    border-radius: 8px;
    color: var(--fq-subtle);
    transition:
        background-color 0.15s var(--fq-ease),
        color 0.15s var(--fq-ease);
}

.ops-row-action svg {
    width: 1rem;
    height: 1rem;
}

.ops-table tbody tr:hover .ops-row-action,
.ops-row-action:hover {
    color: var(--fq-primary);
    background-color: var(--fq-primary-soft);
}

.ops-nomatch td {
    padding: 2.25rem 1rem;
    text-align: center;
    color: var(--fq-muted);
    white-space: normal;
}

/* Empty organisation */
.ops-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 3.5rem 1.5rem;
    border-radius: var(--fq-radius);
    border: 1px dashed var(--fq-border-strong);
    background-color: var(--fq-surface);
    text-align: center;
}

.ops-empty-ico {
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    margin-bottom: 0.25rem;
    border-radius: 9999px;
    background-color: var(--fq-primary-soft);
    color: var(--fq-primary);
}

.ops-empty-ico svg {
    width: 1.5rem;
    height: 1.5rem;
}

.ops-empty-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--fq-text);
}

.ops-empty-text {
    max-width: 26rem;
    font-size: 0.8125rem;
    color: var(--fq-muted);
}

/* Responsive */
@media (max-width: 639px) {
    .ops {
        gap: 1rem;
    }

    .ops-kpis {
        gap: 0.75rem;
    }

    .ops-kpis > .ops-kpi {
        flex-basis: calc(50% - 0.375rem);
    }

    .ops-kpis > .ops-kpi--present {
        flex-basis: 100%;
    }

    .ops-kpi {
        padding: 0.875rem;
    }

    .ops-kpi-value {
        font-size: 1.625rem;
    }

    .ops-tools,
    .ops-search,
    .ops-search input {
        width: 100%;
    }

    .ops-chips {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        scrollbar-width: none;
    }

    .ops-chip {
        flex: none;
    }
}

/* ── 7b. Reports (Attendance Register, Conveyance Report) ─────────────── */

.fq-report {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: opacity 0.2s var(--fq-ease);
}

.fq-report.fq-is-loading {
    opacity: 0.55;
    pointer-events: none;
}

.fq-report-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.5rem;
}

/* Month stepper */
.fq-month {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--fq-border-strong);
    border-radius: var(--fq-radius-sm);
    background-color: var(--fq-surface);
    box-shadow: var(--fq-shadow-xs);
    overflow: hidden;
}

.fq-month-step {
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    color: var(--fq-muted);
    transition: background-color 0.15s var(--fq-ease), color 0.15s var(--fq-ease);
}

.fq-month-step:hover:not(:disabled) {
    background-color: var(--fq-surface-3);
    color: var(--fq-text);
}

.fq-month-step:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.fq-month-step:focus-visible,
.fq-month-input:focus-visible {
    outline: 2px solid rgb(var(--primary-500));
    outline-offset: -2px;
}

.fq-month-icon {
    width: 1.125rem;
    height: 1.125rem;
}

.fq-month-input {
    height: 2.25rem;
    padding: 0 0.5rem;
    border: 0;
    border-inline: 1px solid var(--fq-border);
    background: transparent;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--fq-text);
    font-variant-numeric: tabular-nums;
    color-scheme: light;
}

.dark .fq-month-input {
    color-scheme: dark;
}

/* Inline stats — lightweight, not cards */
.fq-report-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.75rem;
}

.fq-report-stats dt {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--fq-muted);
}

.fq-report-stats dd {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--fq-text);
    font-variant-numeric: tabular-nums;
}

.fq-report-stats .is-key dd {
    color: var(--fq-primary);
}

.fq-report-stats .is-warn dd {
    color: var(--fq-warning);
}

.fq-report-card {
    border-radius: var(--fq-radius);
    background-color: var(--fq-surface);
    border: 1px solid var(--fq-border);
    box-shadow: var(--fq-shadow-sm);
    overflow: hidden;
}

.fq-report-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--fq-border);
}

.fq-report-note {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    max-width: 46rem;
    font-size: 0.75rem;
    color: var(--fq-muted);
}

.fq-chip-muted {
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    background-color: var(--fq-surface-3);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--fq-text-2);
    white-space: nowrap;
}

.fq-report-empty {
    padding: 3rem 1rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--fq-muted);
}

.fq-report-foot {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--fq-border);
    font-size: 0.75rem;
    color: var(--fq-muted);
}

/* Legend */
.fq-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem 1rem;
    font-size: 0.75rem;
    color: var(--fq-muted);
}

.fq-legend li {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

/* Register grid */
.fq-register-scroll {
    overflow-x: auto;
    scrollbar-width: thin;
}

.fq-register {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}

.fq-register th,
.fq-register td {
    border-bottom: 1px solid var(--fq-border);
    background-color: var(--fq-surface);
    white-space: nowrap;
}

.fq-register thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 0.5rem 0.25rem;
    background-color: var(--fq-surface-2);
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--fq-muted);
}

.fq-register tbody tr:hover > * {
    background-color: var(--fq-surface-2);
}

.fq-register .fq-reg-emp {
    position: sticky;
    left: 0;
    z-index: 3;
    min-width: 13rem;
    padding: 0.5rem 0.75rem;
    text-align: left;
    box-shadow: 1px 0 0 0 var(--fq-border);
}

.fq-register tbody .fq-reg-emp {
    z-index: 1;
    font-weight: 400;
}

.fq-register .fq-reg-total {
    padding: 0.5rem 0.5rem;
    text-align: right;
    font-weight: 600;
    color: var(--fq-text-2);
}

.fq-register thead :is(.fq-reg-total, .fq-reg-emp) {
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.fq-register .fq-reg-total.is-key {
    color: var(--fq-primary);
    font-weight: 700;
}

.fq-register td.fq-reg-total.is-key {
    font-size: 0.8125rem;
}

.fq-register .fq-reg-total.is-bad {
    color: var(--fq-danger);
}

.fq-register .fq-reg-total.is-warn {
    color: var(--fq-warning);
}

.fq-register .fq-reg-hours {
    padding-inline-end: 0.875rem;
    border-inline-end: 1px solid var(--fq-border);
}

.fq-register .fq-reg-day {
    min-width: 2.125rem;
    text-align: center;
    line-height: 1.1;
}

.fq-register .fq-reg-day span {
    display: block;
    font-size: 0.75rem;
    color: var(--fq-text-2);
}

.fq-register .fq-reg-day small {
    display: block;
    font-size: 0.625rem;
    font-weight: 500;
}

.fq-register :is(.fq-reg-day, .fq-reg-cell):is(.is-weekoff, .is-holiday) {
    background-color: var(--fq-surface-2);
}

.fq-register thead .fq-reg-day.is-holiday span {
    color: var(--fq-warning);
}

.fq-register .fq-reg-day.is-today {
    box-shadow: inset 0 -2px 0 0 rgb(var(--primary-500));
}

.fq-register .fq-reg-day.is-today span {
    color: var(--fq-primary);
}

.fq-register .fq-reg-cell {
    padding: 0.25rem 0.125rem;
    text-align: center;
}

/* Day code chip */
.fq-reg-code {
    position: relative;
    display: inline-grid;
    place-items: center;
    min-width: 1.75rem;
    height: 1.5rem;
    padding: 0 0.25rem;
    border-radius: 6px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--fq-text-2);
}

a.fq-reg-code:hover {
    filter: brightness(0.95);
    box-shadow: 0 0 0 1px currentColor;
}

a.fq-reg-code:focus-visible {
    outline: 2px solid rgb(var(--primary-500));
    outline-offset: 1px;
}

.fq-reg-code.tone-present {
    background-color: var(--fq-success-soft);
    color: var(--fq-success);
}

.fq-reg-code.tone-present-off {
    background-color: var(--fq-success-soft);
    color: var(--fq-success);
    box-shadow: inset 0 0 0 1px rgb(16 185 129 / 0.45);
}

.fq-reg-code.tone-absent {
    background-color: var(--fq-danger-soft);
    color: var(--fq-danger);
}

.fq-reg-code.tone-absent.is-pending {
    background-color: transparent;
    border: 1px dashed currentColor;
}

.fq-reg-code.tone-leave {
    background-color: var(--fq-info-soft);
    color: var(--fq-info);
}

.fq-reg-code.tone-off {
    color: var(--fq-subtle);
    font-weight: 600;
}

.fq-reg-code.tone-none {
    color: var(--fq-subtle);
}

/* Late: amber corner dot. Missed punch-out: red corner dot. */
.fq-reg-code.has-late::after,
.fq-reg-code.has-flag::before {
    content: '';
    position: absolute;
    top: -2px;
    width: 6px;
    height: 6px;
    border-radius: 9999px;
    box-shadow: 0 0 0 1.5px var(--fq-surface);
}

.fq-reg-code.has-late::after {
    right: -2px;
    background-color: var(--fq-warning-dot);
}

.fq-reg-code.has-flag::before {
    left: -2px;
    background-color: var(--fq-danger-dot);
}

/* Conveyance */
.fq-conv-split {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.fq-conv-bar {
    display: flex;
    gap: 3px;
    height: 8px;
}

.fq-conv-bar > span {
    border-radius: 9999px;
    transform-origin: left center;
    animation: ops-grow 0.8s var(--fq-ease) both;
}

.fq-conv-bar .is-approved,
.fq-conv-keys .is-approved { background-color: var(--fq-success-dot); }
.fq-conv-bar .is-pending,
.fq-conv-keys .is-pending { background-color: var(--fq-warning-dot); }
.fq-conv-bar .is-unclaimed,
.fq-conv-keys .is-unclaimed { background-color: var(--fq-info-dot); }

.fq-conv-keys {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem 1.25rem;
    font-size: 0.75rem;
    color: var(--fq-muted);
}

.fq-conv-keys li {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.fq-conv-keys i {
    width: 8px;
    height: 8px;
    border-radius: 9999px;
}

.fq-conv-keys strong {
    color: var(--fq-text);
    font-variant-numeric: tabular-nums;
}

.fq-conv-scroll {
    overflow-x: auto;
}

.fq-conv {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
}

.fq-conv > thead th {
    padding: 0.625rem 1rem;
    background-color: var(--fq-surface-2);
    border-bottom: 1px solid var(--fq-border);
    text-align: left;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--fq-muted);
    white-space: nowrap;
}

.fq-conv .is-num {
    text-align: right;
}

.fq-conv-row > * {
    padding: 0.625rem 1rem;
    border-bottom: 1px solid var(--fq-border);
    text-align: left;
    font-weight: 400;
    color: var(--fq-text-2);
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.12s var(--fq-ease);
}

.fq-conv-row:hover > *,
.fq-conv-row.is-open > * {
    background-color: var(--fq-surface-2);
}

.fq-conv .is-key {
    font-weight: 700;
    color: var(--fq-text);
}

.fq-conv-toggle {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

.fq-conv-flag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--fq-warning);
}

.fq-conv-flag svg {
    width: 0.9375rem;
    height: 0.9375rem;
}

.fq-conv-chevron {
    display: grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 8px;
    color: var(--fq-subtle);
}

.fq-conv-chevron svg {
    width: 1.125rem;
    height: 1.125rem;
    transition: transform 0.2s var(--fq-ease);
}

.fq-conv-row.is-open .fq-conv-chevron svg {
    transform: rotate(180deg);
}

.fq-conv-chevron:focus-visible {
    outline: 2px solid rgb(var(--primary-500));
}

.fq-conv-detail > td {
    padding: 0.25rem 1rem 1rem 3.625rem;
    background-color: var(--fq-surface-2);
    border-bottom: 1px solid var(--fq-border);
}

.fq-conv-lines {
    width: 100%;
    max-width: 52rem;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.fq-conv-lines th {
    padding: 0.375rem 0.75rem;
    text-align: left;
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--fq-muted);
}

.fq-conv-lines td {
    padding: 0.375rem 0.75rem;
    border-top: 1px solid var(--fq-border);
    color: var(--fq-text-2);
    white-space: nowrap;
}

.fq-conv-flags {
    color: var(--fq-warning);
}

.fq-conv-status {
    display: inline-flex;
    padding: 0.0625rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.fq-conv-status.tone-success { background-color: var(--fq-success-soft); color: var(--fq-success); }
.fq-conv-status.tone-warning { background-color: var(--fq-warning-soft); color: var(--fq-warning); }
.fq-conv-status.tone-info { background-color: var(--fq-info-soft); color: var(--fq-info); }
.fq-conv-status.tone-gray { background-color: var(--fq-neutral-soft); color: var(--fq-neutral); }

a.fq-conv-status:hover {
    text-decoration: underline;
}

.fq-conv tfoot > tr > * {
    padding: 0.75rem 1rem;
    background-color: var(--fq-surface-2);
    border-top: 1px solid var(--fq-border-strong);
    text-align: left;
    font-weight: 600;
    color: var(--fq-text);
    white-space: nowrap;
}

.fq-conv tfoot .is-num {
    text-align: right;
}

/* ── 7c. Team Analytics ("ta-*") ──────────────────────────────────────── */

.ta {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: opacity 0.2s var(--fq-ease);
}

.ta.fq-is-loading {
    opacity: 0.55;
    pointer-events: none;
}

/* Filter toolbar: its own card row, never under the topbar. */
.ta-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.25rem;
    padding: 0.75rem;
    border-radius: var(--fq-radius);
    background-color: var(--fq-surface);
    border: 1px solid var(--fq-border);
    box-shadow: var(--fq-shadow-xs);
}

.ta-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.1875rem;
    border-radius: 11px;
    background-color: var(--fq-surface-3);
}

.ta-range {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.ta-date,
.ta-select {
    height: 2.25rem;
    padding: 0 0.625rem;
    border: 1px solid var(--fq-border-strong);
    border-radius: var(--fq-radius-sm);
    background-color: var(--fq-surface);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--fq-text);
    font-variant-numeric: tabular-nums;
    color-scheme: light;
}

.dark :is(.ta-date, .ta-select) {
    color-scheme: dark;
}

.ta-date:focus,
.ta-select:focus {
    outline: none;
    border-color: rgb(var(--primary-500));
    box-shadow: 0 0 0 4px rgba(var(--primary-500), 0.13);
}

.ta-range-sep {
    color: var(--fq-subtle);
}

.ta-rank-by {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-inline-start: auto;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--fq-muted);
}

.ta-select {
    min-width: 10rem;
    padding-right: 2rem;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%2364748B' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.75' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1.1rem;
}

/* Headline cards: four, equal height */
.ta-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

@media (max-width: 640px) {
    .ta-presets {
        flex-wrap: nowrap;
        max-width: 100%;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .ta-presets .ops-chip {
        flex: none;
    }

    .ta-rank-by {
        margin-inline-start: 0;
    }
}

@media (max-width: 1100px) {
    .ta-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .ta-kpis {
        grid-template-columns: minmax(0, 1fr);
    }
}

.ta-kpi {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
    padding: 1rem 1.125rem;
    border-radius: var(--fq-radius);
    background-color: var(--fq-surface);
    border: 1px solid var(--fq-border);
    box-shadow: var(--fq-shadow-sm);
}

.ta-kpi-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--fq-muted);
    white-space: nowrap;
}

.ta-kpi-icon {
    width: 1rem;
    height: 1rem;
    color: var(--fq-subtle);
}

.ta-kpi-value {
    margin-top: 0.25rem;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--fq-text);
    font-variant-numeric: tabular-nums;
}

.ta-kpi-sub {
    font-size: 0.75rem;
    color: var(--fq-muted);
}

/* Bars, not a smoothed line: each one is a real day (or week). */
.ta-spark {
    width: 100%;
    height: 28px;
    margin-top: auto;
    padding-top: 0.5rem;
    box-sizing: content-box;
    color: rgb(var(--primary-500));
}

.ta-spark rect {
    fill: currentColor;
    opacity: 0.55;
}

.ta-spark rect:last-of-type {
    opacity: 1;
}

.ta-spark rect.is-empty {
    fill: var(--fq-border-strong);
    opacity: 1;
}

.ta-spark rect:hover {
    opacity: 1;
}

.ta-kpi-bar {
    height: 6px;
    margin-top: auto;
    border-radius: 9999px;
    background-color: var(--fq-surface-3);
    overflow: hidden;
}

.ta-kpi-bar > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background-color: rgb(var(--primary-500));
    transform-origin: left center;
    animation: ops-grow 0.8s var(--fq-ease) both;
}

.ta-delta {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.ta-delta.is-up { color: var(--fq-success); }
.ta-delta.is-down { color: var(--fq-danger); }
.ta-delta.is-flat,
.ta-delta.is-none { color: var(--fq-subtle); font-weight: 500; }

.ta-delta-icon {
    width: 1rem;
    height: 1rem;
}

.ta-secondary {
    padding: 0 0.25rem;
}

.ta-secondary dd small {
    margin-left: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--fq-muted);
}

.fq-report-stats dd.is-missing {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--fq-subtle);
}

/* Insights */
.ta-insights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
    gap: 0.75rem;
}

.ta-insight {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    padding: 0.875rem 1rem;
    border-radius: var(--fq-radius);
    background-color: var(--fq-surface);
    border: 1px solid var(--fq-border);
    border-inline-start: 3px solid var(--fq-neutral-dot);
}

.ta-insight.is-good { border-inline-start-color: var(--fq-success-dot); }
.ta-insight.is-warn { border-inline-start-color: var(--fq-warning-dot); }
.ta-insight.is-info { border-inline-start-color: var(--fq-info-dot); }

.ta-insight-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.ta-insight-title {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--fq-muted);
}

.ta-insight.is-warn .ta-insight-title { color: var(--fq-warning); }
.ta-insight.is-good .ta-insight-title { color: var(--fq-success); }

.ta-insight p {
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--fq-text-2);
}

.ta-insight-action {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--fq-primary);
    text-decoration: none;
    white-space: nowrap;
}

.ta-insight-action svg {
    width: 0.875rem;
    height: 0.875rem;
}

.ta-insight-action:hover {
    text-decoration: underline;
}

.ta-people {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.ta-person {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.1875rem 0.625rem 0.1875rem 0.1875rem;
    border: 1px solid var(--fq-border);
    border-radius: 9999px;
    background-color: var(--fq-surface);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--fq-text-2);
    text-decoration: none;
    transition: border-color 0.15s var(--fq-ease), background-color 0.15s var(--fq-ease);
}

.ta-person:hover {
    border-color: var(--fq-border-strong);
    background-color: var(--fq-surface-2);
}

.ta-person:focus-visible,
.ta-insight-action:focus-visible,
.ta-cols-btn:focus-visible {
    outline: 2px solid rgb(var(--primary-500));
    outline-offset: 2px;
}

.ta-person-av {
    width: 1.375rem;
    height: 1.375rem;
    font-size: 0.5625rem;
}

.ta-more {
    padding-inline-start: 0.625rem;
    color: var(--fq-muted);
    cursor: pointer;
}

/* Column picker */
.ta-cols {
    position: relative;
}

.ta-cols-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    height: 2rem;
    padding: 0 0.75rem;
    border: 1px solid var(--fq-border-strong);
    border-radius: var(--fq-radius-sm);
    background-color: var(--fq-surface);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--fq-text-2);
}

.ta-cols-icon {
    width: 1rem;
    height: 1rem;
    color: var(--fq-muted);
}

.ta-cols-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 0.375rem);
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 12rem;
    padding: 0.375rem;
    border-radius: 12px;
    background-color: var(--fq-surface);
    border: 1px solid var(--fq-border);
    box-shadow: var(--fq-shadow-lg);
}

.ta-cols-menu label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.5rem;
    border-radius: 8px;
    font-size: 0.8125rem;
    color: var(--fq-text-2);
    cursor: pointer;
}

.ta-cols-menu label:hover {
    background-color: var(--fq-surface-3);
}

.ta-cols-menu input {
    border-radius: 4px;
    color: rgb(var(--primary-600));
}

/* Leaderboard table */
.ta-scroll {
    overflow-x: auto;
}

.ta-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
}

.ta-table th,
.ta-table td {
    padding: 0.625rem 1rem;
    border-bottom: 1px solid var(--fq-border);
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
    color: var(--fq-text-2);
}

.ta-table thead th {
    background-color: var(--fq-surface-2);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--fq-muted);
}

.ta-table thead .ta-groups th {
    padding-block: 0.5rem 0.25rem;
    border-bottom: 0;
    font-size: 0.625rem;
    color: var(--fq-subtle);
}

.ta-table thead .ta-groups th:not(:empty) {
    box-shadow: inset 0 -2px 0 -0px var(--fq-border);
    text-align: center;
}

.ta-table .is-num {
    text-align: right;
}

.ta-row {
    cursor: pointer;
    transition: background-color 0.12s var(--fq-ease);
}

.ta-row:hover > td {
    background-color: var(--fq-surface-2);
}

.ta-row.is-inactive > td {
    opacity: 0.55;
}

.ta-rank {
    width: 2.5rem;
    color: var(--fq-subtle);
    font-weight: 600;
}

.ta-person-link {
    display: inline-block;
    border-radius: 6px;
    text-decoration: none;
}

.ta-person-link:hover .fq-person-name {
    color: var(--fq-primary);
}

.ta-person-link:focus-visible {
    outline: 2px solid rgb(var(--primary-500));
    outline-offset: 2px;
}

.ta-of {
    color: var(--fq-subtle);
}

.ta-sub {
    display: block;
    margin-top: 1px;
    font-size: 0.6875rem;
    color: var(--fq-subtle);
}

.ta-sub.is-bad { color: var(--fq-danger); }
.ta-sub.is-good { color: var(--fq-success); }

.ta-dash {
    color: var(--fq-subtle);
}

/* Percentage meter: bar + number; colour only at the ends of the scale */
.ta-meter {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.ta-meter-track {
    position: relative;
    width: 4.5rem;
    height: 6px;
    border-radius: 9999px;
    background-color: var(--fq-surface-3);
    overflow: hidden;
}

.ta-meter-track > span {
    position: absolute;
    inset: 0 auto 0 0;
    max-width: 100%;
    border-radius: inherit;
    background-color: var(--fq-neutral-dot);
}

.ta-meter.is-mid .ta-meter-track > span { background-color: rgb(var(--primary-500)); }
.ta-meter.is-good .ta-meter-track > span { background-color: var(--fq-success-dot); }
.ta-meter.is-bad .ta-meter-track > span { background-color: var(--fq-danger-dot); }

.ta-meter-num {
    min-width: 2.25rem;
    text-align: right;
    font-weight: 600;
    color: var(--fq-text);
}

.ta-meter.is-bad .ta-meter-num { color: var(--fq-danger); }
.ta-meter.is-none .ta-meter-num { color: var(--fq-subtle); font-weight: 500; }

.ta-table tfoot > tr > * {
    background-color: var(--fq-surface-2);
    border-top: 1px solid var(--fq-border-strong);
    border-bottom: 0;
    font-weight: 600;
    color: var(--fq-text);
}

.ta-empty {
    padding: 3rem;
    text-align: center;
    color: var(--fq-muted);
    border: 1px dashed var(--fq-border-strong);
    border-radius: var(--fq-radius);
    background-color: var(--fq-surface);
}

/* ── 8. Motion ──────────────────────────────────────────────────────────── */

.ops-rise {
    animation: ops-rise 0.5s var(--fq-ease) both;
    animation-delay: calc(var(--i, 0) * 55ms);
}

@keyframes ops-rise {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
}

@keyframes ops-ring {
    from {
        stroke-dasharray: 0 100;
    }
}

@keyframes ops-grow {
    from {
        transform: scaleX(0);
    }
}

@keyframes ops-ping {
    75%,
    100% {
        transform: scale(2.4);
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ops-rise,
    .ops-ring-value,
    .ops-meter > span,
    .ops-mix > span,
    .ops-live-dot::after {
        animation: none;
    }

    .ops-kpi,
    .ops-kpi:hover,
    .ops-approve-link:hover {
        transform: none;
    }
}
