/*
 * Mission Control theme: a clean, light CRM look (light gray menu, white
 * workspace, navy text, royal-blue actions, underlined tabs, soft pastel tags).
 * Loaded by all three apps (App\Filament\Theme). Plain CSS, no build step.
 * Dark mode keeps Filament's dark styles; only layout touches apply there.
 */

:root {
    --mc-ink: #1b2440;          /* headings */
    --mc-text: #2b3550;         /* body text in menus */
    --mc-muted: #7b8499;        /* secondary text, icons */
    --mc-line: #e4e8f0;         /* borders */
    --mc-canvas: #ffffff;       /* page background */
    --mc-rail: #f3f5f9;         /* sidebar */
    --mc-soft: #f7f8fb;         /* table headers, hovers */
}

/* ---------- Page canvas ---------- */
html:not(.dark) .fi-body { background: var(--mc-canvas); color: var(--mc-text); }

/* ---------- Top bar ---------- */
html:not(.dark) .fi-topbar,
html:not(.dark) .fi-topbar-ctn > nav { background: #fff; box-shadow: none; border-bottom: 1px solid var(--mc-line); }
.fi-topbar .fi-logo { font-weight: 700; letter-spacing: -.01em; }
html:not(.dark) .fi-topbar .fi-logo { color: var(--mc-ink); }

/* ---------- Left menu ---------- */
.fi-sidebar-nav { padding-top: 1rem; padding-bottom: 1rem; row-gap: .75rem; }
.fi-sidebar-nav-groups { row-gap: .75rem; }
.fi-sidebar-group-items { row-gap: .1rem; }
.fi-sidebar-item-btn { padding-top: .4rem; padding-bottom: .4rem; }
html:not(.dark) .fi-sidebar { background: var(--mc-rail); border-right: 1px solid var(--mc-line); }
html:not(.dark) .fi-sidebar-header { background: var(--mc-rail); box-shadow: none; border-bottom: 1px solid var(--mc-line); }
.fi-sidebar-group-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
html:not(.dark) .fi-sidebar-group-label { color: var(--mc-muted); }
.fi-sidebar-item-btn { border-radius: .5rem; }
html:not(.dark) .fi-sidebar-item-label { color: var(--mc-text); font-weight: 500; }
html:not(.dark) .fi-sidebar-item-icon { color: var(--mc-muted); }
html:not(.dark) .fi-sidebar-item-btn:hover { background: #e9edf5; }
html:not(.dark) .fi-sidebar-item.fi-active > .fi-sidebar-item-btn {
    background: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 0 0 1px var(--mc-line);
}
.fi-sidebar-item.fi-active .fi-sidebar-item-label,
.fi-sidebar-item.fi-active .fi-sidebar-item-icon { color: var(--primary-600); font-weight: 600; }
.dark .fi-sidebar-item.fi-active .fi-sidebar-item-label,
.dark .fi-sidebar-item.fi-active .fi-sidebar-item-icon { color: var(--primary-400); }

/* ---------- Page header ---------- */
.fi-header-heading { font-weight: 700; letter-spacing: -.02em; font-size: 1.375rem; line-height: 1.3; }
/* Less room above and below the title; pages have no subtitles. */
.fi-page-header-main-ctn { padding-top: 1rem; padding-bottom: 1rem; row-gap: 1rem; }
.fi-page-content { row-gap: 1.25rem; }
.fi-header { row-gap: .5rem; }
.fi-header .fi-breadcrumbs { margin-bottom: -.25rem; }
html:not(.dark) .fi-header-heading { color: var(--mc-ink); }
html:not(.dark) .fi-breadcrumbs { color: var(--mc-muted); }

/* ---------- Tabs: underlined text, left aligned ---------- */
.fi-tabs {
    background: transparent !important; box-shadow: none !important; border-radius: 0 !important;
    padding: 0 !important; gap: 1.5rem !important; margin-inline: 0 !important;
    border-bottom: 1px solid var(--mc-line); max-width: 100%;
}
.dark .fi-tabs { border-bottom-color: rgba(255, 255, 255, .1); }
.fi-tabs-item {
    background: transparent !important; box-shadow: none !important; border-radius: 0 !important;
    padding: .7rem .1rem !important; margin-bottom: -1px; border-bottom: 2px solid transparent;
}
html:not(.dark) .fi-tabs-item { color: var(--mc-muted); }
.fi-tabs-item:hover { color: var(--primary-600); }
.fi-tabs-item.fi-active { border-bottom-color: var(--primary-600); }
.fi-tabs-item.fi-active .fi-tabs-item-label { color: var(--primary-600); font-weight: 600; }
.dark .fi-tabs-item.fi-active { border-bottom-color: var(--primary-400); }
.dark .fi-tabs-item.fi-active .fi-tabs-item-label { color: var(--primary-400); }

/* ---------- Cards, tables, stats ---------- */
html:not(.dark) .fi-section:not(.fi-section-not-contained),
html:not(.dark) .fi-ta-ctn,
html:not(.dark) .fi-wi-stats-overview-stat {
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 0 0 1px var(--mc-line) !important;
}
.fi-section, .fi-ta-ctn, .fi-wi-stats-overview-stat { border-radius: .625rem !important; }
.fi-section-header-heading { font-weight: 600; }
html:not(.dark) .fi-section-header-heading { color: var(--mc-ink); }

.fi-ta-header-cell { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
html:not(.dark) .fi-ta-header-cell { background: var(--mc-soft); color: var(--mc-muted); }
html:not(.dark) .fi-ta-row:hover { background: #f8faff; }

.fi-wi-stats-overview-stat-label { font-weight: 500; }
.fi-wi-stats-overview-stat-value { letter-spacing: -.02em; }
html:not(.dark) .fi-wi-stats-overview-stat-value { color: var(--mc-ink); }

/* ---------- Controls ---------- */
.fi-btn { border-radius: .5rem; font-weight: 600; }
/* Solid royal-blue main buttons with white text (Filament would lighten them). */
.fi-btn.fi-color-primary:not(.fi-outlined):not([aria-pressed="false"]) {
    background-color: var(--primary-600) !important; color: #fff !important;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .12);
}
.fi-btn.fi-color-primary:not(.fi-outlined):not([aria-pressed="false"]):hover { background-color: var(--primary-700) !important; }
.fi-btn.fi-color-primary:not(.fi-outlined):not([aria-pressed="false"]) .fi-icon { color: #fff !important; }
/* Unselected option in a button switch (e.g. Matching: client / caregiver). */
html:not(.dark) .fi-btn[aria-pressed="false"] { background: #fff !important; color: var(--mc-text) !important; box-shadow: 0 0 0 1px #d9dee8 !important; }
html:not(.dark) .fi-btn[aria-pressed="false"] .fi-icon { color: var(--mc-muted) !important; }
html:not(.dark) .fi-btn[aria-pressed="false"]:hover { background: var(--mc-soft) !important; }
/* Secondary (gray) buttons: white with a soft border. */
html:not(.dark) .fi-btn.fi-color-gray:not(.fi-outlined) { background: #fff; color: var(--mc-text); box-shadow: 0 0 0 1px #d9dee8; }
html:not(.dark) .fi-btn.fi-color-gray:not(.fi-outlined):hover { background: var(--mc-soft); }
.fi-badge { border-radius: 9999px; padding-inline: .6rem; font-weight: 500; }
.fi-input-wrp { border-radius: .5rem; }
html:not(.dark) .fi-input-wrp { box-shadow: 0 0 0 1px #d9dee8; }
html:not(.dark) .fi-fo-field-label { color: var(--mc-text); }
.fi-modal-window, .fi-dropdown-panel { border-radius: .75rem; }

/* ---------- Login and family pages ---------- */
html:not(.dark) .fi-simple-main { box-shadow: 0 10px 30px rgba(16, 24, 40, .06), 0 0 0 1px var(--mc-line); }
html:not(.dark) .fi-simple-layout { background: var(--mc-rail); }

/* ---------- Profile pages: card on the left, tabs on the right ---------- */
.mc-profile-card { background: #fff; border-radius: .75rem; box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 0 0 1px var(--mc-line); padding: 1.5rem; }
.dark .mc-profile-card { background: rgb(24 24 27); box-shadow: 0 0 0 1px rgba(255, 255, 255, .1); }
.mc-profile-head { display: flex; align-items: center; gap: 1rem; }
.mc-avatar { width: 4.5rem; height: 4.5rem; border-radius: 9999px; flex-shrink: 0; object-fit: cover; display: grid; place-items: center; font-size: 1.5rem; font-weight: 700; }
.mc-profile-name { font-size: 1.4rem; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }
html:not(.dark) .mc-profile-name { color: var(--mc-ink); }
.mc-profile-sub { font-size: .85rem; color: var(--mc-muted); margin-top: .15rem; }
.mc-stage { appearance: none; -webkit-appearance: none; cursor: pointer; margin-top: .5rem; border: 1px solid; border-radius: 9999px; padding: .2rem 1.8rem .2rem .7rem; font-size: .8rem; font-weight: 600; background-repeat: no-repeat; background-position: right .45rem center; background-size: 1rem; }
.mc-actions { display: flex; gap: .55rem; margin-top: 1.25rem; flex-wrap: wrap; }
.mc-action { width: 2.5rem; height: 2.5rem; border-radius: 9999px; display: grid; place-items: center; border: 1px solid var(--mc-line); color: var(--mc-muted); background: #fff; transition: all .15s; }
.mc-action svg { width: 1.15rem; height: 1.15rem; }
.mc-action:hover { color: var(--primary-600); border-color: var(--primary-300); background: var(--primary-50); }
.mc-action-disabled { opacity: .35; cursor: not-allowed; }
.dark .mc-action { background: transparent; border-color: rgba(255, 255, 255, .15); }
.mc-section { border-top: 1px solid var(--mc-line); margin-top: 1.25rem; padding-top: 1rem; }
.dark .mc-section { border-top-color: rgba(255, 255, 255, .1); }
.mc-section-title { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--mc-muted); margin-bottom: .6rem; }
.mc-row { display: flex; align-items: flex-start; gap: .65rem; padding: .3rem 0; }
.mc-row-icon { width: 1.1rem; height: 1.1rem; color: var(--mc-muted); flex-shrink: 0; margin-top: .15rem; }
.mc-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mc-row-value { font-size: .9rem; word-break: break-word; }
.mc-row-label { font-size: .75rem; color: var(--mc-muted); }
.mc-muted { color: var(--mc-muted); }
.mc-link:hover { color: var(--primary-600); text-decoration: underline; }
.mc-copy { color: var(--mc-muted); padding: .15rem; border-radius: .3rem; opacity: 0; transition: opacity .15s; }
.mc-row:hover .mc-copy, .mc-copy:focus { opacity: 1; }
.mc-copy:hover { color: var(--primary-600); background: var(--primary-50); }
.mc-detail { padding: .35rem 0; }
.mc-detail-label { font-size: .75rem; color: var(--mc-muted); }
.mc-detail-value { font-size: .9rem; margin-top: .1rem; }
.mc-select { width: 100%; margin-top: .2rem; border: 1px solid #d9dee8; border-radius: .5rem; padding: .35rem .6rem; font-size: .9rem; background: transparent; }
.dark .mc-select { border-color: rgba(255, 255, 255, .15); }
@media (hover: none) { .mc-copy { opacity: 1; } }

/* ---------- Respite Companion application (public): Mission Respite's navy and pink ---------- */
:root { --mr-navy: #2a2466; --mr-pink: #e2185b; }
.mr-apply { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
@media (min-width: 1024px) { .mr-apply { grid-template-columns: minmax(0, 5fr) minmax(0, 8fr); gap: 3rem; } }
.mr-apply-aside { color: var(--mr-navy); }
@media (min-width: 1024px) { .mr-apply-main { border-left: 1px solid var(--mc-line); padding-left: 3rem; } }
.mr-apply-hero { width: 100%; aspect-ratio: 2.2 / 1; object-fit: cover; }
.mr-apply-hero-art { display: grid; place-items: center; background: linear-gradient(135deg, #fde2ec, #e8e6ff 55%, #d7f0ff); }
.mr-apply-hero-art svg { width: 4.5rem; height: 4.5rem; color: var(--mr-pink); }
.mr-apply-pitch { font-size: 2.4rem; line-height: 1.15; font-weight: 300; margin-top: 1.75rem; color: var(--mr-navy); }
.mr-apply-pitch strong { font-weight: 700; }
.mr-apply-lead { margin-top: .6rem; line-height: 1.6; }
.mr-apply-lead strong { font-weight: 600; }
.mr-apply-benefits { margin-top: 2rem; display: grid; gap: 1.5rem; }
.mr-apply-benefits li { display: flex; gap: .85rem; align-items: flex-start; }
.mr-apply-check { width: 1.6rem; height: 1.6rem; flex: none; margin-top: .35rem; color: var(--mr-pink); }
.mr-apply-benefits h3 { font-size: 1.75rem; font-weight: 600; line-height: 1.2; }
.mr-apply-benefits p { margin-top: .3rem; line-height: 1.6; opacity: .9; }
.mr-apply-title { font-size: 2rem; font-weight: 600; color: var(--mr-navy); margin-bottom: 1.25rem; }
.mr-apply-family { margin-bottom: 1rem; padding: .75rem 1rem; border-radius: .5rem; background: #fdecf2; color: var(--mr-navy); }
.mr-apply-done { text-align: center; padding: 3rem 0; }
.mr-apply-done-icon { width: 4rem; height: 4rem; margin: 0 auto 1rem; color: rgb(34 197 94); }
.mr-apply-footer { text-align: center; padding-top: 2rem; margin-top: 1rem; border-top: 1px solid var(--mc-line); opacity: .8; }
.mr-apply .fi-fo-field-label-content, .mr-apply .fi-fo-field-label { color: var(--mr-navy); font-weight: 600; }
.dark .mr-apply-aside, .dark .mr-apply-title, .dark .mr-apply-pitch { color: #fff; }

/* ---------- Authorization (PA) usage: approved solid, waiting approval striped ---------- */
.mc-usage { min-width: 13rem; }
.mc-usage-bar { display: flex; height: .5rem; border-radius: 9999px; overflow: hidden; background: var(--mc-line); }
.mc-usage-used { background: var(--primary-600); }
.mc-usage-used.mc-usage-over { background: rgb(220 38 38); }
.mc-usage-pending { background: repeating-linear-gradient(45deg, var(--primary-300), var(--primary-300) 4px, var(--primary-100) 4px, var(--primary-100) 8px); }
.mc-usage-text { font-size: .8rem; margin-top: .3rem; }
.mc-usage-muted { color: var(--mc-muted); }
.mc-usage-danger { color: rgb(220 38 38); font-weight: 600; }
.mc-usage-table { width: 100%; font-size: .875rem; border-collapse: collapse; }
.mc-usage-table th { text-align: left; font-weight: 600; color: var(--mc-muted); padding: .4rem .5rem; border-bottom: 1px solid var(--mc-line); }
.mc-usage-table td { padding: .45rem .5rem; border-bottom: 1px solid var(--mc-line); }
.dark .mc-usage-bar { background: rgba(255, 255, 255, .1); }

/* ---------- Reports ---------- */
.mc-report-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 1rem; }
.mc-report-card { display: flex; gap: 1rem; align-items: flex-start; padding: 1.25rem; border-radius: .75rem; background: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 0 0 1px var(--mc-line); transition: box-shadow .15s; }
.mc-report-card:hover { box-shadow: 0 6px 18px rgba(16, 24, 40, .08), 0 0 0 1px var(--primary-300); }
.mc-report-card-icon { flex: none; width: 2.5rem; height: 2.5rem; border-radius: .6rem; display: grid; place-items: center; background: var(--primary-50); color: var(--primary-600); }
.mc-report-card-icon svg { width: 1.35rem; height: 1.35rem; }
.mc-report-card-group { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--mc-muted); }
.mc-report-card-title { font-size: 1.05rem; font-weight: 600; color: var(--mc-ink); margin-top: .1rem; }
.mc-report-card-text { font-size: .875rem; color: var(--mc-muted); margin-top: .3rem; line-height: 1.45; }
.dark .mc-report-card { background: rgba(255, 255, 255, .04); }
.dark .mc-report-card-title { color: #fff; }

.mc-report-filters { display: flex; flex-wrap: wrap; gap: .75rem 1rem; }
.mc-report-filters label { display: grid; gap: .3rem; min-width: 10rem; }
.mc-report-filters label > span { font-size: .75rem; font-weight: 600; color: var(--mc-muted); }
.mc-report-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 1rem; }
.mc-report-stat { padding: 1rem 1.25rem; border-radius: .75rem; background: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 0 0 1px var(--mc-line); }
.mc-report-stat-label { font-size: .8rem; color: var(--mc-muted); }
.mc-report-stat-value { font-size: 1.75rem; font-weight: 600; color: var(--mc-ink); margin-top: .2rem; }
.mc-report-stat-note { font-size: .8rem; color: var(--mc-muted); margin-top: .1rem; }
.dark .mc-report-stat { background: rgba(255, 255, 255, .04); }
.dark .mc-report-stat-value { color: #fff; }

.mc-chart-scroll { overflow-x: auto; }
.mc-chart { width: 100%; min-width: 36rem; height: auto; }
.mc-chart-axis { stroke: var(--mc-line); stroke-width: 1.5; }
.mc-chart-grid { stroke: var(--mc-line); stroke-dasharray: 3 3; }
.mc-chart-tick { font-size: 10px; fill: var(--mc-muted); }
.mc-chart-pct { font-size: 10px; font-weight: 600; fill: var(--mc-ink); }
.mc-chart-allowed { fill: var(--primary-100); background: var(--primary-100); }
.mc-chart-used { fill: var(--primary-600); background: var(--primary-600); }
.mc-chart-used-low { fill: rgb(220 38 38); background: rgb(220 38 38); }
.mc-chart-legend { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .8rem; color: var(--mc-muted); margin-top: .5rem; }
.mc-chart-legend i { display: inline-block; width: .75rem; height: .75rem; border-radius: .2rem; vertical-align: -1px; margin-right: .25rem; }
.dark .mc-chart-pct { fill: #fff; }

.mc-report-table-wrap { overflow-x: auto; }
.mc-report-table { width: 100%; font-size: .85rem; border-collapse: collapse; }
.mc-report-table th { text-align: left; font-weight: 600; font-size: .75rem; color: var(--mc-muted); padding: .5rem .6rem; border-bottom: 1px solid var(--mc-line); white-space: nowrap; }
.mc-report-table td { padding: .6rem; border-bottom: 1px solid var(--mc-line); vertical-align: top; }
.mc-report-table .mc-num { text-align: right; white-space: nowrap; }
.mc-report-link { font-weight: 600; color: var(--primary-600); }
.mc-util { display: inline-block; min-width: 3rem; padding: .1rem .4rem; border-radius: .35rem; font-weight: 600; text-align: center; }
.mc-util-low { background: rgb(254 226 226); color: rgb(185 28 28); }
.mc-util-ok { background: rgb(220 252 231); color: rgb(21 128 61); }
.mc-util-high { background: rgb(254 243 199); color: rgb(161 98 7); }
.mc-util-low-text { color: rgb(185 28 28); }
.mc-report-table td:nth-child(-n+2) { min-width: 9rem; }
.mc-match-count { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; font-size: .85rem; color: var(--mc-muted); margin-bottom: .75rem; }

/* ---------- Clients list: My clients / All clients switch ---------- */
.mc-scope-switch { display: inline-flex; gap: .25rem; padding: .25rem; border-radius: .6rem; background: var(--mc-rail); box-shadow: inset 0 0 0 1px var(--mc-line); }
.mc-scope-option { padding: .4rem 1rem; border-radius: .45rem; font-size: .875rem; font-weight: 600; color: var(--mc-muted); }
.mc-scope-option:hover { color: var(--mc-ink); }
.mc-scope-active { background: #fff; color: var(--primary-600); box-shadow: 0 1px 2px rgba(16, 24, 40, .08), 0 0 0 1px var(--mc-line); }
.dark .mc-scope-switch { background: rgba(255, 255, 255, .05); }
.dark .mc-scope-active { background: rgba(255, 255, 255, .1); color: #fff; }

/* ---------- Client pipeline: My/All clients and Find a client ---------- */
.mc-pipeline-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; }
.mc-client-search { position: relative; width: 100%; max-width: 22rem; }
.mc-client-search-results { position: absolute; z-index: 30; top: calc(100% + .35rem); left: 0; right: 0; max-height: 22rem; overflow-y: auto; padding: .35rem; border-radius: .75rem; background: #fff; box-shadow: 0 12px 32px rgba(16, 24, 40, .14), 0 0 0 1px var(--mc-line); }
.mc-client-search-results button { display: flex; width: 100%; flex-direction: column; align-items: flex-start; gap: .2rem; padding: .5rem .65rem; border-radius: .5rem; text-align: left; }
.mc-client-search-active { background: var(--primary-50); }
.mc-client-search-name { font-size: .9rem; font-weight: 600; color: var(--mc-ink); }
.mc-client-search-meta { display: flex; align-items: center; gap: .4rem; font-size: .75rem; color: var(--mc-muted); }
.mc-client-search-empty { padding: .6rem; font-size: .85rem; color: var(--mc-muted); }
.dark .mc-client-search-results { background: rgb(24 24 27); }
.dark .mc-client-search-active { background: rgba(255, 255, 255, .06); }
.dark .mc-client-search-name { color: #fff; }

/* ---------- Pipelines: the Matched column is a drop zone, not a list ---------- */
.mc-pipeline-matched { display: grid; justify-items: center; gap: .4rem; padding: 1.25rem .75rem; border: 2px dashed var(--mc-line); border-radius: .5rem; text-align: center; font-size: .8rem; color: var(--mc-muted); }
.mc-pipeline-matched svg { width: 1.5rem; height: 1.5rem; color: rgb(47 179 68); }
.mc-pipeline-matched a { font-weight: 600; color: var(--primary-600); }

/* ---------- Respite Companion app: service name, with a Group tag for group time ---------- */
.mr-service { display: inline-flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.mr-group-tag { display: inline-block; padding: .05rem .5rem; border-radius: 9999px; font-size: .72rem; font-weight: 700; letter-spacing: .02em; color: rgb(161 98 7); background: rgb(254 243 199); }
.mr-group-tag-lg { font-size: .85rem; padding: .15rem .7rem; }
.dark .mr-group-tag { color: rgb(253 230 138); background: rgba(245, 158, 11, .2); }

/* ---------- Respite Companion app: client address, tap to open maps ---------- */
.mr-address { display: inline-flex; align-items: flex-start; gap: .3rem; margin-top: .2rem; font-size: .85rem; color: var(--primary-600); text-decoration: underline; text-underline-offset: 2px; text-align: left; }
.mr-address svg { width: 1rem; height: 1rem; flex: none; margin-top: .1rem; }
.mr-address-missing { color: var(--mc-muted); text-decoration: none; }
/* The client's "i" button and its popup. */
.mr-info-button.fi-icon-btn { width: 2.75rem; height: 2.75rem; border-radius: 9999px; color: var(--primary-600); background: var(--primary-50); box-shadow: inset 0 0 0 1px var(--primary-200); }
.mr-info-button.fi-icon-btn svg { width: 1.6rem; height: 1.6rem; }
.dark .mr-info-button.fi-icon-btn { background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15); }
.mr-info { display: grid; gap: 1rem; }
.mr-info-row { display: grid; gap: .2rem; padding-bottom: 1rem; border-bottom: 1px solid var(--mc-line); }
.mr-info-row:last-child { border-bottom: 0; padding-bottom: 0; }
.mr-info-label { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--mc-muted); }
.mr-info-value { font-size: 1rem; }
.mr-info-muted { color: var(--mc-muted); font-size: .9rem; }
.mr-info-link { display: inline-flex; align-items: center; gap: .35rem; font-size: 1rem; font-weight: 600; color: var(--primary-600); }
.mr-info-link svg { width: 1.1rem; height: 1.1rem; }
.mr-card-buttons { display: flex; flex-direction: row; align-items: center; flex: none; gap: .4rem; margin-right: .85rem; }

/* ---------- Respite Companion app: Contact page ---------- */
.mr-call-office { display: flex; align-items: center; gap: .85rem; padding: 1rem 1.1rem; border-radius: .75rem; background: var(--primary-600); color: #fff; }
.mr-call-office svg { width: 1.6rem; height: 1.6rem; flex: none; }
.mr-call-office span { display: grid; gap: .1rem; font-size: .85rem; }
.mr-call-office strong { font-size: 1.05rem; }
.mr-message { padding: .75rem .9rem; border-radius: .6rem; border: 1px solid var(--mc-line); }
.mr-message-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.mr-message-body { margin-top: .35rem; font-size: .9rem; white-space: pre-line; }

/* ---------- Respite Companion app: what's left on the authorization ---------- */
.mr-remaining { display: flex; align-items: center; gap: .3rem; margin-top: .2rem; font-size: .8rem; color: var(--mc-muted); }
.mr-remaining svg { width: .95rem; height: .95rem; flex: none; }
.mr-remaining-low { color: rgb(194 65 12); font-weight: 600; }

/* ---------- Respite Companion app: Refer a friend link ---------- */
.mr-refer { display: grid; gap: .85rem; }
.mr-refer-link { padding: .65rem .8rem; border-radius: .5rem; background: var(--mc-soft); border: 1px solid var(--mc-line); font-size: .85rem; word-break: break-all; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.mr-refer-buttons { display: flex; flex-wrap: wrap; gap: .5rem; }
.dark .mr-refer-link { background: rgba(255, 255, 255, .05); }

/* =====================================================================
   Soft cards: a light blue-gray page with content on white, rounded cards
   with soft shadows, so each section stands out. (Overrides the flatter
   look above; light mode only.)
   ===================================================================== */
:root {
    --mc-page: #eef2f8;                                   /* page background */
    --mc-card-shadow: 0 1px 2px rgba(31, 41, 79, .04), 0 6px 24px rgba(31, 41, 79, .07);
    --mc-card-shadow-hover: 0 2px 4px rgba(31, 41, 79, .05), 0 12px 32px rgba(31, 41, 79, .10);
    --mc-card-radius: 1rem;
}

html:not(.dark) .fi-body,
html:not(.dark) .fi-main-ctn { background: var(--mc-page); }

/* Top bar and menu: white panels with a soft edge. */
html:not(.dark) .fi-topbar,
html:not(.dark) .fi-topbar-ctn > nav { background: #fff; border-bottom: 0; box-shadow: 0 1px 0 rgba(31, 41, 79, .06), 0 4px 16px rgba(31, 41, 79, .04); }
html:not(.dark) .fi-sidebar { background: #fff; border-right: 0; box-shadow: 1px 0 0 rgba(31, 41, 79, .06), 4px 0 16px rgba(31, 41, 79, .03); }
html:not(.dark) .fi-sidebar-header { background: #fff; border-bottom: 0; }
html:not(.dark) .fi-sidebar-item-btn:hover { background: var(--primary-50); }
html:not(.dark) .fi-sidebar-item.fi-active > .fi-sidebar-item-btn { background: var(--primary-50); box-shadow: none; }

/* Cards: sections, tables, stats, widgets, profile card, report cards. */
html:not(.dark) .fi-section:not(.fi-section-not-contained),
html:not(.dark) .fi-ta-ctn,
html:not(.dark) .fi-wi-stats-overview-stat,
html:not(.dark) .fi-wi-chart .fi-section,
html:not(.dark) .mc-profile-card,
html:not(.dark) .mc-report-card,
html:not(.dark) .mc-report-stat {
    background: #fff;
    border: 0;
    box-shadow: var(--mc-card-shadow) !important;
}
.fi-section:not(.fi-section-not-contained), .fi-ta-ctn, .fi-wi-stats-overview-stat,
.mc-profile-card, .mc-report-card, .mc-report-stat { border-radius: var(--mc-card-radius) !important; }
html:not(.dark) .mc-report-card:hover { box-shadow: var(--mc-card-shadow-hover) !important; }
.fi-section-header { padding-top: 1.1rem; padding-bottom: 1.1rem; }
html:not(.dark) .fi-section-content-ctn { border-top-color: #eef1f6; }

/* Stats: a little more air, and a colored top edge to separate them. */
.fi-wi-stats-overview-stat { padding: 1.25rem 1.35rem !important; }
.fi-wi-stats-overview-stat-value { font-size: 1.75rem; }

/* Tables: rounded, header row tinted, rows separated softly. */
html:not(.dark) .fi-ta-header-cell { background: #f7f9fc; }
html:not(.dark) .fi-ta-row { border-color: #eef1f6; }
html:not(.dark) .fi-ta-header-toolbar, html:not(.dark) .fi-ta-header { border-color: #eef1f6; }
html:not(.dark) .fi-ta-row:hover { background: #f8faff; }

/* Tabs sit on the page background: underline in the brand blue. */
html:not(.dark) .fi-tabs { border-bottom-color: #dfe5ef; }

/* Inputs and selects stay white on the gray page. */
html:not(.dark) .fi-input-wrp { background: #fff; }
html:not(.dark) .mc-scope-switch { background: #fff; box-shadow: var(--mc-card-shadow); }
html:not(.dark) .mc-scope-active { background: var(--primary-600); color: #fff; box-shadow: none; }

/* Pipeline boards: white cards on the gray page. */
html:not(.dark) .pipeline-card { box-shadow: 0 1px 2px rgba(31, 41, 79, .05), 0 4px 14px rgba(31, 41, 79, .06); border-color: transparent !important; border-radius: .75rem !important; }
html:not(.dark) .pipeline-card:hover { box-shadow: var(--mc-card-shadow-hover); }

/* Profile tabs on the right: the tab content gets the card look too. */
html:not(.dark) .fi-resource-relation-manager .fi-ta-ctn { box-shadow: var(--mc-card-shadow) !important; }

/* ---------- Ask Mission Control (AI questions) ---------- */
.mc-ask { max-width: 56rem; display: flex; flex-direction: column; gap: 1rem; }
.mc-ask-setup { display: flex; gap: 1rem; align-items: flex-start; }
.mc-ask-setup-icon { width: 2rem; height: 2rem; flex: none; color: var(--primary-600); }
.mc-ask-setup-title { font-size: 1.05rem; font-weight: 600; }
.mc-ask-setup p { color: var(--mc-muted); margin-top: .25rem; line-height: 1.5; }
.mc-ask-intro { background: #fff; border-radius: var(--mc-card-radius, 1rem); box-shadow: var(--mc-card-shadow); padding: 1.5rem; }
.mc-ask-intro-title { font-size: 1.05rem; font-weight: 600; color: var(--mc-ink); }
.mc-ask-intro-text { color: var(--mc-muted); font-size: .9rem; margin-top: .25rem; }
.mc-ask-examples { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.mc-ask-example { border-radius: 999px; padding: .4rem .85rem; font-size: .85rem; background: var(--primary-50); color: var(--primary-700); border: 1px solid var(--primary-100); }
.mc-ask-example:hover { background: var(--primary-100); }
.mc-ask-thread { display: flex; flex-direction: column; gap: .75rem; }
.mc-ask-question { align-self: flex-end; max-width: 80%; background: var(--primary-600); color: #fff; padding: .6rem .95rem; border-radius: 1rem 1rem .25rem 1rem; font-size: .925rem; white-space: pre-wrap; }
.mc-ask-answer { display: flex; gap: .75rem; align-items: flex-start; background: #fff; border-radius: var(--mc-card-radius, 1rem); box-shadow: var(--mc-card-shadow); padding: 1rem 1.15rem; }
.mc-ask-answer-icon { flex: none; width: 2rem; height: 2rem; border-radius: .6rem; display: grid; place-items: center; background: var(--primary-50); color: var(--primary-600); }
.mc-ask-answer-icon svg { width: 1.1rem; height: 1.1rem; }
.mc-ask-answer-body { flex: 1; min-width: 0; font-size: .925rem; line-height: 1.55; color: var(--mc-ink); overflow-x: auto; }
.mc-ask-answer-body p + p, .mc-ask-answer-body p + ul, .mc-ask-answer-body ul + p, .mc-ask-answer-body table + p, .mc-ask-answer-body p + table { margin-top: .6rem; }
.mc-ask-answer-body ul { list-style: disc; padding-left: 1.25rem; }
.mc-ask-answer-body ol { list-style: decimal; padding-left: 1.25rem; }
.mc-ask-answer-body li + li { margin-top: .2rem; }
.mc-ask-answer-body a { color: var(--primary-600); font-weight: 500; }
.mc-ask-answer-body a:hover { text-decoration: underline; }
.mc-ask-answer-body strong { font-weight: 600; }
.mc-ask-answer-body table { border-collapse: collapse; font-size: .85rem; }
.mc-ask-answer-body th { text-align: left; font-weight: 600; background: #f7f9fc; }
.mc-ask-answer-body th, .mc-ask-answer-body td { padding: .35rem .65rem; border-bottom: 1px solid var(--mc-line); }
.mc-ask-thinking { display: inline-flex; align-items: center; gap: .5rem; color: var(--mc-muted); }
.mc-ask-form { display: flex; gap: .5rem; align-items: center; background: #fff; border-radius: var(--mc-card-radius, 1rem); box-shadow: var(--mc-card-shadow); padding: .5rem .5rem .5rem 1rem; }
.mc-ask-input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: .95rem; padding: .4rem 0; outline: none; box-shadow: none; }
.mc-ask-input:focus { outline: none; box-shadow: none; }
.mc-ask-footnote { font-size: .75rem; color: var(--mc-muted); }
.mc-ask-topbar { display: flex; align-items: center; gap: .4rem; border-radius: .6rem; padding: 0 .6rem; height: 2.25rem; background: var(--primary-50); border: 1px solid var(--primary-100); margin-right: .5rem; }
.mc-ask-topbar-icon { width: 1rem; height: 1rem; color: var(--primary-600); flex: none; }
.mc-ask-topbar input { border: 0; background: transparent; font-size: .85rem; width: 14rem; padding: 0; outline: none; box-shadow: none; }
.mc-ask-topbar input:focus { outline: none; box-shadow: none; }
@media (max-width: 767px) { .mc-ask-topbar { display: none; } .mc-ask-question { max-width: 92%; } }
.dark .mc-ask-intro, .dark .mc-ask-answer, .dark .mc-ask-form { background: rgba(255, 255, 255, .04); }
.dark .mc-ask-answer-body, .dark .mc-ask-intro-title { color: #fff; }
.dark .mc-ask-answer-body th { background: rgba(255, 255, 255, .05); }
.dark .mc-ask-topbar { background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .1); }
.dark .mc-ask-example { background: rgba(255, 255, 255, .05); color: var(--primary-300); border-color: rgba(255, 255, 255, .1); }

/* Profile card: keep the stage pill inside the white card. */
.mc-profile-head > div:last-child { flex: 1; min-width: 0; }
.mc-stage { display: block; width: auto; max-width: 100%; box-sizing: border-box; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Current matches box on profiles */
.mc-match-link { color: var(--primary-600); font-weight: 600; }
.mc-match-link:hover { text-decoration: underline; }
.mc-match-since { display: block; color: var(--mc-muted); font-size: .8em; margin-bottom: .35rem; }

/* ---------- Info fields (profiles, details): small gray labels, darker values ---------- */
.fi-in-entry-label { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; line-height: 1.3; }
html:not(.dark) .fi-in-entry-label { color: var(--mc-muted); }
.fi-in-entry { row-gap: .3rem; }
.fi-in-entry-content .fi-in-text-item { font-size: .95rem; font-weight: 500; }
html:not(.dark) .fi-in-entry-content .fi-in-text-item { color: var(--mc-ink); }
.dark .fi-in-entry-label { color: rgb(161 161 170); }

/* Phone app: client with no authorization on file yet */
.mr-no-auth { margin: 0 1rem .9rem 3.5rem; padding: .5rem .7rem; border-radius: .5rem; font-size: .85rem; background: rgb(254 243 199); color: rgb(146 64 14); }
.dark .mr-no-auth { background: rgba(245, 158, 11, .15); color: rgb(252 211 77); }
.mc-page-note { font-size: .9rem; color: var(--mc-muted); max-width: 60rem; line-height: 1.5; }

/* Notes box on profiles */
.mc-notes { display: flex; flex-direction: column; gap: .75rem; }
.mc-note { padding-bottom: .75rem; border-bottom: 1px solid var(--mc-line); }
.mc-note:last-of-type { border-bottom: 0; padding-bottom: 0; }
.mc-note-body { font-size: .9rem; line-height: 1.45; color: var(--mc-ink); overflow-wrap: anywhere; }
.mc-note-meta { font-size: .75rem; color: var(--mc-muted); margin-top: .25rem; }
.mc-note-empty { font-size: .875rem; color: var(--mc-muted); }
.mc-notes-more { align-self: flex-start; font-size: .8rem; font-weight: 600; color: var(--primary-600); }
.dark .mc-note-body { color: #fff; }

/* Client card: Medicaid ID section with Add / Change */
.mc-section-title-row { display: flex; justify-content: space-between; align-items: center; }
.mc-section-edit { font-size: .75rem; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--primary-600); }
.mc-section-edit:hover { text-decoration: underline; }
.mc-add-id { display: inline-flex; align-items: center; gap: .4rem; font-size: .9rem; font-weight: 600; color: var(--primary-600); padding: .35rem 0; }

/* Respite Companion app: Profile page */
.mr-profile-link { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; color: var(--primary-600); }
.mc-more-hours { display: inline-flex; align-items: center; gap: .3rem; margin-top: .4rem; padding: .15rem .55rem; border-radius: 9999px; font-size: .75rem; font-weight: 600; background: rgb(220 252 231); color: rgb(21 128 61); }
.dark .mc-more-hours { background: rgba(34, 197, 94, .15); color: rgb(134 239 172); }

/* Logo: the navy wordmark sits on a light pill in dark mode so it stays readable. */
.dark .fi-logo { background: #fff; border-radius: .5rem; padding: .25rem .5rem; box-sizing: content-box; }

/* ---------- Grouped tables (Claims entry, etc.): a gap between groups ---------- */
.fi-ta-row + .fi-ta-group-header-row > td { border-top: 1.5rem solid var(--mc-rail); }
.dark .fi-ta-row + .fi-ta-group-header-row > td { border-top-color: rgb(9 9 11); }

/* ---------- Claims summary report ---------- */
a.mc-report-stat { display: block; transition: box-shadow .15s; }
a.mc-report-stat:hover { box-shadow: 0 6px 18px rgba(16, 24, 40, .08), 0 0 0 1px var(--primary-300); }
.mc-claims-entered { fill: var(--primary-600); background: var(--primary-600); }
.mc-claims-ready { fill: var(--primary-300); background: var(--primary-300); }
.mc-claims-missing { fill: rgb(248 113 113); background: rgb(248 113 113); }
.mc-claims-denied { fill: rgb(185 28 28); background: rgb(185 28 28); }
.mc-claims-forecast { fill: var(--primary-100); background: var(--primary-100); stroke: var(--primary-400); stroke-dasharray: 4 3; }
.mc-report-total td { font-weight: 600; background: var(--mc-soft); }
.dark .mc-report-total td { background: rgba(255, 255, 255, .04); }
.mc-report-two { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); align-items: start; }
.mc-aging-late td { color: rgb(185 28 28); font-weight: 600; }
.mc-forecast-alert { margin-bottom: 1rem; padding: .75rem 1rem; border-radius: .6rem; background: rgb(254 242 242); color: rgb(153 27 27); font-size: .875rem; }
.dark .mc-forecast-alert { background: rgba(220, 38, 38, .15); color: rgb(254 202 202); }
/* Group header rows (client name, ID, DOB) in light blue so each group stands out. */
html:not(.dark) .fi-ta-group-header-row > td,
html:not(.dark) .fi-ta-group-header { background-color: var(--primary-100); }
html:not(.dark) .fi-ta-group-header-row > td { border-bottom: 1px solid var(--primary-200); }
.dark .fi-ta-group-header-row > td,
.dark .fi-ta-group-header { background-color: rgba(99, 102, 241, .12); }

/* When rows are ticked, the table's toolbar (bulk actions like "Mark denied")
   sticks under the top bar so it's at hand wherever you are on the page. */
.fi-ta-ctn:has(.fi-ta-record-checkbox:checked) .fi-ta-header-ctn {
    position: sticky; top: 4rem; z-index: 25;
    background: #fff; box-shadow: 0 6px 16px rgba(16, 24, 40, .08); border-bottom: 1px solid var(--mc-line);
}
.dark .fi-ta-ctn:has(.fi-ta-record-checkbox:checked) .fi-ta-header-ctn { background: rgb(24 24 27); }
/* Claims: no checkbox that ticks every claim on the page. */
.mc-no-select-all .fi-ta-page-checkbox { display: none; }
.mc-no-select-all .fi-ta-selection-indicator-actions-ctn > [x-on\:click="selectAllRecords"] { display: none !important; }
