/* Dordle Console app styles.

   Radzen's material3 theme supplies the component styling; this file does three things on top:
   sets Montserrat as the single typeface, applies the Dordle brand colours to the app shell so
   it matches the sign-in screen, and tightens typography/density for a data-heavy console.

   Everything is driven through Radzen's own custom properties where one exists, so the theme
   stays in charge of the details. */

:root {
    /* Radzen renders ALL text through this one variable. The previous value fell back to
       `serif`, which is what actually rendered whenever Montserrat failed to load. */
    --rz-text-font-family: 'Montserrat', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

    /* Brand, taken from the design handoff's tokens (css/login.css :root) so the console and
       the sign-in screen are the same product. Navy = brand/authority, blue = the wordmark
       blue used for actions. */
    --dordle-navy: #093f57;
    --dordle-blue: #11698a;
    --dordle-line: #e2e8eb;

    --rz-primary: var(--dordle-blue);
    --rz-primary-light: #1a7ba6;
    --rz-primary-dark: #0b5474;
    --rz-primary-lighter: #e7f2f6;
    --rz-on-primary: #ffffff;
    --rz-on-primary-lighter: #093f57;

    /* App shell: dark header, light rail, white canvas for contrast with gray data grids. */
    --rz-header-background-color: var(--dordle-navy);
    --rz-header-color: #ffffff;
    --rz-header-min-height: 4.5rem;
    --rz-sidebar-background-color: #ffffff;
    --rz-sidebar-border-inline-end: 1px solid var(--dordle-line);
}

/* Set directly: material3 does not consume --rz-body-background-color. A white canvas
   distinguishes the main content from the grid's gray surfaces without heavier borders. */
.dordle-console .rz-body {
    margin-top: 0;
    background: #ffffff;
}

