/* Mid Mich Consultant Tools — app shell. DevExpress Fluent supplies component styling. */
:root {
    --app-header-height: 3.25rem;
    --app-nav-width: 15rem;
    --app-bg: #f5f6f8;
    --app-surface: #ffffff;
    --app-border: #dfe2e6;
    --app-text-muted: #5f6670;
    --app-accent: #5f368d;
}

html, body {
    margin: 0;
    background: var(--app-bg);
}

h1:focus {
    outline: none;
}

h1 {
    font-size: 1.5rem;
    margin: 0 0 1rem;
}

/* ---------- Shell ---------- */
.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--app-nav-width) 1fr;
    grid-template-rows: var(--app-header-height) 1fr;
    grid-template-areas: "header header" "nav main";
}

.app-header {
    grid-area: header;
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1rem;
    background: var(--app-accent);
    color: #fff;
}

/* Office staff: a darker header, so the administration side looks different from the consultants'. */
.app-office .app-header {
    background: #2e1a47;
}

.app-title {
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.app-title:hover {
    color: #fff;
}

.app-user {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
}

.app-user form {
    margin: 0;
}

.app-user-link {
    color: #fff;
    white-space: nowrap;
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.app-user-link:hover {
    color: #efe6fa;
}

.nav-section.nav-mobile-only {
    display: none;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0.4rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 4px;
}

.menu-toggle-bar {
    display: block;
    height: 2px;
    background: #fff;
}

.app-nav {
    grid-area: nav;
    background: var(--app-surface);
    border-right: 1px solid var(--app-border);
    padding: 0.75rem 0;
}

.nav-section {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

.nav-heading {
    padding: 0.25rem 1.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--app-text-muted);
}

.nav-item {
    padding: 0.5rem 1.25rem;
    color: inherit;
    text-decoration: none;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: #f4f0f9;
    color: inherit;
}

.nav-item.active {
    border-left-color: var(--app-accent);
    background: #efe9f6;
    font-weight: 600;
    color: var(--app-accent);
}

.app-main {
    grid-area: main;
    padding: 1.5rem;
    min-width: 0;
}

/* Phones and small tablets: nav slides over the content. */
@media (max-width: 767.98px) {
    .app-shell {
        grid-template-columns: 1fr;
        grid-template-areas: "header" "main";
    }

    .menu-toggle {
        display: inline-flex;
    }

    .app-user-name,
    .app-user-desktop {
        display: none;
    }

    .nav-section.nav-mobile-only {
        display: flex;
    }

    .app-title {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .app-nav {
        position: fixed;
        top: var(--app-header-height);
        bottom: 0;
        left: 0;
        width: min(80vw, var(--app-nav-width));
        z-index: 15;
        transform: translateX(-100%);
        transition: transform 0.15s ease-out;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
    }

    .menu-open .app-nav {
        transform: none;
    }

    .app-main {
        padding: 1rem;
    }
}

/* ---------- Content helpers ---------- */
.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin-bottom: 1rem;
}

.page-header h1 {
    margin: 0;
}

.card-panel {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.muted {
    color: var(--app-text-muted);
}

.empty-state {
    max-width: 32rem;
    margin: 3rem auto;
    text-align: center;
}

.badge-current {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    background: #efe9f6;
    color: var(--app-accent);
    font-size: 0.75rem;
    font-weight: 600;
}

.temp-password {
    font-family: Consolas, "Courier New", monospace;
    font-size: 1.25rem;
    letter-spacing: 0.05em;
    user-select: all;
}

/* ---------- Sign-in pages ---------- */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3rem 1rem;
}

.auth-brand {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--app-accent);
    margin-bottom: 1.5rem;
}

.auth-card {
    width: 100%;
    max-width: 24rem;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 12px;
    padding: 1.5rem;
}

.auth-hint {
    margin: 1rem 0 0;
    font-size: 0.875rem;
    color: var(--app-text-muted);
    text-align: center;
}

/* ---------- Validation & errors (from template) ---------- */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* ---------- Shared bits ---------- */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.section-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
}

.section-summary {
    color: var(--app-text-muted);
    font-size: 0.9rem;
}

.link-button {
    background: none;
    border: 0;
    padding: 0;
    color: var(--app-accent);
    text-decoration: underline;
    cursor: pointer;
    font: inherit;
}

.link-button:disabled {
    color: var(--app-text-muted);
    cursor: default;
}

