:root {
    --oh-ink: #18342a;
    --oh-muted: #56665e;
    --oh-line: #e1e8e2;
    --oh-surface: #fff;
    --oh-soft: #f1f5f1;
    --oh-accent: #9a6e34;
}

.dark {
    --oh-ink: #e8eee8;
    --oh-muted: #b5c1b6;
    --oh-line: #36443a;
    --oh-surface: #1d2721;
    --oh-soft: #26342b;
    --oh-accent: #dfb478;
}

.oh-brand {
    display: block;
    height: 100%;
    width: auto;
    object-fit: contain;
}

.fi-simple-header {
    --oh-brand-height: 6.5rem;
}

.oh-welcome {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.25rem;
    padding: clamp(1.4rem, 4vw, 2.45rem);
    border-radius: 1rem;
    background: linear-gradient(112deg, #142e26, #244b3b);
    color: #f9fcf7;
}

.oh-welcome time {
    display: block;
    margin-bottom: .4rem;
    color: #edca98;
    font-size: .84rem;
    text-transform: capitalize;
}

.oh-welcome h2 {
    font-size: clamp(1.7rem, 3.4vw, 2.6rem);
    font-weight: 680;
    letter-spacing: -.035em;
    line-height: 1.15;
}

.oh-welcome p {
    margin-top: .5rem;
    color: #d4e3d9;
}

.oh-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
    gap: .8rem;
}

.oh-metric,
.oh-section {
    border: 1px solid var(--oh-line);
    border-radius: .9rem;
    background: var(--oh-surface);
    color: var(--oh-ink);
}

.oh-metric {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    min-width: 0;
    padding: .95rem;
}

.oh-metric-icon {
    flex: none;
    padding: .45rem;
    border-radius: .6rem;
    background: var(--oh-soft);
    color: var(--oh-accent);
}

.oh-metric-icon svg {
    width: 1.1rem;
    height: 1.1rem;
}

.oh-metric p, .oh-table small, .oh-alert small {
    color: var(--oh-muted);
    font-size: .8rem;
}

.oh-metric strong {
    display: block;
    margin-top: .2rem;
    font-size: clamp(1rem, 1.8vw, 1.35rem);
    font-weight: 700;
    overflow-wrap: anywhere;
}

.oh-metric-body {
    flex: 1;
    min-width: 0;
}

.oh-goal-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .4rem;
}

.oh-goal-caption {
    color: var(--oh-muted);
    font-size: .74rem;
    white-space: nowrap;
}

.oh-goal-bar {
    width: 100%;
    height: .45rem;
    margin-top: .45rem;
    border-radius: 999px;
    background: var(--oh-soft);
    border: 1px solid var(--oh-line);
    overflow: hidden;
}

.oh-goal-bar-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--oh-accent), #2e7d5b);
    transition: width .35s ease;
}

.oh-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 23rem), 1fr));
    gap: 1rem;
}

.oh-section {
    min-width: 0;
}

.oh-section-heading {
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--oh-line);
}

.oh-section-heading h2 {
    font-size: 1rem;
    font-weight: 700;
}

.oh-table-wrap {
    container-type: inline-size;
    overflow-x: auto;
}

.oh-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .87rem;
}

.oh-table th, .oh-table td {
    padding: .75rem 1.1rem;
    border-bottom: 1px solid var(--oh-line);
    text-align: left;
}

.oh-table th {
    color: var(--oh-muted);
    font-size: .78rem;
    font-weight: 650;
}

.oh-table-label {
    display: none;
}

.oh-table time,
.oh-table-value {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.oh-table--recent .fi-badge,
.oh-table--recent .fi-badge-label {
    max-width: 100%;
    overflow: visible;
    white-space: normal;
    overflow-wrap: anywhere;
}

.oh-table tr:last-child td {
    border-bottom: 0;
}

.oh-table small, .oh-alert small {
    display: block;
    margin-top: .2rem;
}

.oh-table a, .oh-alert a {
    font-weight: 650;
    text-decoration: underline;
    text-decoration-color: var(--oh-line);
    text-underline-offset: .2em;
}

.oh-table a:hover, .oh-alert a:hover {
    text-decoration-color: var(--oh-accent);
}

.oh-empty {
    color: var(--oh-muted);
    padding: 1rem 1.15rem;
}

.oh-stages {
    display: grid;
    gap: .9rem;
    padding: 1rem 1.15rem;
}

.oh-stages .oh-empty {
    padding: 0;
}

.oh-stage div, .oh-alert summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
    font-size: .87rem;
}

