/* Follow-up pages (My follow-ups, Aging, Triage) and the ticket page extras.
   Builds on the tokens and components in pss-theme.css and loads right after it (_ThemeHead),
   so body.pss selectors here win over the theme's at equal specificity. */

/* --------------------------------------------------------------------------
   Page toolbar
   -------------------------------------------------------------------------- */
body.pss .fu-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 36px;
    margin-left: 12px;
}

.fu-inline-field {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--text-3);
    font-size: 13px;
    font-weight: 500;
}

body.pss .fu-inline-field .form-control {
    width: auto;
    height: 32px;
    padding: 4px 8px;
    font-size: 13px;
}

.fu-segmented {
    display: inline-flex;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--muted-bg);
}

    .fu-segmented button {
        height: 28px;
        padding: 0 11px;
        border: 0;
        border-radius: 6px;
        background: transparent;
        color: var(--text-2);
        font: inherit;
        font-size: 13px;
        font-weight: 500;
        white-space: nowrap;
        cursor: pointer;
    }

        .fu-segmented button:hover {
            color: var(--text);
        }

        .fu-segmented button.active {
            background: var(--surface);
            box-shadow: var(--shadow-2);
            color: var(--text);
        }

        .fu-segmented button:focus-visible {
            outline: none;
            box-shadow: var(--ring);
        }

/* --------------------------------------------------------------------------
   My follow-ups: tiles that double as tabs
   -------------------------------------------------------------------------- */
.fu-tiles {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

body.pss .fu-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    min-width: 0;
    padding: 14px 16px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-1);
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

    body.pss .fu-tile:hover {
        border-color: var(--line-strong);
        box-shadow: var(--shadow-2);
    }

    body.pss .fu-tile:focus-visible {
        outline: none;
        box-shadow: var(--ring);
    }

    body.pss .fu-tile[aria-selected="true"] {
        border-color: var(--accent);
        background: var(--accent-soft);
        box-shadow: inset 0 0 0 1px var(--accent);
    }

.fu-tile-label {
    max-width: 100%;
    overflow: hidden;
    color: var(--text-2);
    font-size: 13px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fu-tile[aria-selected="true"] .fu-tile-label {
    color: var(--accent-ink);
}

.fu-tile-value {
    font-size: 28px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -.03em;
    font-variant-numeric: tabular-nums;
}

.fu-tile[data-alert="true"] .fu-tile-value {
    color: var(--red);
}

.fu-tile-badge {
    min-height: 20px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--red-bg);
    color: var(--red);
    font-size: 12px;
    font-weight: 600;
    line-height: 18px;
}

.fu-tile-badge-empty {
    visibility: hidden;
}

/* --------------------------------------------------------------------------
   Lists
   -------------------------------------------------------------------------- */
body.pss .fu-panel {
    overflow: hidden;
}

    body.pss .fu-panel > .list-head {
        flex-wrap: wrap;
        row-gap: 4px;
    }

.fu-hint {
    color: var(--text-3);
    font-size: 13px;
    font-weight: 400;
}

body.pss .fu-head-btn {
    margin-left: auto;
}

    body.pss .fu-head-btn[hidden] {
        display: none;
    }

    body.pss .fu-head-btn .fa {
        margin-right: 6px;
    }

body.pss .fu-table > tbody > tr > td {
    vertical-align: top;
}

body.pss .fu-table > tbody > tr:hover > td {
    background: var(--row-hover);
}

body.pss .fu-table > tbody > tr.fu-row-new > td:first-child {
    box-shadow: inset 3px 0 0 var(--accent);
}

.fu-col-ticket {
    min-width: 240px;
    max-width: 360px;
}

    .fu-col-ticket .t-title {
        max-width: 100%;
    }

.fu-col-status {
    min-width: 150px;
}

.fu-col-comment {
    min-width: 230px;
    max-width: 340px;
}

.fu-col-actions {
    width: 1%;
    white-space: nowrap;
}

