﻿/* ============================= */
/*        Root Variables         */
/* ============================= */

:root {
    --couture-blue: #00B9F2;
    --couture-blue-hover: #0F6F95;
    --couture-dark-blue: #0F6F95;
    --couture-light-grey: #F3F3F3;
    --couture-dark-grey: #666666;
    --couture-background-white: #F8F9FA;
    --couture-navigation-blue: #0A1B27;
    --couture-gray: #374151;
    --couture-dark: #111827;
}

/* FINsight Analytics */
.finsight-analytics-shell {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.finsight-brand-band {
    order: 0;
}

.finsight-toast {
    order: 1;
}

.finsight-command-bar {
    order: 2;
}

.finsight-studio-layout {
    order: 3;
}

.finsight-kpi-grid {
    order: 4;
}

.finsight-comparison-panel {
    order: 5;
}

.finsight-toast,
.finsight-brand-band,
.finsight-command-bar,
.finsight-config-bar,
.finsight-kpi-card,
.finsight-empty-panel,
.finsight-account-browser,
.finsight-builder-panel,
.finsight-comparison-panel {
    background: #fff;
    border: 1px solid #dbe3ea;
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .06);
}

.finsight-toast {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .75rem 1rem;
    color: #166534;
    background: #f0fdf4;
    border-color: #bbf7d0;
    font-size: .875rem;
    font-weight: 600;
}

.finsight-toast svg {
    width: 1rem;
    height: 1rem;
}

.finsight-brand-band {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 5.2rem;
    padding: .35rem .9rem;
    overflow: hidden;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 45%, #e0f7ff 100%);
}

.finsight-brand-logo-wrap {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
}

.finsight-brand-logo {
    display: block;
    width: auto;
    max-width: min(100%, 22rem);
    height: auto;
    max-height: 4.35rem;
    object-fit: contain;
    object-position: right center;
}

.finsight-command-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 1rem;
    padding: 1rem;
}

.finsight-studio-control-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.finsight-command-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: .85rem;
    border-bottom: 1px solid #e2e8f0;
}

.finsight-command-heading span {
    display: block;
    color: #64748b;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.finsight-command-heading h2 {
    margin: .12rem 0 0;
    color: #0f172a;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0;
}

.finsight-command-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .55rem;
}

.finsight-command-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 1rem;
}

.finsight-config-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .85rem 1rem;
}

.finsight-config-bar div {
    min-width: 0;
}

.finsight-config-bar span,
.finsight-comparison-subheading span {
    display: block;
    color: #64748b;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.finsight-config-bar strong {
    display: block;
    margin-top: .15rem;
    color: #0f172a;
    font-size: .88rem;
    font-weight: 700;
    line-height: 1.35;
}

.finsight-filter-grid {
    display: grid;
    grid-template-columns: minmax(14rem, 1.25fr) repeat(4, minmax(8rem, .65fr)) auto;
    gap: .75rem;
    align-items: end;
}

.finsight-filter-grid label,
.finsight-builder-form label {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    min-width: 0;
}

.finsight-filter-grid span,
.finsight-builder-form label > span,
.finsight-panel-heading span,
.finsight-market-strip span,
.finsight-kpi-client {
    color: #64748b;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.finsight-filter-grid select,
.finsight-builder-form input,
.finsight-builder-form select,
.finsight-builder-form textarea,
.finsight-search-wrap input {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #0f172a;
    font-size: .86rem;
    line-height: 1.3;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.finsight-filter-grid select,
.finsight-builder-form input,
.finsight-builder-form select {
    min-height: 2.45rem;
    padding: .55rem .7rem;
}

.finsight-builder-form textarea {
    min-height: 9rem;
    padding: .75rem .85rem;
    font-family: Consolas, "Courier New", monospace;
    resize: vertical;
}

.finsight-filter-grid select:focus,
.finsight-builder-form input:focus,
.finsight-builder-form select:focus,
.finsight-builder-form textarea:focus,
.finsight-search-wrap input:focus {
    border-color: #0f6f95;
    box-shadow: 0 0 0 3px rgba(15, 111, 149, .14);
}

.finsight-icon-button,
.finsight-primary-button,
.finsight-secondary-button,
.finsight-text-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    border: 0;
    border-radius: 6px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}

.finsight-icon-button {
    width: 2.45rem;
    height: 2.45rem;
    background: #0a1b27;
    color: #fff;
}

.finsight-icon-button.is-loading svg {
    animation: finsight-spin .8s linear infinite;
}

.finsight-primary-button {
    min-height: 2.45rem;
    padding: .7rem 1rem;
    background: #0f6f95;
    color: #fff;
}

.finsight-secondary-button,
.finsight-text-button {
    min-height: 2.25rem;
    padding: .6rem .8rem;
    background: #f8fafc;
    color: #334155;
    border: 1px solid #dbe3ea;
}

.finsight-text-button.is-danger {
    color: #b91c1c;
}

.finsight-icon-button:hover,
.finsight-primary-button:hover {
    background: #155e75;
}

.finsight-secondary-button:hover,
.finsight-text-button:hover {
    background: #eef2f7;
}

.finsight-icon-button svg,
.finsight-primary-button svg,
.finsight-secondary-button svg,
.finsight-text-button svg {
    width: 1rem;
    height: 1rem;
}

@keyframes finsight-spin {
    to {
        transform: rotate(360deg);
    }
}

.finsight-market-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(5.75rem, auto));
    gap: .55rem;
    align-items: stretch;
}

.finsight-market-strip div {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: .65rem .8rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
}

.finsight-market-strip strong {
    color: #0f172a;
    font-size: .98rem;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.finsight-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(17rem, 1fr));
    gap: 1rem;
    transition: opacity .18s ease;
}

.finsight-kpi-grid.is-refreshing {
    opacity: .58;
    pointer-events: none;
}

.finsight-kpi-card {
    display: flex;
    flex-direction: column;
    gap: .85rem;
    min-width: 0;
    padding: 1rem;
    border-top: 4px solid #64748b;
    transition: box-shadow .18s ease, transform .18s ease;
}

.finsight-kpi-card.is-zoomed {
    grid-column: 1 / -1;
    padding: 1.15rem;
    box-shadow: 0 18px 42px rgba(15, 23, 42, .11);
}

.finsight-kpi-card.is-good {
    border-top-color: #16a34a;
}

.finsight-kpi-card.is-ok {
    border-top-color: #d97706;
}

.finsight-kpi-card.is-bad {
    border-top-color: #dc2626;
}

.finsight-kpi-card.is-info {
    border-top-color: #0f6f95;
}

.finsight-kpi-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
}

.finsight-kpi-card-tools {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: .45rem;
    flex: 0 0 auto;
}

.finsight-kpi-zoom-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    flex: 0 0 2rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    color: #0f6f95;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}

.finsight-kpi-zoom-button:hover,
.finsight-kpi-zoom-button[aria-pressed="true"] {
    background: #e0f2fe;
    border-color: #7dd3fc;
    color: #075985;
    transform: translateY(-1px);
}

.finsight-kpi-zoom-button svg {
    width: 1rem;
    height: 1rem;
    color: currentColor;
    stroke: currentColor;
}

.finsight-kpi-card h2,
.finsight-panel-heading h2 {
    margin: 0;
    color: #0f172a;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0;
}

.finsight-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .3rem;
    min-height: 1.65rem;
    padding: .25rem .55rem;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #475569;
    font-size: .72rem;
    font-weight: 800;
    white-space: nowrap;
}

.finsight-status-pill svg {
    width: .82rem;
    height: .82rem;
}

.finsight-status-pill.is-good {
    color: #166534;
    background: #dcfce7;
    border-color: #86efac;
}

.finsight-status-pill.is-ok {
    color: #92400e;
    background: #fef3c7;
    border-color: #fcd34d;
}

.finsight-status-pill.is-bad {
    color: #991b1b;
    background: #fee2e2;
    border-color: #fca5a5;
}

.finsight-status-pill.is-info {
    color: #0f6f95;
    background: #e0f2fe;
    border-color: #7dd3fc;
}

.finsight-kpi-value-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .75rem;
}

.finsight-kpi-value-row strong {
    color: #0f172a;
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1;
}

.finsight-trend-delta,
.finsight-comparison-delta {
    color: #64748b;
    font-size: .76rem;
    font-weight: 800;
}

.finsight-trend-delta.is-up,
.finsight-comparison-delta.is-up {
    color: #15803d;
}

.finsight-trend-delta.is-down,
.finsight-comparison-delta.is-down {
    color: #b91c1c;
}

.finsight-kpi-chart-wrap {
    height: 9rem;
    min-height: 9rem;
}

.finsight-kpi-card.is-zoomed .finsight-kpi-chart-wrap {
    height: clamp(18rem, 42vw, 31rem);
    min-height: 18rem;
}

.finsight-kpi-chart-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}

.finsight-legend-strip {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
}

.finsight-legend-strip span {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    color: #475569;
    font-size: .74rem;
    font-weight: 700;
}

.finsight-legend-strip i {
    width: .55rem;
    height: .55rem;
    border-radius: 999px;
}

.finsight-legend-strip .is-good {
    background: #16a34a;
}

.finsight-legend-strip .is-ok {
    background: #d97706;
}

.finsight-legend-strip .is-bad {
    background: #dc2626;
}

.finsight-legend-rule {
    min-height: 1rem;
    color: #64748b;
    font-size: .75rem;
    font-weight: 600;
}

.finsight-kpi-detail {
    border-top: 1px solid #e2e8f0;
    padding-top: .5rem;
}

.finsight-kpi-detail summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    color: #334155;
    font-size: .78rem;
    font-weight: 800;
    list-style: none;
}

.finsight-kpi-detail summary::-webkit-details-marker {
    display: none;
}

.finsight-kpi-detail summary svg {
    width: .95rem;
    height: .95rem;
}

.finsight-kpi-detail[open] summary svg {
    transform: rotate(180deg);
}

.finsight-kpi-detail-table {
    display: grid;
    gap: .35rem;
    padding-top: .55rem;
}

.finsight-kpi-card.is-zoomed .finsight-kpi-detail-table {
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
}

.finsight-kpi-detail-table div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .45rem .55rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
    color: #475569;
    font-size: .78rem;
}

.finsight-kpi-detail-table strong {
    color: #0f172a;
    font-variant-numeric: tabular-nums;
}

.finsight-kpi-actions {
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
    margin-top: auto;
}

.finsight-kpi-actions form {
    margin: 0;
}

.finsight-kpi-actions .finsight-card-action-button {
    min-width: 6.75rem;
    height: 2.35rem;
    padding: 0 .9rem;
    border-radius: .5rem;
    font-size: .82rem;
}

.finsight-studio-layout {
    display: grid;
    grid-template-columns: minmax(18rem, .8fr) minmax(0, 1.2fr);
    gap: 1rem;
    align-items: start;
}

.finsight-account-browser,
.finsight-builder-panel,
.finsight-comparison-panel {
    padding: 1rem;
}

.finsight-panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .9rem;
}

.finsight-panel-heading > svg {
    width: 1.2rem;
    height: 1.2rem;
    color: #0f6f95;
}

.finsight-help-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    min-height: 2.25rem;
    padding: .55rem .75rem;
    border: 1px solid #bae6fd;
    border-radius: 6px;
    background: #f0f9ff;
    color: #0f6f95;
    font-size: .78rem;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}

.finsight-help-link:hover {
    background: #e0f2fe;
    border-color: #7dd3fc;
    color: #0f6f95;
    transform: translateY(-1px);
}

.finsight-help-link svg {
    width: 1rem;
    height: 1rem;
}

.finsight-pdf-action {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: .55rem;
    margin: 0;
}

.finsight-pdf-action button svg,
.finsight-action-button svg {
    width: 1rem;
    height: 1rem;
    color: currentColor;
    stroke: currentColor;
}

.finsight-pdf-action .finora-btn-save-close svg,
.finsight-company-picker .finora-btn-save-close svg,
.finsight-command-actions .finora-btn svg {
    color: currentColor;
    stroke: currentColor;
}

.finsight-export-field {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    min-width: min(17rem, 100%);
}

