﻿/* Fidetech Custom Theme */
:root {
    --bs-primary: #087f6e;
    --bs-primary-rgb: 8, 127, 110;
    --bs-secondary: #52636b;
    --bs-secondary-rgb: 82, 99, 107;
    --bs-success: #187047;
    --bs-success-rgb: 24, 112, 71;
    --app-ink: #17333d;
    --app-muted: #52636b;
    --app-surface: #fff;
    --app-canvas: #f3f5f7;
    --app-line: #d7e0e5;
    --app-teal: #087f6e;
    --app-teal-dark: #075e54;
    --app-teal-soft: #e6f5f2;
    --app-sidebar-width: 256px;
    --app-shadow-sm: 0 2px 6px rgba(16,47,59,.04);
    --app-shadow-md: 0 4px 12px rgba(16,47,59,.08);
    --app-font: "Segoe UI", Arial, sans-serif;
    --app-radius: .5rem;
}

/* Navbar */
.nav-link.text-dark:hover {
    color: var(--bs-primary) !important;
}

.navbar-brand img {
    max-height: 40px;
}

/* Layout */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

#main-container {
    flex-grow: 1;
    display: flex;
}

/* Sidebar */
@media (min-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        width: var(--app-sidebar-width);
        z-index: 100;
    }
}

/* Sticky menu area inside sidebar */
.sidebar-sticky {
    overflow-x: hidden;
    overflow-y: auto;
}

.menu-item-link {
    display: block;
}

/* Global dropdown affordance
   Keep native selects and Select2 controls visually recognizable and make the
   currently selected/highlighted item unambiguous for mouse and keyboard users. */
:root {
    --dropdown-border: #8fa3ad;
    --dropdown-border-hover: #466875;
    --dropdown-focus: #087f6e;
    --dropdown-focus-ring: rgba(8, 127, 110, .22);
    --dropdown-selected-bg: #dff3ef;
    --dropdown-selected-text: #064e45;
}