.fu-col-when {
    min-width: 120px;
    white-space: nowrap;
}

.fu-reminder-note-sm {
    display: block;
    max-width: 200px;
    margin-top: 2px;
    overflow: hidden;
    color: var(--text-2);
    font-size: 12.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.pss .fu-num {
    text-align: right;
}

.fu-id {
    color: var(--text-3);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.fu-new-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 6px;
    border-radius: 50%;
    background: var(--accent);
    vertical-align: 1px;
}

.fu-comment-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 8px;
    font-size: 13px;
}

    .fu-comment-head .person {
        font-weight: 500;
    }

body.pss .fu-comment-head .avatar {
    width: 22px;
    height: 22px;
    font-size: 10px;
}

.fu-side {
    padding: 0 7px;
    border-radius: 999px;
    background: var(--gray-bg);
    color: var(--gray);
    font-size: 11.5px;
    font-weight: 500;
    line-height: 18px;
}

    .fu-side[data-side="requester"] {
        background: var(--amber-bg);
        color: var(--amber);
    }

.fu-snippet {
    display: -webkit-box;
    margin-top: 4px;
    overflow: hidden;
    color: var(--text-2);
    font-size: 13px;
    line-height: 1.45;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.fu-days,
.fu-due {
    font-weight: 500;
    white-space: nowrap;
}

    .fu-days[data-tone="amber"],
    .fu-due[data-tone="amber"] {
        color: var(--amber);
    }

    .fu-days[data-tone="red"],
    .fu-due[data-tone="red"] {
        color: var(--red);
    }

.fu-reminder {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--violet-bg);
    color: var(--violet);
    font-size: 12px;
    font-weight: 500;
    line-height: 20px;
}

    .fu-reminder[data-due="true"] {
        background: var(--red-bg);
        color: var(--red);
    }

.fu-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

body.pss .fu-icon-btn {
    width: 32px;
    padding-left: 0;
    padding-right: 0;
    text-align: center;
}

    body.pss .fu-icon-btn[aria-pressed="true"] {
        border-color: var(--accent-line);
        background: var(--accent-soft);
        color: var(--accent-ink);
    }

body.pss .fu-done-btn {
    margin-right: 6px;
}

    body.pss .fu-done-btn .fa {
        margin-right: 5px;
    }

.fu-col-actions .fu-actions {
    display: inline-flex;
}

.fu-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 48px 20px;
    color: var(--text-3);
    text-align: center;
}

    .fu-empty .fa {
        color: var(--green-dot);
        font-size: 28px;
    }

    .fu-empty p {
        max-width: 420px;
        margin: 0;
    }

    .fu-error .fa {
        color: var(--red-dot);
    }

.fu-loading {
    padding: 48px 20px;
    color: var(--text-3);
    font-size: 20px;
    text-align: center;
}

/* --------------------------------------------------------------------------
   Filter bars (Triage)
   -------------------------------------------------------------------------- */
body.pss .fu-filter-bar {
    padding: 12px 18px;
}

.fu-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 16px;
}

body.pss .fu-filters .form-group {
    margin: 0;
}

body.pss .fu-filters .form-control {
    height: 34px;
    min-width: 180px;
    padding-top: 5px;
    padding-bottom: 5px;
    font-size: 13.5px;
}

body.pss .fu-search {
    flex: 1 1 260px;
    max-width: 380px;
}

    body.pss .fu-search .form-control {
        width: 100%;
    }

body.pss .fu-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    color: var(--text-2);
    font-size: 13.5px;
    font-weight: 400;
    cursor: pointer;
    white-space: nowrap;
}

    body.pss .fu-check input {
        margin: 0;
    }

body.pss .fu-check-strong {
    margin-left: auto;
    color: var(--text);
    font-weight: 500;
}

/* --------------------------------------------------------------------------
   New-comment pill (ticket page)
   -------------------------------------------------------------------------- */
.fu-new-pill {
    display: inline-block;
    margin-left: 6px;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    letter-spacing: .02em;
    vertical-align: 1px;
}