.finsight-export-field span {
    color: #64748b;
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.finsight-export-field select {
    min-height: 2.45rem;
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #0f172a;
    font-size: .84rem;
    font-weight: 700;
    padding: .52rem .65rem;
    outline: none;
}

.finsight-export-field select:focus {
    border-color: #0f6f95;
    box-shadow: 0 0 0 3px rgba(15, 111, 149, .14);
}

.finsight-command-actions .finsight-action-button,
.finsight-config-bar .finsight-action-button,
.finsight-builder-actions .finsight-action-button,
.finsight-company-picker .finsight-action-button,
.finsight-pdf-action .finsight-action-button {
    min-width: 8.75rem;
    height: 2.45rem;
    border-radius: 6px;
    font-size: .84rem;
}

.finsight-pdf-option {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    min-height: 2.25rem;
    padding: .55rem .7rem;
    border: 1px solid #dbe3ea;
    border-radius: 6px;
    background: #f8fafc;
    color: #334155;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.finsight-pdf-option input {
    width: .95rem;
    height: .95rem;
    accent-color: #0f6f95;
}

.finsight-search-wrap {
    position: relative;
    margin-bottom: .75rem;
}

.finsight-search-wrap svg {
    position: absolute;
    left: .7rem;
    top: 50%;
    width: 1rem;
    height: 1rem;
    color: #94a3b8;
    transform: translateY(-50%);
}

.finsight-search-wrap input {
    height: 2.45rem;
    padding: .55rem .7rem .55rem 2.1rem;
}

.finsight-account-list {
    display: grid;
    gap: .5rem;
    max-height: 30rem;
    overflow-y: auto;
    padding-right: .25rem;
}

.finsight-account-token {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: .75rem;
    width: 100%;
    min-height: 3rem;
    padding: .55rem .65rem;
    border: 1px solid #dbe3ea;
    border-radius: 6px;
    background: #fff;
    color: #334155;
    text-align: left;
    cursor: grab;
}

.finsight-account-token:hover {
    border-color: #0f6f95;
    background: #f8fafc;
}

.finsight-account-token.is-rollup {
    border-color: #bae6fd;
    background: #f0f9ff;
}

.finsight-account-token.is-kpi {
    border-color: #c7d2fe;
    background: #eef2ff;
}

.finsight-account-token span {
    min-width: 0;
}

.finsight-account-token strong,
.finsight-account-token span span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.finsight-account-token strong {
    color: #0f172a;
    font-size: .78rem;
}

.finsight-account-token span span {
    color: #475569;
    font-size: .8rem;
    font-weight: 600;
}

.finsight-account-token em {
    max-width: 8rem;
    overflow: hidden;
    color: #64748b;
    font-size: .68rem;
    font-style: normal;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.finsight-form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .8rem;
}

.finsight-form-grid .is-wide {
    grid-column: span 3;
}

.finsight-formula-editor {
    margin-top: .85rem;
}

.finsight-formula-tools {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    margin-top: .55rem;
}

.finsight-formula-tools button {
    min-height: 2.05rem;
    padding: .45rem .65rem;
    border: 1px solid #dbe3ea;
    border-radius: 6px;
    background: #fff;
    color: #334155;
    font-size: .74rem;
    font-weight: 800;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}

.finsight-formula-tools button:hover {
    border-color: #0f6f95;
    background: #f0f9ff;
    color: #0f6f95;
    transform: translateY(-1px);
}

.finsight-builder-form label.is-disabled {
    opacity: .55;
}

.finsight-builder-form label.is-disabled input {
    cursor: not-allowed;
    background: #f8fafc;
}

.finsight-validation {
    color: #b91c1c !important;
    font-size: .72rem !important;
    font-weight: 700 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
}

.finsight-builder-actions {
    display: flex;
    justify-content: flex-end;
    gap: .65rem;
    padding-top: .9rem;
}

.finsight-comparison-panel {
    display: flex;
    flex-direction: column;
    gap: .9rem;
}

.finsight-comparison-subheading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    padding-top: .25rem;
    border-top: 1px solid #e2e8f0;
}

.finsight-comparison-subheading h3 {
    margin: .15rem 0 0;
    color: #0f172a;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0;
}

.finsight-company-picker {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(16rem, 1fr) auto;
    gap: .75rem;
    align-items: stretch;
}

.finsight-company-source,
.finsight-company-dropzone {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: .45rem;
    min-height: 4.25rem;
    padding: .6rem;
    border: 1px solid #dbe3ea;
    border-radius: 6px;
    background: #f8fafc;
}

.finsight-company-dropzone {
    background: #fff;
}

.finsight-company-chip,
.finsight-company-pill {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    max-width: 100%;
    min-height: 2rem;
    padding: .4rem .55rem;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #334155;
    font-size: .76rem;
    font-weight: 800;
}

.finsight-company-chip {
    cursor: grab;
}

.finsight-company-chip.is-selected,
.finsight-company-pill {
    border-color: #0f6f95;
    color: #0f172a;
    background: #e0f2fe;
}

.finsight-company-chip svg {
    width: .9rem;
    height: .9rem;
}

.finsight-company-chip span,
.finsight-company-pill {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.finsight-company-pill button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    border: 0;
    border-radius: 999px;
    background: #0f6f95;
    color: #fff;
    font-size: .7rem;
    line-height: 1;
}

.finsight-comparison-table-wrap {
    overflow-x: auto;
    border: 1px solid #dbe3ea;
    border-radius: 8px;
}

.finsight-comparison-table {
    width: 100%;
    min-width: 54rem;
    border-collapse: collapse;
    font-size: .84rem;
}

.finsight-comparison-table th {
    padding: .75rem .85rem;
    border-bottom: 1px solid #dbe3ea;
    background: #f8fafc;
    color: #475569;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-align: left;
    text-transform: uppercase;
}

.finsight-comparison-table th strong,
.finsight-comparison-table th span {
    display: block;
}