html, body {
    margin: 0;
    font-family: var(--rz-text-font-family);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Montserrat is geometrically wide and reads light at UI sizes; slight negative tracking and a
   heavier stem keep headings from looking washed out. */
h1, h2, h3, h4, h5, h6,
.rz-text-h1, .rz-text-h2, .rz-text-h3, .rz-text-h4, .rz-text-h5, .rz-text-h6 {
    font-weight: 600;
    letter-spacing: -0.012em;
}

/* ── Header ──────────────────────────────────────────────────────────────── */

.rz-header {
    box-shadow: 0 1px 0 rgba(10, 37, 64, 0.08);
}

.rz-header .app-logo {
    height: 32px;
    width: auto;
    display: block;
}

/* The header sits on navy, so Radzen's link and toggle defaults have to invert. */
.rz-header a,
.rz-header a:hover,
.rz-header .rz-link,
.rz-header .rz-sidebar-toggle {
    color: #ffffff;
}

.rz-header .rz-link:hover {
    color: #cfe0ff;
    text-decoration: underline;
}

.rz-header .app-user {
    color: #a9c2e0;
    font-size: 0.8125rem;
}

.rz-header .app-divider {
    width: 1px;
    height: 1.25rem;
    background: rgba(255, 255, 255, 0.18);
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */

.rz-sidebar {
    padding-block-start: 0.5rem;
}

.rz-navigation-item-link {
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.005em;
}

.rz-navigation-item-wrapper-active > .rz-navigation-item-link {
    font-weight: 600;
    color: var(--dordle-blue);
}

/* ── Page canvas ─────────────────────────────────────────────────────────── */

/* Deliberately no max-width: the report and audit grids are wide by nature, and constraining
   them would force horizontal scrolling on exactly the screens this console is used on. */
.app-page {
    padding: 2.25rem clamp(1rem, 3vw, 3rem) 3rem;
}

/* ── Data grids ──────────────────────────────────────────────────────────── */

/* Selectors below were checked against the live DOM — Radzen 11.2 renders
   `.rz-data-grid .rz-datatable` with UNCLASSED tbody/tr/td, so the cell rules have to hang off
   the table elements rather than the `.rz-datatable-data` class older versions used. */

/* Tabular figures so amounts, dates and reference numbers align column-wise — the biggest
   readability win in a bureau console, and Montserrat's proportional digits do not align
   without it. Set on the grid root; the cells inherit. */
.rz-data-grid,
.rz-pager {
    font-variant-numeric: tabular-nums;
}

/* Radzen already renders headers at 700; only the tracking needs adjusting for Montserrat. */
.rz-data-grid thead > tr > th {
    letter-spacing: 0.01em;
}

.rz-data-grid tbody > tr:hover > td {
    background: #f2f5fa;
}

.rz-data-grid tbody > tr > td,
.rz-data-grid thead > tr > th {
    padding-block: 0.5rem;
}

/* ── Forms ───────────────────────────────────────────────────────────────── */

.rz-form-field-label,
.rz-label {
    font-weight: 500;
}

/* Native controls do not inherit the family on their own. */
input, select, textarea, button {
    font-family: inherit;
}

/* ── Validation (unchanged from the original file) ───────────────────────── */

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

/* Shared console surfaces; account screens retain their dedicated design system. */
.dordle-console {
    --rz-text-title-color: #123747;
    --rz-panel-menu-item-active-background-color: #e7f2f6;
    --rz-panel-menu-item-active-color: #093f57;
    --rz-panel-menu-item-hover-background-color: #f0f6f8;
    --rz-panel-menu-item-hover-color: #093f57;
    --rz-panel-menu-item-border-radius: 8px;
    --rz-card-border-radius: 12px;
    --rz-card-shadow: 0 2px 8px rgba(9, 63, 87, 0.035);
    --rz-button-border-radius: 8px;
    --rz-input-border-radius: 8px;
}
.app-brand { display: flex; flex-shrink: 0; }
.app-product-name {
    border-left: 1px solid #547c8d;
    margin-left: .5rem;
    padding-left: 1.25rem;
    color: #c3dce6;
    font-size: .8rem;
    letter-spacing: .09em;
    text-transform: uppercase;
}
.app-user { max-width: 20vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-nav-heading, .app-eyebrow {
    color: #526d79;
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.app-nav-heading { padding: 1.5rem 1.5rem .9rem; }
.dordle-console .rz-panel-menu { padding: 0 .75rem; }
.dordle-console .rz-navigation-item-wrapper { border-radius: 8px; margin-block: 3px; }
.dordle-console .rz-navigation-item-wrapper-active { background: #e7f2f6; box-shadow: inset 3px 0 #11698a; }
.app-nav-footer { margin: 2rem 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--dordle-line); font-size: .6875rem; line-height: 1.7; color: #526d79; }
.app-brand-rule { display: block; width: 64px; height: 4px; border-radius: 3px; background: linear-gradient(90deg, #f04c23, #ffca08 50%, #81cf18); }
.app-nav-footer .app-brand-rule { width: 36px; height: 3px; margin-bottom: .75rem; }
.app-page h1 { font-size: clamp(1.65rem, 2.5vw, 2.35rem); line-height: 1.2; color: #123747; letter-spacing: -.035em; }
.app-page-heading { margin-bottom: 1.75rem; }
.app-page-heading h1 { margin: .65rem 0 .75rem; }
.app-page-heading p, .home-intro p { color: #526570; font-size: .9375rem; line-height: 1.8; margin-bottom: 0; }
.app-search-panel { background: white; border: 1px solid var(--dordle-line); border-radius: 14px; padding: clamp(1rem, 2.5vw, 2rem); margin-bottom: 2rem; box-shadow: 0 3px 12px rgba(9, 63, 87, .025); }
.app-search-panel > .rz-stack { margin-bottom: 0 !important; }
.app-results-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem; font-size: 1.125rem; color: #123747; }
.app-results-heading span { font-size: .8125rem; font-weight: 400; color: #526570; }
.dordle-console .rz-data-grid { border: 1px solid var(--dordle-line); border-radius: 10px; }
.dordle-console .rz-data-grid thead > tr > th { background: #edf3f5; color: #294c5b; }
.dordle-console .rz-card { border: 1px solid var(--dordle-line); }

.credit-score-history-card { height: 100%; min-width: 0; }
.credit-score-history-chart { height: 240px; width: 100%; }
.credit-score-history-caption { color: #526570; }
.credit-score-history-empty { min-height: 240px; text-align: center; color: #526570; }
.credit-score-history-empty .rzi { font-size: 2rem; color: var(--dordle-blue); }
.credit-score-history-empty p { margin: 0; }

/* Expanded account details inherit nowrap from the grid cell unless reset here.
   Keep the history scroller inside its column, and let long account names wrap. */
.account-payment-detail {
    white-space: normal;
    overflow-wrap: anywhere;
    padding-block: .75rem;
}
.account-payment-summary,
.account-payment-history {
    min-width: 0;
}
.payment-history-track {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: .25rem .125rem .75rem;
}
.dordle-console .payment-history-card {
    flex: 0 0 250px;
    min-width: 0;
    background: #ffffff;
    border: 1px solid #c4d4dc;
    box-shadow: 0 2px 5px rgba(9, 63, 87, .06);
}
.payment-history-card .payment-history-date {
    color: var(--dordle-navy);
    font-weight: 600;
    padding-bottom: .75rem;
    margin-bottom: .75rem;
    border-bottom: 1px solid var(--dordle-line);
}
.payment-history-track:focus-visible {
    outline: 2px solid var(--dordle-blue);
    outline-offset: 2px;
}

.home-intro { padding: .75rem 0 2.5rem; max-width: 760px; }
.home-intro h1 { margin: .9rem 0 1rem; }
.home-intro .app-brand-rule { margin-top: 1.75rem; }
.home-section-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .5rem 1rem; margin-bottom: 1.25rem; }
.home-section-heading h2 { font-size: 1.125rem; color: #123747; margin: 0; }
.home-section-heading > span { font-size: .75rem; color: #526570; }
.home-search-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.home-search-card { display: flex; flex-direction: column; align-items: flex-start; padding: clamp(1.5rem, 3vw, 2.5rem); background: white; border: 1px solid #dce6eb; border-radius: 16px; text-decoration: none; color: #123747; box-shadow: 0 4px 16px rgba(9, 63, 87, .025); transition: border-color .18s, box-shadow .18s, transform .18s; }
.home-search-card:hover { color: #123747; text-decoration: none; border-color: #6a9fb4; box-shadow: 0 10px 24px rgba(9, 63, 87, .08); transform: translateY(-2px); }
.home-card-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: #e7f2f6; color: #11698a; margin-bottom: 1.5rem; }
.home-card-icon .rzi { font-size: 28px; }
.home-search-card h3 { font-size: 1.25rem; margin: 0 0 .75rem; }
.home-search-card p { color: #526570; font-size: .875rem; line-height: 1.8; max-width: 420px; margin: 0 0 1.75rem; }
.home-card-action { display: flex; align-items: center; justify-content: space-between; align-self: stretch; gap: 1rem; margin-top: auto; padding-top: 1.25rem; border-top: 1px solid #e5edef; color: #0b5474; font-weight: 600; font-size: .8125rem; }
.home-guidance { display: flex; gap: 1rem; align-items: flex-start; margin-top: 2rem; padding: 1.5rem; background: #eaf1f4; border-radius: 12px; color: #526570; }
.home-guidance-icon { color: #11698a; padding-top: .125rem; }
.home-guidance h2 { color: #294c5b; font-size: .875rem; margin: 0 0 .5rem; }
.home-guidance p { font-size: .8125rem; line-height: 1.8; margin: 0; max-width: 850px; }
.app-skip-link { position: fixed; top: -100px; left: 1rem; z-index: 3000; padding: .75rem 1rem; background: white; color: #093f57; border-radius: 8px; }
.app-skip-link:focus { top: .5rem; }
.dordle-console a:focus-visible, .dordle-console button:focus-visible { outline: 3px solid #3784a3; outline-offset: 3px; }
.dordle-console .rz-header a:focus-visible, .dordle-console .rz-header button:focus-visible { outline-color: #bcdcea; }
@media (max-width: 767px) {
    .home-search-grid { grid-template-columns: 1fr; gap: 1rem; }
    .home-intro { padding-top: 0; padding-bottom: 2rem; }
    .app-page { padding-top: 1.5rem; }
    .app-product-name, .app-user, .app-divider { display: none; }
    .rz-header .app-logo { height: 26px; }
    .app-search-panel .rz-row > .rz-col-4,
    .app-search-panel .rz-row > .rz-col-6 { flex: 0 0 100%; max-width: 100%; width: 100%; }
    .app-search-panel .rz-row > .rz-col-8:empty { display: none; }
}
@media (max-width: 400px) {
    .rz-header .app-logo { height: 21px; }
    .app-account-actions { gap: .25rem !important; }
}
@media (prefers-reduced-motion: reduce) {
    .home-search-card { transition: none; }
    .home-search-card:hover { transform: none; }
}
