﻿body {
}

/* container: keep avatar and name-logout aligned */
.user-display {
    display: flex;
    align-items: center;
    gap: 8px; /* space between avatar and the name-logout group (reduce if you want them closer) */
}

/* tightly group the name and logout button */
.name-logout {
    display: flex;
    align-items: center;
    gap: 4px; /* set to 2px or 0 to make them even closer */
    white-space: nowrap; /* keep them on one line */
}

/* adjust the name text a bit so vertical spacing matches avatar */
.user-name {
    margin: 0;
    padding: 0;
    font-size: 0.95rem;
    line-height: 1;
}

/* compact the logout text-button so it sits very close to the name */
.logout-btn {
    font-size: 0.75rem;
    /*color: gray;*/
    min-width: 0; /* remove Mud's default min-width */
    padding: 0 6px; /* small horizontal padding - increase for accessibility if needed */
    margin: 0;
    line-height: 1;
    text-transform: none;
    height: auto;
    --mud-button-min-width: 0; /* defensive override if Mud uses this variable */
}

/* If you want the logout to be even closer, reduce gap above to 2px or set .logout-btn { margin-left: 2px } */
/* For touch targets, slightly increase padding */
@media (pointer: coarse) {
    .logout-btn {
        padding: 2px 2px;
    }
}

/* Dark theme tweak if needed */
@media (prefers-color-scheme: dark) {
    .logout-btn {
        color: rgba(255,255,255,0.85);
    }
}


/* Stack the brand text vertically and keep it vertically centered in the AppBar */
.brand-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* left align */
    justify-content: center; /* vertically center within the AppBar line */
    gap: 0; /* no extra gap */
}

/* Keep the h6 tight */
.brand-title {
    font-size: 1.25rem; /* adjust as needed */
    font-weight: 700;
    margin: 0;
    line-height: 1; /* make the heading compact vertically */
}

/* Very small, subtle powered-by text snugly under the heading */
.brand-powered {
    font-size: 0.75rem; /* very small */
    color: rgba(0,0,0,0.6); /* subtle gray; adjust for theme if needed */
    margin-top: -0.01rem; /* small negative margin to pull it closer */
    line-height: 1; /* prevents extra spacing */
    padding: 0;
}

/* Optional: slightly different color in dark theme */
@media (prefers-color-scheme: dark) {
    .brand-powered {
        color: rgba(255,255,255,0.65);
    }
}


.kpi-grid .mud-grid-item {
    padding-top: 6px !important; /* adjust as needed */
}

/* KPI card styling */
.kpi-card {
    background: #ffffff; /* keep white background for contrast */
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    padding: 0.2rem; /* compact padding */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 4px solid #d9d9d9; /* dark gray border */
    box-sizing: border-box;
    width: 100%; /* allow container/grid to control width */
    min-height: 6rem; /* small flexible minimum height */
}

.kpi-card-content {
    padding: 0.15rem 0.15rem; /* compact internal spacing */
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: center; /* center title and value */
}

.kpi-title {
    font-weight: 700;
    text-align: center; /* center title */
    margin: 0;
    line-height: 1;
    color: #222222;
    font-size: 0.9rem;
}

.kpi-value {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #2d3748;
    margin-top: 0.15rem;
    margin-bottom: 0.15rem;
    /* responsive sizing: between 1.25rem and 2.25rem depending on viewport */
    font-size: clamp(1.25rem, 3vw, 2.25rem);
}

