/* ==========================================================================
   UTP V2 — CLIENT REPORTS NORMALIZATION V1
   ========================================================================== */

.utp-client-reports__notice {
    margin: 0 0 14px;
    padding: 11px 13px;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 650;
}

.utp-client-reports__notice.is-success {
    border: 1px solid #bbf7d0;
    background: #ecfdf5;
    color: #166534;
}

.utp-client-reports__notice.is-error {
    border: 1px solid #fecdd3;
    background: #fff1f2;
    color: #9f1239;
}

.utp-client-reports__notice.is-warning {
    border: 1px solid rgba(234, 88, 12, .28);
    border-left: 4px solid #ea580c;
    background: #fff7ed;
    color: #7c2d12;
}

/* Report fields remain a business editor, but use the UTP surface language. */
.utp-client-reports__fields {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid var(--utp-ui-border, #dbe2ea);
    border-radius: var(--utp-ui-radius-panel, 14px);
    background: #fff;
}

.utp-client-reports__fields-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.utp-client-reports__fields-head > div {
    display: grid;
    gap: 3px;
}

.utp-client-reports__fields-head strong {
    color: var(--utp-ui-text, #172033);
    font-size: 13px;
    font-weight: 700;
}

.utp-client-reports__fields-head span {
    color: var(--utp-ui-text-muted, #8793a8);
    font-size: 11px;
}

.utp-client-reports__fields-head button,
.utp-client-reports__preview-actions button,
.utp-client-report-batch__actions button,
.utp-client-report-batch__actions > a {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    padding: 0 13px;
    box-sizing: border-box;
    border: 1px solid var(--utp-ui-accent, #ff6647);
    border-radius: 11px;
    background: #fff;
    color: var(--utp-ui-accent, #ff6647);
    font-family: inherit;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
}

.utp-client-reports__field-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.utp-client-reports__field-grid label {
    display: flex;
    min-height: 38px;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    border: 1px solid var(--utp-ui-border, #dbe2ea);
    border-radius: 10px;
    background: #f8fafc;
    color: #334155;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.utp-client-reports__field-grid input {
    accent-color: var(--utp-ui-accent, #ff6647);
}

.utp-client-reports__preview {
    margin-top: 18px;
}

.utp-client-reports__summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.utp-client-reports__summary > div,
.utp-client-reports__summary > button {
    display: grid;
    gap: 4px;
    padding: 13px 14px;
    border: 1px solid var(--utp-ui-border, #dbe2ea);
    border-radius: 11px;
    background: #fff;
}

.utp-client-reports__summary span {
    color: var(--utp-ui-text-muted, #8793a8);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.utp-client-reports__summary strong {
    color: var(--utp-ui-text, #172033);
    font-size: 16px;
    font-weight: 700;
}

/* Work-table uses Platform Table Results. Horizontal overflow is intentional. */
.utp-client-reports__table-wrap {
    width: 100%;
    overflow: auto;
}

.utp-client-reports__table {
    width: max-content;
    min-width: 100%;
}

.utp-client-reports__table a {
    color: var(--utp-ui-text, #172033);
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 102, 71, .35);
}

.utp-client-reports__table tr.is-reported td {
    background: rgba(15, 23, 42, .03);
    color: #667085;
}

.utp-client-reports__select-col {
    min-width: 145px;
    white-space: nowrap;
}

.utp-client-reports__include {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #334155;
    font-size: 11px;
    font-weight: 700;
}

.utp-client-reports__include input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--utp-ui-accent, #ff6647);
}

.utp-client-reports__reported-badge,
.utp-client-reports__missing-value {
    display: inline-flex;
    align-items: center;
    padding: 4px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}

.utp-client-reports__reported-badge {
    border: 1px solid #d0d5dd;
    background: #f2f4f7;
    color: #475467;
}

.utp-client-reports__missing-value {
    border: 1px solid rgba(234, 88, 12, .30);
    background: #fff7ed;
    color: #c2410c;
}

.utp-client-reports__preview-actions,
.utp-client-report-batch__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 12px;
}

.utp-client-reports__preview-actions > span,
.utp-client-report-batch__locked {
    color: var(--utp-ui-text-muted, #8793a8);
    font-size: 11px;
}

/* Batch dossier */
.utp-client-report-batch {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid var(--utp-ui-border, #dbe2ea);
    border-radius: var(--utp-ui-radius-panel, 14px);
    background: #fff;
}

.utp-client-report-batch__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 12px;
}

.utp-client-report-batch__eyebrow {
    display: block;
    margin-bottom: 4px;
    color: var(--utp-ui-accent, #ff6647);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.utp-client-report-batch__head h3 {
    margin: 0;
    color: var(--utp-ui-text, #172033);
    font-size: 17px;
    font-weight: 650;
}

.utp-client-report-batch__head p {
    margin: 4px 0 0;
    color: var(--utp-ui-text-muted, #8793a8);
    font-size: 11px;
}

.utp-client-report-batch__metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 12px;
}

.utp-client-report-batch__metrics span {
    padding: 6px 9px;
    border: 1px solid var(--utp-ui-border, #dbe2ea);
    border-radius: 9px;
    background: #f8fafc;
    color: var(--utp-ui-text-muted, #8793a8);
    font-size: 10px;
}

.utp-client-report-batch__metrics b {
    color: var(--utp-ui-text, #172033);
}

/* Recent batches use Platform List Results. */
.utp-client-report-batches {
    margin-top: 18px;
}

.utp-client-report-batches__head {
    margin-bottom: 10px;
}

.utp-client-report-batches__head > div {
    display: grid;
    gap: 3px;
}

.utp-client-report-batches__head strong {
    color: var(--utp-ui-text, #172033);
    font-size: 13px;
}

.utp-client-report-batches__head span {
    color: var(--utp-ui-text-muted, #8793a8);
    font-size: 11px;
}

.utp-client-report-batches__list > a {
    display: grid !important;
    grid-template-columns: 150px 220px 100px 90px 1fr;
    gap: 12px !important;
    min-height: 58px !important;
    color: #526175;
    text-decoration: none;
}

.utp-client-report-batches__list em {
    justify-self: end;
    color: var(--utp-ui-text, #172033);
    font-style: normal;
    font-weight: 700;
}

@media (min-width: 768px) and (max-width: 1100px) {
    .utp-client-reports__field-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .utp-client-reports__summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* ==========================================================================
   Analytics Client Reports — batch row + wide table polish V2
   ========================================================================== */

/* Recent Report Batches: use the normal UTP result text scale. */
.utp-client-report-batches__list > a {
    grid-template-columns: 150px 190px 90px 90px minmax(120px, 1fr);
    min-height: 58px !important;
    font-family: inherit;
    font-size: 12px !important;
    font-weight: 500;
    line-height: 1.35;
}

.utp-client-report-batches__list > a > strong {
    font-size: 13px !important;
    font-weight: 700;
    line-height: 1.3;
}

.utp-client-report-batches__list > a > span {
    color: var(--utp-ui-text-secondary, #5f6f84);
    font-size: 12px !important;
    font-weight: 500;
    line-height: 1.35;
    white-space: nowrap;
}

.utp-client-report-batches__list > a > b {
    font-size: 10px !important;
    line-height: 1;
}

.utp-client-report-batches__list > a > em {
    color: var(--utp-ui-text, #172033);
    font-size: 13px !important;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
}

/* Wide report tables deliberately scroll horizontally inside their own frame. */
.utp-client-reports__table-wrap {
    position: relative;
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: scroll !important;
    overflow-y: hidden;
    scrollbar-gutter: stable;
    padding-bottom: 8px;
    box-sizing: border-box;
    overscroll-behavior-x: contain;
}

.utp-client-reports__table {
    width: max-content !important;
    min-width: 100% !important;
}

/* Keep the horizontal control visible and easy to grab on desktop/tablet. */
.utp-client-reports__table-wrap::-webkit-scrollbar {
    height: 12px;
}

.utp-client-reports__table-wrap::-webkit-scrollbar-track {
    background: #f3f5f7;
    border-radius: 999px;
}

.utp-client-reports__table-wrap::-webkit-scrollbar-thumb {
    background: #aab4c2;
    border: 3px solid #f3f5f7;
    border-radius: 999px;
}

.utp-client-reports__table-wrap::-webkit-scrollbar-thumb:hover {
    background: #7f8b9b;
}

.utp-client-reports__table-wrap {
    scrollbar-width: auto;
    scrollbar-color: #aab4c2 #f3f5f7;
}


/* Client Reports — inline Travel order No. editing in preview */
.utp-client-reports__travel-order-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 220px;
}

.utp-client-reports__travel-order-inline input {
    width: 132px;
    min-height: 34px;
    padding: 0 9px;
    border: 1px solid var(--utp-ui-border, #dbe2ea);
    border-radius: 9px;
    background: #fff;
    color: var(--utp-ui-text, #172033);
    font: inherit;
    font-size: 11px;
    outline: none;
}

.utp-client-reports__travel-order-inline input::placeholder {
    color: #c2410c;
    font-weight: 800;
}

.utp-client-reports__travel-order-inline input:focus {
    border-color: var(--utp-ui-accent, #ff6647);
    box-shadow: 0 0 0 2px rgba(255, 102, 71, .10);
}

.utp-client-reports__travel-order-inline button {
    min-height: 34px;
    padding: 0 9px;
    border: 1px solid var(--utp-ui-accent, #ff6647);
    border-radius: 9px;
    background: #fff;
    color: var(--utp-ui-accent, #ff6647);
    font-family: inherit;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
}


/* Client Reports — full-screen review mode */
.utp-client-reports__review-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
}

.utp-client-reports__review-toolbar > div {
    display: grid;
    gap: 3px;
}

.utp-client-reports__review-toolbar strong {
    color: var(--utp-ui-text, #172033);
    font-size: 14px;
    font-weight: 800;
}

.utp-client-reports__review-toolbar span:not([data-utp-report-review-label]) {
    color: var(--utp-ui-text-secondary, #718096);
    font-size: 11px;
}

.utp-client-reports__review-toggle {
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid var(--utp-ui-accent, #ff6647);
    border-radius: 11px;
    background: #fff;
    color: var(--utp-ui-accent, #ff6647);
    font-family: inherit;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

body.utp-report-review-open {
    overflow: hidden !important;
}

.utp-client-reports__preview.is-full-screen {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    width: 100vw;
    height: 100vh;
    max-width: none;
    margin: 0;
    padding: 24px 28px 20px;
    border: 0;
    border-radius: 0;
    background: #fff;
    box-sizing: border-box;
    overflow: hidden;
}

.utp-client-reports__preview.is-full-screen .utp-client-reports__review-toolbar {
    flex: 0 0 auto;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--utp-ui-border, #e4e9f0);
}

.utp-client-reports__preview.is-full-screen .utp-client-reports__summary,
.utp-client-reports__preview.is-full-screen .utp-client-reports__notice {
    flex: 0 0 auto;
}

.utp-client-reports__preview.is-full-screen .utp-client-reports__preview-form {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    flex-direction: column;
}

.utp-client-reports__preview.is-full-screen .utp-client-reports__table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow: auto !important;
    border: 1px solid var(--utp-ui-border, #e4e9f0);
    border-radius: 12px;
}

.utp-client-reports__preview.is-full-screen .utp-client-reports__table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #f7f9fb;
}

.utp-client-reports__preview.is-full-screen .utp-client-reports__preview-actions {
    flex: 0 0 auto;
    margin-top: 12px;
    padding-top: 12px;
    background: #fff;
}

@media (max-width: 1024px) and (min-width: 768px) {
    .utp-client-reports__preview.is-full-screen {
        padding: 18px;
    }
}

/* Client report field template: compact by default once a client profile exists. */
.utp-client-reports__fields {
    padding: 0;
    overflow: hidden;
}

.utp-client-reports__fields-summary {
    display: flex;
    min-height: 58px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 16px;
    cursor: pointer;
    list-style: none;
}

.utp-client-reports__fields-summary::-webkit-details-marker { display: none; }

.utp-client-reports__fields-summary > div {
    display: grid;
    gap: 3px;
}

.utp-client-reports__fields-summary strong {
    color: var(--utp-ui-text, #172033);
    font-size: 13px;
    font-weight: 700;
}

.utp-client-reports__fields-summary span {
    color: var(--utp-ui-text-muted, #8793a8);
    font-size: 11px;
}

.utp-client-reports__fields-toggle::before {
    content: '›';
    display: block;
    color: var(--utp-ui-accent, #ff6647);
    font-size: 22px;
    font-weight: 700;
    transform: rotate(90deg);
    transition: transform .16s ease;
}

.utp-client-reports__fields[open] .utp-client-reports__fields-toggle::before {
    transform: rotate(-90deg);
}

.utp-client-reports__fields-form {
    padding: 0 16px 16px;
    border-top: 1px solid var(--utp-ui-border, #dbe2ea);
}

.utp-client-reports__fields-head {
    margin-top: 14px;
}

.utp-client-reports__fields-head > span {
    color: var(--utp-ui-text-muted, #8793a8);
    font-size: 11px;
}

/* Client Reports V9 — compact preview register controls */
.utp-client-reports__table-tools {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin: 12px 0 8px;
}

.utp-client-reports__table-search,
.utp-client-reports__page-size {
    display: flex;
    align-items: center;
    gap: 8px;
}

.utp-client-reports__table-search span,
.utp-client-reports__page-size span {
    color: var(--utp-ui-text-muted, #8793a8);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.utp-client-reports__table-search input,
.utp-client-reports__page-size select {
    min-height: 36px;
    border: 1px solid var(--utp-ui-border, #dbe2ea);
    border-radius: 10px;
    background: #fff;
    color: var(--utp-ui-text, #172033);
    font-size: 12px;
}

.utp-client-reports__table-search input {
    width: min(360px, 44vw);
    padding: 0 11px;
}

.utp-client-reports__page-size select {
    padding: 0 30px 0 10px;
}

.utp-client-reports__pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
    min-height: 36px;
}

.utp-client-reports__pagination[hidden] { display: none !important; }

.utp-client-reports__pagination > span {
    color: var(--utp-ui-text-muted, #8793a8);
    font-size: 11px;
    font-weight: 600;
}

.utp-client-reports__pager {
    display: flex;
    align-items: center;
    gap: 4px;
}

.utp-client-reports__pager button {
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border: 1px solid var(--utp-ui-border, #dbe2ea);
    border-radius: 9px;
    background: #fff;
    color: var(--utp-ui-text-secondary, #5f6f84);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.utp-client-reports__pager button.is-current {
    border-color: var(--utp-ui-accent, #ff6647);
    color: var(--utp-ui-accent, #ff6647);
}

.utp-client-reports__pager button:disabled {
    opacity: .4;
    cursor: default;
}

/* Client Reports — mirrored top horizontal scrollbar for wide preview tables. */
.utp-client-reports__top-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: scroll;
    overflow-y: hidden;
    height: 16px;
    margin: 0 0 6px;
    scrollbar-gutter: stable;
    overscroll-behavior-x: contain;
}
.utp-client-reports__top-scroll-inner { height: 1px; }
.utp-client-reports__top-scroll::-webkit-scrollbar { height: 12px; }
.utp-client-reports__top-scroll::-webkit-scrollbar-track { background: #f3f5f7; border-radius: 999px; }
.utp-client-reports__top-scroll::-webkit-scrollbar-thumb { background: #aab4c2; border: 3px solid #f3f5f7; border-radius: 999px; }
.utp-client-reports__top-scroll::-webkit-scrollbar-thumb:hover { background: #7f8b9b; }
.utp-client-reports__top-scroll { scrollbar-width: auto; scrollbar-color: #aab4c2 #f3f5f7; }

/* Wide report table: mouse grab-to-scroll without interfering with controls. */
.utp-client-reports__preview-form .utp-client-reports__table-wrap {
    cursor: grab;
}
.utp-client-reports__preview-form .utp-client-reports__table-wrap.is-dragging {
    cursor: grabbing;
    user-select: none;
}
body.utp-report-table-dragging {
    cursor: grabbing !important;
    user-select: none;
}
.utp-client-reports__preview-form .utp-client-reports__table-wrap a,
.utp-client-reports__preview-form .utp-client-reports__table-wrap button,
.utp-client-reports__preview-form .utp-client-reports__table-wrap input,
.utp-client-reports__preview-form .utp-client-reports__table-wrap select,
.utp-client-reports__preview-form .utp-client-reports__table-wrap textarea,
.utp-client-reports__preview-form .utp-client-reports__table-wrap label {
    cursor: auto;
}

/* V13 — Report Preview behaves like a normal scrollable data grid.
 * Keep the page stable while the mouse wheel scrolls report rows vertically.
 * Horizontal scrolling remains available via the native bar / top mirror / drag.
 */
.utp-client-reports__preview-form .utp-client-reports__table-wrap {
    height: min(48vh, 440px);
    max-height: 440px;
    overflow-x: auto !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.utp-client-reports__preview-form .utp-client-reports__table thead th {
    position: sticky;
    top: 0;
    z-index: 4;
    background: #f7f9fb;
}


/* V14 — Continuous report register. Pagination is intentionally removed.
 * The viewport stays compact (roughly 10 rows) while every matching traveller
 * remains in one continuous native mouse-wheel scroll.
 */
.utp-client-reports__preview-form .utp-client-reports__table-tools {
    grid-template-columns: minmax(260px, 520px) !important;
}
\n\n/* V20 — Saved Draft/Finalized batch uses the same continuous register UX as Preview. */\n.utp-client-report-batch .utp-client-reports__table-wrap {\n    height: min(48vh, 440px);\n    max-height: 440px;\n    overflow-x: auto !important;\n    overflow-y: auto !important;\n    overscroll-behavior: contain;\n    scrollbar-gutter: stable;\n    cursor: grab;\n}\n.utp-client-report-batch .utp-client-reports__table-wrap.is-dragging { cursor: grabbing; user-select: none; }\n.utp-client-report-batch .utp-client-reports__table thead th {\n    position: sticky; top: 0; z-index: 4; background: #f7f9fb;\n}\n.utp-client-report-batch .utp-client-reports__table-wrap a,\n.utp-client-report-batch .utp-client-reports__table-wrap button,\n.utp-client-report-batch .utp-client-reports__table-wrap input,\n.utp-client-report-batch .utp-client-reports__table-wrap select,\n.utp-client-report-batch .utp-client-reports__table-wrap textarea,\n.utp-client-report-batch .utp-client-reports__table-wrap label { cursor: auto; }\n
/* Preview KPI filters reuse the existing summary card geometry and Platform tokens. */
.utp-client-reports__summary > button {
    text-align: left;
    font: inherit;
    cursor: pointer;
}
.utp-client-reports__summary > button[aria-pressed="true"] {
    border-color: var(--utp-ui-accent, #f5793b);
    background: var(--utp-ui-surface-soft, #f6f8fb);
}
.utp-client-reports__summary > button:focus-visible {
    outline: 2px solid var(--utp-ui-accent, #f5793b);
    outline-offset: 2px;
}