.finsight-comparison-table th span {
    margin-top: .15rem;
    color: #64748b;
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

.finsight-comparison-table td {
    min-width: 12rem;
    padding: .85rem;
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
    vertical-align: top;
}

.finsight-comparison-table tbody tr:last-child td {
    border-bottom: 0;
}

.finsight-comparison-table td:first-child {
    min-width: 14rem;
    background: #fcfcfd;
}

.finsight-comparison-table td:first-child strong {
    display: block;
    color: #0f172a;
    font-weight: 800;
}

.finsight-comparison-table td:first-child span {
    color: #64748b;
    font-size: .74rem;
    font-weight: 700;
}

.finsight-comparison-table td.is-muted {
    color: #94a3b8;
    background: #f8fafc;
}

.finsight-pl-comparison-table {
    min-width: 62rem;
}

.finsight-pl-comparison-table td {
    min-width: 8rem;
    padding: .62rem .75rem;
}

.finsight-pl-comparison-table td:first-child {
    min-width: 6rem;
    color: #64748b;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.finsight-pl-comparison-table td:nth-child(2) {
    min-width: 16rem;
    background: #fcfcfd;
}

.finsight-pl-comparison-table td.is-amount {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.finsight-pl-comparison-table td.is-negative {
    color: #b91c1c;
}

.finsight-pl-comparison-table tr.is-section-row td {
    background: #e0f2fe;
    color: #0f172a;
    font-weight: 800;
}

.finsight-pl-comparison-table tr.is-summary-row td,
.finsight-pl-comparison-table tr.is-grand-total-row td {
    border-top: 1px solid #cbd5e1;
    color: #0f172a;
    font-weight: 800;
}

.finsight-pl-comparison-table tr.is-grand-total-row td {
    background: #f8fafc;
    border-top-color: #94a3b8;
}

.finsight-comparison-value {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}

.finsight-comparison-value strong {
    color: #0f172a;
    font-size: .98rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.finsight-mini-bars {
    display: flex;
    align-items: end;
    gap: .18rem;
    height: 2.2rem;
    margin-top: .45rem;
}

.finsight-mini-bars i {
    width: .42rem;
    min-height: .16rem;
    border-radius: 2px 2px 0 0;
    background: #0f6f95;
}

.finsight-mini-bars .is-negative {
    background: #dc2626;
}

.finsight-empty-panel {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 15rem;
    gap: .45rem;
    padding: 2rem;
    color: #64748b;
    text-align: center;
}

.finsight-empty-panel.compact {
    min-height: 8rem;
}

.finsight-empty-panel svg {
    width: 2rem;
    height: 2rem;
    color: #0f6f95;
}

.finsight-empty-panel strong {
    color: #0f172a;
    font-size: 1rem;
    font-weight: 800;
}

.finsight-empty-panel span {
    font-size: .85rem;
}

@media (max-width: 1180px) {
    .finsight-command-bar,
    .finsight-command-body,
    .finsight-studio-layout,
    .finsight-company-picker {
        grid-template-columns: 1fr;
    }

    .finsight-brand-logo {
        max-width: min(100%, 20rem);
    }

    .finsight-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
    }

    .finsight-kpi-grid {
        grid-template-columns: repeat(2, minmax(17rem, 1fr));
    }
}

@media (max-width: 760px) {
    .finsight-brand-band {
        align-items: stretch;
        flex-direction: column;
        min-height: 4.45rem;
        padding: .3rem .5rem;
    }

    .finsight-brand-logo-wrap {
        justify-content: center;
    }

    .finsight-brand-logo {
        max-width: min(100%, 17rem);
        max-height: 3.75rem;
        object-position: center;
    }

    .finsight-command-heading,
    .finsight-config-bar,
    .finsight-panel-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .finsight-command-actions,
    .finsight-config-bar button,
    .finsight-pdf-action,
    .finsight-export-field,
    .finsight-pdf-option,
    .finsight-pdf-action button,
    .finsight-action-button {
        width: 100%;
    }

    .finsight-filter-grid,
    .finsight-form-grid,
    .finsight-kpi-grid {
        grid-template-columns: 1fr;
    }

    .finsight-form-grid .is-wide {
        grid-column: span 1;
    }

    .finsight-market-strip {
        grid-template-columns: 1fr;
    }

    .finsight-kpi-value-row,
    .finsight-kpi-card-header,
    .finsight-comparison-value {
        align-items: flex-start;
        flex-direction: column;
    }

    .finsight-kpi-card-tools {
        width: 100%;
        justify-content: space-between;
    }

    .finsight-kpi-card.is-zoomed .finsight-kpi-chart-wrap {
        height: 18rem;
    }

    .finsight-builder-actions,
    .finsight-kpi-actions,
    .finsight-formula-tools {
        justify-content: stretch;
    }

    .finsight-builder-actions button,
    .finsight-kpi-actions button,
    .finsight-formula-tools button {
        width: 100%;
    }
}

@media print {
    .finsight-command-bar,
    .finsight-studio-layout,
    .finsight-kpi-grid,
    .client-portal-app-shell header,
    #portalSidebar,
    #portalSidebarMobile,
    .finsight-company-picker {
        display: none !important;
    }

    .finsight-comparison-panel {
        box-shadow: none;
    }
}


/* ============================= */
/*         Base Styling          */
/* ============================= */

html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
    color: var(--couture-gray);
    background-color: var(--couture-light-grey);
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}


body {
    background-color: var(--couture-light-grey);
}


a {
    color: #0077cc;
}


/* ============================= */
/*         Typography            */
/* ============================= */

.text-couture-gray {
    font-family: 'Montserrat', sans-serif;
    color: var(--couture-gray);
}

.text-couture-dark {
    font-family: 'Montserrat', sans-serif;
    color: var(--couture-dark);
}

.text-couture-blue {
    font-family: 'Montserrat', sans-serif;
    color: var(--couture-blue);
}

.text-couture-darkblue {
    font-family: 'Montserrat', sans-serif;
    color: var(--couture-dark-blue);
}

/* ============================= */
/*         Backgrounds           */
/* ============================= */

.bg-couture-gray {
    background-color: var(--couture-gray);
}

.bg-couture-blue {
    background-color: var(--couture-blue);
}

.bg-couture-dark-blue {
    background-color: var(--couture-dark-blue);
}

.bg-couture-dark-grey {
    background-color: var(--couture-dark-grey);
}

.bg-couture-light-grey {
    background-color: var(--couture-light-grey);
}

.bg-couture-light {
    background-color: var(--couture-light-grey);
}

.bg-couture-background-white {
    background-color: var(--couture-background-white);
}

.bg-couture-navigation-blue {
    background-color: var(--couture-navigation-blue);
}


/* ============================= */
/*          Buttons              */
/* ============================= */

/* Full width by default (mobile) */
.btn-regular-width {
    width: 100%;
    text-transform: uppercase;
    font-family: 'Montserrat', sans-serif;
    font-size: small;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Fixed width for desktop */
@media (min-width: 768px) {
    .btn-regular-width {
        width: 10rem;
        text-transform: uppercase;
        font-family: 'Montserrat', sans-serif;
        font-size: small;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
    }
}

.btn-small-width {
    width: 2.5rem;
    text-transform: uppercase;
    font-family: 'Montserrat', sans-serif;
    font-size: small;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.btn-blue {
    background-color: var(--couture-blue);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

    .btn-blue:hover {
        background-color: var(--couture-blue-hover);
        transform: scale(1.05);
    }

.btn-gray {
    background-color: #6B6B6B;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

    .btn-gray:hover {
        background-color: #4a4a4a;
        transform: scale(1.05);
    }

.btn-red {
    background-color: #e53935;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

    .btn-red:hover {
        background-color: #b71c1c;
        transform: scale(1.05);
    }

.btn-green {
    background-color: #2e7d32;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

    .btn-green:hover {
        background-color: #1b5e20;
        transform: scale(1.05);
    }

.btn-navy {
    background-color: #001F3F;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

    .btn-navy:hover {
        background-color: #003366;
        transform: scale(1.05);
    }

.btn-light-grey {
    background-color: lightgrey;
    color: #6B6B6B;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    border-color: gray;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

    .btn-light-grey:hover {
        transform: scale(1.05);
    }


.btn-transparent {
    background-color: transparent;
    color: #6b7280;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.3s ease;
}

    .btn-transparent:hover {
        color: #374151;
        text-decoration: underline;
    }



.btn-blue-gradient {
    background-color: var(--couture-blue);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: background-color 0.3s ease, transform 0.3s ease;
    background: linear-gradient(to right, #06b6d4, #3b82f6);
}

    .btn-blue-gradient:hover {
        background-color: var(--couture-blue-hover);
        transform: scale(1.05);
    }



/* ============================= */
/*        Form Styling           */
/* ============================= */
.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.section-card {
    background-color: white;
    border-radius: 0.75rem; /* rounded-xl */
    border: 1px solid #e5e7eb; /* gray-200 */
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    padding: 1.5rem; /* p-6 */
}

/* =========================================================
   Client Portal Page Headers
   ========================================================= */

.portal-page-header-card {
    position: relative;
    margin-bottom: 1.25rem;
    padding: 0;
    overflow: hidden;
    border-radius: 1rem;
}

.portal-page-header-content {
    position: relative;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 1rem;
    min-height: 5.6rem;
    padding-right: 3.25rem;
}

.portal-page-header-title {
    display: flex;
    align-items: stretch;
    gap: 1rem;
    min-width: 0;
    max-width: 100%;
}

.portal-page-header-icon {
    width: 4.75rem;
    align-self: stretch;
    flex: 0 0 4.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #60a5fa;
    background: #eff6ff;
    border-right: 1px solid #dbeafe;
}

.portal-page-header-text {
    align-self: center;
    min-width: 0;
    max-width: 100%;
    padding: 1rem 0;
}

    .portal-page-header-text h1 {
        margin: 0;
        color: #111827;
        font-size: 1.5rem;
        font-weight: 650;
        line-height: 1.25;
    }

    .portal-page-header-text p {
        margin: .25rem 0 0;
        color: #6b7280;
        font-size: .875rem;
        line-height: 1.4;
    }

.portal-page-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .55rem;
    min-width: 0;
    padding: 1rem 0 1rem .5rem;
}

.portal-page-header-action {
    min-height: 2.35rem;
    padding: .55rem .85rem;
    white-space: nowrap;
}

.portal-page-header-view-flag {
    border-radius: 0 1rem 0 0;
}

    .portal-page-header-view-flag svg {
        width: 1.15rem;
        height: 1.15rem;
    }

@media (max-width: 768px) {
    .portal-page-header-card {
        margin-bottom: .7rem;
        border-radius: .75rem;
    }

    .portal-page-header-content {
        flex-direction: column;
        min-height: 0;
        gap: 0;
        padding-right: 2.35rem;
    }

    .portal-page-header-title {
        gap: .6rem;
    }

    .portal-page-header-icon {
        width: 3.15rem;
        flex-basis: 3.15rem;
    }

    .portal-page-header-text {
        align-self: center;
        padding: .65rem 0;
    }

        .portal-page-header-text h1 {
            font-size: 1.12rem;
        }

        .portal-page-header-text p {
            font-size: .75rem;
        }

    .portal-page-header-actions {
        align-items: stretch;
        justify-content: flex-start;
        padding: 0 .85rem .9rem .85rem;
    }

    .portal-page-header-action {
        width: 100%;
    }
}

/* =========================================================
   Client Portal Dashboard Widgets
   ========================================================= */

.client-dashboard-shell {
    display: grid;
    gap: 1.25rem;
}

.client-dashboard-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: .9rem;
}

.client-dashboard-stat-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: .85rem;
    min-height: 5.25rem;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: .75rem;
    background: #ffffff;
    color: #111827;
    text-decoration: none;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

    .client-dashboard-stat-card:hover {
        color: #111827;
        border-color: rgba(0, 185, 242, .45);
        box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
        transform: translateY(-2px);
    }

.client-dashboard-stat-icon,
.client-dashboard-row-icon,
.client-dashboard-icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.client-dashboard-stat-icon {
    width: 2.65rem;
    height: 2.65rem;
    flex: 0 0 2.65rem;
    border-radius: .65rem;
}

    .client-dashboard-stat-icon svg,
    .client-dashboard-row-icon svg,
    .client-dashboard-icon-link svg,
    .client-dashboard-chart-heading svg,
    .client-dashboard-empty svg {
        width: 1.1rem;
        height: 1.1rem;
    }

    .client-dashboard-stat-icon.is-company {
        color: #0f6f95;
        background: #e0f7ff;
    }

    .client-dashboard-stat-icon.is-task {
        color: #166534;
        background: #dcfce7;
    }

    .client-dashboard-stat-icon.is-message {
        color: #1d4ed8;
        background: #dbeafe;
    }

    .client-dashboard-stat-icon.is-finance {
        color: #b45309;
        background: #fef3c7;
    }

.client-dashboard-stat-body {
    display: grid;
    gap: .15rem;
    min-width: 0;
}

.client-dashboard-stat-value {
    color: #111827;
    font-size: 1.65rem;
    font-weight: 750;
    line-height: 1;
}

.client-dashboard-stat-label {
    color: #64748b;
    font-size: .8rem;
    font-weight: 700;
    line-height: 1.2;
}

.client-dashboard-stat-arrow {
    width: 1rem;
    height: 1rem;
    margin-left: auto;
    color: #94a3b8;
}

.client-dashboard-widget-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
}

.client-dashboard-widget {
    grid-column: span 4;
    order: 2;
    display: grid;
    gap: 1rem;
    min-height: 24rem;
    animation: clientDashboardWidgetIn .42s ease both;
    animation-delay: var(--dashboard-delay, 0ms);
}

.client-dashboard-widget-financial {
    grid-column: span 8;
    order: 1;
}

.client-dashboard-widget-financial.is-loading {
    opacity: .72;
    pointer-events: none;
}

.client-dashboard-widget-financial.is-full {
    grid-column: span 12;
}

.client-dashboard-widget-trend {
    grid-column: span 12;
    order: 3;
    min-height: 0;
}

.client-dashboard-widget-top-accounts {
    grid-column: span 12;
    order: 4;
    min-height: 0;
}

.client-dashboard-widget-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

    .client-dashboard-widget-header h2 {
        margin: .15rem 0 0;
        color: #111827;
        font-size: 1.18rem;
        font-weight: 750;
        line-height: 1.2;
    }

.client-dashboard-widget-kicker {
    color: #64748b;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.client-dashboard-icon-link {
    width: 2.25rem;
    height: 2.25rem;
    flex: 0 0 2.25rem;
    border: 1px solid #e5e7eb;
    border-radius: .6rem;
    color: #475569;
    background: #ffffff;
    text-decoration: none;
    transition: transform .18s ease, border-color .18s ease, background-color .18s ease, color .18s ease;
}

    .client-dashboard-icon-link:hover {
        color: #0f6f95;
        border-color: rgba(0, 185, 242, .45);
        background: #f0fbff;
        transform: translateY(-1px);
    }

.client-dashboard-mini-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .55rem;
}

    .client-dashboard-mini-metrics div {
        min-width: 0;
        padding: .75rem;
        border: 1px solid #e5e7eb;
        border-radius: .65rem;
        background: #f8fafc;
    }

    .client-dashboard-mini-metrics strong {
        display: block;
        color: #111827;
        font-size: 1.35rem;
        font-weight: 750;
        line-height: 1;
    }

    .client-dashboard-mini-metrics span {
        display: block;
        margin-top: .3rem;
        color: #64748b;
        font-size: .73rem;
        font-weight: 700;
    }

.client-dashboard-task-meter {
    display: grid;
    gap: .45rem;
}

.client-dashboard-task-meter-track {
    display: flex;
    width: 100%;
    height: .65rem;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
    background: #e2e8f0;
}

.client-dashboard-task-meter-segment {
    display: block;
    min-width: 0;
    height: 100%;
}

    .client-dashboard-task-meter-segment.is-overdue,
    .client-dashboard-task-meter-legend i.is-overdue {
        background: #dc2626;
    }

    .client-dashboard-task-meter-segment.is-today,
    .client-dashboard-task-meter-legend i.is-today {
        background: #16a34a;
    }

    .client-dashboard-task-meter-segment.is-upcoming,
    .client-dashboard-task-meter-legend i.is-upcoming {
        background: #94a3b8;
    }

.client-dashboard-task-meter-legend {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .45rem;
    color: #64748b;
    font-size: .72rem;
    font-weight: 750;
}

    .client-dashboard-task-meter-legend span {
        display: inline-flex;
        align-items: center;
        min-width: 0;
        gap: .3rem;
        line-height: 1.2;
    }

    .client-dashboard-task-meter-legend i {
        width: .45rem;
        height: .45rem;
        flex: 0 0 .45rem;
        border-radius: 9999px;
    }

.client-dashboard-filter-form {
    display: grid;
    grid-template-columns: minmax(12rem, 1fr) minmax(10rem, 12rem) auto;
    gap: .75rem;
    align-items: end;
    padding: .85rem;
    border: 1px solid #e5e7eb;
    border-radius: .75rem;
    background: #f8fafc;
}

    .client-dashboard-filter-form label {
        display: grid;
        gap: .3rem;
        min-width: 0;
        margin: 0;
    }

    .client-dashboard-filter-form label span {
        color: #475569;
        font-size: .72rem;
        font-weight: 800;
        line-height: 1.2;
        text-transform: uppercase;
    }

.client-dashboard-filter-select {
    width: 100%;
    min-height: 2.55rem;
    min-width: 0;
    border: 1px solid #cbd5e1;
    border-radius: .6rem;
    padding: .45rem 2.1rem .45rem .7rem;
    color: #111827;
    background: #ffffff;
    font-size: .88rem;
    font-weight: 650;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease;
}

    .client-dashboard-filter-select:focus {
        border-color: var(--couture-blue);
        box-shadow: 0 0 0 3px rgba(0, 185, 242, .14);
    }

.client-dashboard-filter-button {
    width: 2.55rem;
    height: 2.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #1b5e20;
    border-radius: .65rem;
    color: #ffffff;
    background: #1b5e20;
    transition: transform .18s ease, background-color .18s ease, border-color .18s ease;
}

    .client-dashboard-filter-button:hover {
        background: #14532d;
        border-color: #14532d;
        transform: translateY(-1px);
    }

    .client-dashboard-filter-button svg {
        width: 1rem;
        height: 1rem;
    }

.client-dashboard-message-meter {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-height: 3.2rem;
    padding: .7rem .8rem;
    border: 1px solid #dbeafe;
    border-radius: .7rem;
    color: #1e3a8a;
    background: #eff6ff;
    font-size: .86rem;
    font-weight: 700;
}

.client-dashboard-message-badge {
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    color: #1d4ed8;
    background: #ffffff;
    font-weight: 800;
    box-shadow: inset 0 0 0 1px rgba(29, 78, 216, .18);
}

    .client-dashboard-message-badge.has-unread {
        color: #ffffff;
        background: #1d4ed8;
        animation: clientDashboardUnreadPulse 1.8s ease-in-out infinite;
    }

.client-dashboard-list {
    display: grid;
    gap: .55rem;
}

.client-dashboard-list-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .75rem;
    min-height: 4.15rem;
    padding: .75rem .8rem;
    border: 1px solid #edf2f7;
    border-radius: .65rem;
    color: #111827;
    background: #ffffff;
    text-decoration: none;
    transition: transform .18s ease, border-color .18s ease, background-color .18s ease;
}

    .client-dashboard-list-row:hover {
        color: #111827;
        border-color: rgba(0, 185, 242, .38);
        background: #f8fdff;
        transform: translateX(2px);
    }

    .client-dashboard-list-row.is-unread {
        border-color: #bfdbfe;
        background: #eff6ff;
    }

.client-dashboard-status-dot {
    width: .65rem;
    height: .65rem;
    border-radius: 9999px;
    box-shadow: 0 0 0 4px rgba(148, 163, 184, .12);
}

    .client-dashboard-status-dot.is-overdue {
        background: #dc2626;
        box-shadow: 0 0 0 4px rgba(220, 38, 38, .12);
    }

    .client-dashboard-status-dot.is-today {
        background: #16a34a;
        box-shadow: 0 0 0 4px rgba(22, 163, 74, .12);
    }

    .client-dashboard-status-dot.is-upcoming {
        background: #94a3b8;
    }

.client-dashboard-row-icon {
    width: 2.1rem;
    height: 2.1rem;
    flex: 0 0 2.1rem;
    border-radius: .55rem;
    color: #1d4ed8;
    background: #dbeafe;
}

.client-dashboard-row-main {
    display: grid;
    min-width: 0;
    gap: .15rem;
}

.client-dashboard-row-title,
.client-dashboard-row-subtitle,
.client-dashboard-row-note {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.client-dashboard-row-title {
    color: #111827;
    font-size: .9rem;
    font-weight: 750;
}

.client-dashboard-row-subtitle {
    color: #475569;
    font-size: .78rem;
    font-weight: 650;
}

.client-dashboard-row-note {
    color: #64748b;
    font-size: .74rem;
}

.client-dashboard-row-meta {
    display: grid;
    gap: .18rem;
    color: #64748b;
    font-size: .72rem;
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}

.client-dashboard-empty {
    min-height: 10rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    border: 1px dashed #cbd5e1;
    border-radius: .7rem;
    color: #64748b;
    background: #f8fafc;
    font-size: .9rem;
    font-weight: 700;
}

    .client-dashboard-empty.compact {
        min-height: 13.5rem;
        padding: 1rem;
        text-align: center;
    }

.client-dashboard-financial-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .8rem .9rem;
    border: 1px solid #e5e7eb;
    border-radius: .7rem;
    background: #f8fafc;
}

    .client-dashboard-financial-title div {
        display: grid;
        min-width: 0;
        gap: .15rem;
    }

    .client-dashboard-financial-title strong {
        color: #111827;
        font-size: .95rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .client-dashboard-financial-title span {
        color: #64748b;
        font-size: .78rem;
        font-weight: 700;
    }

.client-dashboard-period-pill {
    flex: 0 0 auto;
    padding: .35rem .55rem;
    border: 1px solid #bae6fd;
    border-radius: 9999px;
    color: #0f6f95 !important;
    background: #f0f9ff;
    font-size: .72rem !important;
    font-weight: 800 !important;
}

.client-dashboard-finance-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
    gap: .9rem;
}

.client-dashboard-chart-panel {
    display: grid;
    align-content: start;
    gap: .95rem;
    min-width: 0;
    min-height: 23rem;
    padding: 1.05rem;
    border: 1px solid #e2e8f0;
    border-radius: .5rem;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.client-dashboard-chart-heading {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: #1f2937;
    font-size: .82rem;
    font-weight: 750;
}

    .client-dashboard-chart-heading svg {
        color: #155e75;
        stroke-width: 2;
    }

.client-dashboard-chart-canvas-wrap {
    position: relative;
    min-height: 16.5rem;
    height: 16.5rem;
    width: 100%;
    padding: .15rem .35rem 0;
}

    .client-dashboard-chart-canvas-wrap.is-doughnut {
        min-height: 15.5rem;
        height: 15.5rem;
        padding: .35rem;
    }

    .client-dashboard-chart-canvas-wrap canvas {
        width: 100% !important;
        height: 100% !important;
    }

.finance-bar-chart {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .7rem;
    min-height: 12rem;
    align-items: end;
    padding: .5rem .25rem 0;
}

.finance-bar-item {
    display: grid;
    gap: .35rem;
    min-width: 0;
}

.finance-bar-track {
    height: 8.8rem;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    border-radius: .65rem;
    background: #f1f5f9;
    overflow: hidden;
}

.finance-bar-fill {
    width: 68%;
    min-height: .35rem;
    height: var(--bar-height, 4%);
    border-radius: .45rem .45rem 0 0;
    background: var(--bar-color, var(--couture-blue));
    transform-origin: bottom;
    animation: clientDashboardBarGrow .75s cubic-bezier(.22, 1, .36, 1) both;
}

    .finance-bar-fill.is-negative {
        background: #dc2626;
    }

.finance-bar-label,
.finance-bar-value {
    min-width: 0;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.finance-bar-label {
    color: #475569;
    font-size: .72rem;
    font-weight: 800;
}

.finance-bar-value {
    color: #111827;
    font-size: .8rem;
    font-weight: 750;
}

.client-dashboard-finance-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .55rem;
}

    .client-dashboard-finance-kpis div {
        display: grid;
        gap: .2rem;
        min-width: 0;
        padding: .7rem .75rem;
        border: 1px solid #e2e8f0;
        border-radius: .45rem;
        background: #ffffff;
    }

    .client-dashboard-finance-kpis span {
        color: #64748b;
        font-size: .72rem;
        font-weight: 750;
    }

    .client-dashboard-finance-kpis strong {
        color: #111827;
        font-size: .9rem;
        font-weight: 800;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

        .client-dashboard-finance-kpis strong.is-negative {
            color: #dc2626;
        }

.finance-donut-layout {
    display: grid;
    grid-template-columns: minmax(8rem, .8fr) minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
    min-height: 16.5rem;
}

.finance-donut {
    width: min(10.5rem, 100%);
    aspect-ratio: 1;
    justify-self: center;
    display: grid;
    place-items: center;
    border-radius: 9999px;
    background:
        conic-gradient(
            #0f6f95 0 calc(var(--liability-share, 0) * 1%),
            #16a34a calc(var(--liability-share, 0) * 1%) 100%);
    animation: clientDashboardDonutIn .75s ease both;
}

.finance-donut-hole {
    width: 58%;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    align-content: center;
    border-radius: 9999px;
    background: #ffffff;
    box-shadow: inset 0 0 0 1px #e5e7eb;
}

    .finance-donut-hole strong {
        color: #111827;
        font-size: 1.2rem;
        line-height: 1;
    }

    .finance-donut-hole span {
        margin-top: .2rem;
        color: #64748b;
        font-size: .7rem;
        font-weight: 800;
    }

.finance-donut-legend {
    display: grid;
    gap: .55rem;
    min-width: 0;
}

    .finance-donut-legend div {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        gap: .25rem .5rem;
        align-items: center;
        min-width: 0;
    }

    .finance-donut-legend span:not(.finance-legend-dot) {
        color: #64748b;
        font-size: .75rem;
        font-weight: 750;
    }

    .finance-donut-legend strong {
        grid-column: 2;
        color: #111827;
        font-size: .92rem;
        font-weight: 800;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.finance-legend-dot {
    width: .7rem;
    height: .7rem;
    border-radius: 9999px;
}

    .finance-legend-dot.is-assets {
        background: #0f766e;
    }

    .finance-legend-dot.is-liability {
        background: #155e75;
    }

    .finance-legend-dot.is-equity {
        background: #166534;
    }

.client-dashboard-trend-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(13rem, 18rem);
    gap: .9rem;
    align-items: stretch;
}

.client-dashboard-trend-chart-wrap {
    position: relative;
    min-height: 21rem;
    height: 21rem;
    min-width: 0;
    padding: 1rem 1rem .35rem;
    border: 1px solid #e2e8f0;
    border-radius: .5rem;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

    .client-dashboard-trend-chart-wrap canvas {
        width: 100% !important;
        height: 100% !important;
    }

.client-dashboard-trend-kpis {
    display: grid;
    gap: .65rem;
    align-content: start;
}

    .client-dashboard-trend-kpis div {
        display: grid;
        gap: .2rem;
        min-width: 0;
        padding: .85rem .9rem;
        border: 1px solid #e2e8f0;
        border-radius: .5rem;
        background: #ffffff;
    }

    .client-dashboard-trend-kpis span {
        color: #64748b;
        font-size: .72rem;
        font-weight: 800;
        text-transform: uppercase;
    }

    .client-dashboard-trend-kpis strong {
        color: #111827;
        font-size: 1rem;
        font-weight: 800;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

        .client-dashboard-trend-kpis strong.is-negative {
            color: #dc2626;
        }

.client-dashboard-top-accounts-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .9rem;
}

.client-dashboard-top-account-panel {
    display: grid;
    align-content: start;
    gap: .8rem;
    min-width: 0;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: .5rem;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.client-dashboard-top-account-heading {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: #1f2937;
    font-size: .82rem;
    font-weight: 800;
}

    .client-dashboard-top-account-heading svg {
        width: 1rem;
        height: 1rem;
        color: #155e75;
        stroke-width: 2;
    }

    .client-dashboard-top-account-panel.is-expense .client-dashboard-top-account-heading svg {
        color: #9a6b1f;
    }

.client-dashboard-top-account-list {
    display: grid;
    gap: .65rem;
}

.client-dashboard-top-account-row {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr) minmax(6.5rem, auto);
    gap: .75rem;
    align-items: center;
    min-width: 0;
    padding: .75rem .8rem;
    border: 1px solid #edf2f7;
    border-radius: .55rem;
    background: #ffffff;
}

.client-dashboard-top-account-rank {
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    color: #155e75;
    background: #ecfeff;
    font-size: .78rem;
    font-weight: 850;
}

    .client-dashboard-top-account-panel.is-expense .client-dashboard-top-account-rank {
        color: #854d0e;
        background: #fffbeb;
    }

.client-dashboard-top-account-main {
    display: grid;
    gap: .45rem;
    min-width: 0;
}

.client-dashboard-top-account-label {
    display: grid;
    gap: .12rem;
    min-width: 0;
}

    .client-dashboard-top-account-label strong,
    .client-dashboard-top-account-label span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .client-dashboard-top-account-label strong {
        color: #111827;
        font-size: .86rem;
        font-weight: 780;
    }

    .client-dashboard-top-account-label span {
        color: #64748b;
        font-size: .72rem;
        font-weight: 700;
    }

.client-dashboard-top-account-track {
    position: relative;
    display: block;
    height: .48rem;
    border-radius: 9999px;
    overflow: hidden;
    background: #eef2f7;
}

.client-dashboard-top-account-fill {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #155e75 0%, #0f6f95 100%);
    transform-origin: left;
    transition: width .78s cubic-bezier(.22, 1, .36, 1);
}

    .client-dashboard-top-account-panel.is-expense .client-dashboard-top-account-fill {
        background: linear-gradient(90deg, #9a6b1f 0%, #b45309 100%);
    }

    .client-dashboard-top-account-panel.is-in-view .client-dashboard-top-account-fill {
        width: var(--account-width, 8%);
    }

    .client-dashboard-top-account-row:nth-child(2) .client-dashboard-top-account-fill {
        transition-delay: 70ms;
    }

    .client-dashboard-top-account-row:nth-child(3) .client-dashboard-top-account-fill {
        transition-delay: 140ms;
    }

    .client-dashboard-top-account-row:nth-child(4) .client-dashboard-top-account-fill {
        transition-delay: 210ms;
    }

    .client-dashboard-top-account-row:nth-child(5) .client-dashboard-top-account-fill {
        transition-delay: 280ms;
    }

.client-dashboard-top-account-metrics {
    display: grid;
    justify-items: end;
    gap: .3rem;
    min-width: 0;
}

    .client-dashboard-top-account-metrics strong {
        color: #111827;
        font-size: .86rem;
        font-weight: 850;
        line-height: 1.1;
    }

.client-dashboard-change-badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    min-height: 1.35rem;
    padding: .18rem .45rem;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
    color: #475569;
    background: #f8fafc;
    font-size: .68rem;
    font-weight: 850;
    line-height: 1;
    white-space: nowrap;
}

    .client-dashboard-change-badge svg {
        width: .76rem;
        height: .76rem;
        stroke-width: 2.4;
    }

    .client-dashboard-change-badge.is-up {
        color: #166534;
        border-color: #bbf7d0;
        background: #f0fdf4;
    }

    .client-dashboard-change-badge.is-down {
        color: #b91c1c;
        border-color: #fecaca;
        background: #fef2f2;
    }

    .client-dashboard-change-badge.is-flat {
        color: #475569;
        border-color: #e2e8f0;
        background: #f8fafc;
    }

@keyframes clientDashboardWidgetIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes clientDashboardBarGrow {
    from {
        transform: scaleY(.04);
    }
    to {
        transform: scaleY(1);
    }
}

@keyframes clientDashboardDonutIn {
    from {
        opacity: .45;
        transform: rotate(-12deg) scale(.94);
    }
    to {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

@keyframes clientDashboardUnreadPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(29, 78, 216, .24);
    }
    50% {
        box-shadow: 0 0 0 .45rem rgba(29, 78, 216, 0);
    }
}

@media (max-width: 1180px) {
    .client-dashboard-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .client-dashboard-widget,
    .client-dashboard-widget-financial {
        grid-column: span 12;
    }
}

@media (max-width: 768px) {
    .client-dashboard-shell {
        gap: .9rem;
    }

    .client-dashboard-stat-grid,
    .client-dashboard-widget-grid,
    .client-dashboard-finance-grid,
    .client-dashboard-finance-kpis,
    .client-dashboard-filter-form,
    .client-dashboard-trend-layout,
    .client-dashboard-trend-kpis,
    .client-dashboard-top-accounts-grid,
    .finance-donut-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .client-dashboard-stat-card {
        min-height: 4.55rem;
        padding: .85rem;
    }

    .client-dashboard-widget {
        min-height: 0;
        padding: 1rem;
    }

    .client-dashboard-filter-button {
        width: 100%;
    }

    .client-dashboard-list-row {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: flex-start;
    }

    .client-dashboard-row-meta {
        grid-column: 2;
        display: flex;
        justify-content: space-between;
        gap: .65rem;
        text-align: left;
    }

    .client-dashboard-financial-title {
        align-items: flex-start;
        flex-direction: column;
    }

    .finance-bar-track {
        height: 7.2rem;
    }

    .client-dashboard-chart-canvas-wrap,
    .client-dashboard-chart-canvas-wrap.is-doughnut,
    .client-dashboard-trend-chart-wrap {
        min-height: 15rem;
        height: 15rem;
    }

    .client-dashboard-top-account-row {
        grid-template-columns: 2rem minmax(0, 1fr);
    }

    .client-dashboard-top-account-metrics {
        grid-column: 2;
        grid-template-columns: auto auto;
        justify-content: space-between;
        justify-items: start;
        align-items: center;
    }

    .finance-donut {
        width: min(12rem, 72vw);
    }
}

@media (prefers-reduced-motion: reduce) {
    .client-dashboard-widget,
    .finance-bar-fill,
    .client-dashboard-top-account-fill,
    .finance-donut,
    .client-dashboard-message-badge.has-unread {
        animation: none;
    }

    .client-dashboard-top-account-fill {
        width: var(--account-width, 8%);
        transition: none;
    }
}

/* =========================================================
   Contact Search
   ========================================================= */

.contact-search-page {
    width: 100%;
    max-width: 72rem;
    margin: 2rem auto 0;
    padding: 0 1.5rem;
}

.contact-search-card {
    margin-bottom: 1.25rem;
}

.contact-search-form-row {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.contact-search-input {
    width: 100%;
    min-width: 0;
    border: 1px solid #d1d5db;
    border-radius: .5rem;
    padding: .65rem .85rem;
    color: #111827;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}

    .contact-search-input:focus {
        border-color: var(--couture-blue);
        outline: none;
        box-shadow: 0 0 0 3px rgba(0, 185, 242, .14);
    }

.contact-search-button,
.contact-view-button {
    justify-content: center;
    min-height: 2.6rem;
    font-weight: 700;
    text-decoration: none;
}

.contact-search-button {
    width: 10rem;
    flex: 0 0 10rem;
}

.contact-results-list {
    display: grid;
    gap: 1rem;
}

.contact-result-card {
    border: 1px solid #e5e7eb;
    border-radius: .75rem;
    background: #ffffff;
    padding: 1.1rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
}

.contact-result-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.contact-result-identity {
    min-width: 0;
}

    .contact-result-identity h2 {
        margin: 0;
        color: var(--couture-gray);
        font-size: 1.15rem;
        font-weight: 700;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }

    .contact-result-identity a {
        display: inline-block;
        max-width: 100%;
        color: var(--couture-blue);
        font-size: .9rem;
        line-height: 1.35;
        overflow-wrap: anywhere;
    }

.contact-result-initials {
    width: 3rem;
    height: 3rem;
    flex: 0 0 3rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--couture-gray);
    color: #ffffff;
    font-weight: 800;
    letter-spacing: 0;
}

.contact-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1rem;
    color: var(--couture-gray);
    font-size: .9rem;
}

.contact-detail-block {
    min-width: 0;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.contact-detail-label {
    margin-bottom: .2rem;
    color: #111827;
    font-weight: 700;
}

.contact-access-enabled {
    color: #16a34a;
    font-weight: 700;
}

.contact-access-disabled {
    color: #9ca3af;
    font-weight: 700;
}

.contact-result-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

.contact-view-button {
    width: 10rem;
}

.contact-empty-state {
    margin-top: 1rem;
    color: #6b7280;
}

@media (max-width: 768px) {
    .contact-search-page {
        margin-top: .5rem;
        padding: 0;
    }

    .contact-search-card,
    .contact-result-card {
        padding: 1rem;
        border-radius: .65rem;
    }

    .contact-search-form-row {
        flex-direction: column;
        align-items: stretch;
    }

    .contact-search-button,
    .contact-view-button {
        width: 100%;
        flex-basis: auto;
    }

    .contact-result-header {
        align-items: center;
    }

    .contact-result-initials {
        width: 2.6rem;
        height: 2.6rem;
        flex-basis: 2.6rem;
        font-size: .82rem;
    }

    .contact-detail-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: .75rem;
    }

    .contact-result-actions {
        justify-content: stretch;
    }
}


/* ============================= */
/*       Navigation Styles       */
/* ============================= */

a.navbar-brand {
    white-space: normal;
    text-align: center;
    word-break: break-word;
}

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    color: var(--couture-blue);
    background-color: var(--couture-dark-grey);
    border-color: var(--couture-dark-grey);
}


/* ============================= */
/*       Utility Classes         */
/* ============================= */

.border-top {
    border-top: 1px solid #e5e5e5;
}

.border-bottom {
    border-bottom: 1px solid #e5e5e5;
}

.box-shadow {
    box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
}


/* ============================= */
/*         Tab Styling ⬇️        */
/* ============================= */

.tab-link {
    padding: 0.5rem 1rem;
    border-bottom: 2px solid transparent;
    color: var(--couture-dark-grey);
    transition: all 0.3s ease;
}

    .tab-link:hover {
        color: var(--couture-blue);
    }

    .tab-link.active {
        border-color: var(--couture-blue);
        color: var(--couture-blue);
    }

.tab-pane {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: none;
}

    .tab-pane.active-tab {
        display: block !important;
        opacity: 1;
        transform: translateY(0);
    }


/* ============================= */
/*           Footer              */
/* ============================= */

.footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    white-space: nowrap;
    line-height: 30px;
}


/* ============================= */
/*     Date Control              */
/* ============================= */

/* Change selected date background and text color */
.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected:hover {
    background: #374151; /* dark gray */
    border-color: #374151;
    color: white;
}

/* Optional: change today's border color */
.flatpickr-day.today {
    border-color: #9ca3af; /* Tailwind gray-400 */
}

.finora-corner-flag {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 3;
    width: 2.65rem;
    height: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    color: #9ca3af;
    border-left: 0.25px solid #dbe3ea;
    box-shadow: none;
    /* THIS now renders properly */
    --border-radius: 0 1rem 0 1rem;
    overflow: hidden;
}

    /* creates the angled fold WITHOUT clip-path */
    .finora-corner-flag::before {
        content: "";
        position: absolute;
        inset: 0;
        background: inherit;
        clip-path: polygon( 0 0, 100% 0, 100% 100%, 34% 100%, 0 66% );
        z-index: -1;
    }

/* =========================================================
   Finora Info Page Chrome
   Shared header, tabs, cards, and sticky actions
   ========================================================= */

.firm-info-page-shell {
    width: 100%;
    padding-bottom: calc(var(--firm-info-footer-height, 0px) + 4.75rem) !important;
}

.firm-info-form-shell {
    padding-bottom: calc(var(--firm-info-footer-height, 0px) + 8.25rem) !important;
}

.firm-info-client-form-shell {
    padding-bottom: calc(var(--firm-info-footer-height, 0px) + 14rem) !important;
}

    .firm-info-client-form-shell form {
        padding-bottom: 6rem;
    }

.finora-page-header-section {
    margin-bottom: 1.25rem;
}

    .finora-page-header-section .finora-page-hero {
        margin-bottom: 0;
    }

.finora-page-hero {
    position: relative;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    padding: 0;
}

    .finora-page-hero::before {
        display: none;
    }

.finora-page-hero-content {
    position: relative;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 1rem;
    min-height: 5.6rem;
    padding-right: 3.25rem;
}

.finora-hero-title-group {
    display: flex;
    align-items: stretch;
    gap: 1rem;
    min-width: 0;
    max-width: 100%;
}

.finora-hero-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4.75rem;
    align-self: stretch;
    flex: 0 0 4.75rem;
    border-radius: 0 0 0 1rem;
    color: #60a5fa;
    background: #eff6ff;
    border-right: 1px solid #dbeafe;
    box-shadow: none;
}

.finora-hero-text {
    align-self: center;
    min-width: 0;
    max-width: 100%;
    padding: 1rem 0;
}

.finora-view-flag-icon {
    width: 1.15rem;
    height: 1.15rem;
}

.finora-page-title {
    margin-top: .2rem;
    font-size: 1.55rem;
    line-height: 1.9rem;
    font-weight: 800;
    color: #0f172a;
    word-break: break-word;
}

.finora-page-subtitle {
    margin-top: .35rem;
    max-width: 58rem;
    font-size: .9rem;
    line-height: 1.45rem;
    color: #64748b;
}

.firm-info-tab-bar {
    margin-bottom: .75rem;
}

.firm-info-tabs {
    align-items: flex-end;
    margin-bottom: -1px;
}

    .firm-info-tabs .tab-link {
        display: inline-flex;
        align-items: center;
        margin-bottom: -1px;
    }

.firm-info-sticky-actions {
    position: fixed;
    left: var(--firm-info-sidebar-width, 16rem);
    right: auto !important;
    width: calc(100vw - var(--firm-info-sidebar-width, 16rem)) !important;
    bottom: max(0px, calc(var(--firm-info-footer-height, 0px) - 1px));
    z-index: 40;
    padding: 0;
    padding-right: var(--firm-scrollbar-overlay-gutter, 17px);
    box-sizing: border-box;
    background: #f8fafc;
    border-top: 1px solid #dbe3ea;
    box-shadow: 0 -2px 8px rgba(15, 23, 42, .06);
}

    .firm-info-sticky-actions .section-card {
        margin: 0;
        padding: .55rem 1.5rem;
        background: transparent;
        border-left: 0;
        border-right: 0;
        border-bottom: 0;
        border-radius: 0;
        box-shadow: none;
    }

@media (max-width: 1024px) {
    .firm-info-page-shell {
        padding-bottom: calc(var(--firm-info-footer-height, 0px) + 10rem) !important;
    }

    .firm-info-form-shell {
        padding-bottom: calc(var(--firm-info-footer-height, 0px) + 15rem) !important;
    }

    .firm-info-client-form-shell {
        padding-bottom: calc(var(--firm-info-footer-height, 0px) + 19rem) !important;
    }

        .firm-info-client-form-shell form {
            padding-bottom: 8rem;
        }

    .firm-info-sticky-actions {
        left: 0 !important;
        right: auto !important;
        width: 100vw !important;
        max-width: 100vw !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box;
    }

        .firm-info-sticky-actions .section-card {
            width: 100% !important;
            max-width: 100% !important;
            padding: .65rem .85rem;
            box-sizing: border-box;
        }
}

@media (max-width: 768px) {
    .finora-page-hero-content {
        align-items: stretch;
        flex-direction: column;
        min-height: 0;
        gap: 0;
        padding-right: 3.25rem;
    }

    .finora-hero-title-group {
        flex-direction: row;
    }

    .finora-page-title {
        font-size: 1.35rem;
        line-height: 1.65rem;
    }

    .finora-page-subtitle {
        font-size: .82rem;
        line-height: 1.3rem;
    }
}

/* =========================================================
   Finora Themed Action Buttons
   Reusable application-wide action bar/buttons
   ========================================================= */

.finora-action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: center;
    justify-content: flex-end;
}

.finora-btn {
    min-width: 10rem;
    height: 2.9rem;
    padding: 0 1.15rem;
    border-radius: .7rem;
    font-family: 'Montserrat', sans-serif;
    font-size: .92rem;
    font-weight: 600;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .18s ease, color .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

/* Save: white background with dark green border */
.finora-btn-save {
    background-color: #ffffff;
    color: #1b5e20;
    border: 1px solid #1b5e20;
}

    .finora-btn-save:hover {
        background-color: #f0fdf4;
        color: #14532d;
        border-color: #14532d;
        transform: translateY(-1px);
    }

/* Save & Close: dark green filled primary action */
.finora-btn-save-close {
    background-color: #1b5e20;
    color: #ffffff;
    border: 1px solid #1b5e20;
}

    .finora-btn-save-close:hover {
        background-color: #14532d;
        border-color: #14532d;
        color: #ffffff;
        transform: translateY(-1px);
    }

/* Login/setup: same Finora action button behavior with the login blue */
.finora-btn-login {
    background-color: var(--couture-blue);
    color: #ffffff;
    border: 1px solid var(--couture-blue);
}

    .finora-btn-login:hover {
        background-color: var(--couture-blue-hover);
        border-color: var(--couture-blue-hover);
        color: #ffffff;
        transform: translateY(-1px);
    }

.finora-btn-full {
    width: 100%;
    min-width: 0;
}

/* Cancel: neutral secondary action */
.finora-btn-cancel {
    background-color: #ffffff;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

    .finora-btn-cancel:hover {
        background-color: #f9fafb;
        color: #374151;
        border-color: #9ca3af;
        transform: translateY(-1px);
    }

/* Edit */
.finora-btn-edit {
    background-color: #ffffff;
    color: #1e3a8a;
    border: 1px solid #1e3a8a;
}

    .finora-btn-edit:hover {
        background-color: #eff6ff;
        color: #1d4ed8;
        border-color: #1d4ed8;
        transform: translateY(-1px);
    }

/* Delete */
.finora-btn-delete {
    background: #dc2626;
    color: #ffffff;
    border-color: #dc2626;
}

    .finora-btn-delete:hover {
        background: #b91c1c;
        border-color: #b91c1c;
        color: #ffffff;
        transform: translateY(-1px);
    }

/* Optional left-aligned variant for pages that need actions on the left */
.finora-action-bar-left {
    justify-content: flex-start;
}

/* Optional split layout if a page needs Cancel on left and Save actions on right */
.finora-action-bar-split {
    justify-content: space-between;
}

.finora-action-bar-group {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: center;
}

@media (max-width: 768px) {
    .finora-action-bar,
    .finora-action-bar-left,
    .finora-action-bar-split,
    .finora-action-bar-group {
        flex-direction: column;
        align-items: stretch;
    }

    .finora-btn {
        width: 100%;
        min-width: unset;
    }
}

/* =========================================================
   Secure Message Mailbox
   Outlook-style three-pane message workspace
   ========================================================= */

.secure-message-page {
    --secure-message-pane-height: min(760px, calc(100vh - 14rem));
}

.secure-message-page,
.secure-message-page * {
    box-sizing: border-box;
}

.secure-message-header-card {
    position: relative;
    margin-bottom: 1.25rem;
    padding: 0;
    overflow: hidden;
    border-radius: 1rem;
}

.secure-message-header-content {
    position: relative;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 1rem;
    min-height: 5.6rem;
    padding-right: 3.25rem;
}

.secure-message-header-title {
    display: flex;
    align-items: stretch;
    gap: 1rem;
    min-width: 0;
    max-width: 100%;
}

.secure-message-header-icon {
    width: 4.75rem;
    align-self: stretch;
    flex: 0 0 4.75rem;
    border-radius: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #60a5fa;
    background: #eff6ff;
    border-right: 1px solid #dbeafe;
    box-shadow: none;
}

.secure-message-header-text {
    align-self: center;
    min-width: 0;
    max-width: 100%;
    padding: 1rem 0;
}

.secure-message-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
    padding: 1rem 0 1rem .5rem;
}

.secure-message-corner-flag {
    border-radius: 0 1rem 0 0;
}

    .secure-message-corner-flag svg {
        width: 1.15rem;
        height: 1.15rem;
    }

.secure-count-badge {
    width: 1.25rem;
    height: 1.25rem;
    min-width: 1.25rem;
    padding: 0;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--couture-blue);
    color: #ffffff;
    font-size: .68rem;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.secure-message-nav-link {
    position: relative;
    height: 2.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
    background: #ffffff;
    color: #374151;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: 0 .75rem;
    font-size: .875rem;
    font-weight: 700;
    text-decoration: none;
    overflow: visible;
    transition: background-color .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease;
}

    .secure-message-nav-link:hover {
        background: #f8fafc;
        border-color: var(--couture-blue);
        color: var(--couture-blue);
        text-decoration: none;
        box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
    }

.secure-message-nav-badge {
    position: absolute;
    top: -.42rem;
    right: -.42rem;
    box-sizing: border-box;
    width: 1.5rem;
    height: 1.5rem;
    min-width: 1.5rem;
    aspect-ratio: 1 / 1;
    padding: 0;
    border-radius: 9999px;
    border: 2px solid #ffffff;
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
    display: inline-grid;
    place-items: center;
    font-size: .68rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 6px 12px rgba(185, 28, 28, .28);
}

    .secure-message-nav-badge.is-double {
        width: 1.68rem;
        height: 1.68rem;
        min-width: 1.68rem;
        font-size: .64rem;
    }

    .secure-message-nav-badge.is-triple {
        width: 1.94rem;
        height: 1.94rem;
        min-width: 1.94rem;
        font-size: .54rem;
    }

.client-push-button {
    width: 2.5rem;
    height: 2.5rem;
    min-width: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #dbeafe;
    border-radius: 9999px;
    background: #ffffff;
    color: var(--couture-blue);
    box-shadow: 0 4px 10px rgba(15, 23, 42, .08);
    transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}

    .client-push-button:hover:not(:disabled) {
        background: #eff6ff;
        border-color: #93c5fd;
        color: #1d4ed8;
        box-shadow: 0 6px 14px rgba(29, 78, 216, .14);
    }

    .client-push-button:focus-visible {
        outline: 3px solid rgba(37, 99, 235, .25);
        outline-offset: 2px;
    }

    .client-push-button.is-enabled {
        background: var(--couture-blue);
        border-color: var(--couture-blue);
        color: #ffffff;
    }

    .client-push-button.is-error {
        background: #fef2f2;
        border-color: #fecaca;
        color: #b91c1c;
    }

    .client-push-button.is-blocked,
    .client-push-button:disabled {
        cursor: not-allowed;
        opacity: .58;
        box-shadow: none;
    }

.client-portal-app-shell,
.login-app-shell {
    min-height: 100dvh;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.client-portal-app-shell.min-h-screen {
    min-height: 100dvh;
}

.client-portal-app-shell input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
.client-portal-app-shell textarea,
.client-portal-app-shell select,
.login-app-shell input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
.login-app-shell textarea,
.login-app-shell select {
    font-size: 16px;
}

.client-portal-app-shell footer {
    transition: transform .2s ease;
}

.client-portal-app-shell main.client-portal-main {
    padding-bottom: calc(7rem + env(safe-area-inset-bottom));
}

.portal-firm-table {
    border-collapse: separate;
    border-spacing: 0;
}

    .portal-firm-table thead th {
        background: #f8fafc;
        border-bottom: 1px solid #dbe3ea;
        color: #64748b;
        font-weight: 700;
        letter-spacing: .04em;
    }

    .portal-firm-table tbody td {
        border-bottom: 1px solid #eef2f7;
        vertical-align: top;
    }

    .portal-firm-table tbody tr:last-child td {
        border-bottom: 0;
    }

.portal-firm-table tbody tr:hover {
    background: #f8fafc;
}

/* =========================================================
   Client Portal Employees
   ========================================================= */

.portal-employee-filter-form {
    margin: 0;
}

.portal-employee-filter-grid {
    display: grid;
    grid-template-columns: minmax(12rem, 18rem) minmax(16rem, 1fr) auto;
    gap: 1rem;
    align-items: end;
}

.portal-employee-filter-label,
.portal-employee-field-label {
    display: block;
    margin-bottom: .35rem;
    color: #374151;
    font-size: .875rem;
    font-weight: 700;
}

    .portal-employee-field-label span {
        color: #ef4444;
    }

.portal-employee-control {
    width: 100%;
    min-height: 2.5rem;
    border: 1px solid #d1d5db;
    border-radius: .375rem;
    padding: .5rem .75rem;
    color: #1f2937;
    background: #ffffff;
    font-size: .875rem;
    line-height: 1.35;
}

.portal-employee-textarea {
    min-height: 5.5rem;
}

.portal-employee-filter-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .5rem;
    min-height: 2.5rem;
}

.portal-employee-table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.portal-employee-add-card {
    position: relative;
    overflow: visible;
    border-radius: .75rem;
    border-color: #dbeafe;
}

    .portal-employee-add-card::before {
        content: "";
        position: absolute;
        inset: 0 0 auto 0;
        height: .28rem;
        background: #00b9f2;
    }

.portal-employee-form-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

    .portal-employee-form-heading h2 {
        margin: 0;
        color: #111827;
        font-size: 1.25rem;
        font-weight: 700;
    }

    .portal-employee-form-heading p {
        margin: .25rem 0 0;
        color: #6b7280;
        font-size: .875rem;
    }

.portal-employee-close-button,
.portal-employee-action-icon,
.portal-task-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    flex: 0 0 auto;
    padding: 0;
    border-radius: .5rem;
    border: 1px solid #dbeafe;
    background: #eff6ff;
    color: #1e3a8a;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}

    .portal-employee-close-button:hover,
    .portal-employee-action-icon:hover,
    .portal-task-action-icon:hover {
        background: #dbeafe;
        color: #1d4ed8;
        transform: translateY(-1px);
    }

    .portal-employee-action-icon.is-danger {
        border-color: #fecaca;
        background: #fef2f2;
        color: #dc2626;
    }

        .portal-employee-action-icon.is-danger:hover,
        .portal-task-action-icon.is-danger:hover {
            border-color: #fca5a5;
            background: #fee2e2;
            color: #b91c1c;
        }

    .portal-task-action-icon.is-danger {
        border-color: #fecaca;
        background: #fef2f2;
        color: #dc2626;
    }

.portal-task-table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.portal-task-table-actions {
    display: flex;
    align-items: center;
    gap: .45rem;
}

.portal-employee-request-form {
    display: grid;
    gap: 1.35rem;
}

.portal-employee-add-page {
    padding-bottom: calc(8.5rem + env(safe-area-inset-bottom));
}

.portal-employee-info-grid,
.portal-employee-pay-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.portal-employee-grid-full,
.portal-employee-name-row {
    grid-column: 1 / -1;
}

.portal-employee-name-row {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(5rem, .7fr) minmax(0, 2fr);
    gap: 1rem;
}

.portal-employee-address-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.portal-employee-address-line1 {
    grid-column: span 3;
}

.portal-employee-city {
    grid-column: span 2;
}

.portal-employee-sticky-actions {
    position: fixed;
    left: 16rem;
    right: 0;
    bottom: calc(3.25rem + env(safe-area-inset-bottom));
    z-index: 40;
    padding: 0;
    background: #f8fafc;
    border-top: 1px solid #dbe3ea;
    box-shadow: 0 -2px 8px rgba(15, 23, 42, .06);
}

    .portal-employee-sticky-actions .section-card {
        margin: 0;
        padding: .55rem 1.5rem;
        background: transparent;
        border-left: 0;
        border-right: 0;
        border-bottom: 0;
        border-radius: 0;
        box-shadow: none;
    }

.portal-employee-form-section h3 {
    margin: 0;
    color: #111827;
    font-size: .88rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.portal-employee-section-rule {
    height: 2px;
    margin: .55rem 0 1rem;
    background: #00b9f2;
}

.employee-drop-zone {
    display: grid;
    justify-items: center;
    gap: .35rem;
    min-height: 11rem;
    padding: 1.35rem 1rem;
    border: 2px dashed #d1d5db;
    border-radius: .75rem;
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
    text-align: center;
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

    .employee-drop-zone:hover,
    .employee-drop-zone.is-dragging {
        border-color: #60a5fa;
        box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
    }

    .employee-drop-zone.is-selected {
        border-color: #4ade80;
        box-shadow: 0 10px 24px rgba(22, 163, 74, .1);
    }

    .employee-drop-zone.is-invalid {
        border-color: #f87171;
        background: #fff7f7;
        box-shadow: 0 10px 24px rgba(220, 38, 38, .08);
    }

    .employee-drop-zone p {
        margin: .2rem 0 0;
        color: #374151;
        font-size: .875rem;
        font-weight: 700;
    }

    .employee-drop-zone small {
        color: #9ca3af;
        font-size: .75rem;
    }

.employee-drop-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: .65rem;
    color: #374151;
    background: #ecfdf5;
}

.employee-file-name {
    max-width: 100%;
    margin-top: .25rem;
    color: #6b7280;
    font-size: .8rem;
    font-style: italic;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

    .employee-file-name.is-selected {
        color: #047857;
        font-style: normal;
        font-weight: 700;
    }

@media (max-width: 1023px) {
    .portal-employee-filter-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .portal-employee-filter-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .portal-employee-info-grid,
    .portal-employee-name-row,
    .portal-employee-address-grid,
    .portal-employee-pay-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .portal-employee-address-line1,
    .portal-employee-city {
        grid-column: auto;
    }

    .portal-employee-sticky-actions {
        left: 0;
    }

        .portal-employee-sticky-actions .section-card {
            padding: .65rem .85rem;
        }
}

.portal-reporting-page {
    padding-bottom: calc(10rem + env(safe-area-inset-bottom));
}

.portal-financial-report-card {
    margin-bottom: 1.5rem;
}

.portal-report-card-header {
    position: relative;
    isolation: isolate;
    overflow: visible;
    display: grid;
    justify-items: center;
    gap: .45rem;
    min-height: 8.25rem;
    padding: .35rem 2.5rem 1.15rem;
    border-bottom: 1px solid #e5e7eb;
    text-align: center;
}

.portal-report-title-block {
    position: relative;
    z-index: 1;
    min-width: 0;
    max-width: 44rem;
}

.portal-certified-report-emblem {
    position: absolute;
    top: -1.2rem;
    right: -.75rem;
    z-index: 0;
    width: 10.25rem;
    height: 10.25rem;
    object-fit: contain;
    opacity: .96;
    pointer-events: none;
    transform: rotate(16deg);
    transform-origin: center;
}

.portal-report-client-name {
    margin: 0;
    color: #111827;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25;
}

.portal-report-title-block h2 {
    margin: .15rem 0 0;
    color: #111827;
    font-size: 1.65rem;
    font-weight: 750;
    line-height: 1.18;
}

.portal-report-period {
    margin: .25rem 0 0;
    color: #374151;
    font-size: .92rem;
    font-weight: 600;
    line-height: 1.35;
}

.portal-report-filter-summary {
    position: relative;
    z-index: 1;
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .35rem .85rem;
    color: #6b7280;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .1em;
    line-height: 1.2;
    text-transform: uppercase;
}

    .portal-report-filter-summary span + span::before {
        content: "";
        display: inline-block;
        width: .25rem;
        height: .25rem;
        margin: 0 .85rem .13rem 0;
        border-radius: 999px;
        background: #9ca3af;
    }

.portal-report-sticky-actions {
    position: fixed;
    left: 16rem;
    right: 0;
    bottom: calc(3.25rem + env(safe-area-inset-bottom));
    z-index: 40;
    padding: 0;
    background: #f8fafc;
    border-top: 1px solid #dbe3ea;
    box-shadow: 0 -2px 8px rgba(15, 23, 42, .06);
}

    .portal-report-sticky-actions .section-card {
        margin: 0;
        padding: .55rem 1.5rem;
        background: transparent;
        border-left: 0;
        border-right: 0;
        border-bottom: 0;
        border-radius: 0;
        box-shadow: none;
    }

@media (max-width: 1023px) {
    .portal-report-card-header {
        min-height: 8rem;
        padding: .45rem .75rem 1rem;
    }

    .portal-certified-report-emblem {
        top: -.85rem;
        right: -.6rem;
        width: 7.65rem;
        height: 7.65rem;
    }

    .portal-report-title-block h2 {
        font-size: 1.45rem;
    }

    .portal-report-sticky-actions {
        left: 0;
    }

        .portal-report-sticky-actions .section-card {
            padding: .65rem .85rem;
        }
}

.portal-financial-report-table {
    table-layout: fixed;
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: .5rem;
    overflow: hidden;
}

    .portal-financial-report-table col.col-account-number {
        width: 200px;
    }

    .portal-financial-report-table col.col-account-name {
        width: auto;
    }

    .portal-financial-report-table col.col-amount {
        width: 250px;
    }

    .portal-financial-report-table .section-header-row,
    .portal-financial-report-table .section-col-headers {
        --section-indent: 0px;
    }

    .portal-financial-report-table .section-header-row {
        background: linear-gradient(to right, #f9fafb, #eef2ff);
        border-top: 1px solid #e5e7eb;
        border-bottom: 1px solid #e5e7eb;
        position: sticky;
        top: 0;
        z-index: 10;
    }

        .portal-financial-report-table .section-header-row td {
            color: #111827;
            font-weight: 600;
            padding-top: .4rem !important;
            padding-bottom: .4rem !important;
        }

        .portal-financial-report-table .section-header-row td.no-wrap {
            overflow: visible;
        }

        .portal-financial-report-table .section-header-row .bs-indent-wrap {
            margin-left: var(--section-indent);
        }

        .portal-financial-report-table .section-header-row .account-type {
            font-size: .7rem;
            letter-spacing: .04em;
            text-transform: uppercase;
            opacity: .7;
        }

    .portal-financial-report-table .section-header {
        cursor: pointer;
        user-select: none;
    }

        .portal-financial-report-table .section-header:hover {
            background: linear-gradient(to right, #f3f4f6, #e0e7ff);
        }

            .portal-financial-report-table .section-header:hover .collapse-chevron {
                color: #2563eb;
            }

    .portal-financial-report-table .section-col-headers td {
        border-bottom: 1px solid #e5e7eb;
        background: #f8fafc;
        color: #64748b;
        padding-top: .35rem !important;
        padding-bottom: .35rem !important;
    }

    .portal-financial-report-table .section-row td {
        border-bottom: 1px solid #eef2f7;
        padding-top: .35rem !important;
        padding-bottom: .35rem !important;
    }

    .portal-financial-report-table .report-summary-row td {
        border-top: 2px solid #d1d5db;
        background: #fff;
        padding-top: .4rem !important;
        padding-bottom: .4rem !important;
    }

    .portal-financial-report-table .always-visible-row td {
        border-top: 2px solid #d1d5db;
    }

    .portal-financial-report-table .report-grand-total-row td {
        border-top-color: #9ca3af;
        background: #f8fafc;
    }

    .portal-financial-report-table .section-row:last-child td {
        border-bottom: 0;
    }

    .portal-financial-report-table .no-wrap {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .portal-financial-report-table .col-nudge {
        padding-left: 50px;
    }

    .portal-financial-report-table .bs-subindent .col-nudge {
        margin-left: 20px;
    }

    .portal-financial-report-table .sub-account-cell {
        color: #4b5563;
        font-size: .85rem;
        padding-left: 1rem !important;
    }

    .portal-financial-report-table .collapse-chevron {
        color: #64748b;
        transition: transform 150ms ease;
        transform: rotate(0deg);
    }

    .portal-financial-report-table .section-header.is-collapsed .collapse-chevron {
        transform: rotate(-90deg);
    }

@media (max-width: 768px), (pointer: coarse) {
    .client-portal-app-shell,
    .login-app-shell {
        min-height: 100dvh;
        overscroll-behavior-y: contain;
        touch-action: manipulation;
    }

    .client-portal-app-shell input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
    .client-portal-app-shell textarea,
    .client-portal-app-shell select,
    .login-app-shell input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
    .login-app-shell textarea,
    .login-app-shell select {
        font-size: 16px !important;
        line-height: 1.35;
    }

    .client-portal-app-shell main.client-portal-main {
        padding-bottom: calc(7rem + env(safe-area-inset-bottom) + var(--client-portal-keyboard-offset, 0px));
    }

    .login-app-shell.client-keyboard-active .scroll-wrapper {
        padding-bottom: 35vh;
    }

    .client-portal-app-shell.client-keyboard-active footer {
        transform: translateY(100%);
    }
}

.secure-message-toast-container {
    position: fixed;
    top: 4rem;
    right: 1rem;
    z-index: 80;
    width: min(460px, calc(100vw - 2rem));
    display: flex;
    flex-direction: column;
    gap: .75rem;
    pointer-events: none;
}

.secure-message-toast {
    pointer-events: auto;
    display: block;
    border: 1px solid var(--couture-blue);
    border-radius: .75rem;
    background: #ffffff;
    color: inherit;
    padding: 1.25rem;
    text-decoration: none;
    box-shadow: 0 18px 40px rgba(15, 23, 42, .18);
    opacity: 0;
    transform: translateX(calc(100% + 1.25rem));
    transition: transform .34s cubic-bezier(.22, 1, .36, 1), opacity .24s ease, background-color .16s ease, border-color .16s ease;
}

    .secure-message-toast.is-visible {
        opacity: 1;
        transform: translateX(0);
    }

    .secure-message-toast.is-hiding {
        opacity: 0;
        transform: translateX(calc(100% + 1.25rem));
    }

    .secure-message-toast.is-visible:hover {
        background: #eff6ff;
        color: inherit;
        text-decoration: none;
        transform: translateX(0);
    }

.secure-folder-total {
    min-width: 1.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    background: transparent;
    color: #64748b;
    font-size: .72rem;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.secure-message-pill {
    min-height: 2.65rem;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    border: 1px solid #bfdbfe;
    border-radius: .7rem;
    background: #eff6ff;
    color: var(--couture-blue);
    padding: 0 .9rem;
    font-size: .86rem;
    font-weight: 700;
    white-space: nowrap;
}

.secure-message-new-button {
    width: 100%;
    min-width: 0;
    justify-content: center;
}

.secure-mailbox-card {
    padding: 0;
    overflow: hidden;
}

.secure-mailbox-frame {
    display: grid;
    grid-template-columns: 15rem minmax(20rem, 24rem) minmax(0, 1fr);
    height: var(--secure-message-pane-height);
    min-height: 0;
    max-height: var(--secure-message-pane-height);
    background: #ffffff;
}

.secure-mailbox-pane {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.secure-folder-pane,
.secure-thread-pane {
    border-right: 1px solid #e5e7eb;
}

.secure-folder-pane {
    background: #f8fafc;
}

.secure-reader-pane {
    overflow: hidden;
}

.secure-pane-header,
.secure-reader-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid #e5e7eb;
    backdrop-filter: blur(10px);
}

.secure-pane-header {
    padding: .9rem 1rem;
}

.secure-reader-header {
    padding: 1rem 1.25rem;
}

.secure-mailbox-scroll {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
}

.secure-folder-list {
    padding: .75rem;
}

.secure-folder-actions {
    flex: 0 0 auto;
    padding: .85rem .85rem 0 .85rem;
}

.secure-folder-tools {
    flex: 0 0 auto;
    padding: .6rem .75rem 0 .75rem;
}

.secure-folder-editor-panel {
    border: 1px solid #dbeafe;
    border-radius: .55rem;
    background: #ffffff;
    padding: .55rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
}

    .secure-folder-editor-panel + .secure-folder-editor-panel {
        margin-top: .45rem;
    }

.secure-folder-editor-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: .45rem;
    min-width: 0;
}

.secure-folder-name-input {
    width: 100%;
    min-width: 0;
    height: 2.25rem;
    border: 1px solid #cbd5e1;
    border-radius: .5rem;
    padding: 0 .65rem;
    color: #0f172a;
    font-size: .82rem;
}

.secure-folder-color-row {
    display: flex;
    align-items: center;
    min-width: 0;
}

.secure-folder-color-input {
    width: 100%;
    height: 2.25rem;
    border: 1px solid #cbd5e1;
    border-radius: .5rem;
    background: #ffffff;
    padding: .2rem;
    cursor: pointer;
}

.secure-folder-editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: .4rem;
    min-width: 0;
}

.secure-folder-add-button,
.secure-folder-icon-button {
    width: 2rem;
    height: 2rem;
    min-width: 2rem;
    border-radius: .5rem;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}

    .secure-folder-add-button:hover,
    .secure-folder-icon-button:hover {
        background: #eff6ff;
        border-color: #bfdbfe;
        color: var(--couture-blue);
    }

    .secure-folder-icon-button.is-primary {
        background: #1b5e20;
        border-color: #1b5e20;
        color: #ffffff;
    }

    .secure-folder-icon-button.is-primary:hover {
        background: #14532d;
        border-color: #14532d;
        color: #ffffff;
    }

    .secure-folder-icon-button.is-danger:hover {
        background: #fef2f2;
        border-color: #fecaca;
        color: #dc2626;
    }

    .secure-folder-icon-button:disabled,
    .secure-folder-icon-button:disabled:hover {
        cursor: not-allowed;
        opacity: .35;
        background: #ffffff;
        border-color: #e2e8f0;
        color: #94a3b8;
        transform: none;
    }

.secure-folder-item {
    position: relative;
    display: block;
    min-width: 0;
}

    .secure-folder-item.is-unread .secure-folder-name {
        font-weight: 800;
    }

.secure-folder-action-form {
    display: block;
    margin: 0;
}

.secure-folder-context-menu {
    position: fixed;
    z-index: 60;
    width: 11rem;
    border: 1px solid #dbe3ea;
    border-radius: .55rem;
    background: #ffffff;
    padding: .35rem;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .18);
}

.secure-folder-menu-item {
    width: 100%;
    min-height: 2.15rem;
    border: 0;
    border-radius: .4rem;
    background: transparent;
    color: #334155;
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: 0 .55rem;
    font-size: .8rem;
    font-weight: 700;
    text-align: left;
}

    .secure-folder-menu-item:hover {
        background: #eff6ff;
        color: #0f172a;
    }

    .secure-folder-menu-item.is-danger {
        color: #dc2626;
    }

    .secure-folder-menu-item.is-danger:hover {
        background: #fef2f2;
        color: #b91c1c;
    }

    .secure-folder-menu-item:disabled,
    .secure-folder-menu-item:disabled:hover {
        cursor: not-allowed;
        opacity: .42;
        background: transparent;
        color: #94a3b8;
    }

.secure-folder-link {
    width: 100%;
    min-width: 0;
    min-height: 2.75rem;
    border: 1px solid transparent;
    border-radius: .6rem;
    color: #334155;
}

    .secure-folder-link:hover {
        background: #ffffff;
        color: #0f172a;
        border-color: #e2e8f0;
    }

    .secure-folder-link.is-active {
        background: #ffffff;
        color: var(--couture-blue);
        border-color: #bfdbfe;
        box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
    }

.secure-folder-swatch {
    width: .85rem;
    height: .85rem;
    flex: 0 0 .85rem;
    border-radius: .25rem;
    border: 1px solid rgba(15, 23, 42, .16);
    background: var(--folder-color, #64748b);
}

.secure-folder-name {
    min-width: 0;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.secure-folder-count {
    min-width: 2.1rem;
    flex: 0 0 auto;
    text-align: right;
    color: #64748b;
    font-size: .72rem;
    font-weight: 500;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.secure-folder-create {
    flex: 0 0 auto;
    border-top: 1px solid #e5e7eb;
    padding: .85rem;
    background: rgba(255, 255, 255, .92);
}

.secure-thread-link {
    display: block;
    padding: .85rem 1rem;
    border-left: 3px solid transparent;
    color: inherit;
    text-decoration: none;
    transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
}

    .secure-thread-link:hover {
        background: #f8fafc;
        text-decoration: none;
    }

    .secure-thread-link.is-active {
        background: #eff6ff;
        border-left-color: var(--couture-blue);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72);
    }

    .secure-thread-link.is-unread .secure-thread-subject {
        color: #0f172a;
        font-weight: 800;
    }

.secure-thread-subject-line {
    display: flex;
    align-items: center;
    gap: .45rem;
    min-width: 0;
}

.secure-thread-subject {
    min-width: 0;
    flex: 1 1 auto;
}

.secure-thread-date {
    flex: 0 0 auto;
    color: #64748b;
    font-size: .72rem;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
}

    .secure-thread-link.is-unread .secure-thread-date {
        color: #64748b;
        font-weight: 500;
    }

.secure-thread-sender,
.secure-thread-context {
    margin-top: .35rem;
    padding-left: 1.05rem;
    line-height: 1.25;
}

.secure-thread-context {
    margin-top: .2rem;
}

.secure-thread-sort-menu {
    position: relative;
    flex: 0 0 auto;
}

.secure-thread-sort-button {
    width: 2.15rem;
    height: 2.15rem;
    border: 1px solid #cbd5e1;
    border-radius: .5rem;
    background: #ffffff;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}

    .secure-thread-sort-button:hover,
    .secure-thread-sort-button[aria-expanded="true"] {
        background: #eff6ff;
        border-color: #bfdbfe;
        color: var(--couture-blue);
    }

.secure-thread-sort-options {
    position: absolute;
    top: calc(100% + .35rem);
    right: 0;
    z-index: 40;
    width: 12rem;
    border: 1px solid #dbe3ea;
    border-radius: .55rem;
    background: #ffffff;
    padding: .35rem;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .16);
}

.secure-thread-sort-option {
    min-height: 2.2rem;
    border-radius: .4rem;
    color: #334155;
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: 0 .6rem;
    font-size: .8rem;
    font-weight: 700;
    text-decoration: none;
}

    .secure-thread-sort-option:hover,
    .secure-thread-sort-option.is-active {
        background: #eff6ff;
        color: #0f172a;
        text-decoration: none;
    }

    .secure-thread-sort-option.is-active {
        color: var(--couture-blue);
    }
}

.hidden-by-filter {
    display: none !important;
}

.secure-recipient-modal-sticky {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #ffffff;
}

.secure-recipient-selected-panel {
    border: 1px solid #dbeafe;
    border-radius: .55rem;
    background: #f8fbff;
    padding: .85rem;
}

.secure-recipient-selected-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    color: #0f172a;
    font-size: .78rem;
    font-weight: 800;
    line-height: 1.2;
}

.secure-recipient-selected-heading span:last-child {
    color: #64748b;
    font-size: .72rem;
    font-weight: 700;
}

.secure-recipient-selected-list {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    max-height: 7rem;
    overflow-y: auto;
    margin-top: .65rem;
}

.secure-recipient-selected-empty {
    margin-top: .6rem;
    color: #64748b;
    font-size: .78rem;
    font-weight: 600;
}

.secure-recipient-selected-chip {
    min-width: 0;
    max-width: 16rem;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    border: 1px solid #bfdbfe;
    border-radius: .5rem;
    background: #ffffff;
    padding: .45rem .5rem .45rem .65rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
}

.secure-recipient-selected-chip-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .1rem;
}

.secure-recipient-selected-chip-name,
.secure-recipient-selected-chip-meta {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.secure-recipient-selected-chip-name {
    color: #0f172a;
    font-size: .8rem;
    font-weight: 800;
    line-height: 1.15;
}

.secure-recipient-selected-chip-meta {
    color: #64748b;
    font-size: .68rem;
    font-weight: 700;
    line-height: 1.15;
}

.secure-recipient-selected-chip-remove {
    flex: 0 0 auto;
    width: 1.35rem;
    height: 1.35rem;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #ffffff;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}

.secure-recipient-selected-chip-remove:hover,
.secure-recipient-selected-chip-remove:focus {
    border-color: #fca5a5;
    background: #fef2f2;
    color: #b91c1c;
    outline: none;
}

.secure-recipient-filter-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
    gap: .85rem;
    align-items: end;
}

.secure-recipient-search-action-row {
    display: flex;
    justify-content: flex-end;
    margin-top: .85rem;
}

.secure-recipient-search-button {
    width: auto;
    min-width: 8rem;
    min-height: 2.65rem;
    justify-content: center;
    font-size: .875rem;
    font-weight: 700;
    transition: background-color .18s ease, color .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

    .secure-recipient-search-button:hover {
        transform: translateY(-1px);
    }

.secure-recipient-picker,
.secure-recipient-select {
    width: 100%;
    min-height: 3.2rem;
    border: 1px solid #cbd5e1;
    border-radius: .55rem;
    background: #ffffff;
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .55rem .75rem;
    text-align: left;
    transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
}

    .secure-recipient-picker:hover,
    .secure-recipient-picker:focus,
    .secure-recipient-select:hover,
    .secure-recipient-select:focus,
    .secure-recipient-select[aria-expanded="true"] {
        background: #f8fafc;
        border-color: #93c5fd;
        box-shadow: 0 0 0 3px rgba(147, 197, 253, .22);
        outline: none;
    }

    .secure-recipient-picker:disabled,
    .secure-recipient-select:disabled {
        cursor: not-allowed;
        opacity: .55;
        box-shadow: none;
    }

.secure-recipient-picker-copy,
.secure-recipient-selected-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .15rem;
}

.secure-recipient-picker-name,
.secure-recipient-name,
.secure-recipient-option-name {
    color: #0f172a;
    font-weight: 800;
    line-height: 1.2;
}

    .secure-recipient-picker-name.is-placeholder,
    .secure-recipient-name.is-placeholder {
        color: #64748b;
        font-weight: 600;
    }

.secure-recipient-picker-meta,
.secure-recipient-title,
.secure-recipient-option-title {
    color: #64748b;
    font-size: .7rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0;
}

.secure-recipient-dropdown {
    position: relative;
}

.secure-recipient-options {
    position: absolute;
    top: calc(100% + .35rem);
    left: 0;
    right: 0;
    z-index: 45;
    max-height: 17rem;
    overflow-y: auto;
    border: 1px solid #dbe3ea;
    border-radius: .55rem;
    background: #ffffff;
    padding: .35rem;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .16);
}

.secure-recipient-option {
    width: 100%;
    border: 0;
    border-radius: .45rem;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: .2rem;
    padding: .65rem .7rem;
    text-align: left;
}

    .secure-recipient-option:hover,
    .secure-recipient-option:focus {
        background: #eff6ff;
        outline: none;
    }

.secure-recipient-check-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: .55rem;
    max-height: 15rem;
    overflow-y: auto;
    border: 1px solid #dbe3ea;
    border-radius: .55rem;
    background: #f8fafc;
    padding: .55rem;
}

.secure-recipient-check {
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    border: 1px solid #e2e8f0;
    border-radius: .5rem;
    background: #ffffff;
    padding: .65rem .7rem;
    cursor: pointer;
}

    .secure-recipient-check:hover {
        border-color: #93c5fd;
        background: #eff6ff;
    }

    .secure-recipient-check input {
        margin-top: .2rem;
        flex: 0 0 auto;
    }

.secure-recipient-check-name,
.secure-recipient-check-meta {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.secure-recipient-check-name {
    color: #0f172a;
    font-size: .86rem;
    font-weight: 800;
    line-height: 1.2;
}

.secure-recipient-check-meta {
    margin-top: .18rem;
    color: #64748b;
    font-size: .72rem;
    font-weight: 700;
    line-height: 1.2;
}

.secure-thread-preview {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.35;
}

.secure-thread-reader {
    height: 100%;
    min-height: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.secure-compose-panel {
    height: 100%;
    min-height: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    max-height: 100%;
    overflow: hidden;
    border-bottom: 1px solid #e5e7eb;
    background: #ffffff;
}

.secure-compose-panel:not(.hidden) ~ .secure-thread-reader,
.secure-compose-panel:not(.hidden) ~ .secure-empty-state {
    display: none;
}

.secure-compose-form,
.secure-reply-form {
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.secure-compose-form {
    flex: 1 1 auto;
}

.secure-reply-form {
    flex: 0 0 auto;
    max-height: 54%;
}

.secure-reply-form.hidden {
    display: none;
}

.secure-compose-fields,
.secure-reply-fields {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 1rem 1.25rem;
}

.secure-message-conversation {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    padding: 1.25rem;
    background:
        linear-gradient(180deg, rgba(248, 250, 252, .98) 0%, rgba(241, 245, 249, .92) 100%);
}

.secure-message-row {
    display: flex;
    align-items: flex-end;
    gap: .7rem;
    margin-bottom: 1rem;
}

.secure-message-date-divider {
    display: flex;
    align-items: center;
    gap: .85rem;
    margin: .25rem 0 1.15rem 0;
    color: #64748b;
    font-size: .78rem;
    font-weight: 800;
    line-height: 1;
}

    .secure-message-date-divider::before,
    .secure-message-date-divider::after {
        content: "";
        flex: 1 1 auto;
        border-top: 1px dashed #cbd5e1;
    }

    .secure-message-date-divider span {
        flex: 0 0 auto;
    }

    .secure-message-row.is-own {
        flex-direction: row-reverse;
    }

.secure-message-avatar {
    width: 2.15rem;
    height: 2.15rem;
    border-radius: .6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #0f766e;
    background: #ccfbf1;
    border: 1px solid #99f6e4;
    flex: 0 0 auto;
}

.secure-message-row.is-own .secure-message-avatar {
    color: var(--couture-blue);
    background: #dbeafe;
    border-color: #bfdbfe;
}

.secure-message-bubble {
    width: min(78%, 46rem);
    border: 1px solid #e2e8f0;
    border-radius: .5rem;
    background: #ffffff;
    padding: 1rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
}

.secure-message-row.is-own .secure-message-bubble {
    border-color: #bfdbfe;
    background: #eff6ff;
}

.secure-message-status {
    margin-top: .65rem;
    color: #64748b;
    font-size: .72rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: right;
}

.secure-message-body {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    color: #1f2937;
    line-height: 1.55;
}

.secure-message-attachments {
    margin-top: .85rem;
    padding-top: .75rem;
    border-top: 1px solid rgba(148, 163, 184, .35);
}

.secure-reply-toggle-button {
    min-height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    border: 1px solid #bfdbfe;
    border-radius: .55rem;
    background: #eff6ff;
    color: var(--couture-blue);
    padding: .45rem .75rem;
    font-size: .82rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}

    .secure-reply-toggle-button:hover {
        background: #dbeafe;
        border-color: #93c5fd;
        color: #1d4ed8;
    }

.secure-message-sticky-actions {
    flex: 0 0 auto;
    z-index: 12;
    background: #f8fafc;
    border-top: 1px solid #dbe3ea;
    box-shadow: 0 -2px 8px rgba(15, 23, 42, .06);
}

    .secure-message-sticky-actions .section-card {
        margin: 0;
        padding: .6rem 1.25rem;
        background: transparent;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

.secure-drop-zone {
    cursor: pointer;
    transition: border-color .16s ease, background-color .16s ease;
}

.secure-empty-state {
    flex: 1 1 auto;
    min-height: 28rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #64748b;
    text-align: center;
}

.secure-empty-state-icon {
    width: 3rem;
    height: 3rem;
    border-radius: .75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--couture-blue);
    background: #eff6ff;
    margin: 0 auto .85rem auto;
}

@media (max-width: 1279px) {
    .secure-message-page {
        --secure-message-pane-height: auto;
    }

    .secure-mailbox-frame {
        grid-template-columns: minmax(0, 1fr);
        height: auto;
        min-height: 0;
        max-height: none;
    }

    .secure-folder-pane,
    .secure-thread-pane {
        border-right: 0;
        border-bottom: 1px solid #e5e7eb;
    }

    .secure-folder-pane .secure-mailbox-scroll {
        max-height: 16rem;
    }

    .secure-thread-pane .secure-mailbox-scroll {
        max-height: 24rem;
    }

    .secure-message-conversation {
        max-height: 48vh;
    }

    .secure-reader-pane,
    .secure-thread-reader,
    .secure-compose-panel,
    .secure-compose-form,
    .secure-reply-form {
        overflow: visible;
    }

    .secure-thread-reader,
    .secure-compose-panel {
        height: auto;
        max-height: none;
    }

    .secure-compose-fields,
    .secure-reply-fields {
        overflow-y: visible;
    }

    .secure-reply-form {
        max-height: none;
    }
}

@media (max-width: 768px) {
    .secure-message-page {
        width: 100%;
        max-width: 100%;
        margin: 0;
        overflow-x: hidden;
        overflow-x: clip;
        --secure-message-pane-height: auto;
    }

    .secure-message-header-card {
        margin-bottom: .7rem;
        border-radius: .75rem;
    }

    .secure-message-header-content {
        flex-direction: column;
        min-height: 0;
        gap: 0;
        padding-right: 2.35rem;
    }

    .secure-message-header-title {
        align-items: stretch;
        gap: .6rem;
    }

    .secure-message-header-icon {
        width: 3.15rem;
        flex-basis: 3.15rem;
        border-radius: 0;
    }

    .secure-message-header-text {
        align-self: center;
        padding: .65rem 0;
    }

    .secure-message-header-text h1 {
        font-size: 1.12rem;
        line-height: 1.25;
    }

    .secure-message-header-text p {
        font-size: .75rem;
        line-height: 1.35;
    }

    .secure-message-header-actions {
        align-items: stretch;
        justify-content: flex-start;
        padding: 0 .85rem .9rem .85rem;
    }

    .secure-message-header-card .finora-action-bar {
        align-items: stretch;
        justify-content: flex-start;
        width: 100%;
    }

    .secure-message-new-button {
        width: 100%;
    }

    .secure-mailbox-card {
        width: 100%;
        overflow: visible;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .secure-mailbox-frame {
        display: flex;
        flex-direction: column;
        gap: .7rem;
        width: 100%;
        min-width: 0;
        height: auto;
        max-height: none;
        background: transparent;
    }

    .secure-mailbox-pane {
        width: 100%;
        max-width: 100%;
        min-height: 0;
        border: 1px solid #e5e7eb;
        border-radius: .8rem;
        background: #ffffff;
        box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
        overflow: visible;
    }

    .secure-mailbox-scroll,
    .secure-message-conversation,
    .secure-compose-fields,
    .secure-reply-fields {
        width: 100%;
        max-width: 100%;
        flex: 0 0 auto;
        min-height: auto;
    }

    .secure-folder-pane,
    .secure-thread-pane {
        border-right: 1px solid #e5e7eb;
        border-bottom: 1px solid #e5e7eb;
    }

    .secure-folder-pane {
        order: 1;
    }

    .secure-thread-pane {
        order: 2;
    }

    .secure-reader-pane {
        order: 3;
    }

    .secure-pane-header {
        position: static;
        padding: .7rem .85rem;
        backdrop-filter: none;
    }

    .secure-reader-header {
        position: static;
        padding: .85rem .95rem;
        backdrop-filter: none;
    }

    .secure-reader-header h2 {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        line-height: 1.25;
    }

    .secure-folder-actions,
    .secure-folder-tools {
        padding-left: .75rem;
        padding-right: .75rem;
    }

    .secure-folder-actions {
        padding-top: .65rem;
    }

    .secure-folder-pane .secure-mailbox-scroll {
        max-height: none;
        flex: 0 0 auto;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .secure-folder-list {
        display: flex;
        gap: .5rem;
        padding: .65rem .75rem .75rem;
        scroll-snap-type: x proximity;
    }

    .secure-folder-list.space-y-1 > :not([hidden]) ~ :not([hidden]) {
        margin-top: 0 !important;
    }

    .secure-folder-item {
        width: auto;
        max-width: 78vw;
        flex: 0 0 auto;
        scroll-snap-align: start;
    }

    .secure-folder-link {
        min-height: 2.45rem;
        border-radius: 9999px;
        padding: .5rem .7rem !important;
        gap: .5rem !important;
    }

    .secure-folder-link > .min-w-0 {
        flex: 0 1 auto;
        min-width: 0;
        max-width: 12rem;
    }

    .secure-folder-name {
        font-size: .82rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        overflow-wrap: normal;
    }

    .secure-folder-count {
        min-width: auto;
        margin-left: .1rem;
        font-size: .72rem;
        white-space: nowrap;
    }

    .secure-thread-pane .secure-mailbox-scroll {
        max-height: none;
        flex: 0 0 auto;
        overflow-y: visible;
        padding: .45rem;
    }

    .secure-thread-link {
        margin-bottom: .45rem;
        border: 1px solid #e5e7eb;
        border-left: 4px solid transparent;
        border-radius: .72rem;
        padding: .85rem .9rem;
        background: #ffffff;
    }

    .secure-thread-link.is-active {
        border-left-color: var(--couture-blue);
    }

    .secure-thread-pane .divide-y > :not([hidden]) ~ :not([hidden]) {
        border-top-width: 0 !important;
    }

    .secure-thread-subject-line {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: .3rem .45rem;
    }

    .secure-thread-link .secure-thread-subject,
    .secure-thread-link .secure-thread-sender,
    .secure-thread-link .secure-thread-context {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }

    .secure-thread-subject {
        flex: 1 1 calc(100% - 1.25rem);
        font-size: .94rem;
        line-height: 1.32;
    }

    .secure-thread-date {
        flex: 1 0 100%;
        margin-top: .15rem;
        font-size: .73rem;
        line-height: 1.2;
    }

    .secure-thread-sender,
    .secure-thread-context {
        padding-left: 0;
        line-height: 1.35;
        font-size: .76rem;
    }

    .secure-recipient-filter-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .secure-recipient-search-action-row {
        justify-content: stretch;
    }

    .secure-recipient-search-button {
        width: 100%;
        min-width: 0;
    }

    .secure-recipient-selected-list {
        max-height: 8.5rem;
    }

    .secure-recipient-selected-chip {
        width: 100%;
        max-width: none;
        justify-content: space-between;
    }

    #secureRecipientSearchResults {
        overflow: visible;
    }

    .secure-recipient-results-table,
    .secure-recipient-results-table tbody,
    .secure-recipient-results-table tr,
    .secure-recipient-results-table td {
        display: block;
        width: 100%;
    }

    .secure-recipient-results-table thead {
        display: none;
    }

    .secure-recipient-results-table tbody {
        background: transparent;
    }

    .secure-recipient-results-table tr {
        border: 1px solid #e5e7eb;
        border-radius: .7rem;
        background: #ffffff;
        padding: .55rem 0;
        box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
    }

    .secure-recipient-results-table tr + tr {
        margin-top: .65rem;
    }

    .secure-recipient-results-table td {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: .75rem;
        padding: .35rem .85rem !important;
        text-align: right;
        overflow-wrap: anywhere;
    }

    .secure-recipient-results-table td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        color: #64748b;
        font-weight: 700;
        text-align: left;
    }

    .secure-recipient-results-table td[data-label="Select"] {
        justify-content: flex-end;
    }

    .secure-recipient-results-table td[data-label="Select"]::before {
        content: "";
    }

    .secure-message-toast-container {
        top: 3.75rem;
        right: .75rem;
        width: calc(100vw - 1.5rem);
    }

    .secure-reader-header {
        padding: .9rem;
    }

    .secure-message-conversation,
    .secure-compose-fields,
    .secure-reply-fields {
        padding: .8rem;
    }

    .secure-thread-reader,
    .secure-compose-panel,
    .secure-compose-form,
    .secure-reply-form {
        height: auto;
        max-height: none;
        overflow: visible;
    }

    .secure-message-conversation,
    .secure-compose-fields,
    .secure-reply-fields {
        max-height: none;
        overflow-y: visible;
    }

    .secure-message-row,
    .secure-message-row.is-own {
        align-items: stretch;
        flex-direction: column;
        gap: .35rem;
        margin-bottom: .8rem;
    }

    .secure-message-row.is-own {
        align-items: stretch;
        justify-content: flex-start;
    }

    .secure-message-avatar {
        display: none;
    }

    .secure-message-bubble {
        width: 100%;
        max-width: 100%;
        padding: .85rem;
        border-radius: .72rem;
    }

    .secure-message-body {
        font-size: .92rem;
        line-height: 1.55;
    }

    .secure-message-date-divider {
        gap: .55rem;
        margin: .45rem 0 .8rem 0;
        font-size: .72rem;
        font-weight: 700;
    }

    .secure-message-status {
        font-size: .7rem;
    }

    .secure-empty-state {
        min-height: 12rem;
        padding: 1.25rem;
    }
}