.oh-stage progress {
    display: block;
    width: 100%;
    height: .45rem;
    margin-top: .3rem;
    accent-color: var(--oh-accent);
}

.oh-alerts, .oh-report-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
    gap: .8rem;
    padding: 1rem 1.15rem;
}

.oh-alert {
    align-self: start;
    background: var(--oh-soft);
    border-radius: .6rem;
}

.oh-alert summary {
    padding: .75rem;
    cursor: pointer;
    font-weight: 650;
}

.oh-alert summary strong {
    border-radius: 1rem;
    padding: .12rem .6rem;
    background: var(--oh-surface);
}

.oh-alert ul, .oh-alert-pagination {
    padding: 0 .75rem .75rem;
}

.oh-alert li {
    padding: .55rem 0;
    border-top: 1px solid var(--oh-line);
    overflow-wrap: anywhere;
    font-size: .85rem;
}

.oh-report-form label {
    min-width: 0;
    font-size: .85rem;
    font-weight: 600;
}

.oh-report-form :is(input, select) {
    width: 100%;
    min-width: 0;
    display: block;
    min-height: 2.35rem;
    padding: .35rem .55rem;
    margin-top: .35rem;
    border: 1px solid var(--oh-line);
    border-radius: .45rem;
    background: var(--oh-surface);
    color: var(--oh-ink);
}

.oh-report-filters summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    cursor: pointer;
    font-weight: 700;
    list-style: none;
}

.oh-report-filters summary::-webkit-details-marker {
    display: none;
}

.oh-report-filters summary .fi-icon {
    width: 1.1rem;
    height: 1.1rem;
}

.oh-report-filters[open] summary .fi-icon {
    rotate: 180deg;
}

.oh-report-filters:not([open]) summary {
    border-bottom: 0;
}

.oh-report-actions, .oh-report-downloads {
    display: flex;
    align-items: flex-end;
    gap: .55rem;
    flex-wrap: wrap;
}

.oh-report-downloads {
    justify-content: flex-end;
}

.oh-settings-actions {
    margin-top: 1rem;
}

.oh-form-errors {
    padding: 0 1.15rem 1rem;
    color: #b91c1c;
}

.dark .oh-form-errors {
    color: #fca5a5;
}

.oh-audit {
    padding: .65rem .75rem;
    max-width: 34rem;
}

.oh-audit summary {
    cursor: pointer;
}

.oh-audit dt {
    margin-top: .55rem;
    font-weight: 650;
}

.oh-audit dd {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.oh-panel-preview {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .6rem 1rem;
    padding: .75rem 1rem;
    margin-top: 1rem;
    border: 1px solid var(--oh-line);
    border-inline-start: .25rem solid var(--oh-accent);
    border-radius: .625rem;
    background: var(--oh-soft);
    color: var(--oh-ink);
}

.oh-panel-preview p {
    color: var(--oh-muted);
    font-size: .85rem;
}

.oh-sales-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
    gap: .8rem;
}

.oh-sales-card {
    container-type: inline-size;
    padding: .95rem 1.15rem 1rem;
    border-inline-start: .25rem solid var(--oh-sales-color);
}

.oh-sales-card--closed {
    --oh-sales-color: #347858;
}

.oh-sales-card--open {
    --oh-sales-color: var(--oh-accent);
}

.dark .oh-sales-card--closed {
    --oh-sales-color: #79b999;
}

.oh-sales-header {
    display: flex;
    align-items: center;
    gap: .55rem;
}

.oh-sales-header h2 {
    font-size: .9rem;
    font-weight: 650;
}