/* --------------------------------------------------------------------------
   Aging
   -------------------------------------------------------------------------- */
.fu-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.fu-kpi {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-1);
}

.fu-kpi-label {
    color: var(--text-2);
    font-size: 13px;
    font-weight: 500;
}

.fu-kpi-value {
    font-size: 26px;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -.03em;
    font-variant-numeric: tabular-nums;
}

.fu-kpi[data-tone="amber"] .fu-kpi-value {
    color: var(--amber);
}

.fu-kpi-sub {
    overflow: hidden;
    color: var(--text-3);
    font-size: 12.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.pss .fu-aging-grid {
    margin-bottom: 20px;
}

    body.pss .fu-aging-grid > .panel {
        overflow: hidden;
    }

body.pss .fu-matrix-body {
    padding: 0;
}

body.pss .fu-matrix > thead > tr > th {
    text-align: center;
}

    body.pss .fu-matrix > thead > tr > th:first-child {
        text-align: left;
    }

body.pss .fu-matrix > tbody > tr > th {
    max-width: 210px;
    padding: 8px 10px 8px 18px;
    overflow: hidden;
    border-top: 1px solid var(--line-soft);
    font-size: 13px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

body.pss .fu-matrix > tbody > tr > td {
    padding: 4px;
    text-align: center;
}

body.pss .fu-matrix > tbody > tr > td.fu-total {
    padding-right: 18px;
}

.fu-cell[data-empty="true"] {
    color: var(--empty);
}

.fu-cell-btn {
    --tint: 58, 87, 232;
    width: 100%;
    min-width: 38px;
    height: 30px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: rgba(var(--tint), .06);
    color: var(--text);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease;
}

    .fu-cell-btn[data-late="true"] {
        --tint: 229, 72, 77;
    }

    .fu-cell-btn[data-level="2"] { background: rgba(var(--tint), .14); }
    .fu-cell-btn[data-level="3"] { background: rgba(var(--tint), .24); }
    .fu-cell-btn[data-level="4"] { background: rgba(var(--tint), .38); }
    .fu-cell-btn[data-level="5"] { background: rgba(var(--tint), .55); }

    .fu-cell-btn:hover {
        border-color: rgba(var(--tint), .6);
    }

    .fu-cell-btn:focus-visible {
        outline: none;
        box-shadow: var(--ring);
    }

    .fu-cell-btn[aria-pressed="true"] {
        border-color: var(--text);
        box-shadow: inset 0 0 0 1px var(--text);
    }

.fu-total-btn {
    background: transparent;
    color: var(--text-2);
}

/* --------------------------------------------------------------------------
   Triage
   -------------------------------------------------------------------------- */
.fu-bulk {
    position: sticky;
    top: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
    padding: 10px 18px;
    border-bottom: 1px solid var(--accent-line);
    background: var(--accent-soft);
}

    .fu-bulk[hidden] {
        display: none;
    }

body.pss .fu-bulk .btn .fa {
    margin-right: 6px;
}

.fu-bulk-count {
    margin-right: 6px;
    color: var(--accent-ink);
    font-weight: 600;
}

.fu-bulk-group {
    display: inline-flex;
    gap: 6px;
}

body.pss .fu-bulk .form-control {
    width: auto;
    height: 32px;
    padding: 4px 8px;
    font-size: 13px;
}

body.pss .fu-triage > tbody > tr > td {
    vertical-align: middle;
}

body.pss .fu-triage > tbody > tr.is-selected > td {
    background: var(--selected-row);
}

body.pss .fu-col-check {
    width: 1%;
}

    body.pss .fu-col-check input {
        margin: 0;
    }

body.pss .fu-inline-select {
    width: auto;
    max-width: 170px;
    height: 30px;
    padding: 3px 6px;
    font-size: 13px;
}

.fu-inline-pair {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.fu-sort {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

    .fu-sort .fa {
        color: var(--muted-icon);
        font-size: 11px;
    }

th[aria-sort="ascending"] .fu-sort,
th[aria-sort="descending"] .fu-sort {
    color: var(--text);
}

    th[aria-sort="ascending"] .fu-sort .fa,
    th[aria-sort="descending"] .fu-sort .fa {
        color: var(--accent);
    }

.fu-readonly {
    display: inline-block;
    margin-top: 6px;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--gray-bg);
    color: var(--gray);
    font-size: 11.5px;
    line-height: 18px;
}

.fu-table-foot {
    padding: 10px 18px;
    border-top: 1px solid var(--line);
    color: var(--text-3);
    font-size: 12.5px;
}

#fuTriage.is-busy {
    opacity: .55;
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   Ticket page
   -------------------------------------------------------------------------- */
.fu-reminder-empty {
    margin: 0 0 12px;
    color: var(--text-3);
    font-size: 13px;
}

body.pss #fuTicketReminder .btn .fa {
    margin-right: 6px;
}

.fu-reminder-set {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--violet-bg);
    color: var(--violet);
}

    .fu-reminder-set > .fa {
        margin-top: 3px;
    }

    .fu-reminder-set strong {
        color: var(--text);
    }

    .fu-reminder-set[data-due="true"] {
        background: var(--red-bg);
        color: var(--red);
    }

.fu-reminder-note {
    margin: 4px 0 0;
    color: var(--text-2);
    font-size: 13px;
    white-space: pre-line;
}

.fu-reminder-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.fu-timeline {
    position: relative;
    margin: 0;
    padding: 12px 16px 4px;
    list-style: none;
}

    .fu-timeline > li {
        position: relative;
        display: flex;
        gap: 12px;
        padding-bottom: 14px;
    }

        .fu-timeline > li::before {
            content: "";
            position: absolute;
            left: 4px;
            top: 14px;
            bottom: 0;
            width: 2px;
            background: var(--line);
        }

        .fu-timeline > li:last-child::before {
            display: none;
        }

.fu-timeline-dot {
    position: relative;
    flex: none;
    width: 10px;
    height: 10px;
    margin-top: 6px;
    border: 2px solid var(--line-strong);
    border-radius: 50%;
    background: var(--surface);
}

.fu-timeline > li.is-current .fu-timeline-dot {
    border-color: var(--accent);
    background: var(--accent);
}

.fu-timeline-body {
    min-width: 0;
}

.fu-timeline-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 8px;
}