.kpi-actions {
    display: flex;
    justify-content: center; /* center the description at the bottom */
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.kpi-desc {
    color: #6b7280; /* gray-500 */
    font-size: 0.8rem; /* slightly smaller caption */
    text-align: center; /* center description */
    margin: 0;
}

/* Ensure the card remains compact on small screens while remaining readable */
@media (max-width: 600px) {
    .kpi-card {
        padding: 0.4rem;
        min-height: 5rem;
    }
    .kpi-title { font-size: 0.85rem; }
    .kpi-desc { font-size: 0.75rem; }
}

/* Existing styles below (kept) */


.super-dense-grid .mud-table-root .mud-table-row,
.super-dense-grid .mud-table-root .mud-table-cell {
    padding-top: 1px !important;
    padding-bottom: 1px !important;
    padding-left: 3px !important;
    padding-right: 3px !important;
    vertical-align: top !important;
    font-size: .99em;    
}

.super-dense-grid .mud-table-root .mud-table-row {
    min-height: 24px !important;
    height: 24px !important;
}

 /*Override the indented-row padding when inside .super-dense-grid*/ 
.super-dense-grid .mud-data-grid .mud-table-cell.mud-row-group-indented-2 {
    padding-left: 36px !important;
}


.panel-super-dense-grid .mud-table-root .mud-table-row,
.panel-super-dense-grid .mud-table-root .mud-table-cell {
    padding-top: 1px !important;
    padding-bottom: 1px !important;
    padding-left: 3px !important;
    padding-right: 3px !important;
    vertical-align: top !important;
    font-size: .99em;
}

.panel-super-dense-grid .mud-table-root .mud-table-row {
    min-height: 24px !important;
    height: 24px !important;
}

/*Override the indented-row padding when inside .super-dense-grid*/
.panel-super-dense-grid .mud-data-grid .mud-table-cell.mud-row-group-indented-2 {
    padding-left: 36px !important;
}

/* ensure the DataGrid itself fills its container */
/*.super-dense-grid .mud-data-grid,
.super-dense-grid .mud-table-root {
    width: 100% !important;
    box-sizing: border-box;
}*/

    /* make rows full width */
    /*.super-dense-grid .mud-table-root .mud-table-row {
        width: 100% !important;
        box-sizing: border-box;*/
        /* if rows use flex, allow children to shrink */
        /*display: flex;
        flex-direction: column;*/ /* stacked/mobile orientation: each cell on its own line */
    /*}*/

    /* make cells fill the available width and not shrink to content */
    /*.super-dense-grid .mud-table-root .mud-table-cell {
        width: 100% !important;
        min-width: 0 !important;*/ /* important for flex children to not overflow */
        /*box-sizing: border-box;
        padding-top: 1px !important;
        padding-bottom: 1px !important;
        padding-right: 3px !important;
        vertical-align: top !important;
        font-size: .99em;*/
        /* optionally make them expand equally if you use row flex-direction: row */
        /* flex: 1 1 0% !important; */
    /*}*/

    /* keep your row-height compact */
    /*.super-dense-grid .mud-table-root .mud-table-row {
        min-height: 24px !important;
        height: 24px !important;
    }*/

    /* override indented-row padding when inside .super-dense-grid */
    /*.super-dense-grid .mud-data-grid .mud-table-cell.mud-row-group-indented-2 {
        padding-left: 36px !important;
    }*/

/* Optionally: only apply the stacked rules on small screens */
/*@media (max-width: 768px) {
    .super-dense-grid .mud-table-root .mud-table-row {
        display: flex;
        flex-direction: column;
    }

    .super-dense-grid .mud-table-root .mud-table-cell {
        width: 100% !important;
        min-width: 0 !important;
    }
}*/

/* Styles for grid filter breadcrumb chips */
.filter-breadcrumb {
    background: #f5f5f5;
    border-radius: 3px;
    padding: 1px 3px;
    display: inline-flex; /* keeps each breadcrumb inline while allowing flex alignment */
    align-items: center;
    margin-right: 2px; /* space between chips; optional */
    /*font-size: 0.9rem;*/ /* optional - matches compact pill appearance */
    color: #333333;
}

.filter-breadcrumb-title {
    color: #333333;
    font-weight: 600;
}

.filter-breadcrumb-operator {
    margin: 0 2px;
    color: #333333;
}

.filter-breadcrumb-value {
    color: #333333;
    font-weight: 600;
}

/* Optional focus/hover states for accessibility */
.filter-breadcrumb:focus,
.filter-breadcrumb:hover {
    outline: none;
    background: #ececec;
}

.small-select .mud-select-input,
.small-select .mud-select-input .mud-select-value {
    font-size: 1.15em !important;
}

.preserve-whitespace {
    /* fallbacks first for older browsers */
    white-space: -moz-pre-wrap; /* Firefox */
    white-space: -pre-wrap;
    white-space: -o-pre-wrap;
    /* standard behavior: preserve whitespace and line breaks; allow wrapping */
    white-space: pre-wrap;
    /* allow wrapping for very long words so layout doesn't break */
    overflow-wrap: anywhere;
    word-break: break-word;
    /* control how many spaces a tab is displayed as */
    tab-size: 4;
    -moz-tab-size: 4;
}

/* Body that can scroll if content is large (sets a comfortable max height) */
.scrollable-text-body {
    overflow: auto;
    max-height: calc(80vh - 120px);
    padding: 6px;
}

/* Responsive two-column label/value layout using CSS grid (mobile-first) */
.proc-grid {
    display: grid;
    gap: 8px 12px;
}

/* Each row is itself a grid to keep label/value aligned nicely */
.proc-row {
    display: grid;
    gap: 6px;
    align-items: start;
    grid-template-columns: 1fr;
}

/* Label and value styling: use theme-aware color (do NOT hard-code black) */
.proc-label {
    font-weight: 700;
    font-size: 0.95rem;
    color: inherit; /* inherits from .processor-paper */
}

.proc-value {
    font-size: 0.92rem;
    color: inherit; /* inherits from .processor-paper */
}

.proc-pre {
    color: inherit;  inherit readable theme text color 
    background: var(--mud-palette-surface, #fff);
    border: 1px solid rgba(0,0,0,0.06);
    white-space: pre-wrap;
    word-break: break-word;
    overflow: auto;
    max-height: 40vh;
    padding: 8px;
    border-radius: 6px;
    box-sizing: border-box;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", monospace;
    font-size: 0.9rem;
    line-height: 1.25;
}

/* Styling for the map link component. */

.map-link-desktop {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: inherit;
    text-decoration: none;
}

    .map-link-desktop .map-link-label {
        font-size: 0.95rem;
        color: rgba(0,0,0,0.87); /* adjust for dark/light theme if needed */
    }

/* Make the icon a little smaller on mobile if you want */
@media (max-width: 599px) {
    .map-link button.mud-icon-button-root, /* MudIconButton renders a button */
    .map-link .mud-icon-button-root {
        width: 40px;
        height: 40px;
    }
}

/* Additional polite spacing if used inline with lines of text */
.map-link {
    vertical-align: middle;
}

/* Small styling helpers for the ZillowLink component */
.zillow-link-desktop {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: inherit;
    text-decoration: none;
}

    .zillow-link-desktop .zillow-link-label {
        font-size: 0.95rem;
        color: rgba(0,0,0,0.87);
    }

@media (max-width: 599px) {
    .zillow-link button.mud-icon-button-root {
        width: 40px;
        height: 40px;
    }
}

.zillow-link {
    vertical-align: middle;
}


.redfin-link-desktop {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: inherit;
    text-decoration: none;
}

    .redfin-link-desktop .redfin-link-label {
        font-size: 0.95rem;
        color: rgba(0,0,0,0.87);
    }

@media (max-width: 599px) {
    .redfin-link button.mud-icon-button-root {
        width: 40px;
        height: 40px;
    }
}

.redfin-link {
    vertical-align: middle;
}

@media (max-width: 600px) {
    .compact-panels .mud-expand-panel-header.mud-expand-panel-header-gutters {
        padding: 2px 6px !important;
    }

    .compact-panels .mud-expand-panel-header .mud-expand-panel-text {
        padding: 0 !important;
    }

    .compact-panels .mud-expand-panel-header p.mud-typography {
        margin: 0 !important;
        line-height: 1 !important;
    }

    .compact-panels .mud-expand-panel-header .d-flex {
        align-items: center !important;
        gap: .25rem;
    }
}

.panel-grid-text-right {
    text-align: right;
    /* optional: vertically center and avoid wrapping issues */
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

/* make entire KPI card area show pointer when wrapped in button */
/* .kpi-clickable { width: 100%; text-align: inherit; } */
/*     .kpi-clickable {
                            width: 100%;
                            text-align: inherit;
                        } */
.kpi-clickable {
    display: flex;
    width: 100% !important; /* ensure button fills the MudItem */
    padding: 0;
    box-sizing: border-box;
    align-items: stretch; /* ensure consistent height */
}

    .kpi-clickable .kpi-button-inner {
        display: flex;
        flex-direction: column; /* stack title / body if needed */
        align-items: stretch;
        width: 100%;
        padding: 0 2px; /* reduce horizontal padding */
        gap: 2px; /* small gap between title/body */
    }

    .kpi-clickable .kpi-card {
        width: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center; /* center content vertically to reduce extra space */
        align-items: stretch;
        box-sizing: border-box;
        padding: 6px !important; /* make the inner card more compact */
        margin: 0 !important; /* remove extra margin */
        min-height: 44px; /* smaller minimum height */
        line-height: 1.05;
    }

/* subtle active state for selected KPI */
.kpi-active {
    /* top-level button styling handled; card border is overridden below */
}

    /* change border color of inner card when active */
    .kpi-active .kpi-card {
        border-color: #facc15 !important; /* amber-400/light yellow */
        box-shadow: 0 6px 16px rgba(250, 204, 21, 0.10);
    }

/* container for card + overlayed checkmark */
.kpi-button-inner {
    position: relative;
    display: block;
    padding: 0;
}

/* checkmark style */
.kpi-checkmark {
    position: absolute;
    top: 6px;
    right: 12px;
    color: #b45309; /* amber-700 for contrast */
    background: #ffffff;
    border-radius: 50%;
    padding: 2px;
    z-index: 50;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* slightly lift active card on hover for visbility */
.kpi-clickable:hover {
    transform: translateY(-1px);
}

/* tighten up text blocks inside KPI card if KpiCards uses these classes */
.kpi-card .kpi-title, .kpi-card .kpi-value, .kpi-card .kpi-desc {
    margin: 0;
    padding: 0;
    line-height: .95; /* reduce vertical spacing and card height */
}

/* small, high-touch phone icon beside numbers for mobile PWAs */
/* container that holds the text and icon; align everything to the right edge of the cell */
.phone-with-icon {
  display: flex;
  justify-content: flex-end; /* push content (text+icon) to right */
  align-items: center;
  gap: 0.375rem;
  width: 100%;
}

.phone-text {
  line-height: 1;
  white-space: nowrap;
  display: inline-block;
  vertical-align: middle;
  /* allow the text to take remaining space but not push the icon out */
  max-width: calc(100% - 44px);
  overflow: hidden;
  text-overflow: ellipsis;
}

/* For email text allow wrapping when using .email-text and wbr */
.email-text {
  line-height: 1;
  /* force wrapping for email-text even if parent cell uses nowrap */
  white-space: normal !important; /* allow wrapping at allowed break points (wbr) or explicit <br/> */
  /* avoid aggressive breaking anywhere — prefer the explicit <wbr/> we insert */
  overflow-wrap: normal !important;
  word-break: normal !important;
  display: inline-block;
  /* Leave room for the icon/tap target. On narrow screens allow nearly-full width; on wider screens cap to avoid pushing label column. */
  max-width: 220px;
  vertical-align: middle;
}

@media (max-width: 600px) {
  .email-text {
    max-width: calc(100% - 56px) !important; /* allow wrapping on narrow screens but reserve icon width */
  }
}

/* Make the icon large enough for touch but visually small */
.phone-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 6px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--mud-palette-primary);
  margin-left: 4px;
}

/* size the inline SVG */
.phone-icon-link svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}


/* Dark drop shadow for a specific MudPaper */
.mud-paper.contactcard-dark-shadow,
.contactcard-dark-shadow.mud-paper {
    /* stronger, dark-gray shadow */
    box-shadow: 0 8px 24px rgba(40,40,40,0.40) !important;
    border-radius: 8px !important;
}

/* Compact card: apply this class to MudCard (component will render with mud-card) */
.mud-card.contactcard-compact,
.contactcard-compact.mud-card {
    padding: 6px !important; /* reduce internal padding */
    margin: 4px 0 !important;
    gap: 6px !important;
    border-radius: 6px !important;
}

    /* Compact card header */
    .mud-card.contactcard-compact .mud-card-header,
    .contactcard-compact.mud-card .mud-card-header {
        padding: 6px 8px !important;
        min-height: unset !important;
    }

        /* Tighter header title/subtitle */
        .mud-card.contactcard-compact .mud-card-header .mud-typography-h6,
        .contactcard-compact.mud-card .mud-card-header .mud-typography-h6 {
            margin: 0 !important;
            line-height: 1.1 !important;
            font-size: 0.95rem !important;
            font-weight: 600;
        }

        .mud-card.contactcard-compact .mud-card-header .mud-typography-body2,
        .contactcard-compact.mud-card .mud-card-header .mud-typography-body2 {
            margin: 0 !important;
            font-size: 0.82rem !important;
        }

    /* Compact card content */
    .mud-card.contactcard-compact .mud-card-content,
    .contactcard-compact.mud-card .mud-card-content {
        padding: 6px 8px !important;
    }

    /* Reduce vertical spacing of body2 typography inside the card */
    .mud-card.contactcard-compact .mud-typography-body2,
    .contactcard-compact.mud-card .mud-typography-body2 {
        margin: 0 !important;
        padding: 0 !important;
    }

/* Optional small layout helpers you can use inside those cards */
.contactcard-compact .ck-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.contactcard-compact .ck-text {
    flex: 1;
    margin: 0;
}

.contactcard-compact .ck-icon {
    margin-left: 4px;
    display: flex;
    align-items: center;
}

/* === Exhaustive, attribute-targeted placeholder styling for dark theme === */
@media (prefers-color-scheme: dark) {
    /* match the exact emitted element: has mud classes and inputclass attribute */
    input.mud-input-slot.mud-input-root.mud-input-root-text.mud-input-root-adorned-start[inputclass="search-input"]::placeholder,
    input.mud-input-slot.mud-input-root.mud-input-root-text.mud-input-root-adorned-start[inputclass="search-input"]::-webkit-input-placeholder,
    input.mud-input-slot.mud-input-root.mud-input-root-text.mud-input-root-adorned-start[inputclass="search-input"]:-moz-placeholder,
    input.mud-input-slot.mud-input-root.mud-input-root-text.mud-input-root-adorned-start[inputclass="search-input"]::-moz-placeholder,
    input.mud-input-slot.mud-input-root.mud-input-root-text.mud-input-root-adorned-start[inputclass="search-input"]:-ms-input-placeholder {
        color: rgba(255,255,255,0.92) !important; /* near-white placeholder */
        opacity: .9 !important;
        font-weight: 300 !important;
        text-shadow: 0 0 1px rgba(255,255,255,0.04) !important;
    }

    /* WebKit mobile often requires the input itself to have -webkit-text-fill-color
     while the placeholder is visible. Style the input when placeholder is shown. */
    input.mud-input-slot.mud-input-root.mud-input-root-text.mud-input-root-adorned-start[inputclass="search-input"]:placeholder-shown {
        color: rgba(255,255,255,0.92) !important; /* fallback */
        -webkit-text-fill-color: rgba(255,255,255,0.92) !important; /* WebKit */
    }

    /* fallback: match by placeholder prefix (last resort) */
    input.mud-input-root[placeholder^="Search loan number"]::placeholder,
    input.mud-input-root[placeholder^="Search loan number"]::-webkit-input-placeholder {
        color: rgba(255,255,255,0.90) !important;
        opacity: 1 !important;
        -webkit-text-fill-color: rgba(255,255,255,0.90) !important;
    }
}

/* === Exhaustive, attribute-targeted placeholder styling for light theme === */
@media (prefers-color-scheme: light) {
    /* match the exact emitted element: has mud classes and inputclass attribute */
    input.mud-input-slot.mud-input-root.mud-input-root-text.mud-input-root-adorned-start[inputclass="search-input"]::placeholder,
    input.mud-input-slot.mud-input-root.mud-input-root-text.mud-input-root-adorned-start[inputclass="search-input"]::-webkit-input-placeholder,
    input.mud-input-slot.mud-input-root.mud-input-root-text.mud-input-root-adorned-start[inputclass="search-input"]:-moz-placeholder,
    input.mud-input-slot.mud-input-root.mud-input-root-text.mud-input-root-adorned-start[inputclass="search-input"]::-moz-placeholder,
    input.mud-input-slot.mud-input-root.mud-input-root-text.mud-input-root-adorned-start[inputclass="search-input"]:-ms-input-placeholder {
        color: rgba(30, 30, 30, 0.92) !important; /* near-white placeholder */
        opacity: .9 !important;
        font-weight: 300 !important;
        text-shadow: 0 0 1px rgba(255,255,255,0.04) !important;
    }

    /* WebKit mobile often requires the input itself to have -webkit-text-fill-color
     while the placeholder is visible. Style the input when placeholder is shown. */
    input.mud-input-slot.mud-input-root.mud-input-root-text.mud-input-root-adorned-start[inputclass="search-input"]:placeholder-shown {
        color: rgba(30, 30, 30, 0.92) !important; /* fallback */
        -webkit-text-fill-color: rgba(255,255,255,0.92) !important; /* WebKit */
    }

    /* fallback: match by placeholder prefix (last resort) */
    input.mud-input-root[placeholder^="Search loan number"]::placeholder,
    input.mud-input-root[placeholder^="Search loan number"]::-webkit-input-placeholder {
        color: rgba(30, 30, 30, 0.92) !important;
        opacity: 1 !important;
        -webkit-text-fill-color: rgba(255,255,255,0.90) !important;
    }
}

.loan-table-header {
    background-color: #1976d2 !important;
    font-weight: 600 !important;
    color: white !important;
    padding-top: 3px !important;
    padding-bottom: 3px !important;
}