.oh-sales-card .oh-metric-icon {
    color: var(--oh-sales-color);
}

.oh-sales-value {
    display: block;
    margin-block: .45rem .2rem;
    font-size: clamp(1rem, 7.1cqi, 2rem);
    font-weight: 720;
    letter-spacing: -.025em;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.oh-sales-amount {
    font-size: min(2rem, calc(145cqi / var(--oh-amount-length)));
    white-space: nowrap;
}

.oh-sales-detail {
    color: var(--oh-muted);
    font-size: .84rem;
}

.oh-sales-missing {
    margin-block-start: .3rem;
    color: var(--oh-muted);
    font-size: .8rem;
}

.oh-period-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.oh-period-value {
    color: var(--oh-ink);
    font-size: 1rem;
    font-weight: 700;
}

.oh-period-dropdown {
    position: relative;
}

.oh-period-trigger {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .4rem .65rem;
    border: 1px solid var(--oh-line);
    border-radius: .5rem;
    background: var(--oh-surface);
    color: var(--oh-ink);
    cursor: pointer;
    font-size: .82rem;
    font-weight: 650;
    list-style: none;
}

.oh-period-trigger::-webkit-details-marker {
    display: none;
}

.oh-period-trigger svg {
    width: 1rem;
    height: 1rem;
}

.oh-period-menu {
    position: absolute;
    z-index: 10;
    inset-inline-end: 0;
    inset-block-start: calc(100% + .4rem);
    width: min(21rem, calc(100vw - 3rem));
    padding: .75rem;
    border: 1px solid var(--oh-line);
    border-radius: .65rem;
    background: var(--oh-surface);
    box-shadow: 0 .5rem 1.25rem #0002;
}

.oh-period-shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--oh-line);
}

.oh-period-form,
.oh-period-dates {
    display: grid;
    gap: .65rem;
}

.oh-period-form {
    padding-top: .75rem;
}