.fu-timeline-days {
    color: var(--text-2);
    font-size: 12.5px;
    font-weight: 500;
}

.fu-new-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    padding: 8px 12px;
    border: 1px solid var(--accent-line);
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent-ink);
    font-size: 13.5px;
    font-weight: 500;
}

    .fu-new-banner > .fa {
        font-size: 8px;
    }

body.pss .fu-new-banner .btn-link {
    margin-left: auto;
    padding: 0 4px;
    box-shadow: none;
}

body.pss li.fu-comment-new > .row,
body.pss li.fu-comment-new > div:first-child {
    border-radius: 10px;
    box-shadow: inset 3px 0 0 var(--accent);
}

/* --------------------------------------------------------------------------
   Dialogs
   -------------------------------------------------------------------------- */
.fu-modal-sub {
    margin: 4px 0 0;
    overflow: hidden;
    color: var(--text-3);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fu-quick-dates {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

/* --------------------------------------------------------------------------
   Smaller screens
   -------------------------------------------------------------------------- */
@media (max-width: 1399px) {
    .fu-tiles {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    body.pss .fu-aging-grid > .panel {
        grid-column: span 12;
    }
}

@media (max-width: 1199px) {
    .fu-col-comment {
        display: none;
    }

    .fu-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991px) {
    body.pss .fu-toolbar {
        float: none !important;
        justify-content: flex-start;
        margin: 0 0 12px;
    }

    body.pss .fu-check-strong {
        margin-left: 0;
    }
}

@media (max-width: 600px) {
    .fu-tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