.locked-note {
    background: #f3f4f6;
    border-left: 3px solid #9aa1ab;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.field-label {
    display: block;
    font-size: 0.8rem;
    color: var(--app-text-muted);
    margin-bottom: 0.2rem;
}

.simple-table {
    width: 100%;
    margin-top: 0.75rem;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.simple-table th,
.simple-table td {
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid var(--app-border);
    text-align: left;
}

.simple-table tfoot td {
    border-bottom: 0;
    color: var(--app-text-muted);
}

.inline-errors {
    margin: 0.5rem 0 0;
    padding-left: 1.1rem;
    color: #b42318;
    font-size: 0.875rem;
}

/* Green counterpart of .inline-errors, shown in the same spot after a save. */
.inline-success {
    margin: 0.5rem 0 0;
    color: #1f6b35;
    font-size: 0.875rem;
    font-weight: 600;
}

.site-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    flex: none;
}

.site-home { background: #3f7d4e; }
.site-center { background: #7a4fa3; }
.site-meeting { background: #8a6d1f; }

.type-chip,
.ack-chip,
.complete-chip {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    vertical-align: middle;
}

.type-chip { background: #efe9f6; color: var(--app-accent); }
.ack-chip { background: #fff1d6; color: #8a5300; }
.complete-chip { background: #e3f4e8; color: #1f6b35; }

.row-pending td {
    background: #fff8e8 !important;
}

/* ---------- Month calendar ---------- */
.consultant-picker {
    min-width: 16rem;
}

.cal-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.cal-month {
    font-size: 1.15rem;
    margin: 0 0.25rem;
    min-width: 9.5rem;
    text-align: center;
}

.cal-today-link {
    margin-left: auto;
}

.cal-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.25rem;
    font-size: 0.8rem;
    color: var(--app-text-muted);
    margin-bottom: 0.75rem;
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border: 1px solid var(--app-border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--app-border);
    gap: 1px;
}

.cal-head {
    background: #eef1f5;
    padding: 0.35rem;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
}

.cal-day {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    min-height: 6rem;
    padding: 0.35rem 0.45rem;
    background: var(--app-surface);
    color: inherit;
    text-decoration: none;
    font-size: 0.8rem;
}

.cal-day:hover {
    background: #f2f6fc;
    color: inherit;
}

.cal-day:focus-visible {
    outline: 2px solid var(--app-accent);
    outline-offset: -2px;
}

.cal-num {
    font-weight: 600;
    font-size: 0.9rem;
}

.cal-weekend { background: #fafbfc; }
.cal-outside { background: #f6f7f9; color: #9aa1ab; }
.cal-unavailable { background: repeating-linear-gradient(135deg, #f3f4f6, #f3f4f6 6px, #eceef1 6px, #eceef1 12px); }

.cal-today .cal-num {
    background: var(--app-accent);
    color: #fff;
    border-radius: 999px;
    padding: 0 0.4rem;
}

.cal-period {
    position: absolute;
    top: 0.4rem;
    right: 0.45rem;
    font-size: 0.68rem;
    color: var(--app-text-muted);
}

.cal-flags {
    position: absolute;
    bottom: 0.35rem;
    right: 0.45rem;
    display: flex;
    gap: 0.3rem;
    align-items: center;
}

.cal-visits {
    font-weight: 600;
    color: var(--app-accent);
}

.cal-dot {
    display: inline-block;
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 999px;
    vertical-align: middle;
}

.cal-dot-ack { background: #e8930c; }

.cal-check {
    color: #1f6b35;
    font-weight: 700;
}

.cal-badge {
    display: inline-block;
    padding: 0 0.35rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.cal-badge-partial { background: #fff1d6; color: #8a5300; }
.cal-badge-off { background: #e4e6ea; color: #3d434c; }

@media (max-width: 767.98px) {
    .cal-day {
        min-height: 4.25rem;
        padding: 0.25rem;
        font-size: 0.7rem;
    }

    .cal-period,
    .cal-badge,
    .cal-legend {
        display: none;
    }

    .cal-visits {
        font-size: 0.68rem;
    }

    .cal-today-link {
        margin-left: 0;
    }
}

/* ---------- Day view ---------- */
.day-header {
    margin-bottom: 1rem;
}

.back-link {
    display: inline-block;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.day-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

/* Can shrink and wrap its own text, so the ‹ › buttons stay on the date's line. */
.day-title-text {
    flex: 0 1 auto;
    min-width: 0;
}

@media (max-width: 575.98px) {
    /* On phones the worksheet button gets its own line under the date. */
    .day-title-row > .btn {
        margin-left: 0 !important;
    }
}

.day-title {
    font-size: 1.4rem;
    margin: 0;
}

@media (max-width: 575.98px) {
    .day-title {
        font-size: 1.2rem;
    }
}

.ack-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background: #fff4dc;
    border: 1px solid #f0c36b;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.info-banner {
    background: #eef4fb;
    border: 1px solid #c9dbf1;
    border-radius: 8px;
    padding: 0.6rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.availability-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.5rem;
}

.availability-select { width: 11rem; }
.availability-note { flex: 1 1 16rem; }

.visit-provider {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.visit-comment {
    font-style: italic;
    color: #4a5059;
}

.provider-search {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--app-border);
}

.provider-lookup {
    position: relative;
}

.provider-dropdown {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    z-index: 20;
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgb(0 0 0 / 0.12);
}

.provider-results {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 14rem;
    overflow-y: auto;
}

.provider-empty {
    padding: 0.5rem 0.6rem;
}

.provider-result {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    background: none;
    border: 0;
    border-bottom: 1px solid var(--app-border);
    padding: 0.4rem 0.6rem;
    text-align: left;
    font-size: 0.875rem;
}

.provider-result:hover,
.provider-result:focus-visible {
    background: #eef4fb;
}

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

@media (max-width: 991.98px) {
    .day-columns {
        grid-template-columns: 1fr;
    }
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem 1rem;
}

.quick-add {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.5rem 0.75rem;
}

.quick-add > label {
    width: 9rem;
}

.quick-add > .quick-add-wide {
    flex: 1 1 10rem;
    width: auto;
}

.quick-add-error {
    flex-basis: 100%;
}

.notes-list {
    list-style: none;
    margin: 0 0 0.75rem;
    padding: 0;
}

.note {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--app-border);
}

.note-meta {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.8rem;
}

.note-author {
    font-weight: 700;
}

.note-text {
    white-space: pre-wrap;
    margin-top: 0.15rem;
}

.note-add {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.note-add > :first-child {
    width: 100%;
}

.complete-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
}

.team-day-picker {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* ---------- Payroll (Phase 3) ---------- */
.toolbar-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.period-picker {
    width: 22rem;
    max-width: 100%;
}

.period-line,
.period-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-bottom: 1rem;
}

.day-chip {
    display: inline-block;
    margin: 0.15rem 0.2rem 0 0;
    padding: 0 0.45rem;
    border-radius: 4px;
    background: #fff;
    border: 1px solid #c9dbf1;
    font-size: 0.85rem;
    text-decoration: none;
}

.timesheet-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    margin-bottom: 1rem;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 8px;
}

.timesheet-table {
    width: 100%;
    min-width: 46rem;
    border-collapse: collapse;
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
}

.timesheet-table th,
.timesheet-table td {
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid var(--app-border);
    text-align: right;
    white-space: nowrap;
}

.timesheet-table thead th {
    background: #eef1f5;
    font-size: 0.78rem;
    font-weight: 600;
}

.timesheet-table .group-row th {
    text-align: center;
    border-bottom: 1px solid #d5dae1;
}

.timesheet-table .ts-date {
    text-align: left;
    font-weight: 600;
    width: 8rem;
}

.timesheet-table .ts-sub {
    background: #f7f8fa;
    font-weight: 600;
}

.timesheet-table .ts-total {
    font-weight: 700;
}

.timesheet-table .ts-weekend th,
.timesheet-table .ts-weekend td {
    color: #6b727c;
}

.timesheet-table tfoot th,
.timesheet-table tfoot td {
    background: #f2f4f7;
    font-weight: 700;
    border-bottom: 0;
}

.report-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem 1rem;
}

.report-filters > label {
    width: 11rem;
}

.report-filters > .report-filter-wide {
    width: 16rem;
}

.report-filter-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

@media (max-width: 767.98px) {
    .report-filter-actions {
        margin-left: 0;
    }
}

/* Click-to-call on the visit list: a comfortable tap target on phones. */
.visit-phone {
    display: inline-block;
    padding: 0.15rem 0;
    white-space: nowrap;
}

/* Visits as cards on phones (the grid shows from the md breakpoint up). */
.visit-cards {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.visit-card {
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
}

.visit-card-time {
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.visit-card-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.25rem;
    margin: 0.5rem 0 0;
    font-size: 0.875rem;
}

.visit-card-facts dt {
    display: inline;
    font-weight: normal;
    color: var(--app-text-muted);
    margin-right: 0.3rem;
}

.visit-card-facts dd {
    display: inline;
    margin: 0;
}

.visit-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.6rem;
}

.visit-card.row-pending {
    background: #fff8e8;
}

/* H/C chip with the directions button under it. */
.visit-markers {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.directions-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: #e8f0fb;
    color: #1a5fb4;
}

.directions-link:hover,
.directions-link:focus-visible {
    background: #d3e3f8;
}

/* Small dialog used for Arrived (see VisitsSection.razor for why it isn't a DxPopup). Sits high on phones,
   clear of the on-screen keyboard. */
.quick-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: rgb(0 0 0 / 0.35);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 12vh 16px 16px;
}

.quick-sheet {
    width: min(22rem, 100%);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgb(0 0 0 / 0.2);
    padding: 1rem 1.1rem 1.1rem;
}

.quick-sheet-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.quick-sheet-header h2 {
    font-size: 1.1rem;
    margin: 0;
}

@media (max-width: 575.98px) {
    .quick-sheet-backdrop {
        padding-top: 8vh;
    }
}

/* iPhones zoom the page in when a text box under 16px takes focus, and don't zoom back out afterwards
   (the "page stays zoomed after closing a popup" glitch). On touch screens every text box is 16px, which
   stops the zoom while leaving pinch-to-zoom alone. DevExpress editors size their inner input themselves,
   hence !important. */
@media (pointer: coarse) {
    input:not([type="checkbox"]):not([type="radio"]),
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* Read-only provider summary at the top of Edit visit. */
.edit-visit-summary {
    padding: 0.5rem 0.75rem;
    background: #f5f7fa;
    border-radius: 8px;
    line-height: 1.45;
}

/* On small screens DevExpress popups get a fixed left margin, so a popup capped at the screen width minus
   2rem hangs off the right edge. Centre them instead. */
@media (max-width: 575.98px) {
    dxbl-modal-dialog.dxbl-popup {
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

/* Buttons on the right of a section header (Visits: Route in MapQuest + Add visit); wrap under the title on phones. */
.section-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Phones: the title takes its own line and the buttons sit underneath, rather than pushing the page wider. */
@media (max-width: 575.98px) {
    .section-header:has(.section-actions) {
        flex-wrap: wrap;
    }

    .section-header .section-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

.route-note {
    margin: -0.25rem 0 0.75rem;
}

.route-note span + span::before {
    content: " ";
}

/* A fixed value shown where an input would be (e.g. the home state, always MI). */
.static-field {
    display: inline-block;
    padding: 0.3rem 0;
    font-weight: 600;
}


/* The form layout pulls itself up by half its row spacing, which the popup body clips: the first row's
   captions (Visit type, Home or center, Appointment) lost their top half. */
.visit-editor .dxbl-fl {
    padding-top: 0.75rem;
}

/* Rounder corners than Blazing Berry's default (about 3px). The theme sets these on each component's own
   class, so they're overridden there, including the small/large variants. */
:root {
    --bs-border-radius: 0.5rem;
    --bs-border-radius-sm: 0.375rem;
    --bs-border-radius-lg: 0.75rem;
}

.dxbl-btn, .dxbl-btn.dxbl-sm, .dxbl-btn.dxbl-lg,
.dxbl-toolbar-btn {
    --dxbl-btn-border-radius: 0.5rem;
    --dxbl-toolbar-btn-border-radius: 0.5rem;
}

.dxbl-text-edit, .dxbl-text-edit.dxbl-sm, .dxbl-text-edit.dxbl-lg {
    --dxbl-text-edit-border-radius: 0.5rem;
}

.dxbl-dropdown, .dxbl-itemlist-dropdown, .dxbl-dropdown.dxbl-sm, .dxbl-dropdown.dxbl-lg,
.dxbl-itemlist-dropdown.dxbl-sm, .dxbl-itemlist-dropdown.dxbl-lg {
    --dxbl-dropdown-border-radius: 0.5rem;
}

.dxbl-listbox, .dxbl-list-box, .dxbl-calendar, .dxbl-pager, .dxbl-flyout, .dxbl-window {
    --dxbl-listbox-border-radius: 0.5rem;
    --dxbl-list-box-border-radius: 0.5rem;
    --dxbl-calendar-border-radius: 0.5rem;
    --dxbl-pager-border-radius: 0.5rem;
    --dxbl-flyout-border-radius: 0.5rem;
    --dxbl-window-border-radius: 0.75rem;
}

.dxbl-modal, .dxbl-modal.dxbl-sm, .dxbl-modal.dxbl-lg {
    --dxbl-popup-border-radius: 0.75rem;
}

/* Pages whose grid should use the rest of the window (Team Day, Mileage Report). The grid scrolls
   inside it with virtual scrolling, so there's no pager. */
.fill-page {
    display: flex;
    flex-direction: column;
    height: calc(100dvh - var(--app-header-height) - 3rem);
}

.fill-page > * {
    flex: 0 0 auto;
}

.fill-page > .fill-grid {
    flex: 1 1 auto;
    min-height: 18rem;
}

/* Phones: let the page scroll normally and give the grid most of the screen. */
@media (max-width: 767.98px) {
    .fill-page {
        height: auto;
    }

    .fill-page > .fill-grid {
        height: 75dvh;
    }
}

/* ---------- Timesheet signature ---------- */
.signature-status {
    padding: 0.125rem 0.625rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    background: #eef0f3;
    color: var(--app-text-muted);
}

.signature-awaitingapproval {
    background: #fff4d6;
    color: #7a5600;
}

.signature-approved {
    background: #e3f4e8;
    color: #1f6b35;
}

.signature-returned,
.signature-changed {
    background: #fde7e7;
    color: #a12020;
}

.signature-form {
    max-width: 40rem;
}

.signature-office {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.signature-reason {
    flex: 1 1 14rem;
    max-width: 24rem;
}

/* ---------- Date navigation (DateNav) ---------- */
.date-nav {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
}

.date-nav-title {
    min-width: 0;
}

.date-nav-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 1px solid #ddd3ea;
    border-radius: 50%;
    background: var(--app-surface);
    color: var(--app-accent);
    box-shadow: 0 1px 2px rgba(46, 26, 71, 0.08);
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}

.date-nav-btn svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.date-nav-btn:hover {
    background: var(--app-accent);
    border-color: var(--app-accent);
    color: #fff;
    box-shadow: 0 4px 12px rgba(95, 54, 141, 0.3);
}

.date-nav-btn:active {
    transform: scale(0.92);
}

.date-nav-btn:focus-visible,
.date-nav-today:focus-visible {
    outline: 3px solid rgba(95, 54, 141, 0.35);
    outline-offset: 2px;
}

.date-nav-today {
    flex: 0 0 auto;
    border: none;
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    background: #efe9f6;
    color: var(--app-accent);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s;
}

.date-nav-today:hover {
    background: #e2d6f0;
}

/* Bigger tap targets on phones. */
@media (pointer: coarse) {
    .date-nav-btn {
        width: 2.75rem;
        height: 2.75rem;
    }
}

/* On the Day page the nav holds the date title, so it may shrink and wrap. */
.day-title-row .date-nav {
    flex: 0 1 auto;
}

/* ---------- A little polish ---------- */
:root {
    --app-bg: #f6f4fa;
    --app-border: #e4deec;
    --app-shadow: 0 1px 2px rgba(46, 26, 71, 0.04), 0 4px 14px rgba(46, 26, 71, 0.06);
}

.app-header {
    background: linear-gradient(100deg, var(--app-accent) 0%, #7d55ad 100%);
    box-shadow: 0 2px 8px rgba(46, 26, 71, 0.18);
}

.app-office .app-header {
    background: linear-gradient(100deg, #2e1a47 0%, #4d2f73 100%);
}

.card-panel {
    border-radius: 12px;
    box-shadow: var(--app-shadow);
}

/* A short accent bar before each section title. */
.section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title::before {
    content: "";
    width: 4px;
    height: 1.1em;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--app-accent), #a07cd0);
}

.page-header h1,
.day-title {
    color: #2b2140;
    letter-spacing: -0.01em;
}

/* ---------- Home ---------- */
.attention-panel {
    border-left: 4px solid #e0a100;
}

.attention-clear {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border-left-color: #2f8a4c;
    color: #1f6b35;
    font-weight: 500;
}

.attention-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: #e3f4e8;
    font-weight: 700;
}

.attention-list {
    margin: 0;
    padding-left: 1.1rem;
    display: grid;
    gap: 0.5rem;
}

.home-today-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin: 1.25rem 0 0.5rem;
}

.signature-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin-bottom: 0.5rem;
}