.oh-period-dates {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.oh-period-dates label {
    display: block;
    margin-bottom: .3rem;
    color: var(--oh-ink);
    font-size: .82rem;
    font-weight: 650;
}

.oh-period-dates input {
    width: 100%;
    min-width: 0;
    min-height: 2.5rem;
    padding: .4rem .5rem;
    border: 1px solid var(--oh-line);
    border-radius: .45rem;
    background: var(--oh-surface);
    color: var(--oh-ink);
    font-size: 1rem;
}

.dark .oh-period-dates input {
    color-scheme: dark;
}

.oh-period-dates input:focus-visible {
    outline: 2px solid var(--oh-accent);
    outline-offset: 1px;
}

.oh-period-error {
    margin-top: .3rem;
    color: #b91c1c;
    font-size: .78rem;
}

.dark .oh-period-error {
    color: #fca5a5;
}

@media (max-width: 22.5rem) {
    .oh-period-dates {
        grid-template-columns: minmax(0, 1fr);
    }
}

@container (max-width: 36rem) {
    .oh-table--responsive,
    .oh-table--responsive tbody {
        display: block;
    }

    .oh-table--responsive thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .oh-table--responsive tbody tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
        gap: .45rem .85rem;
        padding: .8rem .9rem;
        border-bottom: 1px solid var(--oh-line);
    }

    .oh-table--responsive tbody tr:last-child {
        border-bottom: 0;
    }

    .oh-table--responsive tbody td {
        padding: 0;
        border: 0;
        overflow-wrap: anywhere;
    }

    .oh-table--responsive :is(.oh-table-primary, .oh-table-value, .oh-empty) {
        grid-column: 1 / -1;
    }

    .oh-table--recent time {
        font-size: .8rem;
        color: var(--oh-muted);
    }

    .oh-table--performance tbody tr {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .oh-table--performance .oh-table-primary {
        font-weight: 650;
    }

    .oh-table--performance .oh-table-label {
        display: block;
        color: var(--oh-muted);
        font-size: .75rem;
    }

    .oh-table--performance .oh-table-value {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: .6rem;
        padding-top: .45rem;
        border-top: 1px solid var(--oh-line);
        font-weight: 650;
    }

    .oh-table--import tbody tr {
        grid-template-columns: minmax(0, 1fr);
    }

    .oh-table--import tbody td:first-child {
        font-weight: 650;
    }
}

@media (max-width: 39.99rem) {
    .oh-welcome {
        gap: 1rem;
        padding: 1.1rem;
    }

    .oh-welcome .fi-btn {
        width: 100%;
    }

    .oh-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .55rem;
    }

    .oh-metric {
        gap: .45rem;
        padding: .65rem;
    }

    .oh-metric:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    .oh-metric-icon {
        padding: .35rem;
    }

    .oh-metric-icon svg {
        width: 1rem;
        height: 1rem;
    }

    .oh-sales-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: .65rem;
    }

    .oh-sales-card {
        padding: .85rem .95rem;
    }

    .oh-sales-value:not(.oh-sales-amount) {
        font-size: clamp(1.15rem, 5.8cqi, 1.6rem);
    }

    .oh-section-heading,
    .oh-report-form {
        padding: .85rem .9rem;
    }

    .oh-report-form {
        grid-template-columns: minmax(0, 1fr);
        gap: .7rem;
    }

    .oh-report-form :is(input, select) {
        font-size: 1rem;
        min-height: 2.75rem;
    }

    .oh-report-actions .fi-btn,
    .oh-report-downloads .fi-btn {
        flex: 1 1 auto;
        white-space: normal;
    }

    .oh-period-trigger,
    .oh-period-dates input,
    .oh-period-form .fi-btn,
    .fi-main .fi-header-actions-ctn .fi-btn,
    .fi-main .oh-welcome .fi-btn,
    .fi-main .oh-report-actions .fi-btn,
    .fi-main .oh-report-downloads .fi-btn,
    .oh-period-shortcuts .fi-btn {
        min-height: 2.75rem;
    }

    #lead-import-file {
        max-width: 100%;
    }

    .fi-ta-table-stacked-on-mobile > tbody > tr.fi-ta-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
        gap: .35rem .8rem;
        padding: .7rem .8rem;
    }

    .fi-ta-table-stacked-on-mobile > tbody > tr.fi-ta-row > .fi-ta-cell:has(> .fi-ta-cell-label) {
        min-width: 0;
        padding: 0;
    }

    .fi-ta-table-stacked-on-mobile > tbody > tr.fi-ta-row > :is(
        .fi-ta-cell-name, .fi-ta-cell-email, .fi-ta-cell-label, .fi-ta-cell-description,
        .fi-ta-cell-outcome, .fi-ta-cell-changes, .fi-ta-cell:has(> .fi-ta-actions)
    ) {
        grid-column: 1 / -1;
    }

    .fi-ta-table-stacked-on-mobile > tbody > tr.fi-ta-row > .fi-ta-cell:has(> .fi-ta-actions) {
        padding: 0;
    }

    .fi-ta-table-stacked-on-mobile > tbody > tr.fi-ta-row > .fi-ta-cell > .fi-ta-cell-label {
        padding: 0;
        font-size: .75rem;
        line-height: 1.35;
        overflow-wrap: anywhere;
    }

    .fi-ta-table-stacked-on-mobile .fi-ta-cell-name > .fi-ta-cell-label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .fi-ta-table-stacked-on-mobile .fi-ta-cell-name .fi-ta-text-item {
        font-weight: 650;
    }

    .fi-ta-table-stacked-on-mobile .fi-ta-cell-content :is(.fi-ta-text, .fi-ta-text-item, .fi-badge, .fi-badge-label) {
        min-width: 0;
        max-width: 100%;
        overflow: visible;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .fi-ta-table-stacked-on-mobile .fi-ta-cell-content :is(.fi-ta-text-item, .fi-ta-text-description, .fi-ta-placeholder) {
        line-height: 1.4;
    }

    .fi-ta-table-stacked-on-mobile .fi-ta-actions :is(.fi-link, .fi-btn, .fi-icon-btn) {
        min-width: 2.75rem;
        min-height: 2.75rem;
    }
}