select.form-select,
select.form-control {
    min-height: 44px;
    cursor: pointer;
    color: #172b34;
    background-color: #fff;
    border-color: var(--dropdown-border);
    box-shadow: 0 1px 2px rgba(17, 43, 54, .08);
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

select.form-select:hover:not(:disabled),
select.form-control:hover:not(:disabled) {
    border-color: var(--dropdown-border-hover);
    background-color: #fbfefd;
}

select.form-select:focus,
select.form-control:focus {
    border-color: var(--dropdown-focus);
    box-shadow: 0 0 0 .22rem var(--dropdown-focus-ring);
}

select.form-select:disabled,
select.form-control:disabled {
    cursor: not-allowed;
    color: #6c7b82;
    background-color: #edf1f2;
    opacity: .8;
}

select.form-select option:checked,
select.form-control option:checked {
    color: #fff;
    font-weight: 700;
    background: var(--dropdown-focus);
}

.select2-container {
    max-width: 100%;
}

.select2-container .select2-selection {
    min-height: 44px;
    color: #172b34;
    background: #fff;
    border: 1px solid var(--dropdown-border);
    border-radius: .375rem;
    box-shadow: 0 1px 2px rgba(17, 43, 54, .08);
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.select2-container .select2-selection:hover {
    border-color: var(--dropdown-border-hover);
    background-color: #fbfefd;
}

.select2-container .select2-selection--single {
    position: relative;
    display: flex;
    align-items: center;
}

.select2-container .select2-selection--single .select2-selection__rendered {
    width: 100%;
    padding: .58rem 3rem .58rem .9rem;
    overflow: hidden;
    color: #172b34;
    font-weight: 500;
    line-height: 1.5;
    text-overflow: ellipsis;
}

.select2-container .select2-selection--single .select2-selection__placeholder {
    color: #61727a;
    font-weight: 400;
}

/* Always show a chevron, including when a Select2 theme stylesheet is absent. */
.select2-container .select2-selection--single::after {
    position: absolute;
    top: 50%;
    right: 1rem;
    width: .58rem;
    height: .58rem;
    content: "";
    border-right: 2px solid #304f5b;
    border-bottom: 2px solid #304f5b;
    pointer-events: none;
    transform: translateY(-70%) rotate(45deg);
    transition: transform .15s ease;
}

.select2-container--open .select2-selection--single::after {
    transform: translateY(-20%) rotate(225deg);
}

.select2-container .select2-selection--single .select2-selection__arrow {
    display: none;
}

.select2-container--focus .select2-selection,
.select2-container--open .select2-selection {
    border-color: var(--dropdown-focus);
    box-shadow: 0 0 0 .22rem var(--dropdown-focus-ring);
}

.select2-container--disabled .select2-selection {
    color: #6c7b82;
    background: #edf1f2;
    cursor: not-allowed;
    opacity: .8;
}

.select2-container .select2-selection--multiple {
    display: flex;
    align-items: center;
    padding: .25rem .45rem;
}

.select2-container .select2-selection--multiple .select2-selection__rendered {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
    margin: 0;
    padding: 0;
}

.select2-container .select2-selection--multiple .select2-selection__choice {
    margin: 0;
    padding: .28rem .55rem .28rem 1.65rem;
    color: var(--dropdown-selected-text);
    font-weight: 600;
    background: var(--dropdown-selected-bg);
    border: 1px solid #8bc9bd;
    border-radius: 999px;
}

.select2-container .select2-selection--multiple .select2-selection__choice__remove {
    height: 100%;
    color: #a12f2f;
    border-right-color: #8bc9bd;
}

.select2-dropdown {
    overflow: hidden;
    border: 1px solid var(--dropdown-focus);
    border-radius: .375rem;
    box-shadow: 0 .7rem 1.6rem rgba(17, 43, 54, .18);
}

.select2-results__option {
    position: relative;
    padding: .65rem .9rem;
    cursor: pointer;
}

.select2-results__option--highlighted[aria-selected],
.select2-results__option--highlighted.select2-results__option--selectable {
    color: #fff;
    background: var(--dropdown-focus);
}

.select2-results__option[aria-selected="true"]:not(.select2-results__option--highlighted),
.select2-results__option--selected:not(.select2-results__option--highlighted) {
    color: var(--dropdown-selected-text);
    font-weight: 700;
    background: var(--dropdown-selected-bg);
}

.select2-results__option[aria-selected="true"]::after,
.select2-results__option--selected::after {
    float: right;
    margin-left: .75rem;
    content: "\2713";
    font-weight: 800;
}

.select2-results__option[aria-disabled="true"] {
    color: #849198;
    background: #f4f6f7;
    cursor: not-allowed;
}

@media (prefers-reduced-motion: reduce) {
    select.form-select,
    select.form-control,
    .select2-container .select2-selection,
    .select2-container .select2-selection--single::after {
        transition: none;
    }
}

/* Reusable smart-report presentation */
.smart-report-shell {
    --report-ink: #102f3b;
    --report-muted: #5f747d;
    --report-teal: #087f6e;
    --report-blue: #174b7a;
    --report-line: #d8e3e6;
    color: var(--report-ink);
}

.smart-report-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    padding: 1.65rem 1.8rem;
    color: #fff;
    background:
        radial-gradient(circle at 90% 10%, rgba(255,255,255,.19), transparent 30%),
        linear-gradient(135deg, #063f45 0%, #087f6e 52%, #174b7a 100%);
    border-radius: 1rem;
    box-shadow: 0 .8rem 2rem rgba(13, 52, 65, .18);
}

.smart-report-hero h1 {
    margin: .15rem 0 .45rem;
    color: #fff;
    font-size: clamp(1.5rem, 2vw, 1.75rem);
    font-weight: 700;
    letter-spacing: -.035em;
}

.smart-report-hero p {
    color: rgba(255,255,255,.84);
    font-size: 1rem;
}

.smart-report-kicker,
.smart-report-question-number {
    color: #66e0cf;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.smart-report-hero-meta {
    display: grid;
    gap: .45rem;
    min-width: min(100%, 22rem);
    font-size: .9rem;
}

.smart-report-hero-meta span {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .35rem .55rem;
    background: rgba(4, 34, 42, .2);
    border-radius: .45rem;
}

.smart-report-hero-meta svg,
.smart-report-auto-status svg,
.smart-report-methodology svg,
.smart-report-note svg {
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
}

.smart-report-filter-panel {
    padding: 1.25rem;
    background: linear-gradient(180deg, #f4f8f8 0%, #edf3f4 100%);
    border: 1px solid #cbd9dd;
    border-radius: .9rem;
    box-shadow: 0 .3rem 1rem rgba(32, 63, 75, .07);
}

.smart-report-section-title {
    color: var(--report-ink);
    font-size: 1.15rem;
    font-weight: 700;
}

.smart-report-auto-status {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: #49616a;
    font-size: .85rem;
    font-weight: 600;
}

.smart-report-js .smart-report-manual-submit {
    display: none;
}

.smart-report-results {
    position: relative;
    min-height: 8rem;
}

.smart-report-loading-state {
    position: fixed;
    z-index: 1055;
    right: 1.25rem;
    bottom: 1.25rem;
    display: none;
    align-items: center;
    gap: .65rem;
    padding: .8rem 1rem;
    color: #fff;
    font-weight: 700;
    background: #073f53;
    border-radius: .65rem;
    box-shadow: 0 .8rem 2rem rgba(7, 38, 50, .3);
}

.smart-report-results.report-is-loading {
    opacity: .62;
    pointer-events: none;
}

.smart-report-results.report-is-loading .smart-report-loading-state {
    display: flex;
    opacity: 1;
}

.smart-report-stat-card {
    display: flex;
    align-items: center;
    gap: .9rem;
    height: 100%;
    padding: 1rem 1.1rem;
    background: #fff;
    border: 1px solid var(--report-line);
    border-radius: .8rem;
    box-shadow: 0 .25rem .8rem rgba(25, 56, 68, .07);
}

.smart-report-stat-card > div {
    display: grid;
}

.smart-report-stat-card div span {
    color: var(--report-muted);
    font-size: .82rem;
}

.smart-report-stat-card strong {
    color: var(--report-ink);
    font-size: 1.55rem;
    line-height: 1.2;
}

.smart-report-stat-icon {
    display: inline-grid;
    width: 2.6rem;
    height: 2.6rem;
    flex: 0 0 auto;
    place-items: center;
    border-radius: .7rem;
}

.smart-report-stat-icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

.smart-report-question-card {
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--report-line);
    border-radius: 1rem;
    box-shadow: 0 .65rem 1.7rem rgba(25, 56, 68, .1);
}

.smart-report-question-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.15rem 1.3rem;
    background: linear-gradient(105deg, #0e424b, #365f69);
}

.smart-report-question-header h2 {
    max-width: 70rem;
    margin: .25rem 0 0;
    color: #fff;
    font-size: clamp(1.15rem, 2vw, 1.5rem);
    font-weight: 700;
    line-height: 1.35;
}

.smart-report-question-prompt {
    max-width: 70rem;
    margin: .35rem 0 0;
    color: rgba(255,255,255,.78);
    font-size: .9rem;
    line-height: 1.4;
}

.smart-report-context {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .85rem 1.25rem;
    padding: 1rem 1.15rem;
    border: 1px solid #bcd8d4;
    border-left: 5px solid #087f6e;
    border-radius: .8rem;
    background: linear-gradient(100deg, #effaf8 0%, #f7fafc 100%);
    color: #173844;
}

.smart-report-context-title,
.smart-report-context-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .45rem;
}

.smart-report-context-title svg {
    width: 1.15rem;
    color: #087f6e;
}

.smart-report-context-chip {
    padding: .3rem .65rem;
    border: 1px solid #cedde1;
    border-radius: 999px;
    background: #fff;
    font-size: .82rem;
    font-weight: 600;
}

.smart-report-context-chip-primary {
    border-color: #087f6e;
    background: #087f6e;
    color: #fff;
}

.smart-visual-surface {
    overflow: hidden;
    border: 1px solid #d5e1e4 !important;
    border-radius: 1rem !important;
    box-shadow: 0 12px 30px rgba(20,55,70,.09) !important;
}

.smart-visual-surface > .card-header {
    border-bottom: 0;
    background: linear-gradient(135deg, #123b4a 0%, #245d67 100%) !important;
    color: #fff !important;
}

.smart-visual-surface > .card-header h1,
.smart-visual-surface > .card-header h2,
.smart-visual-surface > .card-header h3,
.smart-visual-surface > .card-header h4,
.smart-visual-surface > .card-header h5,
.smart-visual-surface > .card-header h6 {
    color: #fff !important;
}

.smart-visual-canvas {
    min-height: 320px;
    padding: .5rem;
    border-radius: .65rem;
    background: #fff;
}

.smart-visual-canvas canvas {
    max-width: 100%;
}

@media (max-width: 767.98px) {
    .smart-visual-canvas { min-height: 280px; padding: .15rem; }
}

.smart-report-question-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .4rem;
    white-space: nowrap;
}

.smart-report-insight {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    padding: .8rem 1.3rem;
    color: #173f4b;
    background: #e8f5f2;
    border-bottom: 1px solid #cce3df;
    overflow-wrap: anywhere;
}

.smart-report-insight-icon {
    display: inline-grid;
    width: 1.8rem;
    height: 1.8rem;
    flex: 0 0 auto;
    color: #fff;
    background: var(--report-teal);
    border-radius: 50%;
    place-items: center;
}

.smart-report-insight-icon svg {
    width: 1rem;
    height: 1rem;
}

.report-highlights {
    margin: 1rem 0;
    overflow: hidden;
    color: #173844;
    background: #f7fbfa;
    border: 1px solid #cde2df;
    border-radius: .9rem;
    box-shadow: 0 8px 22px rgba(20, 55, 70, .08);
}

.report-highlights__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.15rem .75rem;
    background: linear-gradient(110deg, #e3f4f0, #f7fbfa 68%);
}

.report-highlights__kicker {
    display: flex;
    align-items: center;
    gap: .4rem;
    margin-bottom: .3rem;
    color: #087f6e;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.report-highlights__kicker svg,
.report-highlights__warning svg { width: 1rem; height: 1rem; flex: 0 0 auto; }
.report-highlights__header h3 { margin: 0; color: #123d4a; font-size: 1.18rem; font-weight: 750; }
.report-highlights__question { max-width: 70rem; margin: .25rem 0 0; color: #375763; font-size: .94rem; }
.report-highlights__meta { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .4rem; }
.report-highlights__meta span { padding: .3rem .58rem; white-space: nowrap; color: #234d59; font-size: .76rem; font-weight: 700; background: #fff; border: 1px solid #cfe0e2; border-radius: 999px; }
.report-highlights__scope { padding: .65rem 1.15rem; color: #4d626a; font-size: .85rem; background: #fff; border-top: 1px solid #deebea; border-bottom: 1px solid #deebea; }

.report-highlights__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: .75rem;
    padding: 1rem 1.15rem;
}

.report-highlight-card { min-width: 0; padding: .85rem .9rem; background: #fff; border: 1px solid #dbe7e8; border-top: 4px solid #174b7a; border-radius: .65rem; }
.report-highlight-card--success { border-top-color: #087f6e; }
.report-highlight-card--accent { border-top-color: #e3a82b; }
.report-highlight-card--warning { border-top-color: #d46b2c; }
.report-highlight-card--neutral { border-top-color: #71858c; }
.report-highlight-card__label { display: block; margin-bottom: .35rem; color: #536970; font-size: .73rem; font-weight: 800; letter-spacing: .055em; text-transform: uppercase; }
.report-highlight-card p { margin: 0; color: #173844; font-size: .9rem; line-height: 1.45; overflow-wrap: anywhere; }
.report-highlights__warning { display: flex; align-items: flex-start; gap: .45rem; padding: .65rem 1.15rem; color: #69521a; font-size: .8rem; background: #fff8e5; border-top: 1px solid #f0dfac; }

@media (max-width: 767.98px) {
    .report-highlights__header { flex-direction: column; }
    .report-highlights__meta { justify-content: flex-start; }
    .report-highlights__grid { grid-template-columns: 1fr; }
}

.smart-report-question-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(20rem, .9fr);
    gap: 1.2rem;
    align-items: start;
    padding: 1.25rem;
}

.smart-report-chart {
    position: relative;
    min-width: 0;
}

.smart-report-table {
    font-size: .9rem;
}

.smart-report-table thead th {
    color: #fff;
    background: #49646d;
    border-color: #607880;
}

.smart-report-table td {
    vertical-align: middle;
    overflow-wrap: anywhere;
}

.smart-report-share-track {
    width: 100%;
    height: .27rem;
    margin-top: .38rem;
    overflow: hidden;
    background: #e7edef;
    border-radius: 999px;
}

.smart-report-share-track span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--report-teal), #29a8a1);
    border-radius: inherit;
}

.smart-report-empty-state {
    display: grid;
    max-width: 52rem;
    margin: 2rem auto;
    padding: 3rem 1.5rem;
    text-align: center;
    background: #f7fafb;
    border: 1px dashed #9eb2ba;
    border-radius: 1rem;
    place-items: center;
}

.smart-report-empty-state > span {
    display: grid;
    width: 4rem;
    height: 4rem;
    margin-bottom: 1rem;
    color: var(--report-teal);
    background: #dff3ef;
    border-radius: 50%;
    place-items: center;
}

.smart-report-empty-state h2 {
    font-size: 1.35rem;
    font-weight: 700;
}

.smart-report-empty-state p {
    max-width: 40rem;
    margin: 0;
    color: var(--report-muted);
}

.smart-report-methodology,
.smart-report-note {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    padding: .9rem 1rem;
    color: #4d626a;
    font-size: .86rem;
    background: #f2f6f7;
    border: 1px solid #d6e1e4;
    border-radius: .65rem;
}

@media (max-width: 991.98px) {
    .smart-report-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .smart-report-hero-meta {
        width: 100%;
    }

    .smart-report-question-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575.98px) {
    .smart-report-hero,
    .smart-report-question-grid {
        padding: 1rem;
    }

    .smart-report-question-header {
        flex-direction: column;
    }

    .smart-report-question-badges {
        justify-content: flex-start;
    }
}

@media print {
    .smart-report-filter-panel,
    .smart-report-loading-state {
        display: none !important;
    }

    .smart-report-hero,
    .smart-report-question-header {
        color-adjust: exact;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .smart-report-question-card {
        break-inside: avoid;
        box-shadow: none;
    }
}

/* Shared application shell. Screen styling does not restyle printed reports. */
@media print { .app-table-scroll { overflow: visible !important; border: 0 !important; } }
@media screen {
html { font-size: 100%; }
.fidetech-ui h1, .fidetech-ui .h1, .fidetech-ui h1.h3 { font-size: clamp(1.5rem, 2vw, 1.75rem); font-weight: 650; line-height: 1.25; }
.fidetech-ui h2, .fidetech-ui .h2 { font-size: 1.375rem; font-weight: 600; }
.fidetech-ui h3, .fidetech-ui .h3 { font-size: 1.125rem; font-weight: 600; }
.fidetech-ui .text-muted { color: var(--app-muted) !important; }
.fidetech-ui .tifa-report, .fidetech-ui .tifa-report :is(h1,h2) { font-family: var(--app-font); }
.fidetech-ui a:not(.btn):not(.nav-link):not(.dropdown-item):not(.navbar-brand):not(.mobile-brand) { color: var(--app-teal-dark); text-underline-offset: .15em; }
.fidetech-ui :focus-visible { outline: 3px solid #1263a0; outline-offset: 3px; }
.fidetech-ui .card, .fidetech-ui .report-section { border: 1px solid var(--app-line); border-radius: var(--app-radius); box-shadow: var(--app-shadow-sm); }
.fidetech-ui .card-header { padding: .75rem 1rem; background: #f5f8f9; color: var(--app-ink); border-bottom: 1px solid var(--app-line); }
.fidetech-ui .card-header :is(h2,h3,h4,h5,h6) { color: inherit; font-size: 1rem; }
.fidetech-ui .card-body { padding: 1rem; }
.fidetech-ui .shadow, .fidetech-ui .shadow-lg { box-shadow: var(--app-shadow-md) !important; }
.fidetech-ui .form-label { font-size: .875rem; font-weight: 600; margin-bottom: .375rem; }
.fidetech-ui :is(.form-control,.form-select) { font-family: inherit; font-size: 1rem; min-height: 44px; border-radius: var(--app-radius); }
.fidetech-ui .btn { min-height: 44px; padding: .5rem 1rem; }
.fidetech-ui .btn-sm { padding: .375rem .75rem; }
.fidetech-ui .btn-outline-primary { --bs-btn-color: var(--app-teal-dark); --bs-btn-border-color: var(--app-teal-dark); --bs-btn-hover-bg: var(--app-teal-dark); --bs-btn-hover-border-color: var(--app-teal-dark); }
.fidetech-ui .alert { padding: .75rem 1rem; font-size: .9375rem; }
.fidetech-ui .alert-info { background: #eaf3fa; color: #194d6d; border-color: #367a9c; }
.fidetech-ui .alert-warning { background: #fff6df; color: #694b0a; border-color: #b58117; }
.fidetech-ui .alert-danger { background: #fceef0; color: #852d3c; border-color: #b63149; }
.fidetech-ui .alert-success { background: #e9f5ed; color: #22593b; border-color: #328153; }
.fidetech-ui .table { font-size: .875rem; color: var(--app-ink); margin-bottom: 0; }
.fidetech-ui .table > :not(caption) > * > * { padding: .625rem .75rem; vertical-align: middle; border-color: var(--app-line); }
.fidetech-ui .table thead th { background: #edf2f5; color: var(--app-ink); font-weight: 600; }
.fidetech-ui .table-responsive { max-width: 100%; border: 1px solid var(--app-line); border-radius: var(--app-radius); }
.fidetech-ui .table-responsive:focus-visible { outline-offset: -3px; }
.fidetech-ui .pagination { flex-wrap: wrap; gap: .25rem; }
.fidetech-ui .page-link { color: var(--app-teal-dark); min-height: 44px; display: grid; place-items: center; }
.fidetech-ui .active > .page-link { color: white; background: var(--app-teal-dark); border-color: var(--app-teal-dark); }
.fidetech-ui .nav-tabs .nav-link.active { color: var(--app-teal-dark); border-top: 3px solid var(--app-teal-dark); }
.fidetech-ui .app-filter-panel { padding: 1rem; background: white; border: 1px solid var(--app-line); border-radius: var(--app-radius); margin-bottom: 1rem; }
.fidetech-ui .app-count-note { padding: .75rem 1rem; border-left: 3px solid var(--app-line); color: var(--app-muted); background: white; }
.app-job-status { padding: .75rem 1rem; border: 1px solid var(--app-line); border-left: 4px solid #367a9c; border-radius: var(--app-radius); background: #eaf3fa; color: #194d6d; }
.app-job-status[data-status="Complete"] { background: #e9f5ed; color: #22593b; border-left-color: #328153; }
.app-job-status[data-status^="Paused"] { background: #fff6df; color: #694b0a; border-left-color: #b58117; }
.app-job-status[data-status="Failed"] { background: #fceef0; color: #852d3c; border-left-color: #b63149; }
.dashboard-metrics > div { display: flex; }
.stat-card { width: 100%; background: white; border: 1px solid var(--app-line); border-left: 4px solid var(--app-teal); border-radius: var(--app-radius); padding: 1rem; display: flex; align-items: flex-start; box-shadow: var(--app-shadow-sm); }
.stat-card-body { flex: 1; min-width: 0; }
.stat-card-title { font-size: .875rem; font-weight: 600; color: var(--app-muted); margin-bottom: .5rem; }
.stat-card-value { font-size: clamp(1.5rem, 2.3vw, 2rem); font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-card-icon { display: none; }
.app-login-shell { max-width: 440px; margin: clamp(1rem, 8vh, 5rem) auto; padding: 1.5rem; background: white; border: 1px solid var(--app-line); border-radius: var(--app-radius); box-shadow: var(--app-shadow-sm); }
.app-login-shell .app-login-logo { height: 48px; width: auto; }
.fidetech-ui .client-nav { background: var(--app-teal-dark); }
.fidetech-ui .report-shell { max-width: 1440px; }
@media (max-width: 767.98px) { .fidetech-ui .app-main > .container-fluid { padding-inline: 0; } .fidetech-ui .btn { white-space: normal; } }
@media (prefers-reduced-motion: reduce) { .fidetech-ui *, .fidetech-ui *::before, .fidetech-ui *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; animation-iteration-count: 1 !important; } }

html {
    scroll-behavior: smooth;
    background: var(--app-canvas);
}

body.fidetech-ui {
    color: var(--app-ink);
    font-family: var(--app-font);
    font-size: 1rem;
    line-height: 1.5;
    background: var(--app-canvas);
}

.sidebar {
    width: var(--app-sidebar-width);
    padding: 0;
    background: rgba(255, 255, 255, .96) !important;
    border-right: 1px solid var(--app-line);
    box-shadow: .4rem 0 1.8rem rgba(16, 47, 59, .045);
    backdrop-filter: blur(16px);
}

.sidebar-header {
    min-height: 72px;
    padding: 1rem !important;
    background: var(--app-surface);
    border-bottom-color: var(--app-line) !important;
}

.sidebar-header .navbar-brand {
    color: #183741;
    font-weight: 700;
    letter-spacing: -.025em;
}

.sidebar-header .navbar-brand img {
    width: 40px;
    height: 40px !important;
    object-fit: contain;
    border-radius: .65rem;
    box-shadow: 0 .35rem .8rem rgba(8, 127, 110, .16);
}

.sidebar-sticky {
    padding: .7rem .6rem 1rem;
    scrollbar-color: #b6c7cc transparent;
    scrollbar-width: thin;
}

.sidebar .nav {
    gap: .16rem;
    padding: 0 !important;
}

.menu-item {
    margin: 0;
}

.menu-item-link {
    position: relative;
    min-height: 44px;
    padding: .5rem .75rem !important;
    color: #526971 !important;
    font-size: .88rem;
    font-weight: 600;
    line-height: 1.3;
    border: 1px solid transparent;
    border-radius: var(--app-radius);
    transition: color .16s ease, background-color .16s ease, border-color .16s ease, transform .16s ease;
}

.menu-item-link svg {
    width: 1.18rem;
    height: 1.18rem;
    flex: 0 0 auto;
    color: #71858c;
    stroke-width: 1.9;
    transition: color .16s ease;
}

.menu-item-link:hover,
.menu-item-link:focus-visible {
    color: var(--app-teal-dark) !important;
    background: #f0f8f6;
    border-color: #d6ebe7;
}

.menu-item-link:hover svg,
.menu-item-link:focus-visible svg {
    color: var(--app-teal);
}

.menu-item-link.active,
.menu-item-link[aria-current="page"] {
    color: #fff !important;
    background: var(--app-teal-dark);
    border-color: #087568;
    box-shadow: none;
}

.menu-item-link.active svg,
.menu-item-link[aria-current="page"] svg {
    color: #baf5e8;
}

.sidebar .dropdown-menu {
    max-width: calc(var(--app-sidebar-width) - 1.2rem);
    padding: .45rem;
    border-color: var(--app-line);
    border-radius: .75rem;
    box-shadow: var(--app-shadow-md);
}

.sidebar .dropdown-item {
    padding: .55rem .65rem;
    white-space: normal;
    color: #4e666f;
    font-size: .82rem;
    font-weight: 600;
    border-radius: .5rem;
}

.sidebar .dropdown-item:hover,
.sidebar .dropdown-item:focus {
    color: var(--app-teal-dark);
    background: var(--app-teal-soft);
}

.sidebar .mt-auto {
    margin: .25rem .6rem .7rem !important;
    padding: .9rem !important;
    color: #627981;
    font-size: .82rem;
    background: #f4f8f8;
    border: 1px solid var(--app-line);
    border-radius: .8rem;
}

.main-content-wrapper {
    min-width: 0;
    padding: clamp(1rem, 2vw, 1.5rem);
}

.app-main {
    min-height: calc(100vh - 7rem);
    padding-top: 0 !important;
}

.footer {
    position: static;
    width: auto;
    color: #71858c !important;
    line-height: 1.4;
    background: transparent;
    border-top-color: var(--app-line) !important;
}

.btn {
    font-weight: 600;
    border-radius: var(--app-radius);
    transition: color .16s ease, background-color .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.btn-primary {
    background: var(--app-teal-dark);
    border-color: var(--app-teal);
    box-shadow: none;
}

.btn-primary:hover,
.btn-primary:focus {
    background: #044f49;
    border-color: #076f61;
    box-shadow: none;
}

.alert {
    border-width: 0 0 0 .28rem;
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow-sm);
}

.form-control,
.form-select {
    border-color: #9fb2b9;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--app-teal);
    box-shadow: 0 0 0 .22rem rgba(8, 127, 110, .14);
}

.mobile-app-bar {
    position: sticky;
    z-index: 1030;
    top: 0;
    min-height: 64px;
    background: rgba(255, 255, 255, .95);
    border-bottom: 1px solid var(--app-line);
    box-shadow: var(--app-shadow-sm);
    backdrop-filter: blur(14px);
}

.mobile-brand {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    color: #183741;
    font-weight: 700;
    text-decoration: none;
}

.mobile-brand img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: .5rem;
}

.mobile-menu-button {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    min-height: 42px;
    color: var(--app-teal-dark);
    font-weight: 700;
    background: var(--app-teal-soft);
    border: 1px solid #c4e3dc;
}

.mobile-menu-button svg {
    width: 1.1rem;
    height: 1.1rem;
}

@media (min-width: 768px) {
    .sidebar {
        width: var(--app-sidebar-width);
    }

    .main-content-wrapper {
        margin-left: var(--app-sidebar-width);
    }

    .footer {
        margin-left: var(--app-sidebar-width);
    }
}

@media (max-width: 767.98px) {
    .sidebar {
        width: min(88vw, 320px);
    }

    .main-content-wrapper {
        padding: .85rem;
    }

    .footer {
        padding-right: 1rem !important;
        padding-left: 1rem !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .menu-item-link,
    .btn {
        transition: none;
    }

    .menu-item-link:hover,
    .btn:hover {
        transform: none;
    }
}

.sidebar .dropdown-item.active,
.sidebar .dropdown-item[aria-current="page"] {
    color: #fff;
    background: var(--app-teal);
}

.sidebar .dropdown-item.active:hover,
.sidebar .dropdown-item.active:focus {
    color: #fff;
    background: var(--app-teal-dark);
}
}

/* Shared content-first panels: keep text readable without changing data or hiding notices. */
.fidetech-ui .row > [class*="col-"],
.fidetech-ui .card, .fidetech-ui .card-body { min-width: 0; }
.fidetech-ui .card :is(h2,h3,h4,h5,h6,p),
.fidetech-ui .table :is(th,td) { overflow-wrap: break-word; }
.fidetech-ui .card-body > :last-child { margin-bottom: 0; }
.report-chart--notice {
    height: auto !important; min-height: 0 !important; max-height: none !important;
    padding: .75rem 1rem !important;
}
.report-chart--notice > canvas[hidden] { display: none !important; }
.report-chart-status { margin: 0; color: #52666e; font-size: .875rem; line-height: 1.5; }
@media screen {
    .fidetech-ui .table-responsive { overflow-x: auto; }
    .tifa-report .table-responsive th { min-width: 9rem; white-space: normal; }
    .tifa-report .table-responsive td { min-width: 6rem; }
}
