:root {
    color-scheme: light;
    --navy: #12304a;
    --blue: #176b87;
    --blue-dark: #0d526b;
    --aqua: #dff4f3;
    --cream: #f7f8f4;
    --white: #ffffff;
    --ink: #18232c;
    --muted: #60717d;
    --border: #cad5da;
    --danger: #a22929;
    --success: #176b45;
    --shadow: 0 12px 32px rgba(18, 48, 74, 0.09);
}

* {
    box-sizing: border-box;
}

html {
    font-family: Arial, Helvetica, sans-serif;
    background: var(--cream);
    color: var(--ink);
}

body {
    margin: 0;
    min-height: 100vh;
    line-height: 1.5;
}

a {
    color: var(--blue-dark);
}

button,
input,
select {
    font: inherit;
}

button,
.button {
    min-height: 44px;
    border: 0;
    border-radius: 10px;
    padding: 0.7rem 1rem;
    background: var(--blue);
    color: var(--white);
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
}

button:hover,
.button:hover {
    background: var(--blue-dark);
}

button.secondary,
.button.secondary {
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--navy);
}

button.danger {
    background: var(--danger);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid #f5a623;
    outline-offset: 3px;
}

.site-header {
    background: var(--navy);
    color: var(--white);
}

.header-inner {
    width: min(1120px, calc(100% - 2rem));
    margin: auto;
    padding: 1rem 0;
}

.brand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    color: var(--white);
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-decoration: none;
}

.role {
    color: #d7e8ef;
    font-size: 0.9rem;
}

.navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.85rem;
}

.navigation a,
.navigation button {
    min-height: 40px;
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    background: transparent;
    color: var(--white);
    font-weight: 700;
    text-decoration: none;
}

.navigation a:hover,
.navigation button:hover,
.navigation a[aria-current="page"] {
    background: rgba(255, 255, 255, 0.16);
}

main {
    width: min(1120px, calc(100% - 2rem));
    margin: 2rem auto;
}

.hero,
.card {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--white);
    box-shadow: var(--shadow);
}

.hero {
    padding: clamp(1.25rem, 4vw, 2.5rem);
    background: linear-gradient(135deg, var(--white), var(--aqua));
}

.card {
    padding: 1.25rem;
}

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

h1,
h2 {
    color: var(--navy);
    line-height: 1.2;
}

h1 {
    margin-top: 0;
}

.eyebrow {
    margin: 0 0 0.35rem;
    color: var(--blue-dark);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

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

form {
    display: grid;
    gap: 1rem;
}

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

label {
    display: grid;
    gap: 0.35rem;
    color: var(--navy);
    font-weight: 700;
}

input,
select {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 0.65rem 0.75rem;
    background: var(--white);
    color: var(--ink);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
}

.notice {
    min-height: 1.5rem;
    margin: 0.75rem 0;
    font-weight: 700;
}

.notice.error {
    color: var(--danger);
}

.notice.success {
    color: var(--success);
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--white);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 0.8rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

th {
    background: #edf4f6;
    color: var(--navy);
}

.status {
    display: inline-block;
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
    background: var(--aqua);
    color: var(--navy);
    font-size: 0.88rem;
    font-weight: 800;
}

.login-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 1rem;
    background:
        linear-gradient(145deg, rgba(18, 48, 74, 0.94), rgba(23, 107, 135, 0.86));
}

.login-card {
    width: min(440px, 100%);
    border-radius: 18px;
    padding: clamp(1.4rem, 5vw, 2.3rem);
    background: var(--white);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.24);
}

.login-card .brand {
    color: var(--navy);
}

[hidden] {
    display: none !important;
}

@media (max-width: 720px) {
    main {
        width: min(100% - 1rem, 1120px);
        margin: 1rem auto;
    }

    .header-inner {
        width: min(100% - 1rem, 1120px);
    }

    .brand-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .navigation {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .navigation a,
    .navigation button {
        width: 100%;
        text-align: center;
    }

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

    .card {
        padding: 1rem;
    }

    table,
    thead,
    tbody,
    tr,
    th,
    td {
        display: block;
    }

    thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    tr {
        padding: 0.6rem;
        border-bottom: 1px solid var(--border);
    }

    td {
        display: grid;
        grid-template-columns: 7rem minmax(0, 1fr);
        gap: 0.6rem;
        border: 0;
        padding: 0.35rem;
    }

    td::before {
        content: attr(data-label);
        color: var(--navy);
        font-weight: 800;
    }
}


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

.calendar-toolbar h2 {
    margin: 0;
}

.calendar-weekdays,
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.35rem;
}

.calendar-weekdays {
    margin-bottom: 0.35rem;
    font-weight: 700;
    text-align: center;
}

.calendar-day {
    min-height: 112px;
    border: 1px solid #d7dce2;
    border-radius: 0.5rem;
    padding: 0.4rem;
    background: #fff;
    overflow: hidden;
}

.calendar-day.is-outside {
    opacity: 0.45;
}

.calendar-day.is-today {
    outline: 2px solid currentColor;
}

.calendar-date-number {
    display: block;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.calendar-event {
    display: block;
    width: 100%;
    text-align: left;
    margin: 0.2rem 0;
    padding: 0.3rem 0.4rem;
    border-radius: 0.35rem;
    font-size: 0.78rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-appointment {
    border-left: 0.35rem solid var(--appointment-color, #2563eb);
    background: #eef6ff;
    color: #183153;
    font-weight: 600;
}

.calendar-appointment:hover,
.calendar-appointment:focus-visible {
    background: #dcecff;
}


@media (max-width: 720px) {
    .calendar-toolbar {
        align-items: stretch;
    }

    .calendar-toolbar > * {
        width: 100%;
    }

    .calendar-toolbar h2 {
        text-align: center;
    }

    .calendar-weekdays {
        font-size: 0.7rem;
        gap: 0.15rem;
    }

    .calendar-grid {
        gap: 0.15rem;
    }

    .calendar-day {
        min-height: 76px;
        padding: 0.2rem;
        border-radius: 0.3rem;
    }

    .calendar-date-number {
        font-size: 0.75rem;
    }

    .calendar-event {
        font-size: 0.65rem;
        padding: 0.2rem;
    }
}

@media print {
    .calendar-toolbar button,
    #new-rental,
    #print-rentals,
    #rental-filters,
    .calendar-day button {
        display: none !important;
    }
}


.metric {
    font-size: 1.8rem;
    font-weight: 700;
}

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

.commission-totals {
    margin: 1rem 0;
}

.navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}

.navigation a,
.navigation button {
    white-space: nowrap;
}

@media (min-width: 1050px) {
    .site-header .header-inner {
        display: grid;
        grid-template-columns: minmax(180px, 240px) 1fr;
        gap: 1rem;
        align-items: start;
    }

    .site-header .navigation {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .aging-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .navigation {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .navigation a,
    .navigation button {
        width: 100%;
        text-align: center;
    }
}

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

    .navigation {
        grid-template-columns: 1fr;
    }
}

@media print {
    .site-header,
    .navigation,
    form,
    button,
    [data-logout] {
        display: none !important;
    }

    main {
        max-width: none !important;
        width: 100% !important;
    }

    .panel,
    .card {
        break-inside: avoid;
        box-shadow: none !important;
    }
}

.order-workspace{margin-top:1rem;scroll-margin-top:1rem}.order-product-list{display:grid;gap:1rem}.order-product-card{margin-top:1rem;padding:1rem;border:1px solid var(--border);border-radius:12px}.order-product-card h3,.order-product-card h4{color:var(--navy)}.order-product-card h4{margin-bottom:.25rem}.workspace-edit{margin-top:1rem}@media print{#workspace-add,#workspace-refresh,#workspace-close,.workspace-edit{display:none!important}}

.appointment-dialog {
    width: min(42rem, calc(100% - 2rem));
    max-height: calc(100vh - 2rem);
    overflow: auto;
    border: 0;
    border-radius: 0.75rem;
    padding: 1.25rem;
    box-shadow: 0 1rem 3rem rgba(15, 23, 42, 0.3);
}

.appointment-dialog::backdrop {
    background: rgba(15, 23, 42, 0.55);
}

.appointment-dialog .form-grid {
    margin: 0;
}

.appointment-dialog h2,
.appointment-notes-field,
.appointment-form-actions,
#appointment-form-notice {
    grid-column: 1 / -1;
}

.calendar-filters {
    margin: 1rem 0;
    align-items: end;
}

.calendar-filters label {
    min-width: 0;
}

.calendar-filters select {
    width: 100%;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.calendar-day:focus-within {
    outline: 2px solid var(--blue);
    outline-offset: -2px;
}

.appointment-dialog form[aria-busy="true"] {
    cursor: wait;
}

.appointment-dialog form[aria-busy="true"]
    :is(input, select, textarea, button) {
    opacity: 0.72;
}

@media (prefers-reduced-motion: reduce) {
    .calendar-appointment,
    .appointment-dialog {
        scroll-behavior: auto;
        transition: none;
    }
}

@media (prefers-contrast: more) {
    .calendar-appointment {
        border-width: 2px;
    }
}

@media print {
    .calendar-filters,
    #calendar-add-event,
    #print-calendar,
    .appointment-dialog {
        display: none !important;
    }

    .calendar-day {
        break-inside: avoid;
    }
}


/* Visual Batch 2A: enterprise responsive foundation */
:root {
    --ui-primary: #155eef;
    --ui-primary-hover: #004eeb;
    --ui-canvas: #f5f7fb;
    --ui-surface: #ffffff;
    --ui-border: #e4e7ec;
    --ui-text: #101828;
    --ui-muted: #667085;
    --ui-radius-sm: 8px;
    --ui-radius: 12px;
    --ui-radius-lg: 16px;
    --ui-shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
    --ui-shadow: 0 8px 24px rgba(16, 24, 40, .08);
    --ui-content: 1480px;
}

html { background: var(--ui-canvas); }
body {
    min-height: 100vh;
    margin: 0;
    color: var(--ui-text);
    background: radial-gradient(circle at 90% 0, rgba(21,94,239,.07), transparent 28rem), var(--ui-canvas);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
body > header {
    position: sticky;
    z-index: 50;
    top: 0;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: .8rem max(1.25rem, calc((100vw - var(--ui-content))/2));
    border-bottom: 1px solid rgba(228,231,236,.9);
    background: rgba(255,255,255,.94);
    box-shadow: var(--ui-shadow-sm);
    backdrop-filter: blur(14px);
}
body > header h1 {
    flex: 0 0 auto;
    margin: 0 0 .1rem;
    color: var(--ui-text);
    font-size: 1.05rem;
    font-weight: 750;
    letter-spacing: -.02em;
}
.navigation {
    display: flex;
    align-items: center;
    gap: .25rem;
    min-width: 0;
    margin-left: auto;
}
.navigation a,
.navigation button {
    min-height: 40px;
    padding: .55rem .75rem;
    border: 0;
    border-radius: var(--ui-radius-sm);
    color: #344054;
    background: transparent;
    font-size: .9rem;
    font-weight: 600;
    white-space: nowrap;
}
.navigation a:hover,
.navigation button:hover { color: var(--ui-primary); background: #eff4ff; }
.navigation a[aria-current="page"] { color: #1849a9; background: #eaf0ff; }
main {
    width: min(calc(100% - 2.5rem), var(--ui-content));
    margin: 0 auto;
    padding: 2rem 0 3rem;
}
main > h1,
main > header h1 { letter-spacing: -.035em; }
.card,
.panel {
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-lg);
    background: var(--ui-surface);
    box-shadow: var(--ui-shadow-sm);
}
.card { padding: 1.35rem; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.card:hover { border-color: #d0d5dd; box-shadow: var(--ui-shadow); }
.card h2,
.panel h2 { margin-top: 0; color: var(--ui-text); letter-spacing: -.025em; }
p { color: var(--ui-muted); }
a { text-underline-offset: .18em; }
button,
.button,
input,
select,
textarea { border-radius: var(--ui-radius-sm); }
button,
.button { font-weight: 650; box-shadow: var(--ui-shadow-sm); }
button:focus-visible,
.button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(21,94,239,.24);
    outline-offset: 2px;
}

@media (max-width: 1100px) {
    body > header { position: relative; display: block; padding: .8rem 1rem .55rem; }
    body > header h1 { margin-bottom: .55rem; }
    .navigation {
        width: 100%;
        margin: 0;
        padding-bottom: .25rem;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
    }
    .navigation a,
    .navigation button { min-height: 44px; }
}
@media (max-width: 720px) {
    main { width: min(calc(100% - 1.5rem), var(--ui-content)); padding: 1.25rem 0 2rem; }
    .card { padding: 1rem; border-radius: var(--ui-radius); }
    h1 { font-size: clamp(1.55rem, 7vw, 2rem); }
    h2 { font-size: 1.15rem; }
    button,
    .button { min-height: 44px; }
}
@media (max-width: 430px) {
    body > header { padding-inline: .75rem; }
    main { width: calc(100% - 1rem); }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}


/* Visual Batch 2B: enterprise controls and data surfaces */
label {
    display: grid;
    gap: .4rem;
    color: #344054;
    font-size: .875rem;
    font-weight: 650;
}
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
    width: 100%;
    min-height: 42px;
    padding: .62rem .75rem;
    border: 1px solid #d0d5dd;
    border-radius: var(--ui-radius-sm);
    color: var(--ui-text);
    background: var(--ui-surface);
    box-shadow: 0 1px 2px rgba(16,24,40,.05);
    font: inherit;
    transition: border-color .16s ease, box-shadow .16s ease;
}
textarea { min-height: 7rem; resize: vertical; }
input::placeholder,
textarea::placeholder { color: #98a2b3; }
input:not([type="checkbox"]):not([type="radio"]):hover,
select:hover,
textarea:hover { border-color: #98a2b3; }
input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
    border-color: var(--ui-primary);
    outline: 0;
    box-shadow: 0 0 0 4px rgba(21,94,239,.12);
}
input:disabled,
select:disabled,
textarea:disabled { cursor: not-allowed; color: #667085; background: #f2f4f7; }
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 1rem 1.25rem;
    align-items: end;
}
fieldset {
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
}
legend { padding: 0 .4rem; color: #344054; font-weight: 700; }

button,
.button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: .58rem .9rem;
    border: 1px solid transparent;
    border-radius: var(--ui-radius-sm);
    color: #fff;
    background: var(--ui-primary);
    font-size: .9rem;
    font-weight: 650;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
button:hover,
.button:hover { background: var(--ui-primary-hover); box-shadow: 0 3px 8px rgba(21,94,239,.2); }
button:active,
.button:active { transform: translateY(1px); }
button.secondary,
.button.secondary {
    border-color: #d0d5dd;
    color: #344054;
    background: #fff;
}
button.secondary:hover,
.button.secondary:hover { border-color: #98a2b3; color: #101828; background: #f9fafb; }
button.danger,
.button.danger { background: #d92d20; }
button.danger:hover,
.button.danger:hover { background: #b42318; }
button:disabled,
.button[aria-disabled="true"] { opacity: .55; cursor: not-allowed; box-shadow: none; transform: none; }
.actions,
.form-actions,
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; }

.notice {
    min-height: 0;
    margin-block: .75rem;
    padding: .75rem .9rem;
    border: 1px solid #b2ddff;
    border-radius: var(--ui-radius-sm);
    color: #175cd3;
    background: #eff8ff;
    font-size: .9rem;
    font-weight: 600;
}
.notice:empty { display: none; }
.notice.error { border-color: #fecdca; color: #b42318; background: #fef3f2; }
.notice.success { border-color: #abefc6; color: #067647; background: #ecfdf3; }
.status {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: .2rem .55rem;
    border: 1px solid #b2ddff;
    border-radius: 999px;
    color: #175cd3;
    background: #eff8ff;
    font-size: .75rem;
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
}

.table-wrap {
    position: relative;
    overflow-x: auto;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
    background: var(--ui-surface);
    box-shadow: var(--ui-shadow-sm);
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}
table { width: 100%; min-width: 680px; border-collapse: separate; border-spacing: 0; font-size: .875rem; }
th,
td { padding: .78rem 1rem; border-bottom: 1px solid var(--ui-border); text-align: left; vertical-align: middle; }
th {
    position: sticky;
    z-index: 1;
    top: 0;
    color: #475467;
    background: #f9fafb;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .035em;
    text-transform: uppercase;
}
tbody tr { transition: background-color .14s ease; }
tbody tr:hover { background: #f8faff; }
tbody tr:last-child td { border-bottom: 0; }
td .actions { flex-wrap: nowrap; }

@media (max-width: 720px) {
    .form-grid { grid-template-columns: minmax(0, 1fr); gap: .85rem; }
    .form-actions,
    form > .actions { display: grid; grid-template-columns: minmax(0, 1fr); }
    .form-actions > button,
    .form-actions > .button,
    form > .actions > button,
    form > .actions > .button { width: 100%; min-height: 46px; }
    .table-wrap { margin-inline: -.25rem; border-radius: var(--ui-radius-sm); }
    table { min-width: 620px; }
    th,
    td { padding: .7rem .8rem; }
}


/* Visual Batch 2C: dashboard and calendar refinement */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 245px), 1fr));
    gap: 1rem;
    align-items: stretch;
}
.grid .card {
    position: relative;
    display: flex;
    min-height: 185px;
    flex-direction: column;
    overflow: hidden;
}
.grid .card::before {
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, var(--ui-primary), #53b1fd);
    content: "";
    opacity: .75;
}
.grid .card h2 {
    margin-bottom: .65rem;
    color: #475467;
    font-size: .8rem;
    font-weight: 750;
    letter-spacing: .045em;
    text-transform: uppercase;
}
.grid .card p { margin: 0 0 1rem; }
.grid .card p strong {
    color: var(--ui-text);
    font-size: clamp(1.65rem, 3vw, 2.2rem);
    font-weight: 750;
    letter-spacing: -.04em;
    line-height: 1.1;
}
.grid .card .button { align-self: flex-start; margin-top: auto; }
.grid .card[data-mutate] {
    border-color: #b2ccff;
    background: linear-gradient(145deg, #fff 35%, #f5f8ff);
}
.grid .card[data-mutate] h2 { color: #1849a9; }

.panel:has(.calendar-grid) {
    overflow-x: auto;
    padding: 1.25rem;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}
.calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--ui-border);
}
.calendar-toolbar h2 {
    margin: 0;
    color: var(--ui-text);
    font-size: 1.25rem;
    font-weight: 750;
    letter-spacing: -.025em;
}
.calendar-toolbar .actions { justify-content: flex-end; }
.calendar-weekdays,
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--ui-border);
    background: var(--ui-border);
}
.calendar-weekdays {
    border-bottom: 0;
    border-radius: var(--ui-radius) var(--ui-radius) 0 0;
}
.calendar-weekdays > * {
    padding: .6rem .45rem;
    color: #667085;
    background: #f9fafb;
    font-size: .72rem;
    font-weight: 750;
    letter-spacing: .045em;
    text-align: center;
    text-transform: uppercase;
}
.calendar-grid { border-radius: 0 0 var(--ui-radius) var(--ui-radius); }
.calendar-day {
    min-width: 0;
    min-height: 118px;
    padding: .5rem;
    border: 0;
    border-radius: 0;
    color: var(--ui-text);
    background: #fff;
    box-shadow: none;
}
.calendar-day:hover { background: #f8faff; }
.calendar-day.is-outside { color: #98a2b3; background: #fcfcfd; }
.calendar-day.is-today { position: relative; background: #f5f8ff; box-shadow: inset 0 0 0 2px var(--ui-primary); }
.calendar-date-number {
    display: inline-flex;
    width: 1.65rem;
    height: 1.65rem;
    align-items: center;
    justify-content: center;
    margin-bottom: .3rem;
    border-radius: 50%;
    color: #475467;
    font-size: .78rem;
    font-weight: 700;
}
.calendar-day.is-today .calendar-date-number { color: #fff; background: var(--ui-primary); }
.calendar-event,
button.calendar-event {
    display: block;
    width: 100%;
    min-height: 0;
    margin: .22rem 0 0;
    padding: .3rem .4rem;
    overflow: hidden;
    border: 0;
    border-left: 3px solid #667085;
    border-radius: 5px;
    color: #344054;
    background: #f2f4f7;
    box-shadow: none;
    font-size: .7rem;
    font-weight: 650;
    line-height: 1.25;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.calendar-event:hover,
button.calendar-event:hover { color: #101828; background: #e4e7ec; box-shadow: none; transform: none; }
.calendar-appointment,
button.calendar-appointment { border-left-color: var(--ui-primary); background: #eef4ff; }
.calendar-appointment:hover,
.calendar-appointment:focus-visible { background: #dfe9ff; }

@media (max-width: 900px) {
    .calendar-toolbar { align-items: flex-start; flex-direction: column; }
    .calendar-toolbar .actions { width: 100%; justify-content: flex-start; }
}
@media (max-width: 720px) {
    .grid { grid-template-columns: minmax(0, 1fr); gap: .75rem; }
    .grid .card { min-height: 160px; }
    .panel:has(.calendar-grid) { padding: .75rem; }
    .calendar-toolbar .actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .calendar-toolbar .actions > * { width: 100%; }
    .calendar-weekdays,
    .calendar-grid { min-width: 700px; }
    .calendar-day { min-height: 104px; }
}


/* Visual Batch 2D: organized responsive navigation */
.site-header .header-inner {
    width: min(1200px, calc(100% - 2rem));
    padding: 0.85rem 0 0;
}

.site-header .brand-row {
    align-items: center;
    min-height: 58px;
    padding-bottom: 0.85rem;
}

.header-actions,
.account-identity {
    display: flex;
    align-items: center;
}

.header-actions { gap: 0.55rem; }

.header-link {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    border-radius: 9px;
    padding: 0.6rem 0.85rem;
    color: #e9f3f7;
    font-weight: 750;
    text-decoration: none;
}

.header-link:hover,
.header-link:focus-visible { background: rgba(255, 255, 255, 0.12); }

.header-new-order {
    background: var(--ui-primary, #2f6fed);
    color: #fff;
    box-shadow: 0 5px 14px rgba(8, 31, 72, 0.22);
}

.header-new-order:hover,
.header-new-order:focus-visible { background: #1f5fd1; }

.account-menu { position: relative; }

.account-toggle,
.menu-toggle {
    min-height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    box-shadow: none;
}

.account-toggle {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "eyebrow arrow" "identity arrow";
    gap: 0.05rem 0.7rem;
    min-width: 190px;
    padding: 0.45rem 0.7rem;
    text-align: left;
}

.account-toggle:hover,
.account-toggle:focus-visible,
.account-toggle[aria-expanded="true"],
.menu-toggle:hover,
.menu-toggle:focus-visible,
.menu-toggle[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.16);
    transform: none;
}

.account-eyebrow {
    grid-area: eyebrow;
    color: #c6dbe5;
    font-size: 0.7rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.account-identity { grid-area: identity; gap: 0.35rem; }
.account-role { color: #c6dbe5; font-size: 0.78rem; }
.account-role:not(:empty)::before { content: "· "; }

.dropdown-chevron {
    grid-area: arrow;
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 160ms ease;
}

.account-toggle[aria-expanded="true"] .dropdown-chevron {
    transform: rotate(225deg) translate(-2px, -2px);
}

.account-dropdown {
    position: absolute;
    z-index: 50;
    top: calc(100% + 0.5rem);
    right: 0;
    width: 210px;
    overflow: hidden;
    border: 1px solid var(--ui-border, #d8e1e8);
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 18px 40px rgba(15, 35, 52, 0.22);
}

.account-dropdown a,
.account-dropdown button {
    display: flex;
    width: 100%;
    min-height: 44px;
    align-items: center;
    border: 0;
    border-radius: 0;
    padding: 0.7rem 0.9rem;
    background: #fff;
    color: var(--ui-text, #243746);
    box-shadow: none;
    font: inherit;
    font-weight: 700;
    text-align: left;
    text-decoration: none;
}

.account-dropdown a:hover,
.account-dropdown button:hover,
.account-dropdown a:focus-visible,
.account-dropdown button:focus-visible {
    background: #eff4ff;
    color: var(--ui-primary, #2f6fed);
    transform: none;
}

.account-dropdown button { border-top: 1px solid var(--ui-border, #d8e1e8); }

.menu-toggle {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
}

.menu-icon,
.menu-icon::before,
.menu-icon::after {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.menu-icon { position: relative; }
.menu-icon::before,
.menu-icon::after { position: absolute; left: 0; content: ""; }
.menu-icon::before { top: -6px; }
.menu-icon::after { top: 6px; }

.site-header .navigation {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    width: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding: 0.45rem 0;
}

.nav-group { display: contents; }
.nav-group-label,
.mobile-nav-only { display: none !important; }

.site-header .navigation a {
    min-height: 38px;
    padding: 0.5rem 0.68rem;
    color: #dcebf1;
    font-size: 0.87rem;
    font-weight: 720;
}

.site-header .navigation a:hover,
.site-header .navigation a:focus-visible {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.site-header .navigation a[aria-current="page"] {
    background: #fff;
    color: var(--ui-primary, #2f6fed);
}

@media (max-width: 900px) {
    .site-header .header-inner { width: min(100% - 1.25rem, 1200px); }
    .header-patients { display: none; }
    .site-header .navigation a { padding-inline: 0.5rem; font-size: 0.8rem; }
}

@media (max-width: 720px) {
    .site-header .header-inner {
        width: 100%;
        padding: 0.65rem 0.75rem 0.7rem;
    }

    .site-header .brand-row {
        min-height: 50px;
        gap: 0.5rem;
        padding: 0;
    }

    .site-header .brand { font-size: 1.3rem; }
    .header-actions { margin-left: auto; gap: 0.4rem; }
    .header-link { display: none; }
    .menu-toggle { display: inline-flex; }

    .account-toggle {
        display: flex;
        gap: 0.45rem;
        min-width: 0;
        max-width: 135px;
        padding: 0.5rem 0.6rem;
    }

    .account-eyebrow,
    .account-role { display: none; }
    .account-identity { min-width: 0; }
    .account-identity strong {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .account-dropdown { position: fixed; top: 68px; right: 0.75rem; }

    .site-header .navigation {
        display: none;
        max-height: calc(100vh - 86px);
        margin-top: 0.65rem;
        overflow-y: auto;
        border: 1px solid rgba(255, 255, 255, 0.14);
        border-radius: 12px;
        padding: 0.4rem;
        background: #fff;
        box-shadow: 0 16px 35px rgba(4, 25, 42, 0.28);
    }

    .site-header .navigation[data-open="true"] {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.4rem;
    }

    .site-header .nav-group {
        display: flex;
        min-width: 0;
        flex-direction: column;
        gap: 0.15rem;
        border: 1px solid #e5ebf0;
        border-radius: 9px;
        padding: 0.35rem;
        background: #f8fafc;
    }

    .site-header .nav-group-label {
        display: block !important;
        padding: 0.35rem 0.45rem 0.2rem;
        color: #667785;
        font-size: 0.68rem;
        font-weight: 850;
        letter-spacing: 0.07em;
        text-transform: uppercase;
    }

    .site-header .mobile-nav-only { display: flex !important; }

    .site-header .navigation a,
    .site-header .navigation button {
        width: 100%;
        min-height: 42px;
        justify-content: flex-start;
        padding: 0.55rem 0.45rem;
        background: transparent;
        color: #243746;
        font-size: 0.82rem;
        text-align: left;
    }

    .site-header .navigation a:hover,
    .site-header .navigation a:focus-visible {
        background: #eaf0ff;
        color: #1849a9;
    }

    .site-header .navigation a[aria-current="page"] {
        background: #dfe9ff;
        color: #1849a9;
    }
}

@media (max-width: 430px) {
    .site-header .navigation[data-open="true"] { grid-template-columns: 1fr; }
}


/* Tasks 39-43: unified order workflow */
#workspace-history {
    display: grid;
    gap: 0.75rem;
}

.order-history-card {
    margin-top: 0;
}

.order-history-card h4 {
    margin-bottom: 0.25rem;
}

.order-history-card p {
    margin: 0.25rem 0;
}

#workspace-note-dialog textarea {
    width: 100%;
    resize: vertical;
}

#workspace-note-dialog form,
#cancel-order-dialog form {
    display: grid;
    gap: 1rem;
}

#order-filter-summary {
    min-height: 1.5rem;
    margin: 0.75rem 0;
}

button.danger {
    border-color: #b42318;
    color: #ffffff;
    background: #b42318;
}

button.danger:hover {
    background: #912018;
}

@media print {
    body.printing-order-workspace main > :not(#order-workspace) {
        display: none !important;
    }

    body.printing-order-workspace #order-workspace {
        display: block !important;
        padding: 0 !important;
        border: 0 !important;
        box-shadow: none !important;
    }

    body.printing-order-workspace #workspace-notice,
    body.printing-order-workspace #workspace-add,
    body.printing-order-workspace #workspace-add-repair,
    body.printing-order-workspace #workspace-add-document,
    body.printing-order-workspace #workspace-add-delivery,
    body.printing-order-workspace #workspace-add-note,
    body.printing-order-workspace #workspace-print,
    body.printing-order-workspace #workspace-refresh,
    body.printing-order-workspace #workspace-close {
        display: none !important;
    }

    body.printing-order-workspace .order-product-card {
        break-inside: avoid;
    }
}


/* Modern tabbed order workspace */
.workspace-tabs {
    display: flex;
    gap: 0.35rem;
    margin: 1rem 0;
    padding: 0.35rem;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
    background: #f9fafb;
    scrollbar-width: thin;
}

.workspace-tabs [role="tab"] {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 0.65rem 0.9rem;
    border: 1px solid transparent;
    color: var(--ui-muted);
    background: transparent;
    box-shadow: none;
    white-space: nowrap;
}

.workspace-tabs [role="tab"]:hover {
    color: var(--ui-primary);
    background: #eff4ff;
}

.workspace-tabs [role="tab"][aria-selected="true"] {
    border-color: #d0d5dd;
    color: #1849a9;
    background: #ffffff;
    box-shadow: var(--ui-shadow-sm);
}

.workspace-tab-panel {
    padding-top: 0.5rem;
}

.workspace-tab-panel[hidden] {
    display: none;
}

.workspace-tab-panel > h3 {
    margin-top: 1rem;
}

.workspace-summary-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(13rem, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.workspace-summary-field {
    min-width: 0;
    padding: 0.85rem;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-sm);
    background: #f9fafb;
}

.workspace-summary-field dt {
    margin-bottom: 0.25rem;
    color: var(--ui-muted);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.workspace-summary-field dd {
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--ui-text);
    font-weight: 650;
}

@media (max-width: 700px) {
    .workspace-tabs {
        margin-inline: -0.35rem;
    }

    .workspace-summary-grid {
        grid-template-columns: 1fr;
    }

    #order-workspace > .actions {
        align-items: stretch;
    }

    #order-workspace > .actions button {
        flex: 1 1 10rem;
    }
}

@media print {
    body.printing-order-workspace .workspace-tabs {
        display: none !important;
    }

    body.printing-order-workspace .workspace-tab-panel,
    body.printing-order-workspace
        .workspace-tab-panel[hidden] {
        display: block !important;
    }

    body.printing-order-workspace
        .workspace-tab-panel {
        break-before: auto;
        border-top: 1px solid #d0d5dd;
    }
}


/* Patient clinical profile workflow */
.patient-profile-dialog {
    width: min(64rem, calc(100% - 2rem));
}

.patient-profile-dialog form {
    display: grid;
    gap: 1rem;
}

#patient-policies {
    display: grid;
    gap: 1rem;
}

.patient-policy[data-removed="true"] {
    border-style: dashed;
}

.patient-profile-dialog .dialog-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.patient-profile-dialog .dialog-heading h2,
.patient-profile-dialog .dialog-heading p {
    margin-top: 0;
}

.patient-profile-dialog fieldset {
    min-width: 0;
    margin: 0;
    padding: 1rem;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
    background: #ffffff;
}

.patient-profile-dialog legend {
    padding: 0 0.35rem;
    color: var(--ui-text);
    font-weight: 750;
}

.patient-profile-dialog .profile-wide-field {
    grid-column: 1 / -1;
}

.patient-profile-dialog textarea {
    width: 100%;
    resize: vertical;
}

.patient-profile-actions {
    justify-content: flex-end;
}

#patient-profile-preview .workspace-summary-grid {
    margin-top: 0;
}

#workspace-patient > h4 {
    margin: 1.25rem 0 0.35rem;
}

@media (max-width: 700px) {
    .patient-profile-dialog {
        width: calc(100% - 1rem);
        max-height: calc(100vh - 1rem);
        padding: 1rem;
    }

    .patient-profile-dialog .dialog-heading {
        display: grid;
    }

    .patient-profile-dialog .dialog-heading button {
        justify-self: start;
    }
}

@media print {
    #patient-profile-dialog {
        display: none !important;
    }
}


/* Catalog pricing and fee-schedule workspace */
.catalog-dialog {
    width: min(58rem, calc(100% - 2rem));
}

.catalog-dialog-heading,
.catalog-wide-field {
    grid-column: 1 / -1;
}

.catalog-dialog-heading h2 {
    margin-bottom: 0.25rem;
}

.catalog-dialog textarea {
    width: 100%;
    min-height: 7rem;
    resize: vertical;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-sm);
    padding: 0.7rem 0.8rem;
    color: var(--ui-text);
    background: var(--ui-surface);
    font: inherit;
}

.catalog-dialog textarea:focus {
    border-color: var(--ui-primary);
    outline: 0;
    box-shadow: 0 0 0 4px rgba(21, 94, 239, 0.12);
}

.catalog-dialog form[aria-busy="true"] {
    cursor: wait;
}

.catalog-dialog form[aria-busy="true"]
    :is(input, select, textarea, button) {
    opacity: 0.72;
}

#product-catalog .section-heading,
.fee-schedule-panel .section-heading {
    align-items: flex-start;
}

#product-catalog table {
    min-width: 1050px;
}

.fee-schedule-panel {
    scroll-margin-top: 1rem;
}

.fee-schedule-panel .form-grid {
    margin-block: 1rem;
}

#fee-schedules table {
    min-width: 850px;
}

@media (max-width: 720px) {
    .catalog-dialog {
        width: calc(100% - 1rem);
        max-height: calc(100vh - 1rem);
        padding: 1rem;
    }

    #product-catalog .section-heading,
    .fee-schedule-panel .section-heading {
        display: grid;
        gap: 0.8rem;
    }

    .fee-schedule-panel .section-heading > .actions {
        display: grid;
        width: 100%;
    }
}

@media print {
    .catalog-dialog,
    #new-fee-schedule,
    #clear-fee-schedule-filters,
    #print-fee-schedules,
    #fee-schedule-filters button {
        display: none !important;
    }

    #product-catalog,
    #fee-schedules {
        break-inside: auto;
    }

    #product-catalog table,
    #fee-schedules table {
        min-width: 0;
        font-size: 0.72rem;
    }
}


/* Order funding and authorization workflow */
.workspace-panel-heading,
.authorization-card-heading,
.authorization-dialog .dialog-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.workspace-panel-heading h3,
.authorization-card-heading h4,
.authorization-dialog .dialog-heading h2,
.authorization-dialog .dialog-heading p {
    margin: 0;
}

.authorization-list {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.authorization-card {
    margin-top: 0;
    border-left: 4px solid #2e90fa;
}

.authorization-card-heading span {
    flex: 0 0 auto;
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 750;
}

.authorization-amounts {
    grid-template-columns:
        repeat(2, minmax(10rem, 1fr));
    margin-block: 0.75rem;
}

.authorization-notes {
    padding: 0.75rem;
    border-left: 3px solid #d0d5dd;
    background: #f9fafb;
    white-space: pre-wrap;
}

.authorization-dialog {
    width: min(64rem, calc(100% - 2rem));
}

.authorization-dialog form {
    display: grid;
    gap: 1rem;
}

.authorization-dialog .authorization-wide-field {
    grid-column: 1 / -1;
}

.authorization-dialog textarea {
    width: 100%;
    resize: vertical;
}

.authorization-dialog form[aria-busy="true"] {
    opacity: 0.75;
}

@media (max-width: 700px) {
    .workspace-panel-heading,
    .authorization-card-heading,
    .authorization-dialog .dialog-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .workspace-panel-heading .actions,
    .workspace-panel-heading .actions button {
        width: 100%;
    }

    .authorization-amounts {
        grid-template-columns: 1fr;
    }

    .authorization-dialog {
        width: calc(100% - 1rem);
    }
}

@media print {
    body.printing-order-workspace
        #workspace-add-authorization,
    body.printing-order-workspace
        .authorization-card .workspace-edit,
    #workspace-authorization-dialog {
        display: none !important;
    }

    body.printing-order-workspace .authorization-card {
        break-inside: avoid;
    }
}


/* Order funding estimate */
.funding-estimate-panel {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
    background: #f9fafb;
}

.funding-estimate-controls {
    display: grid;
    grid-template-columns:
        minmax(12rem, 1fr)
        minmax(10rem, 0.65fr)
        auto;
    gap: 0.75rem;
    align-items: end;
    margin: 1rem 0;
}

.funding-estimate-controls .actions {
    margin: 0;
}

.funding-estimate-metrics {
    margin-block: 1rem;
}

.funding-estimate-table {
    margin-top: 1rem;
    max-width: 100%;
    overflow-x: auto;
}

.funding-estimate-table td.status-success,
.funding-estimate-table td.status-warning {
    font-weight: 750;
}

@media (max-width: 760px) {
    .funding-estimate-controls {
        grid-template-columns: 1fr;
    }

    .funding-estimate-controls .actions,
    .funding-estimate-controls button {
        width: 100%;
    }

    .funding-estimate-table table {
        min-width: 52rem;
    }
}

@media print {
    body.printing-order-workspace
        .funding-estimate-controls,
    body.printing-order-workspace
        #workspace-funding-estimate-notice {
        display: none !important;
    }

    body.printing-order-workspace
        .funding-estimate-panel {
        break-inside: avoid;
        border-color: #d0d5dd;
        background: #ffffff;
    }
}


/* Order-scoped claim workflow */
.workspace-claims-panel {
    margin: 1.25rem 0;
    padding-top: 1.25rem;
    border-top: 1px solid var(--ui-border);
}

.workspace-claim-summary {
    margin-bottom: 1rem;
}

.workspace-claim-list {
    display: grid;
    gap: 1rem;
}

.workspace-claim-card {
    margin: 0;
}

.workspace-claim-card-heading {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
}

.workspace-claim-card-heading h4 {
    margin: 0;
}

.workspace-claim-card-heading span {
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: #f2f4f7;
    font-size: 0.8rem;
    font-weight: 700;
}

.workspace-claim-dialog form {
    display: grid;
    gap: 1rem;
}

@media (max-width: 700px) {
    .workspace-claim-card-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    #workspace-create-claim {
        width: 100%;
    }
}

@media print {
    body.printing-order-workspace
        #workspace-create-claim,
    body.printing-order-workspace
        #workspace-claims-notice {
        display: none !important;
    }

    body.printing-order-workspace
        .workspace-claim-card {
        break-inside: avoid;
    }
}


/* Dedicated order list and order-detail architecture */
.order-list-header {
    display: flex;
    gap: 2rem;
    align-items: end;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding: 1.5rem;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
    background:
        linear-gradient(135deg, #ffffff 0%, #effaf9 100%);
    box-shadow: var(--ui-shadow-sm);
}

.order-list-header h1 {
    margin: 0.25rem 0;
}

.order-directory {
    margin-top: 0;
}

.order-directory-heading {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
}

.order-directory-heading h2,
.order-directory-heading p {
    margin-block: 0.25rem;
}

.order-filter-bar {
    display: grid;
    grid-template-columns:
        minmax(16rem, 2fr)
        minmax(10rem, 1fr)
        minmax(10rem, 1fr)
        auto
        auto;
    gap: 0.75rem;
    align-items: end;
    margin: 1.25rem 0;
}

.order-filter-bar label {
    margin: 0;
}

.order-filter-bar label span {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 700;
}

.order-list-meta {
    margin-bottom: 1rem;
}

.order-list {
    display: grid;
    gap: 0.85rem;
}

.order-list-card {
    padding: 1rem 1.1rem;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-sm);
    background: #ffffff;
    box-shadow: var(--ui-shadow-sm);
}

.order-list-card-heading {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    justify-content: space-between;
}

.order-list-card-heading h3,
.order-list-card-heading p {
    margin-block: 0.15rem;
}

.order-status-badge {
    flex: 0 0 auto;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    background: #f2f4f7;
    font-size: 0.8rem;
    font-weight: 750;
}

.order-list-details {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.order-list-details div {
    min-width: 0;
}

.order-list-details dt {
    margin-bottom: 0.2rem;
    color: var(--ui-muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.order-list-details dd {
    margin: 0;
    overflow-wrap: anywhere;
    font-weight: 650;
}

.order-list-card-footer {
    display: flex;
    justify-content: flex-end;
}

.order-list-empty {
    padding: 2rem;
    border: 1px dashed var(--ui-border);
    border-radius: var(--ui-radius-sm);
    text-align: center;
}

.order-detail-main {
    max-width: 92rem;
}

.order-detail-workspace {
    margin-top: 0;
}

.order-detail-heading {
    display: flex;
    gap: 2rem;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.order-detail-heading h1 {
    margin: 0.25rem 0;
}

.order-detail-summary {
    margin: 0;
    color: var(--ui-muted);
}

.order-back-link {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    color: var(--ui-primary);
    font-weight: 700;
    text-decoration: none;
}

.order-detail-actions {
    flex: 0 0 auto;
}

@media (max-width: 900px) {
    .order-filter-bar {
        grid-template-columns: 1fr 1fr;
    }

    .order-search-field {
        grid-column: 1 / -1;
    }
}

@media (max-width: 700px) {
    .order-list-header,
    .order-directory-heading,
    .order-detail-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .order-list-header {
        padding: 1.1rem;
    }

    .order-list-header .button,
    .order-detail-actions button {
        width: 100%;
    }

    .order-filter-bar {
        grid-template-columns: 1fr;
    }

    .order-search-field {
        grid-column: auto;
    }

    .order-filter-bar button {
        width: 100%;
    }

    .order-list-card {
        padding: 1rem;
    }

    .order-list-details {
        grid-template-columns: 1fr;
        gap: 0.7rem;
    }

    .order-list-card-footer,
    .order-list-card-footer .button {
        width: 100%;
    }

    .order-list-card-footer .button {
        justify-content: center;
        text-align: center;
    }

    .order-detail-workspace {
        padding-inline: 1rem;
    }
}

@media print {
    body[data-page="order-list"] .site-header,
    body[data-page="order-list"] .order-list-header .actions,
    body[data-page="order-list"] #order-filters,
    body[data-page="order-list"] #print-orders,
    body[data-page="order-list"] .order-list-card-footer {
        display: none !important;
    }

    body[data-page="order-list"] .order-list-card {
        break-inside: avoid;
        box-shadow: none;
    }

    body[data-page="order-detail"] .site-header,
    body[data-page="order-detail"] .order-back-link,
    body[data-page="order-detail"] .order-detail-actions,
    body[data-page="order-detail"] .workspace-edit,
    body[data-page="order-detail"] [data-mutate] {
        display: none !important;
    }
}


/* order-workspace-redesign-v1 */

body[data-page="order-detail"] .workspace-redesign {
    display: block;
}

body[data-page="order-detail"]
.workspace-section-intro {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 0 1.5rem;
    padding: 0 0 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

body[data-page="order-detail"]
.workspace-section-intro-copy {
    max-width: 58rem;
}

body[data-page="order-detail"]
.workspace-section-intro .eyebrow {
    margin-bottom: 0.35rem;
}

body[data-page="order-detail"]
.workspace-section-title {
    margin: 0;
    font-size: clamp(1.35rem, 2vw, 1.8rem);
    line-height: 1.2;
}

body[data-page="order-detail"]
.workspace-section-description {
    max-width: 52rem;
    margin: 0.55rem 0 0;
}

body[data-page="order-detail"]
.workspace-subsection-title {
    margin-top: 0;
}

body[data-page="order-detail"]
.workspace-overview-dashboard {
    display: grid;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

body[data-page="order-detail"]
.workspace-overview-summary,
body[data-page="order-detail"]
.workspace-overview-workflow,
body[data-page="order-detail"]
.workspace-overview-activity {
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--surface-raised);
}

body[data-page="order-detail"]
.workspace-overview-metrics {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
}

body[data-page="order-detail"]
.workspace-overview-metric {
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface);
}

body[data-page="order-detail"]
.workspace-overview-metric-label {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

body[data-page="order-detail"]
.workspace-overview-metric-value {
    display: block;
    overflow: hidden;
    font-size: 1.15rem;
    line-height: 1.3;
    text-overflow: ellipsis;
}

body[data-page="order-detail"]
.workspace-overview-metric-detail {
    display: block;
    margin-top: 0.3rem;
    color: var(--text-muted);
    font-size: 0.82rem;
}

body[data-page="order-detail"]
.workspace-overview-workflow {
    display: grid;
    gap: 0.35rem;
}

body[data-page="order-detail"]
.workspace-overview-workflow p {
    margin: 0;
}

body[data-page="order-detail"]
.workspace-subsection-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.85rem;
}

body[data-page="order-detail"]
.workspace-overview-activity-list {
    display: grid;
    gap: 0.6rem;
}

body[data-page="order-detail"]
.workspace-overview-activity-item {
    padding: 0.8rem 0.9rem;
    border-left: 3px solid var(--border-strong);
    border-radius: 0 var(--radius-sm)
        var(--radius-sm) 0;
    background: var(--surface);
    line-height: 1.45;
}

body[data-page="order-detail"]
[data-workspace-section="patient"]
#workspace-patient,
body[data-page="order-detail"]
[data-workspace-section="equipment"]
#workspace-products,
body[data-page="order-detail"]
[data-workspace-section="documents"]
#workspace-documents,
body[data-page="order-detail"]
[data-workspace-section="service"]
#workspace-repairs,
body[data-page="order-detail"]
[data-workspace-section="service"]
#workspace-deliveries,
body[data-page="order-detail"]
[data-workspace-section="financials"]
#workspace-financials,
body[data-page="order-detail"]
[data-workspace-section="financials"]
#workspace-commissions,
body[data-page="order-detail"]
[data-workspace-section="history"]
#workspace-history {
    margin-top: 1rem;
}

body[data-page="order-detail"]
[data-workspace-section="service"] {
    display: grid;
    gap: 1.25rem;
}

body[data-page="order-detail"]
[data-workspace-section="financials"] {
    display: grid;
    gap: 1.25rem;
}

body[data-page="order-detail"]
[data-workspace-section="history"] {
    display: grid;
    gap: 1rem;
}

body[data-page="order-detail"]
[role="tablist"] {
    scrollbar-width: thin;
}

body[data-page="order-detail"]
[role="tab"] {
    white-space: nowrap;
}

@media (max-width: 900px) {
    body[data-page="order-detail"]
    .workspace-overview-metrics {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    body[data-page="order-detail"]
    .workspace-section-intro {
        display: block;
    }

    body[data-page="order-detail"]
    .workspace-overview-metrics {
        grid-template-columns: 1fr;
    }

    body[data-page="order-detail"]
    .workspace-subsection-heading {
        display: block;
    }

    body[data-page="order-detail"]
    .workspace-subsection-heading .muted {
        display: block;
        margin-top: 0.35rem;
    }
}

@media print {
    body[data-page="order-detail"]
    .workspace-section-intro {
        break-after: avoid;
    }

    body[data-page="order-detail"]
    .workspace-overview-summary,
    body[data-page="order-detail"]
    .workspace-overview-workflow,
    body[data-page="order-detail"]
    .workspace-overview-activity,
    body[data-page="order-detail"]
    .workspace-overview-metric {
        break-inside: avoid;
    }
}


/* order-mobile-reference-v1 */

/* Mobile controls must disappear when returning to desktop tabs. */
.workspace-mobile-actions,
.workspace-mobile-order-summary,
.workspace-mobile-bottom-bar {
    display: none;
}


@media screen and (max-width: 760px) {
    body[data-page="order-detail"].order-mobile-reference {
        --mobile-purple: #4c316d;
        --mobile-orange: #f47750;
        --mobile-orange-dark: #e96743;
        --mobile-page: #f3f3f5;
        --mobile-card: #ffffff;
        --mobile-text: #555555;
        --mobile-heading: #4d4d4d;

        margin: 0;
        padding-bottom:
            calc(7.5rem + env(safe-area-inset-bottom));
        background: var(--mobile-page);
        color: var(--mobile-text);
    }

    body[data-page="order-detail"].order-mobile-reference
    .site-header {
        position: sticky;
        top: 0;
        z-index: 50;
        min-height: 5.8rem;
        border: 0;
        background: var(--mobile-purple);
        box-shadow: none;
    }

    body[data-page="order-detail"].order-mobile-reference
    .header-inner {
        min-height: 5.8rem;
        padding:
            max(0.75rem, env(safe-area-inset-top))
            1.2rem
            0.8rem;
    }

    body[data-page="order-detail"].order-mobile-reference
    .brand {
        color: #fff;
        font-size: 1.45rem;
        font-weight: 800;
        letter-spacing: -0.03em;
    }

    body[data-page="order-detail"].order-mobile-reference
    .menu-toggle {
        border-color: transparent;
        background: transparent;
        color: #fff;
        box-shadow: none;
    }

    body[data-page="order-detail"].order-mobile-reference
    #main-content {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 0 0 2rem;
    }

    body[data-page="order-detail"].order-mobile-reference
    .order-detail-workspace {
        margin: 0;
        padding: 0 0 1rem;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    body[data-page="order-detail"].order-mobile-reference
    #workspace-title,
    body[data-page="order-detail"].order-mobile-reference
    #workspace-summary {
        display: none;
    }

    body[data-page="order-detail"].order-mobile-reference
    .workspace-mobile-actions {
        position: sticky;
        top: 5.8rem;
        z-index: 40;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding: 0.9rem 1.4rem;
        background:
            rgba(243, 243, 245, 0.96);
        backdrop-filter: blur(12px);
    }

    body[data-page="order-detail"].order-mobile-reference
    .workspace-mobile-add-product {
        min-height: 3.3rem;
        padding: 0.75rem 1.65rem;
        border: 0;
        border-radius: 999px;
        background: var(--mobile-orange);
        color: #fff;
        font-size: 1.05rem;
        font-weight: 500;
        box-shadow:
            0 10px 25px rgba(0, 0, 0, 0.08);
    }

    body[data-page="order-detail"].order-mobile-reference
    .workspace-mobile-menu-toggle {
        display: grid;
        width: 3.4rem;
        height: 3.4rem;
        padding: 0;
        place-content: center;
        gap: 0.28rem;
        border: 0;
        border-radius: 50%;
        background: var(--mobile-orange);
        box-shadow:
            0 10px 25px rgba(0, 0, 0, 0.08);
    }

    body[data-page="order-detail"].order-mobile-reference
    .workspace-mobile-menu-toggle span {
        width: 1.35rem;
        height: 2px;
        border-radius: 999px;
        background: #fff;
    }

    body[data-page="order-detail"].order-mobile-reference
    .workspace-mobile-section-menu {
        position: absolute;
        top: calc(100% - 0.2rem);
        right: 1.4rem;
        z-index: 80;
        width: min(18rem, calc(100vw - 2.8rem));
        overflow: hidden;
        padding: 0.55rem;
        border-radius: 1.2rem;
        background: #fff;
        box-shadow:
            0 18px 45px rgba(0, 0, 0, 0.18);
    }

    body[data-page="order-detail"].order-mobile-reference
    .workspace-mobile-menu-heading {
        margin: 0;
        padding: 0.7rem 0.8rem 0.45rem;
        color: #777;
        font-size: 0.76rem;
        font-weight: 700;
        letter-spacing: 0.07em;
        text-transform: uppercase;
    }

    body[data-page="order-detail"].order-mobile-reference
    .workspace-mobile-section-link {
        width: 100%;
        min-height: 2.75rem;
        padding: 0.65rem 0.8rem;
        border: 0;
        border-radius: 0.75rem;
        background: transparent;
        color: #444;
        text-align: left;
        font-size: 0.95rem;
    }

    body[data-page="order-detail"].order-mobile-reference
    .workspace-mobile-section-link:hover,
    body[data-page="order-detail"].order-mobile-reference
    .workspace-mobile-section-link:focus-visible {
        background: #f7f3f1;
    }

    body[data-page="order-detail"].order-mobile-reference
    .workspace-mobile-order-summary {
        display: grid;
        gap: 0;
        padding: 0.6rem 1.3rem 1rem;
    }

    body[data-page="order-detail"].order-mobile-reference
    .workspace-mobile-summary-row {
        display: grid;
        grid-template-columns:
            minmax(0, 1fr) auto;
        align-items: baseline;
        gap: 1rem;
        min-height: 4.1rem;
        padding: 1rem 0;
    }

    body[data-page="order-detail"].order-mobile-reference
    .workspace-mobile-summary-label {
        color: #555;
        font-size: 1.05rem;
    }

    body[data-page="order-detail"].order-mobile-reference
    .workspace-mobile-summary-value {
        color: var(--mobile-heading);
        font-size: 1.05rem;
        font-weight: 800;
        text-align: right;
    }

    body[data-page="order-detail"].order-mobile-reference
    .workspace-mobile-card {
        scroll-margin-top: 10.5rem;
        display: block;
        width: calc(100% - 1.5rem);
        margin: 0.8rem auto 1.2rem;
        padding: 1.55rem 1.35rem;
        border: 0;
        border-radius: 1.35rem;
        background: var(--mobile-card);
        box-shadow:
            0 9px 24px rgba(30, 30, 30, 0.045);
    }

    body[data-page="order-detail"].order-mobile-reference
    .workspace-section-intro {
        display: block;
        margin: 0 0 1.2rem;
        padding: 0 0 0.9rem;
        border-bottom: 1px solid #eeeeef;
    }

    body[data-page="order-detail"].order-mobile-reference
    .workspace-section-intro .eyebrow,
    body[data-page="order-detail"].order-mobile-reference
    .workspace-section-description {
        display: none;
    }

    body[data-page="order-detail"].order-mobile-reference
    .workspace-section-title {
        margin: 0;
        color: var(--mobile-heading);
        font-size: 1.3rem;
        font-weight: 750;
        letter-spacing: -0.02em;
    }

    body[data-page="order-detail"].order-mobile-reference
    .workspace-subsection-title {
        color: var(--mobile-heading);
        font-size: 1.1rem;
        font-weight: 700;
    }

    body[data-page="order-detail"].order-mobile-reference
    .workspace-overview-dashboard {
        gap: 1rem;
        margin: 0;
    }

    body[data-page="order-detail"].order-mobile-reference
    .workspace-overview-summary,
    body[data-page="order-detail"].order-mobile-reference
    .workspace-overview-workflow,
    body[data-page="order-detail"].order-mobile-reference
    .workspace-overview-activity {
        padding: 0;
        border: 0;
        background: transparent;
    }

    body[data-page="order-detail"].order-mobile-reference
    .workspace-overview-metrics {
        grid-template-columns: 1fr;
        gap: 0;
    }

    body[data-page="order-detail"].order-mobile-reference
    .workspace-overview-metric {
        display: grid;
        grid-template-columns:
            minmax(0, 1fr) minmax(0, 1fr);
        align-items: baseline;
        gap: 1rem;
        padding: 0.85rem 0;
        border: 0;
        border-bottom: 1px solid #f0f0f1;
        border-radius: 0;
        background: transparent;
    }

    body[data-page="order-detail"].order-mobile-reference
    .workspace-overview-metric-label {
        margin: 0;
        color: #666;
        font-size: 0.97rem;
        font-weight: 500;
        letter-spacing: 0;
        text-transform: none;
    }

    body[data-page="order-detail"].order-mobile-reference
    .workspace-overview-metric-value {
        color: var(--mobile-heading);
        font-size: 1rem;
        font-weight: 750;
        text-align: right;
    }

    body[data-page="order-detail"].order-mobile-reference
    .workspace-overview-metric-detail {
        display: none;
    }

    body[data-page="order-detail"].order-mobile-reference
    #workspace-patient,
    body[data-page="order-detail"].order-mobile-reference
    #workspace-products,
    body[data-page="order-detail"].order-mobile-reference
    #workspace-documents,
    body[data-page="order-detail"].order-mobile-reference
    #workspace-repairs,
    body[data-page="order-detail"].order-mobile-reference
    #workspace-deliveries,
    body[data-page="order-detail"].order-mobile-reference
    #workspace-financials,
    body[data-page="order-detail"].order-mobile-reference
    #workspace-commissions,
    body[data-page="order-detail"].order-mobile-reference
    #workspace-history {
        margin-top: 0.8rem;
    }

    body[data-page="order-detail"].order-mobile-reference
    .workspace-summary-field,
    body[data-page="order-detail"].order-mobile-reference
    dl > div {
        display: grid;
        grid-template-columns:
            minmax(7.5rem, 0.9fr)
            minmax(0, 1.35fr);
        align-items: baseline;
        gap: 1rem;
        padding: 0.78rem 0;
    }

    body[data-page="order-detail"].order-mobile-reference
    dt {
        color: #606060;
        font-weight: 500;
    }

    body[data-page="order-detail"].order-mobile-reference
    dd {
        margin: 0;
        color: var(--mobile-heading);
        font-weight: 700;
        text-align: right;
        overflow-wrap: anywhere;
    }

    body[data-page="order-detail"].order-mobile-reference
    .button,
    body[data-page="order-detail"].order-mobile-reference
    button:not(.menu-toggle):not(.account-toggle):not(.workspace-mobile-menu-toggle):not(.workspace-mobile-section-link) {
        border-color: var(--mobile-orange);
    }

    body[data-page="order-detail"].order-mobile-reference
    #workspace-add,
    body[data-page="order-detail"].order-mobile-reference
    #workspace-print,
    body[data-page="order-detail"].order-mobile-reference
    #workspace-refresh,
    body[data-page="order-detail"].order-mobile-reference
    #workspace-close {
        display: none;
    }

    body[data-page="order-detail"].order-mobile-reference
    [data-workspace-section="equipment"]
    button,
    body[data-page="order-detail"].order-mobile-reference
    [data-workspace-section="documents"]
    button,
    body[data-page="order-detail"].order-mobile-reference
    [data-workspace-section="service"]
    button,
    body[data-page="order-detail"].order-mobile-reference
    [data-workspace-section="financials"]
    button,
    body[data-page="order-detail"].order-mobile-reference
    [data-workspace-section="history"]
    button {
        border-color: var(--mobile-orange);
        border-radius: 0.8rem;
    }

    body[data-page="order-detail"].order-mobile-reference
    [data-workspace-section]
    button:not(.secondary):not(.danger) {
        background: var(--mobile-orange);
        color: #fff;
    }

    body[data-page="order-detail"].order-mobile-reference
    [data-workspace-section]
    button:not(.secondary):not(.danger):hover {
        background: var(--mobile-orange-dark);
    }

    body[data-page="order-detail"].order-mobile-reference
    input,
    body[data-page="order-detail"].order-mobile-reference
    select,
    body[data-page="order-detail"].order-mobile-reference
    textarea {
        min-height: 3rem;
        border-width: 0 0 1px;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    body[data-page="order-detail"].order-mobile-reference
    .workspace-mobile-bottom-bar {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 90;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
        padding:
            0.85rem 1rem
            calc(
                0.85rem
                + env(safe-area-inset-bottom)
            );
        border-top: 1px solid #f1f1f2;
        background:
            rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(18px);
        box-shadow:
            0 -10px 35px rgba(0, 0, 0, 0.045);
    }

    body[data-page="order-detail"].order-mobile-reference
    .workspace-mobile-bottom-secondary,
    body[data-page="order-detail"].order-mobile-reference
    .workspace-mobile-bottom-primary {
        display: grid;
        min-height: 3.45rem;
        place-items: center;
        border-radius: 0.85rem;
        font-size: 1.05rem;
        font-weight: 500;
        text-decoration: none;
    }

    body[data-page="order-detail"].order-mobile-reference
    .workspace-mobile-bottom-secondary {
        border: 1px solid #ececef;
        background: #fff;
        color: #999;
    }

    body[data-page="order-detail"].order-mobile-reference
    .workspace-mobile-bottom-primary {
        border: 1px solid var(--mobile-orange);
        background: var(--mobile-orange);
        color: #fff;
    }

    body[data-page="order-detail"].order-mobile-reference
    .notice {
        width: calc(100% - 1.5rem);
        margin-right: auto;
        margin-left: auto;
    }
}

@media print {
    #workspace-mobile-actions,
    #workspace-mobile-order-summary,
    #workspace-mobile-bottom-bar,
    #workspace-mobile-section-menu {
        display: none !important;
    }
}
/* M3 product configuration shares the workspace's responsive/print surface. */
.equipment-dialog { width: min(42rem, calc(100vw - 2rem)); max-height: 85vh; overflow: auto; box-sizing: border-box; }
.equipment-form { display: grid; gap: .8rem; min-width: 0; }
.equipment-form label { display: grid; gap: .25rem; min-width: 0; }
.equipment-form input, .equipment-form select { width: 100%; min-width: 0; box-sizing: border-box; }
.equipment-results { display: grid; gap: .4rem; max-height: 16rem; overflow: auto; }
.equipment-results button { white-space: normal; text-align: left; overflow-wrap: anywhere; }
.equipment-options { border-left: 3px solid #a8b8c8; padding-left: 1rem; margin-top: 1rem; }
.equipment-options article { padding: .5rem 0; }
#workspace-products .order-product-card { overflow-wrap: anywhere; }
@media print {
    .equipment-dialog, .equipment-options button { display: none !important; }
    .equipment-options { break-inside: auto; }
}

/* Palmetto observable-shell parity: layout and behavior, independently implemented. */
.palmetto-shell-header {
    background: #4b3488;
    color: #fff;
    box-shadow: 0 2px 10px rgba(45, 30, 82, .22);
}

.palmetto-header-inner {
    width: min(100% - 2rem, 1480px) !important;
    padding-top: .55rem !important;
}

.palmetto-topbar {
    min-height: 64px !important;
    padding-bottom: .55rem !important;
}

.palmetto-brand {
    min-width: 5rem;
    color: #fff !important;
    font-family: Poppins, Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 1.6rem !important;
    font-weight: 700 !important;
    letter-spacing: -.025em !important;
}

.palmetto-header-actions {
    gap: .4rem;
}

.palmetto-shell-header .header-link {
    border-radius: 4px;
    color: #fff;
    font-weight: 500;
}

.palmetto-shell-header .header-new-order {
    border: 1px solid #ff7149;
    background: #ff7149;
    box-shadow: none;
}

.palmetto-shell-header .header-new-order:hover,
.palmetto-shell-header .header-new-order:focus-visible {
    background: #e06340;
}

.new-order-menu {
    position: relative;
}

.new-order-menu > summary {
    display: grid;
    width: 36px;
    min-height: 42px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 4px;
    color: #fff;
    background: rgba(255, 255, 255, .08);
    cursor: pointer;
    list-style: none;
    font-size: 1rem;
}

.new-order-menu > summary::-webkit-details-marker {
    display: none;
}

.new-order-menu[open] > summary,
.new-order-menu > summary:hover,
.new-order-menu > summary:focus-visible {
    background: rgba(255, 255, 255, .16);
}

.new-order-dropdown {
    position: absolute;
    z-index: 90;
    top: calc(100% + .4rem);
    right: 0;
    width: 190px;
    overflow: hidden;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .16);
}

.new-order-dropdown a {
    display: flex;
    min-height: 42px;
    align-items: center;
    padding: .65rem .8rem;
    color: #4d306e;
    font-weight: 500;
    text-decoration: none;
}

.new-order-dropdown a + a {
    border-top: 1px solid #ededed;
}

.new-order-dropdown a:hover,
.new-order-dropdown a:focus-visible {
    color: #ff7149;
    background: #f8f9fa;
}

.palmetto-shell-header .account-toggle,
.palmetto-shell-header .menu-toggle {
    border-radius: 4px;
}

.palmetto-shell-header .account-eyebrow,
.palmetto-shell-header .account-role {
    color: rgba(255, 255, 255, .74);
}

.palmetto-module-nav {
    gap: 0 !important;
    border-top: 1px solid rgba(255, 255, 255, .14) !important;
    padding: .25rem 0 .4rem !important;
    overflow-x: auto;
    scrollbar-width: thin;
}

.palmetto-module-nav > a {
    flex: 0 0 auto;
    min-height: 36px !important;
    border-radius: 3px !important;
    padding: .45rem .58rem !important;
    color: rgba(255, 255, 255, .9) !important;
    font-size: .78rem !important;
    font-weight: 500 !important;
}

.palmetto-module-nav > a:hover,
.palmetto-module-nav > a:focus-visible {
    background: rgba(255, 255, 255, .12) !important;
    color: #fff !important;
}

.palmetto-module-nav > a[aria-current="page"] {
    background: #fff !important;
    color: #4d306e !important;
}

@media (max-width: 720px) {
    .palmetto-header-inner {
        width: 100% !important;
    }

    .new-order-menu {
        display: none;
    }

    .palmetto-module-nav[data-open="true"] {
        grid-template-columns: 1fr !important;
        gap: .15rem !important;
        background: #fff;
    }

    .palmetto-module-nav > a {
        width: 100%;
        color: #4d306e !important;
        font-size: .86rem !important;
    }

    .palmetto-module-nav > a:hover,
    .palmetto-module-nav > a:focus-visible,
    .palmetto-module-nav > a[aria-current="page"] {
        background: #f2eef7 !important;
        color: #4b3488 !important;
    }
}

/* Palmetto screenshot parity corrections: desktop topbar + separate module strip. */
.palmetto-shell-header {
    overflow: visible;
    background: #4b3488;
}

.palmetto-header-inner {
    width: min(100% - 2rem, 1260px) !important;
    padding: 0 !important;
}

.palmetto-topbar {
    min-height: 72px !important;
    padding: .55rem 0 !important;
}

.palmetto-module-nav {
    position: relative;
    width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    padding: .42rem max(1rem, calc((100vw - 1260px) / 2)) !important;
    border-top: 0 !important;
    border-bottom: 1px solid #e6e6e8;
    background: #fff;
    box-shadow: 0 2px 8px rgba(27, 18, 45, .06);
    overflow: visible;
    flex-wrap: wrap;
}

.palmetto-module-nav > a {
    min-height: 34px !important;
    padding: .42rem .58rem !important;
    color: #5c5b61 !important;
    font-size: .78rem !important;
    font-weight: 500 !important;
}

.palmetto-module-nav > a:hover,
.palmetto-module-nav > a:focus-visible {
    color: #f47750 !important;
    background: #fff7f3 !important;
}

.palmetto-module-nav > a[aria-current="page"] {
    color: #f47750 !important;
    background: #fff !important;
}

@media (max-width: 720px) {
    .palmetto-header-inner {
        width: 100% !important;
        padding: 0 !important;
    }

    .palmetto-topbar {
        min-height: 92px !important;
        padding: .8rem 1.15rem !important;
    }

    .palmetto-brand {
        font-size: 1.45rem !important;
    }

    .palmetto-header-actions .header-patients,
    .palmetto-header-actions .header-new-order,
    .palmetto-header-actions .new-order-menu,
    .palmetto-header-actions .account-menu {
        display: none !important;
    }

    .palmetto-header-actions .menu-toggle {
        display: inline-flex !important;
        width: 46px;
        height: 46px;
        justify-content: center;
        border: 0;
        background: transparent;
    }

    .palmetto-header-actions .menu-toggle span:last-child {
        display: none;
    }

    .palmetto-module-nav {
        position: absolute;
        z-index: 100;
        top: 92px;
        left: 0;
        width: 100% !important;
        max-height: calc(100vh - 92px);
        margin: 0 !important;
        padding: .5rem !important;
        overflow-y: auto;
        border: 0;
        border-radius: 0;
        background: #fff;
        box-shadow: 0 18px 35px rgba(27, 18, 45, .2);
    }

    .palmetto-module-nav:not([data-open="true"]) {
        display: none !important;
    }

    .palmetto-module-nav[data-open="true"] {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }
}

/* Palmetto Equipment directory parity */
body[data-page="order-list"] {
    background: #f1f2f4;
    font-family: Poppins, Roboto, "Helvetica Neue", Arial, sans-serif;
}
body[data-page="order-list"] main {
    width: min(100% - 2rem, 1380px);
    padding-top: 1rem;
}
.equipment-primary-row {
    display: grid;
    grid-template-columns: auto minmax(22rem, 1fr) 10rem 9rem;
    gap: .8rem;
    align-items: end;
}
.equipment-search input {
    border: 0 !important;
    border-bottom: 1px solid #b8b8bc !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}
.filter-trigger {
    border: 0 !important;
    color: #f47750 !important;
    background: transparent !important;
    box-shadow: none !important;
}
.equipment-add-order,
.equipment-print {
    border-radius: 999px !important;
    background: #f47750 !important;
    color: #fff !important;
    box-shadow: 0 10px 22px rgba(244,119,80,.15) !important;
}
.equipment-filter-drawer {
    display: grid;
    grid-template-columns: repeat(3, minmax(10rem, 1fr)) auto auto;
    gap: .8rem;
    margin: .8rem 0;
    padding: 1rem;
    border-radius: .5rem;
    background: #fff;
}
.equipment-table-wrap {
    margin-top: .9rem;
    overflow-x: auto;
    background: #fff;
}
.equipment-directory-table {
    min-width: 1500px;
    border-collapse: collapse;
    font-size: .78rem;
}
.equipment-directory-table th {
    padding: .7rem .45rem;
    color: #333;
    background: #fff;
    text-align: left;
    vertical-align: bottom;
}
.equipment-directory-table td {
    padding: 1rem .45rem;
    border-top: 1px solid #ededee;
    color: #555;
    vertical-align: top;
    white-space: pre-line;
}
.equipment-directory-table a { color: #f47750; font-weight: 650; }
.order-type-pill {
    display: inline-block;
    min-width: 5rem;
    margin-top: .25rem;
    padding: .16rem .5rem;
    border: 1px solid #4b3488;
    border-radius: .3rem;
    color: #4b3488;
    text-align: center;
}
.docs-received { color: #b9b9bd !important; text-decoration: underline; }
.balance-value { color: #f47750 !important; font-weight: 700; }
.chart-notes { color: #f47750 !important; font-weight: 700; }

@media (max-width: 720px) {
    body[data-page="order-list"] main { width: 100%; padding: 0 0 7rem; }
    .equipment-primary-row { display: block; padding: .8rem 1rem 0; }
    .equipment-search { display: block; margin-bottom: 1rem; }
    .equipment-primary-row .filter-trigger,
    .equipment-primary-row .equipment-add-order,
    .equipment-primary-row .equipment-print {
        position: fixed;
        z-index: 80;
        bottom: 1rem;
        height: 52px;
    }
    .equipment-primary-row .filter-trigger {
        left: .75rem;
        width: 52px;
        min-width: 52px;
        border-radius: 50% !important;
        background: #f47750 !important;
        color: #fff !important;
    }
    .equipment-primary-row .equipment-add-order { left: 5rem; width: calc((100% - 6.5rem) / 2); }
    .equipment-primary-row .equipment-print { right: .75rem; width: calc((100% - 6.5rem) / 2); }
    .equipment-filter-drawer { grid-template-columns: 1fr; margin: 0 1rem 1rem; }
    .equipment-table-wrap { overflow: visible; background: transparent; }
    .equipment-directory-table { display: block; min-width: 0; }
    .equipment-directory-table thead { display: none; }
    .equipment-directory-table tbody { display: grid; gap: 1rem; padding: .75rem 0; }
    .equipment-directory-table tr {
        display: block;
        margin: 0 auto;
        width: calc(100% - 2rem);
        padding: 1.25rem 1.15rem;
        border-radius: .2rem;
        background: #fff;
    }
    .equipment-directory-table td {
        display: grid;
        grid-template-columns: minmax(7.5rem, 1fr) minmax(0, 1.45fr);
        gap: 1rem;
        padding: .48rem 0;
        border: 0;
        font-size: .96rem;
        text-align: right;
    }
    .equipment-directory-table td::before {
        content: attr(data-label);
        color: #5a595f;
        text-align: left;
        font-weight: 500;
    }
    .equipment-directory-table td > * { justify-self: end; }
    .order-list-meta { padding-inline: 1rem; }
}

@media (max-width: 720px) {
    html, body {
        max-width: 100%;
        overflow-x: hidden;
    }
    .palmetto-shell-header,
    .palmetto-header-inner,
    .palmetto-topbar,
    .palmetto-module-nav,
    main {
        max-width: 100%;
    }
}

@media (min-width: 721px) {
    .palmetto-module-nav {
        left: 50%;
        margin-left: 0 !important;
        transform: translateX(-50%);
    }
}

@media (min-width: 721px) {
    .palmetto-module-nav {
        left: auto;
        width: 100% !important;
        margin-left: 0 !important;
        transform: none;
        box-shadow: 0 0 0 100vmax #fff, 0 2px 8px rgba(27, 18, 45, .06);
        clip-path: inset(0 -100vmax);
    }
}

/* Ensure Palmetto shell rows stack instead of sharing the legacy header grid. */
.palmetto-header-inner {
    display: block !important;
}
.palmetto-topbar {
    width: 100%;
}
.palmetto-module-nav {
    width: 100% !important;
}

/* Final screenshot-parity polish for shell and Equipment directory. */
.palmetto-brand-cluster {
    display: flex;
    align-items: center;
    gap: .55rem;
}
.shell-back {
    display: none;
    width: 34px;
    min-height: 40px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: #fff;
    font-size: 2rem;
    line-height: 1;
}
.palmetto-brand {
    display: grid !important;
    gap: 0;
    line-height: 1 !important;
}
.palmetto-brand strong {
    font-size: 1.35rem;
    line-height: 1;
}
.palmetto-brand span {
    margin-top: .13rem;
    font-size: .58rem;
    font-weight: 500;
    letter-spacing: .03em;
}
body[data-page="order-list"] .order-list-meta {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}
.equipment-directory-table td strong {
    color: #4d4c50;
}
@media (min-width: 721px) {
    .equipment-directory-table tbody tr:hover {
        background: #fffaf7;
    }
}
@media (max-width: 720px) {
    .shell-back {
        display: grid;
        place-items: center;
    }
    .palmetto-brand-cluster {
        flex: 1 1 auto;
    }
    .palmetto-brand strong {
        font-size: 1.55rem;
    }
    .palmetto-brand span {
        font-size: .68rem;
    }
    .equipment-primary-row .filter-trigger {
        color: transparent !important;
        font-size: 0;
    }
    .equipment-primary-row .filter-trigger::before {
        content: "▼";
        color: #fff;
        font-size: 1rem;
        transform: rotate(60deg);
    }
    .equipment-directory-table tr {
        padding-block: 1.55rem;
    }
    .equipment-directory-table td {
        padding: .62rem 0;
    }
    .equipment-directory-table td:not(.balance-value):not(.chart-notes) {
        color: #555;
    }
}

/* Screenshot-accurate module tab strip: explicit desktop rows. */
.palmetto-module-nav {
    display: block !important;
    padding-top: .45rem !important;
    padding-bottom: .45rem !important;
}

.module-row {
    display: flex;
    align-items: center;
    gap: .2rem;
}

.module-row + .module-row {
    margin-top: .15rem;
}

.module-row > a {
    display: inline-flex;
    min-height: 30px !important;
    align-items: center;
    gap: .34rem;
    flex: 0 0 auto;
    padding: .32rem .46rem !important;
    border-radius: 2px !important;
    color: #5f5d63 !important;
    background: transparent !important;
    font-size: .76rem !important;
    font-weight: 500 !important;
    line-height: 1.1;
    text-decoration: none;
}

.module-icon {
    display: inline-grid;
    width: 1rem;
    place-items: center;
    color: #6d6b70;
    font-size: .8rem;
    line-height: 1;
}

.module-row > a:hover,
.module-row > a:focus-visible {
    color: #f47750 !important;
    background: #fff8f5 !important;
}

.module-row > a[aria-current="page"] {
    color: #f47750 !important;
    background: #fff3ed !important;
}

.module-row > a[aria-current="page"] .module-icon {
    color: #f47750;
}

.module-mobile-links {
    display: none;
}

@media (max-width: 720px) {
    .palmetto-module-nav {
        display: none !important;
    }

    .palmetto-module-nav[data-open="true"] {
        display: block !important;
        padding: .55rem !important;
    }

    .module-mobile-links {
        display: grid;
        grid-template-columns: 1fr;
        gap: .15rem;
        margin-bottom: .35rem;
    }

    .module-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: .15rem;
        margin-top: .35rem;
    }

    .module-row > a,
    .module-mobile-links > a {
        display: flex !important;
        width: 100%;
        min-height: 42px !important;
        align-items: center;
        padding: .6rem .7rem !important;
        color: #4d306e !important;
        background: #fff !important;
        font-size: .88rem !important;
    }
}

/* Screenshot-matched desktop module tabs. */
@media (min-width: 721px) {
    .palmetto-module-nav {
        display: flex !important;
        align-items: center !important;
        align-content: flex-start;
        justify-content: flex-start;
        gap: 0 !important;
        row-gap: .08rem !important;
        padding-top: .28rem !important;
        padding-bottom: .28rem !important;
        min-height: 70px;
    }

    .palmetto-module-nav .mobile-nav-only {
        display: none !important;
    }

    .palmetto-module-nav .module-tab {
        display: inline-flex !important;
        flex: 0 0 auto;
        align-items: center;
        gap: .32rem;
        min-height: 30px !important;
        padding: .28rem .46rem !important;
        border-radius: 0 !important;
        color: #626167 !important;
        background: transparent !important;
        font-size: .77rem !important;
        font-weight: 500 !important;
        line-height: 1.15;
        text-decoration: none;
        box-shadow: none !important;
    }

    .module-tab-icon {
        display: inline-grid;
        width: 1rem;
        min-width: 1rem;
        place-items: center;
        color: #6f6e73;
        font-size: .72rem;
        font-weight: 700;
        line-height: 1;
    }

    .palmetto-module-nav .module-tab:hover,
    .palmetto-module-nav .module-tab:focus-visible {
        color: #f47750 !important;
        background: transparent !important;
    }

    .palmetto-module-nav .module-tab[aria-current="page"] {
        color: #f47750 !important;
        background: transparent !important;
        font-weight: 600 !important;
    }

    .palmetto-module-nav .module-tab[aria-current="page"] .module-tab-icon {
        color: #f47750;
    }

    .module-nav-break {
        flex-basis: 100%;
        width: 0;
        height: 0;
    }
}

@media (max-width: 720px) {
    .palmetto-module-nav .module-tab {
        display: flex !important;
        align-items: center;
        gap: .55rem;
    }

    .module-tab-icon {
        width: 1.1rem;
        text-align: center;
        color: #77747d;
    }

    .module-nav-break {
        display: none;
    }
}

/* Final authority for screenshot-matched module tabs. */
@media (min-width: 721px) {
    .palmetto-module-nav {
        display: block !important;
        min-height: 0 !important;
        padding-top: .42rem !important;
        padding-bottom: .42rem !important;
    }

    .module-mobile-links {
        display: none !important;
    }

    .module-row {
        display: flex !important;
        align-items: center;
        justify-content: flex-start;
        gap: .08rem !important;
        width: 100%;
        margin: 0 !important;
    }

    .module-row + .module-row {
        margin-top: .16rem !important;
    }

    .module-row > a {
        display: inline-flex !important;
        flex: 0 0 auto;
        align-items: center;
        gap: .28rem;
        min-height: 28px !important;
        padding: .26rem .42rem !important;
        border-radius: 0 !important;
        color: #67656b !important;
        background: transparent !important;
        box-shadow: none !important;
        font-size: .75rem !important;
        font-weight: 500 !important;
        line-height: 1.1;
        text-decoration: none;
    }

    .module-row > a .module-icon {
        display: inline-grid;
        width: .95rem;
        min-width: .95rem;
        place-items: center;
        color: #77757a;
        font-size: .72rem;
        line-height: 1;
    }

    .module-row > a:hover,
    .module-row > a:focus-visible {
        color: #f47750 !important;
        background: transparent !important;
    }

    .module-row > a[aria-current="page"] {
        color: #f47750 !important;
        background: transparent !important;
        font-weight: 600 !important;
    }

    .module-row > a[aria-current="page"] .module-icon {
        color: #f47750 !important;
    }
}

/* Palmetto single-canvas order workspace parity. */
body[data-page="order-detail"].order-palmetto-canvas {
    --order-purple: #4b3488;
    --order-orange: #f47750;
    --order-page: #f1f2f4;
    --order-text: #56555a;
    background: var(--order-page);
    font-family: Poppins, Roboto, "Helvetica Neue", Arial, sans-serif;
    padding-bottom: 5.5rem;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-module-nav {
    display: none !important;
}

body[data-page="order-detail"].order-palmetto-canvas .site-header {
    box-shadow: none;
}

body[data-page="order-detail"].order-palmetto-canvas #main-content {
    width: min(calc(100% - 2rem), 1180px);
    max-width: none;
    padding: 0 0 6rem;
}

body[data-page="order-detail"].order-palmetto-canvas .order-detail-workspace {
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

body[data-page="order-detail"].order-palmetto-canvas .order-detail-heading,
body[data-page="order-detail"].order-palmetto-canvas .workspace-tabs,
body[data-page="order-detail"].order-palmetto-canvas #workspace-panel-overview {
    display: none !important;
}

body[data-page="order-detail"].order-palmetto-canvas .workspace-mobile-actions {
    position: sticky;
    top: 72px;
    z-index: 35;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .8rem 0;
    background: rgba(241, 242, 244, .95);
    backdrop-filter: blur(10px);
}

body[data-page="order-detail"].order-palmetto-canvas .workspace-mobile-add-product {
    min-height: 42px;
    padding: .55rem 1.15rem;
    border: 0;
    border-radius: 999px;
    background: var(--order-orange);
    color: #fff;
    font-weight: 500;
    box-shadow: 0 8px 18px rgba(244, 119, 80, .14);
}

body[data-page="order-detail"].order-palmetto-canvas .workspace-mobile-menu-toggle {
    display: grid;
    width: 44px;
    height: 44px;
    padding: 0;
    place-content: center;
    gap: 4px;
    border: 0;
    border-radius: 50%;
    background: var(--order-orange);
    box-shadow: 0 8px 18px rgba(244, 119, 80, .14);
}

body[data-page="order-detail"].order-palmetto-canvas .workspace-mobile-menu-toggle span {
    width: 18px;
    height: 2px;
    border-radius: 10px;
    background: #fff;
}

body[data-page="order-detail"].order-palmetto-canvas .workspace-mobile-section-menu {
    position: absolute;
    z-index: 90;
    top: calc(100% - .1rem);
    right: 0;
    width: min(18rem, calc(100vw - 2rem));
    padding: .5rem;
    border-radius: .75rem;
    background: #fff;
    box-shadow: 0 16px 35px rgba(0,0,0,.17);
}

body[data-page="order-detail"].order-palmetto-canvas .workspace-mobile-section-link {
    width: 100%;
    justify-content: flex-start;
    border: 0;
    background: transparent;
    color: #4d306e;
    text-align: left;
    box-shadow: none;
}

body[data-page="order-detail"].order-palmetto-canvas .workspace-mobile-order-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: .65rem 0 .8rem;
}

body[data-page="order-detail"].order-palmetto-canvas .workspace-mobile-summary-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: baseline;
    min-height: 44px;
    padding: .65rem 0;
}

body[data-page="order-detail"].order-palmetto-canvas .workspace-mobile-summary-label {
    color: #5c5b61;
}

body[data-page="order-detail"].order-palmetto-canvas .workspace-mobile-summary-value {
    color: #4d4c50;
    font-weight: 700;
    text-align: right;
}

body[data-page="order-detail"].order-palmetto-canvas .workspace-palmetto-section {
    display: block;
    width: 100%;
    margin: 1rem auto;
    padding: 1.4rem 1.5rem;
    border: 0;
    border-radius: .35rem;
    background: #fff;
    box-shadow: 0 5px 18px rgba(38, 33, 49, .035);
    scroll-margin-top: 9rem;
}

body[data-page="order-detail"].order-palmetto-canvas .workspace-section-intro {
    margin: 0 0 .8rem;
    padding: 0;
    border: 0;
}

body[data-page="order-detail"].order-palmetto-canvas .workspace-section-intro .eyebrow,
body[data-page="order-detail"].order-palmetto-canvas .workspace-section-description {
    display: none;
}

body[data-page="order-detail"].order-palmetto-canvas .workspace-section-title {
    margin: 0;
    color: #49484c;
    font-size: 1.2rem;
    font-weight: 650;
}

body[data-page="order-detail"].order-palmetto-canvas #workspace-panel-patient .workspace-section-intro,
body[data-page="order-detail"].order-palmetto-canvas #workspace-panel-equipment .workspace-section-intro {
    display: none;
}

body[data-page="order-detail"].order-palmetto-canvas #workspace-panel-patient > h3,
body[data-page="order-detail"].order-palmetto-canvas #workspace-panel-equipment > .workspace-panel-heading {
    display: none;
}

body[data-page="order-detail"].order-palmetto-canvas .workspace-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .2rem 2rem;
}

body[data-page="order-detail"].order-palmetto-canvas .workspace-summary-field {
    display: grid;
    grid-template-columns: minmax(8rem, .8fr) minmax(0, 1.35fr);
    gap: .8rem;
    align-items: baseline;
    padding: .52rem 0;
}

body[data-page="order-detail"].order-palmetto-canvas .workspace-summary-field dt {
    color: #646269;
    font-weight: 500;
}

body[data-page="order-detail"].order-palmetto-canvas .workspace-summary-field dd {
    margin: 0;
    color: #f47750;
    font-weight: 600;
    overflow-wrap: anywhere;
}

body[data-page="order-detail"].order-palmetto-canvas .workspace-product-search {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    width: min(34rem, 100%);
    margin: .6rem auto 1.3rem;
}

body[data-page="order-detail"].order-palmetto-canvas .workspace-product-search label {
    gap: .25rem;
    color: #5b595f;
    font-weight: 500;
}

body[data-page="order-detail"].order-palmetto-canvas .workspace-product-search input {
    min-height: 40px;
    padding: .35rem 2.2rem .35rem 0;
    border: 0;
    border-bottom: 1px solid #aaa9ad;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

body[data-page="order-detail"].order-palmetto-canvas .workspace-product-search button {
    width: 38px;
    min-height: 38px;
    margin-left: -38px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--order-orange);
    box-shadow: none;
    font-size: 1.25rem;
}

body[data-page="order-detail"].order-palmetto-canvas #workspace-products {
    display: grid;
    gap: 1rem;
}

body[data-page="order-detail"].order-palmetto-canvas #workspace-products > .order-product-card {
    padding: 1.25rem;
    border: 0;
    border-radius: .2rem;
    background: #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,.035);
}

body[data-page="order-detail"].order-palmetto-canvas .workspace-mobile-bottom-bar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 90;
    display: grid;
    grid-template-columns: minmax(8rem, 1fr) minmax(8rem, 1fr);
    gap: min(38vw, 32rem);
    padding: .7rem max(1rem, calc((100vw - 1180px) / 2));
    border-top: 1px solid #eeeeef;
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(14px);
}

body[data-page="order-detail"].order-palmetto-canvas .workspace-mobile-bottom-secondary,
body[data-page="order-detail"].order-palmetto-canvas .workspace-mobile-bottom-primary {
    display: grid;
    min-height: 44px;
    place-items: center;
    border-radius: .55rem;
    text-decoration: none;
}

body[data-page="order-detail"].order-palmetto-canvas .workspace-mobile-bottom-secondary {
    border: 1px solid #eee;
    background: #fff;
    color: #bbb;
}

body[data-page="order-detail"].order-palmetto-canvas .workspace-mobile-bottom-primary {
    border: 1px solid var(--order-orange);
    background: var(--order-orange);
    color: #fff;
}

@media (max-width: 760px) {
    body[data-page="order-detail"].order-palmetto-canvas #main-content {
        width: 100%;
        padding-bottom: 6.5rem;
    }

    body[data-page="order-detail"].order-palmetto-canvas .workspace-mobile-actions {
        top: 92px;
        padding: .8rem 1rem;
    }

    body[data-page="order-detail"].order-palmetto-canvas .workspace-mobile-order-summary {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 1rem;
    }

    body[data-page="order-detail"].order-palmetto-canvas .workspace-palmetto-section {
        width: calc(100% - 1rem);
        margin: .8rem auto 1rem;
        padding: 1.35rem 1.1rem;
        border-radius: .8rem;
    }

    body[data-page="order-detail"].order-palmetto-canvas .workspace-summary-grid {
        grid-template-columns: 1fr;
    }

    body[data-page="order-detail"].order-palmetto-canvas .workspace-summary-field {
        grid-template-columns: minmax(7rem, .85fr) minmax(0, 1.35fr);
        padding: .72rem 0;
    }

    body[data-page="order-detail"].order-palmetto-canvas .workspace-product-search {
        width: 100%;
        margin: .4rem 0 1rem;
    }

    body[data-page="order-detail"].order-palmetto-canvas .workspace-mobile-bottom-bar {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
        padding: .7rem .75rem calc(.7rem + env(safe-area-inset-bottom));
    }
}

/* Mobile Palmetto-style navigation drawer */
.mobile-drawer-brand,
.mobile-drawer-actions {
    display: none;
}

@media (max-width: 720px) {
    body.mobile-menu-open {
        overflow: hidden;
    }

    body.mobile-menu-open::before {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 95;
        background: rgba(26, 23, 31, .42);
    }

    .palmetto-module-nav {
        display: block !important;
        position: fixed !important;
        z-index: 110 !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        width: min(78vw, 575px) !important;
        max-width: 575px !important;
        max-height: 100vh !important;
        padding: 0 0 1.4rem !important;
        margin: 0 !important;
        overflow-y: auto !important;
        transform: translateX(-102%);
        transition: transform .2s ease;
        background: #fff !important;
        box-shadow: 18px 0 40px rgba(20, 17, 24, .18) !important;
        clip-path: none !important;
    }

    .palmetto-module-nav[data-open="true"] {
        display: block !important;
        transform: translateX(0);
    }

    .mobile-drawer-brand {
        display: block;
        padding: 1.55rem 1.75rem 1.2rem;
        background: #fff;
    }

    .mobile-drawer-brand > a {
        display: grid !important;
        gap: .05rem;
        color: #4b3488 !important;
        text-decoration: none;
    }

    .mobile-drawer-brand > a strong {
        font-size: 2rem;
        line-height: 1;
        letter-spacing: -.025em;
    }

    .mobile-drawer-brand > a span {
        font-size: 1rem;
        letter-spacing: .02em;
    }

    .mobile-drawer-brand p {
        margin: 2.2rem 0 0;
        color: #111;
        font-size: 1.35rem;
    }

    .module-row {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: .12rem !important;
        margin: 0 !important;
        padding: 0 1.25rem;
    }

    .module-row > a {
        display: grid !important;
        grid-template-columns: 2rem 1fr;
        gap: .7rem;
        min-height: 52px !important;
        align-items: center;
        width: 100%;
        padding: .75rem .85rem !important;
        border-radius: .55rem !important;
        color: #858389 !important;
        background: transparent !important;
        font-size: 1.03rem !important;
        font-weight: 400 !important;
    }

    .module-row > a[aria-current="page"] {
        color: #f47750 !important;
        background: #fff3ee !important;
    }

    .module-icon {
        width: 1.4rem;
        color: #858389;
        font-size: 1rem;
    }

    .module-row > a[aria-current="page"] .module-icon {
        color: #f47750;
    }

    .mobile-drawer-actions {
        display: grid;
        gap: .8rem;
        padding: 1.2rem 1.25rem 0;
    }

    .drawer-action {
        display: flex !important;
        min-height: 48px;
        align-items: center;
        justify-content: center;
        border-radius: .6rem;
        font-size: 1.05rem;
        text-decoration: none;
    }

    .drawer-primary {
        color: #fff !important;
        background: #f47750 !important;
    }

    .drawer-primary:first-child {
        justify-content: space-between;
        padding-left: 2.5rem;
        padding-right: 1.1rem;
    }

    .drawer-primary:first-child span:last-child {
        display: grid;
        width: 3.2rem;
        align-self: stretch;
        place-items: center;
        margin: -.01rem -.01rem -.01rem 0;
        border-left: 1px solid rgba(255,255,255,.2);
        background: rgba(0,0,0,.06);
    }

    .drawer-outline {
        border: 1px solid #f47750;
        color: #f47750 !important;
        background: #fff !important;
    }

    .drawer-account-links {
        display: grid;
        gap: .2rem;
        margin-top: 1.4rem;
        padding-top: .6rem;
        border-top: 1px solid #f0eef1;
    }

    .drawer-account-links a,
    .drawer-account-links button {
        display: flex;
        min-height: 48px;
        align-items: center;
        gap: .75rem;
        padding: .65rem .7rem;
        border: 0;
        color: #77757a !important;
        background: transparent !important;
        box-shadow: none !important;
        font-size: 1rem;
        font-weight: 400;
        text-align: left;
        text-decoration: none;
    }

    .drawer-account-links a span,
    .drawer-account-links button span {
        width: 1.4rem;
        text-align: center;
    }
}

/* Flat patient/insurance card matching the Palmetto order reference. */
body[data-page="order-detail"].order-palmetto-canvas #workspace-notice.success {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-patient-heading {
    position: relative;
    display: grid;
    place-items: center;
    gap: .35rem;
    margin: 0 0 1.15rem;
    padding: .25rem 2.5rem .8rem;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-patient-name {
    margin: 0;
    color: #333236;
    font-size: 1.35rem;
    font-weight: 650;
    text-align: center;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-change-patient {
    min-height: 0;
    padding: .15rem .35rem;
    border: 0;
    background: transparent;
    color: #f47750;
    box-shadow: none;
    font-size: .82rem;
    font-weight: 500;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-change-patient:hover,
body[data-page="order-detail"].order-palmetto-canvas .palmetto-change-patient:focus-visible {
    background: transparent;
    color: #df6540;
    text-decoration: underline;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-patient-summary,
body[data-page="order-detail"].order-palmetto-canvas .palmetto-insurance-summary,
body[data-page="order-detail"].order-palmetto-canvas .palmetto-coverage-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .2rem 2.25rem;
    margin: 0;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-patient-field {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: .45rem;
    align-items: baseline;
    min-height: 46px;
    padding: .55rem 0;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-patient-field dt {
    color: #5d5b60;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-patient-field dd {
    margin: 0;
    color: #f47750;
    font-weight: 600;
    text-align: left;
    overflow-wrap: anywhere;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-insurance-heading {
    margin: 1.1rem 0 .45rem;
    color: #39373d;
    font-size: 1rem;
    font-weight: 650;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-coverage-summary {
    margin-top: .8rem;
    padding-top: .75rem;
    border-top: 1px solid #efeff0;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-sell-type dt {
    color: #33225a;
    font-weight: 700;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-sell-type dd {
    color: #8b878d;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-patient-picker {
    width: min(30rem, calc(100vw - 2rem));
}

@media (max-width: 760px) {
    body[data-page="order-detail"].order-palmetto-canvas .palmetto-patient-heading {
        padding-inline: .5rem;
    }

    body[data-page="order-detail"].order-palmetto-canvas .palmetto-patient-name {
        font-size: 1.45rem;
    }

    body[data-page="order-detail"].order-palmetto-canvas .palmetto-patient-summary,
    body[data-page="order-detail"].order-palmetto-canvas .palmetto-insurance-summary,
    body[data-page="order-detail"].order-palmetto-canvas .palmetto-coverage-summary {
        grid-template-columns: 1fr;
        gap: .05rem;
    }

    body[data-page="order-detail"].order-palmetto-canvas .palmetto-patient-field {
        grid-template-columns: minmax(7.2rem, .8fr) minmax(0, 1.25fr);
        gap: .75rem;
        min-height: 58px;
        padding: .7rem 0;
    }

    body[data-page="order-detail"].order-palmetto-canvas .palmetto-patient-field dd {
        text-align: right;
    }
}

@media (max-width: 720px) {
    .palmetto-module-nav {
        height: 100dvh !important;
        min-height: 100dvh !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
    }
}

@media (max-width: 720px) {
    body.mobile-menu-open .site-header {
        z-index: 140 !important;
    }

    body.mobile-menu-open::before {
        z-index: 90 !important;
    }

    body.mobile-menu-open .palmetto-module-nav {
        z-index: 150 !important;
        width: min(72vw, 575px) !important;
        background: #fff !important;
    }

    body.mobile-menu-open .equipment-primary-row .filter-trigger,
    body.mobile-menu-open .equipment-primary-row .equipment-add-order,
    body.mobile-menu-open .equipment-primary-row .equipment-print {
        visibility: hidden;
    }
}

/* Palmetto product-card hierarchy. */
body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-card {
    padding: 1.25rem 1.35rem !important;
    border: 0 !important;
    background: #fff;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-identity h3 {
    margin: 0 0 .35rem;
    color: #3f3d42;
    font-size: 1.05rem;
    font-weight: 650;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-metadata {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem .9rem;
    margin: 0 0 .45rem;
    color: #5d5b60;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-metadata strong {
    color: #f47750;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-status {
    display: inline-flex;
    padding: .2rem .55rem;
    border-radius: 999px;
    color: #f47750;
    background: #fff0ea;
    font-size: .78rem;
    font-weight: 650;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-header-actions button,
body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-actions button {
    border-radius: 999px;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-assignments {
    margin: .9rem 0 .7rem;
    color: #5a585d;
    word-spacing: .3rem;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-financials {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: end;
    margin: .6rem 0 1rem;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-financial {
    display: grid;
    gap: .15rem;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-financial span {
    color: #3f3d42;
    font-size: .8rem;
    font-weight: 600;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-financial strong {
    color: #2e2d31;
    font-size: 1rem;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-financial.balance span,
body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-financial.balance strong {
    color: #f45f55;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .8rem 2rem;
    margin: 1rem 0;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-details > div {
    display: grid;
    grid-template-columns: minmax(8rem, .75fr) minmax(0, 1fr);
    align-items: baseline;
    gap: .65rem;
    padding: .55rem 0;
    border-bottom: 1px solid #ececef;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-details dt {
    color: #5c5a60;
    font-weight: 500;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-details dd {
    margin: 0;
    color: #55535a;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-options-section {
    margin-top: 1.2rem;
    padding: 1rem 0 0 !important;
    border: 0 !important;
    border-top: 1px solid #efeff0 !important;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-options-section h4 {
    margin: 0 0 .8rem;
    color: #353338;
    font-size: 1.2rem;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-option-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: min(34rem, 100%);
    margin: .2rem auto 1rem;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-option-search label {
    gap: .2rem;
    font-weight: 500;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-option-search input {
    min-height: 40px;
    padding: .35rem 2rem .35rem 0;
    border: 0;
    border-bottom: 1px solid #aaa9ad;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-option-search button {
    width: 38px;
    min-height: 38px;
    margin-left: -38px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #f47750;
    box-shadow: none;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-option-card {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: .9rem 0;
    border-bottom: 1px solid #efeff0;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-option-card h5 {
    margin: 0 0 .2rem;
}

@media (max-width: 760px) {
    body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-card {
        padding: 1.25rem !important;
    }

    body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-header {
        display: block;
    }

    body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-header-actions {
        margin-top: .75rem;
    }

    body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-financials {
        display: grid;
        grid-template-columns: 1fr;
        gap: .7rem;
        margin: 1rem 0;
    }

    body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-financial {
        grid-template-columns: 1fr auto;
        align-items: baseline;
    }

    body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-details {
        grid-template-columns: 1fr;
        gap: .3rem;
    }

    body[data-page="order-detail"].order-palmetto-canvas .palmetto-option-card {
        display: block;
    }

    body[data-page="order-detail"].order-palmetto-canvas .palmetto-option-card .actions {
        margin-top: .65rem;
    }
}

/* Distinct module pages backed by shared, tested implementations. */
body[data-module-mode="claim-details"] #purchases-section,
body[data-module-mode="claim-details"] #documents-section,
body[data-module-mode="claim-details-closed"] #purchases-section,
body[data-module-mode="claim-details-closed"] #documents-section {
    display: none;
}

body[data-module-mode="order-pos"] #claims-section,
body[data-module-mode="order-pos"] #documents-section {
    display: none;
}

body[data-module-mode="doctor-provider"] #product-catalog,
body[data-module-mode="doctor-provider"] #insurance-directory,
body[data-module-mode="doctor-provider"] #inventory-directory,
body[data-module-mode="doctor-provider"] #fee-schedules {
    display: none;
}

body[data-module-mode="inventory"] #product-catalog,
body[data-module-mode="inventory"] #insurance-directory,
body[data-module-mode="inventory"] #provider-directory,
body[data-module-mode="inventory"] #fee-schedules {
    display: none;
}

body[data-module-mode="reports"] #commissions-section {
    display: none;
}

body[data-module-mode="commissions"] #report-summary-section,
body[data-module-mode="commissions"] #aging-section,
body[data-module-mode="commissions"] #insurer-report-section {
    display: none;
}

body[data-module-mode="global-uploads"] #remit-history-section {
    display: none;
}

body[data-module-mode="medicaid-remit"] #upload-create-section,
body[data-module-mode="medicaid-remit"] #upload-history-section {
    display: none;
}

body[data-module-mode="calendar"] #rentals-section {
    display: none;
}

body[data-module-mode="rentals"] #calendar-section,
body[data-module-mode="rentals"] #appointment-dialog {
    display: none;
}

body[data-module-mode] main {
    max-width: 92rem;
}

/* Dedicated module pages split from PPv2's shared controllers. */
body[data-module] {
    background: #f1f2f4;
    font-family: Poppins, Roboto, "Helvetica Neue", Arial, sans-serif;
}

body[data-module] main {
    width: min(calc(100% - 2rem), 1320px);
    padding-top: 1rem;
}

body[data-module] .hero,
.module-page-heading {
    margin: 0 0 .9rem;
    padding: .45rem 0 .65rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

body[data-module] .hero .eyebrow {
    display: none;
}

body[data-module] .hero h1,
.module-page-heading h1 {
    margin: 0 0 .2rem;
    color: #413f44;
    font-size: 1.35rem;
    font-weight: 600;
}

body[data-module] .hero p,
.module-page-heading p {
    margin: 0;
    color: #77757a;
    font-size: .86rem;
}

body[data-module] .panel,
body[data-module] .card {
    border: 0;
    border-radius: .35rem;
    background: #fff;
    box-shadow: 0 5px 18px rgba(38,33,49,.035);
}

body[data-module] .section-heading h2,
body[data-module] .actions h2 {
    color: #3e3c42;
    font-size: 1.05rem;
    font-weight: 600;
}

body[data-module] button:not(.menu-toggle):not(.account-toggle),
body[data-module] .button {
    border-radius: 999px;
}

body[data-module] table thead th {
    color: #3d3b40;
    background: #fff;
    font-size: .75rem;
}

body[data-module] table tbody td {
    border-top: 1px solid #ededee;
    color: #59575c;
}

/* Claim Details */
body[data-module="claims"] #purchases-section,
body[data-module="claims"] #documents-section {
    display: none !important;
}

/* PO's */
body[data-module="purchases"] #claims-section,
body[data-module="purchases"] #documents-section {
    display: none !important;
}

/* Doctor / Provider */
body[data-module="providers"] #product-catalog,
body[data-module="providers"] #insurance-directory,
body[data-module="providers"] #inventory-directory,
body[data-module="providers"] #fee-schedules {
    display: none !important;
}

/* Inventory */
body[data-module="inventory"] #product-catalog,
body[data-module="inventory"] #insurance-directory,
body[data-module="inventory"] #provider-directory,
body[data-module="inventory"] #fee-schedules {
    display: none !important;
}

/* Upcoming rentals / Calendar */
body[data-module="rentals"] #calendar-section,
body[data-module="rentals"] #appointment-dialog {
    display: none !important;
}
body[data-module="calendar"] #rentals-section {
    display: none !important;
}

/* Reports / Commissions */
body[data-module="reports"] #commissions-section {
    display: none !important;
}
body[data-module="commissions"] .report-summary,
body[data-module="commissions"] #aging-section,
body[data-module="commissions"] #insurer-report-section {
    display: none !important;
}

/* Uploads / Medicaid remit */
body[data-module="uploads"] #remit-history-section {
    display: none !important;
}
body[data-module="remits"] #upload-create-section,
body[data-module="remits"] #upload-history-section {
    display: none !important;
}

@media (max-width: 720px) {
    body[data-module] main {
        width: 100%;
        padding: .75rem .5rem 5rem;
    }

    body[data-module] .hero,
    .module-page-heading {
        padding-inline: .5rem;
    }

    body[data-module] .panel,
    body[data-module] .card {
        padding: 1rem;
        border-radius: .7rem;
    }

    body[data-module] .table-wrap {
        overflow-x: auto;
    }
}

/* Keep module pages usable on narrower desktop/tablet widths. */
@media (min-width: 721px) {
    .module-row {
        flex-wrap: wrap !important;
    }
    .palmetto-module-nav {
        overflow-x: clip !important;
    }
}

.record-link {
    color: #f47750;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.record-link:hover,
.record-link:focus-visible {
    color: #d85e3b;
}

/* Context-specific module handoff and linked records. */
body[data-module-mode="claim-details"][data-context-section="documents"] #claims-section,
body[data-module-mode="claim-details"][data-context-section="documents"] #purchases-section {
    display: none !important;
}
body[data-module-mode="claim-details"][data-context-section="documents"] #documents-section {
    display: block !important;
}

.record-link {
    color: #f47750;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: .15rem;
}

body[data-module] {
    background: #f1f2f4;
    font-family: Poppins, Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Palmetto mobile calendar reference layout. */
.calendar-filter-toggle {
    display: none;
}

@media (max-width: 720px) {
    body[data-module="calendar"] {
        background: #fff;
    }

    body[data-module="calendar"] main {
        padding: 0 0 5rem;
        background: #fff;
    }

    body[data-module="calendar"] .module-page-heading {
        display: none;
    }

    body[data-module="calendar"] #calendar-section {
        position: relative;
        width: 100%;
        margin: 0;
        padding: 0;
        overflow: visible;
        border: 0;
        border-radius: 0;
        background: #fff;
        box-shadow: none;
    }

    body[data-module="calendar"] .calendar-filter-toggle {
        position: absolute;
        z-index: 35;
        top: 1.15rem;
        left: .75rem;
        display: grid;
        width: 38px;
        min-height: 38px;
        place-items: center;
        padding: 0;
        border: 0;
        color: #b8b8bb;
        background: transparent;
        box-shadow: none;
        font-size: 1.45rem;
    }

    body[data-module="calendar"] .calendar-toolbar {
        position: relative;
        display: block;
        height: 74px;
        margin: 0;
        padding: 0;
        border-bottom: 1px solid #dedee0;
        background: #fff;
    }

    body[data-module="calendar"] .calendar-toolbar h2 {
        display: grid;
        height: 74px;
        place-items: center;
        margin: 0;
        color: #f47750;
        font-size: 1.35rem;
        font-weight: 400;
        letter-spacing: 0;
    }

    body[data-module="calendar"] .calendar-toolbar > .button-row:first-child {
        display: block;
    }

    body[data-module="calendar"] #calendar-prev,
    body[data-module="calendar"] #calendar-next,
    body[data-module="calendar"] #calendar-today {
        position: absolute;
        z-index: 4;
        top: 17px;
        min-height: 40px;
        padding: 0;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    body[data-module="calendar"] #calendar-prev,
    body[data-module="calendar"] #calendar-next {
        width: 34px;
        color: transparent;
        font-size: 0;
    }

    body[data-module="calendar"] #calendar-prev {
        left: 21%;
    }
    body[data-module="calendar"] #calendar-prev::before {
        content: "‹";
        color: #c9c9cb;
        font-size: 2.4rem;
        line-height: .8;
    }

    body[data-module="calendar"] #calendar-next {
        left: 58%;
    }
    body[data-module="calendar"] #calendar-next::before {
        content: "›";
        color: #c9c9cb;
        font-size: 2.4rem;
        line-height: .8;
    }

    body[data-module="calendar"] #calendar-today {
        right: 1rem;
        color: #18171a;
        font-size: 1.05rem;
        font-weight: 400;
    }

    body[data-module="calendar"] .calendar-toolbar > .button-row:last-child {
        display: contents;
    }

    body[data-module="calendar"] #print-calendar {
        display: none;
    }

    body[data-module="calendar"] #calendar-add-event {
        position: fixed;
        z-index: 70;
        right: 1.15rem;
        bottom: 5.2rem;
        display: grid;
        width: 56px;
        height: 56px;
        min-height: 56px;
        place-items: center;
        padding: 0;
        border: 0;
        border-radius: 50%;
        color: transparent;
        background: #2f146c;
        box-shadow: 0 12px 26px rgba(47,20,108,.22);
        font-size: 0;
    }

    body[data-module="calendar"] #calendar-add-event::after {
        content: "+";
        color: #fff;
        font-size: 2rem;
        font-weight: 300;
        line-height: 1;
    }

    body[data-module="calendar"] #appointment-filters {
        position: absolute;
        z-index: 30;
        top: 66px;
        right: .75rem;
        left: .75rem;
        display: none;
        grid-template-columns: 1fr;
        gap: .65rem;
        padding: 1rem;
        border-radius: .65rem;
        background: #fff;
        box-shadow: 0 16px 34px rgba(20,20,24,.16);
    }

    body[data-module="calendar"] #appointment-filters[data-mobile-open="true"] {
        display: grid;
    }

    body[data-module="calendar"] #calendar-notice {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
    }

    body[data-module="calendar"] .calendar-weekdays,
    body[data-module="calendar"] .calendar-grid {
        width: 100%;
        min-width: 0 !important;
        gap: 1px;
        border-right: 0;
        border-left: 0;
        border-radius: 0;
        background: #dedee0;
    }

    body[data-module="calendar"] .calendar-weekdays > * {
        min-height: 40px;
        padding: .55rem .1rem;
        color: #171619;
        background: #fff;
        font-size: 1rem;
        font-weight: 400;
        letter-spacing: 0;
        text-transform: none;
    }

    body[data-module="calendar"] .calendar-weekdays > *:nth-child(6) {
        color: #f47750;
    }

    body[data-module="calendar"] .calendar-day {
        min-width: 0;
        min-height: 210px;
        padding: .25rem .2rem;
        background: #fff;
    }

    body[data-module="calendar"] .calendar-day.is-outside {
        background: #fff;
        opacity: .36;
    }

    body[data-module="calendar"] .calendar-day.is-today {
        background: #f3f3f3;
        box-shadow: none;
    }

    body[data-module="calendar"] .calendar-date-number,
    body[data-module="calendar"] .calendar-day.is-today .calendar-date-number {
        width: auto;
        height: auto;
        margin: 0 0 .35rem;
        padding: .15rem .25rem;
        border-radius: 0;
        color: #f47750;
        background: #f4f6f8;
        font-size: .82rem;
        font-weight: 400;
    }

    body[data-module="calendar"] .calendar-event,
    body[data-module="calendar"] button.calendar-event {
        width: 16px;
        height: 16px;
        min-height: 16px;
        margin: .45rem auto;
        padding: 0;
        overflow: hidden;
        border: 0;
        border-radius: 50%;
        color: transparent;
        background: #202124;
        box-shadow: none;
        font-size: 0;
        text-indent: -999px;
    }

    body[data-module="calendar"] .calendar-appointment,
    body[data-module="calendar"] button.calendar-appointment {
        background: #59cb78;
    }
}

@media (max-width: 720px) {
    body[data-module="calendar"] .calendar-day:focus-within {
        outline: 0;
    }
}

.module-subnav {
    display: flex;
    gap: .6rem;
    margin: 0 0 .85rem;
    padding: 0;
}

.module-subnav a {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    padding: .45rem .85rem;
    border-radius: 999px;
    color: #4d306e;
    background: #fff;
    text-decoration: none;
    font-size: .85rem;
    font-weight: 600;
}

.module-subnav a[aria-current="page"],
.module-subnav a:hover {
    color: #fff;
    background: #f47750;
}

body[data-module="uploads"] #upload-create-section {
    display: none !important;
}

body[data-module="upload-file"] #upload-history-section,
body[data-module="upload-file"] #remit-history-section,
body[data-module="remit-upload"] #upload-history-section,
body[data-module="remit-upload"] #remit-history-section {
    display: none !important;
}

body[data-module="remit-upload"] #upload-create-section {
    display: block !important;
}

@media (max-width: 720px) {
    .module-subnav {
        padding: 0 .5rem;
        overflow-x: auto;
    }
}

/* Palmetto patient directory and patient documents parity. */
body[data-page="patients"],
body[data-page="patient-documents"] {
    background: #f1f2f4;
    font-family: Poppins, Roboto, "Helvetica Neue", Arial, sans-serif;
}

.patients-directory-page {
    width: min(100% - 2rem, 1380px);
    padding-top: 1rem;
}

.patient-directory-toolbar {
    display: grid;
    grid-template-columns: auto minmax(20rem, 1fr) auto;
    gap: 1rem;
    align-items: center;
    margin-bottom: .9rem;
}

.patient-directory-toolbar #patient-create {
    min-width: 9rem;
    border-radius: 999px;
    background: #f47750;
    color: #fff;
}

.patient-directory-toolbar #patient-search input {
    width: 100%;
    border: 0;
    border-bottom: 1px solid #b8b8bc;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.patient-hide-toggle {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    color: #5e5c62;
    white-space: nowrap;
}

.patient-directory-panel {
    background: #fff;
}

.patient-directory-table {
    min-width: 1450px;
    border-collapse: collapse;
    font-size: .78rem;
}

.patient-directory-table th,
.patient-directory-table td {
    padding: .8rem .5rem;
    border-bottom: 1px solid #ededee;
    vertical-align: top;
    text-align: left;
}

.patient-directory-table th {
    color: #343338;
    font-weight: 700;
}

.patient-doc-badge {
    display: inline-block;
    margin: 0 .25rem .2rem 0;
    color: #b5b5b8;
    font-weight: 650;
    text-decoration: underline;
}

.patient-row-menu {
    position: relative;
}

.patient-row-menu > summary {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 50%;
    color: #f47750;
    cursor: pointer;
    list-style: none;
    font-size: 1.25rem;
}

.patient-row-menu > summary::-webkit-details-marker {
    display: none;
}

.patient-row-menu-popover {
    position: absolute;
    z-index: 50;
    top: calc(100% + .25rem);
    right: 0;
    display: grid;
    min-width: 10rem;
    padding: .35rem;
    border: 1px solid #ecebed;
    border-radius: .45rem;
    background: #fff;
    box-shadow: 0 10px 28px rgba(20,20,24,.15);
}

.patient-row-menu-popover :is(a, button) {
    display: flex;
    min-height: 38px;
    align-items: center;
    padding: .45rem .65rem;
    border: 0;
    border-radius: .3rem;
    color: #55545a;
    background: transparent;
    box-shadow: none;
    text-align: left;
    text-decoration: none;
    font-size: .86rem;
    font-weight: 500;
}

.patient-row-menu-popover :is(a, button):hover {
    color: #f47750;
    background: #fff5f0;
}

.patient-documents-page {
    width: min(100% - 2rem, 1180px);
    padding-top: 1rem;
}

.patient-document-groups {
    display: grid;
    gap: 1rem;
}

.patient-document-order {
    overflow: hidden;
    border-radius: .45rem;
    background: #fff;
}

.patient-document-order-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    cursor: pointer;
    list-style: none;
}

.patient-document-order-summary > div {
    display: grid;
    gap: .15rem;
}

.patient-document-order-summary > div:last-child {
    text-align: right;
}

.patient-document-order-summary a {
    color: #f47750;
    font-weight: 600;
}

@media (max-width: 720px) {
    .patients-directory-page,
    .patient-documents-page {
        width: 100%;
        padding: .8rem 0 5rem;
    }

    .patient-directory-toolbar {
        grid-template-columns: 1fr;
        padding: 0 1rem;
    }

    .patient-directory-toolbar #patient-create {
        width: max-content;
    }

    .patient-hide-toggle {
        white-space: normal;
    }

    .patient-directory-panel {
        overflow-x: auto;
    }

    .patient-document-order {
        margin-inline: .75rem;
    }
}

.patient-archived-marker {
    color: #9b989f;
    font-size: .72rem;
    font-weight: 600;
}

/* Palmetto A/R report navigation and views. */
.report-module-page {
    width: min(100% - 2rem, 1320px);
    padding-top: 1rem;
}

.report-heading {
    margin-bottom: .8rem;
}

.report-view {
    margin: 0;
    border-radius: .35rem;
    background: #fff;
}

body[data-report-view="summary"] .report-view-insurance,
body[data-report-view="summary"] .report-view-patient,
body[data-report-view="insurance"] .report-view-summary,
body[data-report-view="insurance"] .report-view-patient,
body[data-report-view="patient"] .report-view-summary,
body[data-report-view="patient"] .report-view-insurance,
body[data-report-view="commissions"] .report-view {
    display: none !important;
}

.report-filter-row {
    display: grid;
    grid-template-columns: minmax(16rem, 1fr) 11rem 11rem auto auto;
    gap: .7rem;
    align-items: end;
    margin-bottom: 1rem;
}

.report-filter-row input {
    border: 0;
    border-bottom: 1px solid #c6c5c9;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.report-reference-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .86rem;
}

.report-reference-table th,
.report-reference-table td {
    padding: .8rem .65rem;
    border-bottom: 1px solid #ececef;
    text-align: left;
}

.report-reference-table th {
    color: #3c3a40;
    font-weight: 700;
}

@media (max-width: 720px) {
    .report-module-page {
        width: 100%;
        padding: .75rem 0 4rem;
    }

    .report-heading,
    .report-view {
        margin-inline: .65rem;
    }

    .report-filter-row {
        grid-template-columns: 1fr 1fr;
    }

    .report-filter-row label:first-child {
        grid-column: 1 / -1;
    }

    .report-reference-table {
        min-width: 720px;
    }
}

/* Palmetto Upcoming Rentals + Commissions Report parity. */
body[data-module="rentals"],
body[data-module="commissions"] {
    background: #f1f2f4;
    font-family: Poppins, Roboto, "Helvetica Neue", Arial, sans-serif;
}

body[data-module="rentals"] main,
.commission-report-page {
    width: min(100% - 2rem, 1380px);
    padding-top: 1rem;
}

body[data-module="rentals"] #rentals-section,
.commissions-reference-panel {
    margin: 0;
    border-radius: .35rem;
    background: #fff;
}

body[data-module="rentals"] #rental-filters {
    display: grid;
    grid-template-columns: 12rem 11rem 11rem auto auto;
    gap: .7rem;
    align-items: end;
}

body[data-module="rentals"] #rental-filters input,
body[data-module="rentals"] #rental-filters select,
.commission-filter-row input {
    border: 0;
    border-bottom: 1px solid #c7c6ca;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

body[data-module="rentals"] #rentals-section table,
.commission-reference-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .8rem;
}

body[data-module="rentals"] #rentals-section th,
body[data-module="rentals"] #rentals-section td,
.commission-reference-table th,
.commission-reference-table td {
    padding: .8rem .55rem;
    border-bottom: 1px solid #ececef;
    text-align: left;
    vertical-align: top;
}

body[data-module="rentals"] #rentals-section th,
.commission-reference-table th {
    color: #3c3a40;
    font-weight: 700;
}

body[data-module="rentals"] #new-rental,
body[data-module="rentals"] #print-rentals,
.commission-filter-row > button[type="submit"],
.commission-filter-row > #print-commissions {
    border-radius: 999px;
    background: #f47750;
    color: #fff;
}

.commission-filter-row {
    display: grid;
    grid-template-columns: minmax(18rem, 1fr) auto 11rem 11rem auto auto auto;
    gap: .7rem;
    align-items: end;
    margin-bottom: 1rem;
}

.commission-paid-toggle {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    min-height: 42px;
    color: #55545a;
    white-space: nowrap;
}

.commission-paid-toggle input {
    width: auto;
    border: initial;
}

.commission-totals-reference {
    margin: .5rem 0 1rem;
    border: 1px solid #ecebed;
    border-radius: .4rem;
    background: #fff;
}

.commission-totals-reference > summary {
    padding: .75rem 1rem;
    cursor: pointer;
    color: #4b3488;
    font-weight: 700;
}

.commission-total-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    background: #ecebed;
}

.commission-total-grid article {
    display: grid;
    gap: .3rem;
    padding: 1rem;
    background: #fff;
}

.commission-total-grid span {
    color: #646268;
    font-size: .82rem;
}

.commission-total-grid strong {
    font-size: 1.15rem;
}

.commission-doc-badges {
    color: #b4b3b7;
    font-weight: 700;
    text-decoration: underline;
}

@media (max-width: 720px) {
    body[data-module="rentals"] main,
    .commission-report-page {
        width: 100%;
        padding: .75rem 0 5rem;
    }

    body[data-module="rentals"] #rentals-section,
    .commissions-reference-panel {
        margin-inline: .65rem;
    }

    body[data-module="rentals"] #rental-filters,
    .commission-filter-row {
        grid-template-columns: 1fr 1fr;
    }

    body[data-module="rentals"] #rental-filters input[type="hidden"],
    .commission-filter-row input[type="hidden"] {
        display: none;
    }

    .commission-search,
    .commission-paid-toggle {
        grid-column: 1 / -1;
    }

    .commission-total-grid {
        grid-template-columns: 1fr;
    }

    body[data-module="rentals"] #rentals-section table,
    .commission-reference-table {
        min-width: 1080px;
    }
}

/* Order detail screenshot parity refinement. */
body[data-page="order-detail"].order-palmetto-canvas .palmetto-patient-toggle {
    position: absolute;
    top: .25rem;
    right: .15rem;
    display: grid;
    width: 38px;
    min-height: 38px;
    place-items: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: #5d5b60;
    box-shadow: none;
    font-size: 1.45rem;
    line-height: 1;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-patient-toggle:hover,
body[data-page="order-detail"].order-palmetto-canvas .palmetto-patient-toggle:focus-visible {
    background: transparent;
    color: #3f3d42;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-patient-details[hidden] {
    display: none !important;
}

@media (max-width: 760px) {
    body[data-page="order-detail"].order-palmetto-canvas .workspace-mobile-actions {
        position: sticky;
        top: 92px;
        min-height: 72px;
        margin: 0;
        padding: .8rem .8rem;
        background: rgba(255,255,255,.96);
        border-bottom: 1px solid #eeeeef;
    }

    body[data-page="order-detail"].order-palmetto-canvas .workspace-mobile-add-product {
        min-width: 9rem;
        min-height: 46px;
        padding: .65rem 1.35rem;
        font-size: 1rem;
    }

    body[data-page="order-detail"].order-palmetto-canvas .workspace-mobile-menu-toggle {
        width: 46px;
        height: 46px;
    }

    body[data-page="order-detail"].order-palmetto-canvas .workspace-mobile-order-summary {
        display: block;
        padding: 1.1rem .95rem .5rem;
        background: #f1f2f4;
    }

    body[data-page="order-detail"].order-palmetto-canvas .workspace-mobile-summary-row {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 1.25rem;
        min-height: 58px;
        align-items: center;
        padding: .65rem .15rem;
    }

    body[data-page="order-detail"].order-palmetto-canvas .workspace-mobile-summary-label {
        color: #59575d;
        font-size: 1rem;
        font-weight: 400;
    }

    body[data-page="order-detail"].order-palmetto-canvas .workspace-mobile-summary-value {
        color: #4d4b50;
        font-size: 1.05rem;
        font-weight: 700;
    }

    body[data-page="order-detail"].order-palmetto-canvas #workspace-panel-patient {
        width: calc(100% - .7rem);
        margin: .25rem auto 1rem;
        padding: 0;
        overflow: hidden;
        border-radius: .85rem;
        background: #fff;
    }

    body[data-page="order-detail"].order-palmetto-canvas .palmetto-patient-heading {
        min-height: 150px;
        margin: 0;
        padding: 1.8rem 3rem 1.2rem;
        background: #fff;
    }

    body[data-page="order-detail"].order-palmetto-canvas .palmetto-patient-name {
        font-size: 1.55rem;
        line-height: 1.2;
    }

    body[data-page="order-detail"].order-palmetto-canvas .palmetto-change-patient {
        margin-top: .25rem;
        font-size: .9rem;
    }

    body[data-page="order-detail"].order-palmetto-canvas .palmetto-patient-toggle {
        top: 2.05rem;
        right: 1rem;
        font-size: 1.55rem;
    }

    body[data-page="order-detail"].order-palmetto-canvas .palmetto-patient-details {
        padding: .9rem 1.2rem 1.35rem;
        background: #fff;
    }

    body[data-page="order-detail"].order-palmetto-canvas .palmetto-patient-summary,
    body[data-page="order-detail"].order-palmetto-canvas .palmetto-insurance-summary,
    body[data-page="order-detail"].order-palmetto-canvas .palmetto-coverage-summary {
        gap: 0;
    }

    body[data-page="order-detail"].order-palmetto-canvas .palmetto-patient-field {
        grid-template-columns: minmax(8rem, .9fr) minmax(0, 1.3fr);
        min-height: 68px;
        align-items: center;
        padding: .85rem 0;
    }

    body[data-page="order-detail"].order-palmetto-canvas .palmetto-patient-field dt {
        font-size: .98rem;
    }

    body[data-page="order-detail"].order-palmetto-canvas .palmetto-patient-field dd {
        color: #f47750;
        font-size: .98rem;
        font-weight: 650;
        line-height: 1.35;
        text-align: right;
    }

    body[data-page="order-detail"].order-palmetto-canvas .palmetto-insurance-heading {
        margin: 1.4rem 0 .35rem;
        color: #3a285f;
        font-size: 1.05rem;
    }

    body[data-page="order-detail"].order-palmetto-canvas .workspace-product-search {
        width: calc(100% - 1rem);
        margin: 1rem auto 1.2rem;
        padding: .4rem .75rem .85rem;
        border-radius: .65rem;
        background: #fff;
    }

    body[data-page="order-detail"].order-palmetto-canvas #workspace-products {
        gap: 1rem;
        padding: 0 .35rem;
    }

    body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-card {
        border-radius: .7rem !important;
        box-shadow: 0 8px 22px rgba(33,31,38,.045) !important;
    }

    body[data-page="order-detail"].order-palmetto-canvas .workspace-mobile-bottom-bar {
        min-height: 68px;
        align-items: center;
        background: rgba(255,255,255,.98);
    }

    body[data-page="order-detail"].order-palmetto-canvas .workspace-mobile-bottom-secondary,
    body[data-page="order-detail"].order-palmetto-canvas .workspace-mobile-bottom-primary {
        min-height: 48px;
        border-radius: .55rem;
        font-size: 1rem;
    }
}

/* Product identity block matching the Palmetto reference hierarchy. */
body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-media {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: .9rem;
    align-items: start;
    min-width: 0;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-thumb {
    display: grid;
    width: 54px;
    height: 54px;
    place-items: center;
    overflow: hidden;
    border-radius: .35rem;
    color: #4b3488;
    background:
        linear-gradient(135deg, #eeeaf5 0%, #f8f6fb 55%, #e6e0ef 100%);
    font-size: 1.2rem;
    font-weight: 700;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-header-actions {
    flex: 0 0 auto;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-header-actions .secondary {
    min-height: 34px;
    padding: .35rem .8rem;
    border: 1px solid #f47750;
    border-radius: 999px;
    color: #f47750;
    background: #fff;
    box-shadow: none;
    font-size: .78rem;
}

@media (max-width: 760px) {
    body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-media {
        grid-template-columns: 64px minmax(0, 1fr);
        gap: .85rem;
    }

    body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-thumb {
        width: 64px;
        height: 64px;
        font-size: 1.35rem;
    }

    body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: .75rem;
        align-items: start;
    }

    body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-header-actions {
        margin: 0;
    }
}

@media (min-width: 761px) {
    body[data-page="order-detail"] .workspace-mobile-actions,
    body[data-page="order-detail"] .workspace-mobile-order-summary,
    body[data-page="order-detail"] .workspace-mobile-bottom-bar,
    body[data-page="order-detail"] .workspace-mobile-section-menu {
        display: none !important;
    }
}

@media print {
    body.printing-order-workspace #workspace-panel-overview {
        display: none !important;
    }

    body.printing-order-workspace [data-workspace-panel]:not(#workspace-panel-overview),
    body.printing-order-workspace [data-workspace-panel]:not(#workspace-panel-overview)[hidden] {
        display: block !important;
    }
}

/* Palmetto PO + Claim operational list parity. */
body[data-module="purchases"],
body[data-module="claims"] {
    background: #f1f2f4;
    font-family: Poppins, Roboto, "Helvetica Neue", Arial, sans-serif;
}

body[data-module="purchases"] main,
body[data-module="claims"] main {
    width: min(100% - 2rem, 1380px);
    padding-top: 1rem;
}

body[data-module="purchases"] .hero,
body[data-module="claims"] .hero {
    margin: 0 0 .75rem;
    padding: 0;
    background: transparent;
    box-shadow: none;
}

body[data-module="purchases"] .hero .eyebrow,
body[data-module="claims"] .hero .eyebrow {
    display: none;
}

body[data-module="purchases"] .hero h1,
body[data-module="claims"] .hero h1 {
    margin: 0;
    color: #3d3b40;
    font-size: 1.35rem;
}

body[data-module="purchases"] #purchases-section,
body[data-module="claims"] #claims-section {
    margin: 0;
    padding: 1rem;
    border: 0;
    border-radius: .35rem;
    background: #fff;
    box-shadow: none;
}

.purchase-reference-filters,
.claim-reference-filters {
    display: grid;
    grid-template-columns: minmax(17rem, 1fr) 11rem 13rem 11rem 11rem auto;
    gap: .75rem;
    align-items: end;
    margin: .75rem 0 1rem;
}

.purchase-reference-filters label,
.claim-reference-filters label {
    display: grid;
    gap: .25rem;
    min-width: 0;
    color: #5a585e;
    font-size: .8rem;
}

.purchase-reference-filters :is(input, select),
.claim-reference-filters :is(input, select) {
    width: 100%;
    min-width: 0;
    border: 0;
    border-bottom: 1px solid #c5c4c8;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.purchase-reference-filters .actions,
.claim-reference-filters .actions {
    display: flex;
    gap: .5rem;
    align-items: end;
}

body[data-module="purchases"] table,
body[data-module="claims"] table {
    width: 100%;
    border-collapse: collapse;
    font-size: .78rem;
}

body[data-module="purchases"] th,
body[data-module="purchases"] td,
body[data-module="claims"] th,
body[data-module="claims"] td {
    padding: .85rem .5rem;
    border-bottom: 1px solid #ececef;
    text-align: left;
    vertical-align: top;
}

body[data-module="purchases"] th,
body[data-module="claims"] th {
    color: #38363c;
    font-weight: 700;
}

body[data-module="purchases"] #print-purchases,
body[data-module="claims"] #print-claims,
body[data-module="purchases"] #purchases-section > .actions > button:not(.secondary),
body[data-module="claims"] #claims-section > .actions > button:not(.secondary) {
    border-radius: 999px;
    background: #f47750;
    color: #fff;
}

@media (max-width: 720px) {
    body[data-module="purchases"] main,
    body[data-module="claims"] main {
        width: 100%;
        padding: .75rem 0 4.5rem;
    }

    body[data-module="purchases"] .hero,
    body[data-module="claims"] .hero,
    body[data-module="purchases"] #purchases-section,
    body[data-module="claims"] #claims-section {
        margin-inline: .65rem;
    }

    .purchase-reference-filters,
    .claim-reference-filters {
        grid-template-columns: 1fr 1fr;
    }

    .purchase-search,
    .claim-search,
    .purchase-reference-filters .actions,
    .claim-reference-filters .actions {
        grid-column: 1 / -1;
    }

    body[data-module="purchases"] table,
    body[data-module="claims"] table {
        min-width: 1050px;
    }
}

@media (max-width: 720px) {
    body[data-module="purchases"] .table-wrap,
    body[data-module="claims"] .table-wrap {
        overflow: visible;
    }

    body[data-module="purchases"] table,
    body[data-module="claims"] table {
        display: block;
        min-width: 0 !important;
        width: 100%;
    }

    body[data-module="purchases"] thead,
    body[data-module="claims"] thead {
        display: none;
    }

    body[data-module="purchases"] tbody,
    body[data-module="claims"] tbody {
        display: grid;
        gap: .85rem;
    }

    body[data-module="purchases"] tbody tr,
    body[data-module="claims"] tbody tr {
        display: block;
        padding: 1rem 1rem 1.1rem;
        border-radius: .45rem;
        background: #fff;
        box-shadow: 0 6px 18px rgba(32,29,38,.04);
    }

    body[data-module="purchases"] tbody td,
    body[data-module="claims"] tbody td {
        display: grid;
        grid-template-columns: minmax(7.5rem, .95fr) minmax(0, 1.3fr);
        gap: .8rem;
        min-height: 42px;
        align-items: baseline;
        padding: .5rem 0;
        border: 0;
        color: #4f4d53;
        font-size: .9rem;
        text-align: right;
    }

    body[data-module="purchases"] tbody td::before,
    body[data-module="claims"] tbody td::before {
        content: attr(data-label);
        color: #5d5b60;
        text-align: left;
        font-weight: 500;
    }

    body[data-module="purchases"] tbody td > *,
    body[data-module="claims"] tbody td > * {
        justify-self: end;
    }

    body[data-module="purchases"] .record-link,
    body[data-module="claims"] .record-link {
        color: #f47750;
        font-weight: 650;
    }
}

body[data-module="purchases"] .purchase-reference-filters button[type="submit"],
body[data-module="claims"] .claim-reference-filters button[type="submit"],
body[data-module="purchases"] #purchase-rows button,
body[data-module="claims"] #claim-rows button {
    border: 1px solid #f47750 !important;
    background: #f47750 !important;
    color: #fff !important;
    box-shadow: 0 8px 18px rgba(244,119,80,.12) !important;
}

body[data-module="purchases"] .purchase-reference-filters .secondary,
body[data-module="claims"] .claim-reference-filters .secondary {
    border: 1px solid #f47750 !important;
    background: #fff !important;
    color: #f47750 !important;
    box-shadow: none !important;
}

body[data-module="purchases"] #purchase-rows button,
body[data-module="claims"] #claim-rows button {
    min-height: 34px;
    padding: .35rem .75rem;
    border-radius: 999px !important;
    font-size: .8rem;
}

@media (max-width: 720px) {
    body[data-module="calendar"] .calendar-day,
    body[data-module="calendar"] .calendar-day.is-today,
    body[data-module="calendar"] .calendar-day:focus,
    body[data-module="calendar"] .calendar-day:focus-within {
        border: 0 !important;
        outline: 0 !important;
        box-shadow: none !important;
    }

    body[data-module="calendar"] #calendar-prev {
        left: calc(50% - 7.6rem);
    }

    body[data-module="calendar"] #calendar-next {
        left: calc(50% + 4.5rem);
    }

    body[data-module="calendar"] #calendar-prev::before,
    body[data-module="calendar"] #calendar-next::before {
        color: #c3c3c6;
        font-size: 2.2rem;
    }
}

/* Secondary module views use compact dropdown selectors. */
.module-view-dropdown {
    display: inline-grid;
    grid-template-columns: auto minmax(12rem, 18rem);
    gap: .65rem;
    align-items: center;
    margin: 0 0 .85rem;
    padding: .45rem .65rem;
    border-radius: .45rem;
    background: #fff;
    color: #5c5a60;
    font-size: .82rem;
    font-weight: 600;
}

.module-view-dropdown > span {
    white-space: nowrap;
}

.module-view-dropdown select {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    padding: .4rem 2.1rem .4rem .7rem;
    border: 1px solid #dedde1;
    border-radius: .35rem;
    color: #4b3488;
    background: #fff;
    box-shadow: none;
    font-weight: 600;
}

.module-view-dropdown select:focus-visible {
    outline: 2px solid rgba(244, 119, 80, .35);
    outline-offset: 2px;
    border-color: #f47750;
}

/* Entire Equipment order rows/cards open the order workspace. */
.equipment-order-row {
    cursor: pointer;
    transition: background .14s ease, box-shadow .14s ease;
}

.equipment-order-row:hover {
    background: #fff8f4 !important;
}

.equipment-order-row:focus-visible {
    outline: 2px solid #f47750;
    outline-offset: -2px;
    background: #fff8f4 !important;
}

@media (max-width: 720px) {
    .module-view-dropdown {
        grid-template-columns: 1fr;
        width: calc(100% - 1.3rem);
        margin: 0 .65rem .8rem;
    }

    .equipment-order-row:focus-visible {
        outline-offset: 0;
        box-shadow: 0 0 0 2px #f47750;
    }
}

/* Palmetto order workspace accordion hierarchy. */
body[data-page="order-detail"].order-palmetto-canvas .workspace-accordion {
    overflow: hidden;
    margin: .55rem 0;
    border: 1px solid #ecebed;
    border-radius: .5rem;
    background: #fff;
}

body[data-page="order-detail"].order-palmetto-canvas .workspace-accordion > summary {
    list-style: none;
}

body[data-page="order-detail"].order-palmetto-canvas .workspace-accordion > summary::-webkit-details-marker {
    display: none;
}

body[data-page="order-detail"].order-palmetto-canvas .workspace-accordion-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    min-height: 52px;
    padding: .75rem .95rem;
    cursor: pointer;
    color: #4e4c52;
    background: #fff;
}

body[data-page="order-detail"].order-palmetto-canvas .workspace-accordion-summary:hover,
body[data-page="order-detail"].order-palmetto-canvas .workspace-accordion-summary:focus-visible {
    background: #fff8f4;
    outline: 0;
}

body[data-page="order-detail"].order-palmetto-canvas .workspace-accordion-copy {
    display: grid;
    gap: .15rem;
    min-width: 0;
}

body[data-page="order-detail"].order-palmetto-canvas .workspace-accordion-title {
    color: #4b3488;
    font-size: .92rem;
    font-weight: 700;
}

body[data-page="order-detail"].order-palmetto-canvas .workspace-accordion-subtitle {
    color: #858289;
    font-size: .74rem;
    font-weight: 400;
    line-height: 1.35;
}

body[data-page="order-detail"].order-palmetto-canvas .workspace-accordion-chevron {
    color: #6d6a70;
    font-size: 1.2rem;
    transition: transform .16s ease;
}

body[data-page="order-detail"].order-palmetto-canvas .workspace-accordion[open] > .workspace-accordion-summary .workspace-accordion-chevron,
body[data-page="order-detail"].order-palmetto-canvas .workspace-option-accordion[open] > .palmetto-option-summary .workspace-accordion-chevron {
    transform: rotate(180deg);
}

body[data-page="order-detail"].order-palmetto-canvas .workspace-accordion-body {
    padding: .85rem .95rem 1rem;
    border-top: 1px solid #efedf0;
    background: #fff;
}

body[data-page="order-detail"].order-palmetto-canvas .workspace-accordion-body > :first-child {
    margin-top: 0;
}

body[data-page="order-detail"].order-palmetto-canvas .workspace-accordion-body > :last-child {
    margin-bottom: 0;
}

body[data-page="order-detail"].order-palmetto-canvas .patient-demographics-accordion,
body[data-page="order-detail"].order-palmetto-canvas .patient-care-team-accordion,
body[data-page="order-detail"].order-palmetto-canvas .patient-insurance-accordion {
    margin-inline: 0;
}

body[data-page="order-detail"].order-palmetto-canvas .product-details-accordion,
body[data-page="order-detail"].order-palmetto-canvas .product-pricing-accordion,
body[data-page="order-detail"].order-palmetto-canvas .product-authorization-accordion,
body[data-page="order-detail"].order-palmetto-canvas .product-options-accordion {
    margin: .45rem 0 0;
}

body[data-page="order-detail"].order-palmetto-canvas .workspace-option-accordion {
    margin: .45rem 0;
    border: 1px solid #efedf0;
    border-radius: .4rem;
    background: #fff;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-option-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .75rem;
    align-items: center;
    padding: .75rem .8rem;
    cursor: pointer;
    list-style: none;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-option-summary::-webkit-details-marker {
    display: none;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-option-summary h5 {
    margin: 0 0 .15rem;
    color: #4e4c52;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-option-summary p {
    margin: 0;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-option-body {
    padding: .75rem .8rem .9rem;
    border-top: 1px solid #efedf0;
}

body[data-page="order-detail"].order-palmetto-canvas .workspace-static-accordion {
    margin: .65rem 0;
}

@media (max-width: 760px) {
    body[data-page="order-detail"].order-palmetto-canvas .workspace-accordion {
        border-radius: .35rem;
        margin: .4rem 0;
    }

    body[data-page="order-detail"].order-palmetto-canvas .workspace-accordion-summary {
        min-height: 58px;
        padding: .8rem .85rem;
    }

    body[data-page="order-detail"].order-palmetto-canvas .workspace-accordion-title {
        font-size: 1rem;
    }

    body[data-page="order-detail"].order-palmetto-canvas .workspace-accordion-subtitle {
        font-size: .72rem;
    }

    body[data-page="order-detail"].order-palmetto-canvas .workspace-accordion-body {
        padding: .8rem .85rem 1rem;
    }

    body[data-page="order-detail"].order-palmetto-canvas .palmetto-patient-details {
        padding-top: .5rem;
    }
}

body[data-page="order-detail"].order-palmetto-canvas .workspace-claim-accordion {
    overflow: hidden;
    margin: .5rem 0;
    border: 1px solid #ecebed;
    border-radius: .45rem;
    background: #fff;
}

body[data-page="order-detail"].order-palmetto-canvas .workspace-claim-card-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: .65rem;
    align-items: center;
    min-height: 50px;
    padding: .7rem .85rem;
    cursor: pointer;
    list-style: none;
}

body[data-page="order-detail"].order-palmetto-canvas .workspace-claim-card-heading::-webkit-details-marker {
    display: none;
}

body[data-page="order-detail"].order-palmetto-canvas .workspace-claim-card-heading h4 {
    margin: 0;
    color: #4d4b50;
    font-size: .9rem;
}

body[data-page="order-detail"].order-palmetto-canvas .workspace-claim-body {
    padding: .8rem .85rem 1rem;
    border-top: 1px solid #efedf0;
}

body[data-page="order-detail"].order-palmetto-canvas .workspace-claim-accordion[open] .workspace-accordion-chevron {
    transform: rotate(180deg);
}

@media (max-width: 760px) {
    body[data-page="order-detail"].order-palmetto-canvas .workspace-claim-card-heading {
        min-height: 56px;
        padding: .8rem .85rem;
    }

    body[data-page="order-detail"].order-palmetto-canvas .workspace-claim-card-heading h4 {
        font-size: .98rem;
    }
}

/* Crisp CSS chevrons for all order accordions. */
body[data-page="order-detail"].order-palmetto-canvas .workspace-accordion-chevron {
    display: block;
    width: .52rem;
    height: .52rem;
    border-right: 2px solid #6d6a70;
    border-bottom: 2px solid #6d6a70;
    color: transparent;
    font-size: 0;
    transform: rotate(45deg);
    transform-origin: center;
    transition: transform .16s ease;
}

body[data-page="order-detail"].order-palmetto-canvas .workspace-accordion[open] > .workspace-accordion-summary .workspace-accordion-chevron,
body[data-page="order-detail"].order-palmetto-canvas .workspace-option-accordion[open] > .palmetto-option-summary .workspace-accordion-chevron,
body[data-page="order-detail"].order-palmetto-canvas .workspace-claim-accordion[open] > .workspace-claim-card-heading .workspace-accordion-chevron {
    transform: rotate(225deg);
}

/* Palmetto calendar Day / Week / Month view parity. */
.calendar-toolbar {
    display: grid;
    grid-template-columns: auto minmax(16rem, 1fr) auto;
    gap: 1rem;
    align-items: center;
}

.calendar-toolbar-left,
.calendar-toolbar-right {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.calendar-toolbar-center {
    display: grid;
    justify-items: center;
    gap: .35rem;
}

.calendar-jump {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    color: #65636a;
    font-size: .78rem;
}

.calendar-jump input {
    width: 9.5rem;
    min-height: 34px;
    border: 0;
    border-bottom: 1px solid #c5c4c8;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.calendar-view-switch {
    display: inline-flex;
    overflow: hidden;
    border: 1px solid #dedde1;
    border-radius: .4rem;
    background: #fff;
}

.calendar-view-switch button {
    min-height: 34px;
    padding: .35rem .7rem;
    border: 0;
    border-radius: 0;
    color: #5c5961;
    background: #fff;
    box-shadow: none;
    font-size: .78rem;
    font-weight: 600;
}

.calendar-view-switch button + button {
    border-left: 1px solid #dedde1;
}

.calendar-view-switch button[aria-pressed="true"] {
    color: #fff;
    background: #f47750;
}

.calendar-date-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .3rem;
}

.calendar-date-add {
    display: grid;
    width: 24px;
    height: 24px;
    min-height: 24px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: #59cb78;
    box-shadow: none;
    font-size: 1rem;
    line-height: 1;
}

.calendar-time-grid {
    display: block;
    overflow: auto;
    border: 1px solid #dedee0;
    background: #fff;
}

.calendar-time-header,
.calendar-time-row {
    display: grid;
    grid-template-columns: 64px repeat(var(--calendar-days), minmax(7.5rem, 1fr));
    min-width: calc(64px + (var(--calendar-days) * 120px));
}

.calendar-time-header {
    position: sticky;
    top: 0;
    z-index: 8;
    background: #fff;
    border-bottom: 1px solid #dedee0;
}

.calendar-time-spacer,
.calendar-time-day-header,
.calendar-time-label,
.calendar-time-slot {
    border-right: 1px solid #e2e2e4;
}

.calendar-time-day-header {
    display: grid;
    gap: .15rem;
    justify-items: center;
    min-height: 62px;
    padding: .55rem .4rem;
    color: #4d4b50;
    background: #fff;
}

.calendar-time-day-header strong {
    font-size: .86rem;
}

.calendar-time-day-header span {
    color: #f47750;
    font-size: .8rem;
}

.calendar-time-add {
    padding: 0;
    border: 0;
    color: #f47750;
    background: transparent;
    box-shadow: none;
    font-size: .72rem;
    font-weight: 650;
}

.calendar-time-row {
    min-height: 54px;
    border-bottom: 1px solid #ededee;
}

.calendar-time-label {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: .35rem .45rem;
    color: #8a878e;
    background: #fafafb;
    font-size: .72rem;
}

.calendar-time-slot {
    min-height: 54px;
    padding: .2rem;
    background: #fff;
}

.calendar-time-slot:hover {
    background: #fffaf7;
}

.calendar-time-appointment,
.calendar-time-event {
    display: block;
    width: 100%;
    min-height: 30px;
    margin: .15rem 0;
    padding: .25rem .35rem;
    overflow: hidden;
    border: 0;
    border-left: 3px solid var(--appointment-color, #4b3488);
    border-radius: .25rem;
    color: #38363c;
    background: #f7f4fb;
    box-shadow: none;
    font-size: .7rem;
    line-height: 1.2;
    text-align: left;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.calendar-time-event:not(.calendar-appointment) {
    border-left-color: #4b3488;
}

@media (max-width: 720px) {
    body[data-module="calendar"] .calendar-toolbar {
        display: block;
        height: 92px;
        padding-top: 0;
    }

    body[data-module="calendar"] .calendar-toolbar-left,
    body[data-module="calendar"] .calendar-toolbar-right {
        display: contents;
    }

    body[data-module="calendar"] .calendar-toolbar-center {
        display: block;
    }

    body[data-module="calendar"] .calendar-jump {
        display: none;
    }

    body[data-module="calendar"] .calendar-view-switch {
        position: absolute;
        left: 50%;
        bottom: .4rem;
        transform: translateX(-50%);
        border: 0;
        background: transparent;
    }

    body[data-module="calendar"] .calendar-view-switch button {
        min-height: 28px;
        padding: .2rem .65rem;
        border: 0;
        color: #77747c;
        background: transparent;
        font-size: .72rem;
    }

    body[data-module="calendar"] .calendar-view-switch button[aria-pressed="true"] {
        color: #f47750;
        background: transparent;
        text-decoration: underline;
        text-underline-offset: .2rem;
    }

    body[data-calendar-view="day"] .calendar-weekdays,
    body[data-calendar-view="week"] .calendar-weekdays {
        display: none !important;
    }

    body[data-calendar-view="day"] #calendar-grid,
    body[data-calendar-view="week"] #calendar-grid {
        height: calc(100vh - 280px);
        overflow: auto;
        border-right: 0;
        border-left: 0;
    }

    .calendar-time-header,
    .calendar-time-row {
        grid-template-columns: 54px repeat(var(--calendar-days), minmax(7rem, 1fr));
        min-width: calc(54px + (var(--calendar-days) * 112px));
    }

    body[data-calendar-view="day"] .calendar-time-header,
    body[data-calendar-view="day"] .calendar-time-row {
        min-width: 100%;
        grid-template-columns: 54px minmax(0, 1fr);
    }

    .calendar-time-day-header {
        min-height: 56px;
    }

    .calendar-time-row,
    .calendar-time-slot {
        min-height: 50px;
    }

    body[data-calendar-view="day"] #calendar-prev {
        left: 1rem;
    }

    body[data-calendar-view="day"] #calendar-next {
        left: auto;
        right: 5.2rem;
    }
}

/* Palmetto Equipment filter drawer parity. */
.equipment-filter-drawer {
    grid-template-columns: repeat(4, minmax(10rem, 1fr));
    gap: 1rem;
    padding: 1.15rem 1.2rem;
    border: 1px solid #ecebed;
    border-radius: .45rem;
    box-shadow: 0 12px 28px rgba(33, 30, 40, .06);
}

.equipment-filter-drawer > label {
    display: grid;
    gap: .35rem;
    min-width: 0;
    color: #5b5960;
    font-size: .78rem;
    font-weight: 600;
}

.equipment-filter-drawer > label :is(input, select) {
    width: 100%;
    min-width: 0;
    border: 0;
    border-bottom: 1px solid #c8c7cb;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.equipment-switch-filter {
    grid-template-columns: auto minmax(0, 1fr) !important;
    align-items: center;
    align-content: center;
    gap: .65rem !important;
    min-height: 48px;
}

.equipment-switch-filter input {
    appearance: none;
    width: 42px !important;
    height: 22px;
    margin: 0;
    border: 0 !important;
    border-radius: 999px !important;
    background: #d7d5d9 !important;
    cursor: pointer;
    position: relative;
}

.equipment-switch-filter input::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.18);
    transition: transform .15s ease;
}

.equipment-switch-filter input:checked {
    background: #f47750 !important;
}

.equipment-switch-filter input:checked::after {
    transform: translateX(20px);
}

.equipment-balance-range {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .65rem;
    grid-column: span 2;
    margin: 0;
    padding: .65rem .8rem .8rem;
    border: 1px solid #ecebed;
    border-radius: .4rem;
}

.equipment-balance-range legend {
    padding: 0 .3rem;
    color: #5b5960;
    font-size: .78rem;
    font-weight: 700;
}

.equipment-balance-range label {
    display: grid;
    gap: .3rem;
    color: #737077;
    font-size: .74rem;
}

.equipment-balance-range input {
    border: 0;
    border-bottom: 1px solid #c8c7cb;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.equipment-filter-actions {
    display: flex;
    gap: .55rem;
    align-items: end;
    justify-content: flex-end;
    grid-column: span 2;
}

.equipment-filter-actions button:first-child {
    border-radius: 999px;
    background: #f47750;
    color: #fff;
}

.equipment-filter-actions .secondary {
    border: 1px solid #f47750;
    color: #f47750;
    background: #fff;
}

@media (max-width: 900px) and (min-width: 721px) {
    .equipment-filter-drawer {
        grid-template-columns: repeat(2, minmax(10rem, 1fr));
    }
}

@media (max-width: 720px) {
    .equipment-filter-drawer {
        position: fixed;
        z-index: 78;
        right: .7rem;
        bottom: 4.8rem;
        left: .7rem;
        max-height: calc(100vh - 9rem);
        overflow-y: auto;
        grid-template-columns: 1fr 1fr;
        margin: 0;
        padding: 1rem;
        border-radius: .75rem;
        box-shadow: 0 18px 44px rgba(28, 24, 35, .2);
    }

    .equipment-filter-drawer > label:first-of-type,
    .equipment-filter-drawer > label:nth-of-type(2),
    .equipment-filter-drawer > label:nth-of-type(3),
    .equipment-filter-drawer > label:nth-of-type(4),
    .equipment-switch-filter,
    .equipment-balance-range,
    .equipment-filter-actions {
        grid-column: 1 / -1;
    }

    .equipment-balance-range {
        grid-template-columns: 1fr 1fr;
    }

    .equipment-filter-actions {
        justify-content: stretch;
    }

    .equipment-filter-actions button {
        flex: 1 1 0;
    }
}

/* Closed Claims use expandable year groups like the Palmetto reference. */
body[data-module-mode="claim-details-closed"] .claim-balance-filter {
    display: none !important;
}

.closed-claim-groups {
    display: grid;
    gap: .75rem;
}

.closed-claim-year {
    overflow: hidden;
    border: 1px solid #ecebed;
    border-radius: .45rem;
    background: #fff;
}

.closed-claim-year > summary {
    list-style: none;
}

.closed-claim-year > summary::-webkit-details-marker {
    display: none;
}

.closed-claim-year-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    min-height: 54px;
    padding: .75rem 1rem;
    cursor: pointer;
    background: #fff;
}

.closed-claim-year-summary:hover,
.closed-claim-year-summary:focus-visible {
    background: #fff8f4;
    outline: 0;
}

.closed-claim-year-summary > span:first-child {
    display: grid;
    gap: .12rem;
}

.closed-claim-year-label {
    color: #4b3488;
    font-size: 1rem;
}

.closed-claim-year-count {
    color: #858289;
    font-size: .76rem;
}

.closed-claim-year-chevron {
    display: block;
    width: .5rem;
    height: .5rem;
    border-right: 2px solid #6d6a70;
    border-bottom: 2px solid #6d6a70;
    color: transparent;
    font-size: 0;
    transform: rotate(45deg);
    transition: transform .16s ease;
}

.closed-claim-year[open] .closed-claim-year-chevron {
    transform: rotate(225deg);
}

.closed-claim-year-table {
    margin: 0;
    border-top: 1px solid #efedf0;
}

@media (max-width: 720px) {
    .closed-claim-year {
        border-radius: .35rem;
    }

    .closed-claim-year-summary {
        min-height: 58px;
        padding: .8rem .85rem;
    }
}

/* Palmetto Add/Edit Patient modal parity. */
.patient-profile-dialog {
    width: min(70rem, calc(100% - 2rem));
    max-height: min(92vh, 58rem);
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: .7rem;
    background: #f5f5f7;
    box-shadow: 0 24px 70px rgba(30, 26, 37, .24);
}

.patient-profile-dialog::backdrop {
    background: rgba(35, 31, 41, .34);
}

.patient-profile-dialog form {
    display: block;
    max-height: min(92vh, 58rem);
    overflow-y: auto;
    padding: 0 1.25rem 5.5rem;
    background: #f5f5f7;
}

.patient-profile-dialog .dialog-heading {
    position: sticky;
    top: 0;
    z-index: 20;
    align-items: center;
    margin: 0 -1.25rem 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e8e7ea;
    background: rgba(255,255,255,.98);
}

.patient-profile-dialog .dialog-heading h2 {
    margin: 0 0 .2rem;
    color: #4b3488;
    font-size: 1.45rem;
    font-weight: 700;
}

.patient-profile-dialog .dialog-heading p {
    margin: 0;
    color: #858289;
    font-size: .82rem;
}

#patient-profile-close {
    display: grid;
    width: 38px;
    height: 38px;
    min-height: 38px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #7c797f;
    background: transparent;
    box-shadow: none;
    font-size: 1.55rem;
    line-height: 1;
}

#patient-profile-preview {
    display: none;
}

.patient-profile-dialog .patient-modal-section {
    margin: 0 0 .85rem;
    padding: 1rem 1.1rem 1.1rem;
    border: 0;
    border-radius: .45rem;
    background: #fff;
    box-shadow: 0 4px 16px rgba(32, 29, 38, .035);
}

.patient-profile-dialog .patient-modal-section > legend {
    padding: 0 .25rem;
    color: #332058;
    font-size: .95rem;
    font-weight: 750;
    letter-spacing: .01em;
}

.patient-profile-dialog .form-grid {
    gap: .85rem 1rem;
}

.patient-profile-dialog label {
    color: #5b5960;
    font-size: .78rem;
    font-weight: 500;
}

.patient-profile-dialog :is(input:not([type="checkbox"]), select, textarea) {
    border: 0;
    border-bottom: 1px solid #ceccd1;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: #4c4a50;
}

.patient-profile-dialog :is(input:not([type="checkbox"]), select, textarea):focus {
    border-bottom-color: #f47750;
    box-shadow: 0 1px 0 #f47750;
    outline: 0;
}

.patient-profile-dialog textarea {
    min-height: 2.8rem;
}

.patient-profile-dialog output {
    color: #4c4a50;
    font-weight: 650;
}

.patient-insurance-details {
    margin-top: 1rem;
    overflow: hidden;
    border: 1px solid #ecebed;
    border-radius: .4rem;
    background: #fff;
}

.patient-insurance-details > summary {
    padding: .75rem .85rem;
    color: #4b3488;
    cursor: pointer;
    list-style: none;
    font-size: .88rem;
    font-weight: 700;
}

.patient-insurance-details > summary::-webkit-details-marker {
    display: none;
}

.patient-insurance-details > p,
.patient-insurance-details > #patient-policies,
.patient-insurance-details > #add-patient-policy {
    margin-right: .85rem;
    margin-left: .85rem;
}

#patient-policies {
    margin-top: .7rem;
}

.patient-policy {
    padding: .85rem !important;
    border: 1px solid #efedf0 !important;
    border-radius: .35rem !important;
    background: #fafafb !important;
}

.patient-policy legend {
    color: #5b5960 !important;
    font-size: .78rem;
}

#add-patient-policy {
    margin-bottom: .85rem;
    border: 1px solid #f47750;
    color: #f47750;
    background: #fff;
    box-shadow: none;
}

.patient-profile-actions {
    position: sticky;
    z-index: 22;
    bottom: 0;
    display: grid;
    grid-template-columns: minmax(8rem, 12rem) minmax(8rem, 12rem);
    justify-content: space-between;
    gap: 1rem;
    margin: 1rem -1.25rem -5.5rem;
    padding: .8rem 1.25rem 1rem;
    border-top: 1px solid #ebe9ed;
    background: rgba(255,255,255,.98);
}

.patient-profile-actions button[type="submit"] {
    grid-column: 2;
    min-height: 46px;
    border-radius: .5rem;
    background: #f47750;
    color: #fff;
}

.patient-profile-actions #patient-profile-cancel {
    grid-column: 1;
    grid-row: 1;
    min-height: 46px;
    border: 0;
    color: #aaa7ad;
    background: #fff;
    box-shadow: none;
}

@media (max-width: 700px) {
    .patient-profile-dialog {
        width: 100%;
        max-width: none;
        max-height: 100dvh;
        height: 100dvh;
        margin: 0;
        border-radius: 0;
    }

    .patient-profile-dialog form {
        max-height: 100dvh;
        padding: 0 .8rem 5.25rem;
    }

    .patient-profile-dialog .dialog-heading {
        grid-template-columns: 1fr auto;
        margin: 0 -.8rem .8rem;
        padding: .9rem .9rem;
    }

    .patient-profile-dialog .dialog-heading button {
        justify-self: end;
    }

    .patient-profile-dialog .patient-modal-section {
        padding: .9rem;
    }

    .patient-profile-dialog .form-grid {
        grid-template-columns: 1fr 1fr;
    }

    .patient-profile-dialog .profile-wide-field {
        grid-column: 1 / -1;
    }

    .patient-profile-actions {
        margin-right: -.8rem;
        margin-left: -.8rem;
        padding-right: .8rem;
        padding-left: .8rem;
    }
}

/* Revised Palmetto mobile order summary/product expansion treatment. */

body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-accordion {
    display: block;
    width: 100%;
}
body[data-page="order-detail"].order-palmetto-canvas {
    background:
        linear-gradient(
            180deg,
            #f4f5f7 0%,
            #eef1f5 50%,
            #f5f3f7 100%
        );
}

body[data-page="order-detail"].order-palmetto-canvas #workspace-panel-patient,
body[data-page="order-detail"].order-palmetto-canvas .workspace-product-search,
body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-card,
body[data-page="order-detail"].order-palmetto-canvas .workspace-accordion {
    background: rgba(255, 255, 255, .72) !important;
    border: 1px solid rgba(255,255,255,.62) !important;
    box-shadow: 0 12px 30px rgba(42, 36, 55, .055) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-patient-heading,
body[data-page="order-detail"].order-palmetto-canvas .palmetto-patient-details,
body[data-page="order-detail"].order-palmetto-canvas .workspace-accordion-summary,
body[data-page="order-detail"].order-palmetto-canvas .workspace-accordion-body {
    background: transparent !important;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-patient-heading {
    min-height: 132px;
    margin: 0;
    padding: 1.45rem 3.4rem 1.1rem;
    text-align: center;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-patient-name {
    width: 100%;
    text-align: center;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-patient-meta {
    margin: .15rem 0 0;
    color: #6c6970;
    font-size: .86rem;
    text-align: center;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-change-patient {
    position: absolute;
    left: .9rem;
    bottom: .75rem;
    margin: 0;
    padding: .15rem .2rem;
    color: #f47750;
    text-align: left;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-patient-toggle {
    top: 1.9rem;
    right: 1rem;
}

body[data-page="order-detail"].order-palmetto-canvas .workspace-product-search {
    padding: .8rem 1rem 1rem !important;
    border-radius: .8rem;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-card {
    padding: 0 !important;
    overflow: hidden;
    border-radius: .8rem !important;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-accordion > summary {
    list-style: none;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-accordion > summary::-webkit-details-marker {
    display: none;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-summary {
    display: block;
    padding: 1rem 1rem .95rem;
    cursor: pointer;
    background: transparent;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-summary:focus-visible {
    outline: 2px solid rgba(244,119,80,.45);
    outline-offset: -2px;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .8rem;
    align-items: start;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-summary-controls {
    display: inline-flex;
    align-items: center;
    gap: .8rem;
    padding-top: .15rem;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-more {
    color: #5d5a61;
    font-size: 1.35rem;
    line-height: 1;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-chevron {
    width: .58rem;
    height: .58rem;
    border-right: 2px solid #40365c;
    border-bottom: 2px solid #40365c;
    transform: rotate(45deg);
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-accordion[open] .palmetto-product-chevron {
    transform: rotate(225deg);
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-summary .palmetto-product-financials {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    margin: .9rem 0 0;
    padding-top: .8rem;
    border-top: 1px solid rgba(144,140,150,.18);
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-summary .palmetto-product-financial {
    min-width: 0;
    padding: 0 .75rem;
    border-left: 1px solid rgba(144,140,150,.18);
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-summary .palmetto-product-financial:first-child {
    padding-left: 0;
    border-left: 0;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-summary .palmetto-product-financial:last-child {
    padding-right: 0;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-summary .palmetto-product-financial span {
    font-size: .72rem;
    font-weight: 500;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-summary .palmetto-product-financial strong {
    font-size: .9rem;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-expanded {
    padding: .85rem 1rem 1rem;
    border-top: 1px solid rgba(144,140,150,.2);
    background: rgba(255,255,255,.28);
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-expanded .palmetto-product-assignments {
    margin: .2rem 0 .75rem;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-expanded .palmetto-product-details {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    margin: .25rem 0 .8rem;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-expanded .palmetto-product-details > div {
    grid-template-columns: minmax(8rem, .9fr) minmax(0, 1.2fr);
    min-height: 48px;
    align-items: center;
    padding: .55rem 0;
    border-bottom: 1px solid rgba(144,140,150,.16);
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-expanded .workspace-accordion {
    background: rgba(255,255,255,.48) !important;
    box-shadow: none !important;
}

@media (max-width: 760px) {
    body[data-page="order-detail"].order-palmetto-canvas .palmetto-patient-heading {
        min-height: 132px;
        padding: 1.35rem 2.8rem 1.2rem;
    }

    body[data-page="order-detail"].order-palmetto-canvas .palmetto-patient-name {
        font-size: 1.35rem;
    }

    body[data-page="order-detail"].order-palmetto-canvas .palmetto-patient-meta {
        font-size: .82rem;
    }

    body[data-page="order-detail"].order-palmetto-canvas .palmetto-change-patient {
        left: .85rem;
        bottom: .6rem;
        font-size: .9rem;
    }

    body[data-page="order-detail"].order-palmetto-canvas .workspace-product-search {
        width: calc(100% - 1rem);
        margin: 1rem auto 1.15rem;
    }

    body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-summary {
        padding: .9rem .9rem .85rem;
    }

    body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-summary .palmetto-product-financials {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0;
        margin-top: .8rem;
    }

    body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-summary .palmetto-product-financial {
        display: grid;
        grid-template-columns: 1fr;
        gap: .15rem;
        align-items: start;
    }

    body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-summary .palmetto-product-financial strong {
        font-size: .84rem;
        line-height: 1.2;
    }

    body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-expanded {
        padding: .7rem .85rem .9rem;
    }

    body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-expanded .palmetto-product-details > div {
        grid-template-columns: 1fr;
        gap: .15rem;
        min-height: 54px;
        align-items: start;
    }

    body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-expanded .palmetto-product-details dd {
        color: #77747c;
    }
}

/* Final frosted order-summary refinement. */
body[data-page="order-detail"].order-palmetto-canvas #workspace-panel-patient,
body[data-page="order-detail"].order-palmetto-canvas .workspace-product-search,
body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-card,
body[data-page="order-detail"].order-palmetto-canvas .workspace-accordion {
    background: rgba(255, 255, 255, .58) !important;
    border: 1px solid rgba(255,255,255,.68) !important;
    box-shadow: 0 14px 34px rgba(42, 36, 55, .05) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-change-patient {
    border: 0 !important;
    background: transparent !important;
    color: #f47750 !important;
    box-shadow: none !important;
    min-height: 0 !important;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-change-patient:hover,
body[data-page="order-detail"].order-palmetto-canvas .palmetto-change-patient:focus-visible {
    background: transparent !important;
    color: #df6540 !important;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-patient-details[hidden] {
    display: none !important;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-accordion:not([open]) > .palmetto-product-expanded {
    display: none !important;
}

body[data-page="order-detail"].order-palmetto-canvas .palmetto-product-accordion[open] > .palmetto-product-expanded {
    display: block !important;
}

/* Screenshot-aligned order summary/card refinement. */
@media (max-width: 760px) {
    body[data-page="order-detail"].order-palmetto-canvas
    #workspace-panel-patient {
        width: calc(100% - 1.6rem);
        margin: .65rem auto 1rem;
        padding: 0 !important;
        overflow: hidden;
        border-radius: .85rem !important;
    }

    body[data-page="order-detail"].order-palmetto-canvas
    #workspace-panel-equipment {
        width: 100%;
        margin: 0;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    body[data-page="order-detail"].order-palmetto-canvas
    .workspace-mobile-actions {
        padding: .85rem 1.05rem .45rem;
    }

    body[data-page="order-detail"].order-palmetto-canvas
    .workspace-mobile-order-summary {
        padding: .25rem 1.1rem .5rem;
    }

    body[data-page="order-detail"].order-palmetto-canvas
    .workspace-mobile-summary-row {
        min-height: 58px;
        padding: .9rem 0;
        border-bottom: 1px solid rgba(120, 120, 128, .13);
    }

    body[data-page="order-detail"].order-palmetto-canvas
    .palmetto-patient-heading {
        min-height: 140px;
        padding: 1.35rem 2.9rem 2.45rem;
    }

    body[data-page="order-detail"].order-palmetto-canvas
    .palmetto-patient-toggle {
        top: 1.75rem;
        right: 1rem;
    }

    body[data-page="order-detail"].order-palmetto-canvas
    .workspace-product-search {
        width: calc(100% - 1.6rem);
        margin: .35rem auto 1rem;
        padding: .9rem 1rem 1rem !important;
        border-radius: .85rem;
    }

    body[data-page="order-detail"].order-palmetto-canvas
    .workspace-product-search input {
        min-height: 46px;
        padding: .55rem 2.8rem .55rem .7rem;
        border: 1px solid rgba(120, 120, 128, .22);
        border-radius: .45rem;
        background: rgba(255,255,255,.5);
    }

    body[data-page="order-detail"].order-palmetto-canvas
    .workspace-product-search button {
        width: 42px;
        min-height: 42px;
        margin-left: -44px;
    }

    body[data-page="order-detail"].order-palmetto-canvas
    #workspace-products {
        width: calc(100% - 1.6rem);
        margin: 0 auto;
    }

    body[data-page="order-detail"].order-palmetto-canvas
    .palmetto-product-media {
        grid-template-columns: 76px minmax(0, 1fr);
        gap: .85rem;
    }

    body[data-page="order-detail"].order-palmetto-canvas
    .palmetto-product-thumb {
        width: 76px;
        height: 92px;
        border-radius: .45rem;
        font-size: 1.5rem;
    }

    body[data-page="order-detail"].order-palmetto-canvas
    .palmetto-product-identity h3 {
        margin: 0 0 .3rem;
        font-size: 1.02rem;
        line-height: 1.22;
    }

    body[data-page="order-detail"].order-palmetto-canvas
    .palmetto-product-metadata {
        display: flex;
        flex-wrap: wrap;
        gap: .2rem 0;
        margin: 0;
        font-size: .78rem;
        line-height: 1.4;
    }

    body[data-page="order-detail"].order-palmetto-canvas
    .palmetto-product-metadata > span {
        display: inline-flex;
        gap: .2rem;
        align-items: baseline;
        padding-right: .5rem;
        margin-right: .5rem;
        border-right: 1px solid rgba(100, 96, 108, .32);
    }

    body[data-page="order-detail"].order-palmetto-canvas
    .palmetto-product-metadata > span:last-child {
        flex-basis: 100%;
        padding-right: 0;
        margin-right: 0;
        border-right: 0;
    }

    body[data-page="order-detail"].order-palmetto-canvas
    .palmetto-product-status {
        display: inline-flex;
        width: fit-content;
        margin-top: .45rem;
        padding: .25rem .7rem;
        border-radius: 999px;
        color: #e96943;
        background: rgba(255, 230, 220, .72);
        font-size: .78rem;
        font-weight: 700;
    }

    body[data-page="order-detail"].order-palmetto-canvas
    .palmetto-product-summary-footer {
        display: grid;
        grid-template-columns: minmax(6.8rem, .8fr) minmax(0, 2.2fr);
        gap: .9rem;
        align-items: end;
        margin-top: .9rem;
        padding-top: .8rem;
        border-top: 1px solid rgba(144,140,150,.18);
    }

    body[data-page="order-detail"].order-palmetto-canvas
    .palmetto-product-created-by {
        display: grid;
        gap: .12rem;
        min-width: 0;
    }

    body[data-page="order-detail"].order-palmetto-canvas
    .palmetto-product-created-by span,
    body[data-page="order-detail"].order-palmetto-canvas
    .palmetto-product-financial span {
        color: #67636d;
        font-size: .7rem;
        font-weight: 500;
    }

    body[data-page="order-detail"].order-palmetto-canvas
    .palmetto-product-created-by strong {
        overflow-wrap: anywhere;
        color: #343139;
        font-size: .84rem;
        line-height: 1.2;
    }

    body[data-page="order-detail"].order-palmetto-canvas
    .palmetto-product-summary .palmetto-product-financials {
        margin: 0;
        padding: 0;
        border-top: 0;
    }

    body[data-page="order-detail"].order-palmetto-canvas
    .workspace-mobile-bottom-bar {
        grid-template-columns: .72fr 1.28fr;
        gap: .9rem;
        padding: .72rem 1rem calc(.72rem + env(safe-area-inset-bottom));
    }
}

/* Palmetto intake parity */
.intake-page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 1.5rem;
}
.intake-card {
    padding: 0;
    overflow: hidden;
}
.intake-heading {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 1.4rem;
    border-bottom: 1px solid var(--border);
}
.intake-heading h1 {
    margin: 0;
    flex: 1;
    text-align: center;
}
.intake-back {
    min-width: 5.5rem;
}
.intake-order-meta {
    display: grid;
    grid-template-columns: minmax(10rem, .7fr) minmax(14rem, 1fr);
    gap: 1rem;
    padding: 1rem 1.4rem;
    border-bottom: 1px solid var(--border);
}

.intake-order-meta > div,
.intake-order-meta > label {
    display: grid;
    gap: .3rem;
}
.intake-order-meta span,
.intake-order-meta label {
    font-size: .82rem;
    font-weight: 700;
}
#new-order-form {
    padding: 1.35rem 1.4rem 1.5rem;
}
.intake-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
}
.intake-context-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem 1.4rem;
    margin: .75rem 0 1rem;
}
.intake-context-grid > div { min-width: 0; }
.intake-context-grid dt {
    color: var(--muted);
    font-size: .8rem;
}
.intake-context-grid dd {
    margin: .3rem 0 0;
    font-weight: 600;
    overflow-wrap: anywhere;
}
.intake-context-heading {
    font-size: 1rem;
    margin: 1.2rem 0 .75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.intake-patient-identity { font-weight: 700; }
.intake-coverage-list {
    margin: 1rem 0 0;
    padding-left: 1.2rem;
    font-size: .85rem;
    overflow-wrap: anywhere;
}
.intake-alternate-doctor {
    display: grid;
    gap: .35rem;
    max-width: 28rem;
    margin: 0 1rem 1rem;
}
@media (max-width: 700px) {
    .intake-context-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
    .intake-context-grid { grid-template-columns: minmax(0, 1fr); }
}
.intake-patient-panel {
    margin-top: 1rem;
    border: 1px solid var(--border);
    border-radius: .55rem;
    background: rgba(255,255,255,.45);
}
.intake-patient-panel > summary {
    cursor: pointer;
    padding: .85rem 1rem;
    font-weight: 700;
}
#intake-patient-context {
    padding: 0 1rem 1rem;
}

.intake-sell-type {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin: 1rem 0 0;
    padding: .9rem 1rem;
}
.intake-sell-type legend {
    font-weight: 700;
    padding: 0 .35rem;
}
.intake-sell-type label {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}
.intake-actions {
    justify-content: flex-end;
    margin-top: 1.2rem;
}
@media (max-width: 700px) {
    .intake-page { padding: .75rem; }
    .intake-heading h1 { font-size: 1.35rem; }
    .intake-order-meta,
    .intake-fields { grid-template-columns: 1fr; }
    .intake-sell-type { align-items: flex-start; flex-direction: column; }
}

.patient-document-category-nav {
    display: flex;
    gap: .35rem;
    padding: .75rem 1rem;
    overflow-x: auto;
    border-top: 1px solid #ecebed;
    border-bottom: 1px solid #ecebed;
    background: #fafafa;
}
.patient-document-category-nav button {
    flex: 0 0 auto;
    border: 0;
    border-radius: 999px;
    padding: .45rem .75rem;
    background: transparent;
    color: #66636a;
    box-shadow: none;
    font-size: .78rem;
}
.patient-document-category-nav button[aria-selected="true"] {
    background: #fff0e9;
    color: #e9663d;
    font-weight: 700;
}

.patient-document-category-content {
    padding: 1rem;
}
.patient-document-table {
    min-width: 850px;
}
.patient-document-table th,
.patient-document-table td {
    text-align: left;
    vertical-align: top;
}
.patient-document-action {
    min-width: auto;
    padding: .3rem .55rem;
    border-radius: .35rem;
    font-size: .75rem;
}
.patient-document-empty {
    margin: 0;
    padding: 1.25rem;
    text-align: center;
}
@media (max-width: 720px) {
    .patient-document-category-content {
        padding: .75rem;
        overflow-x: auto;
    }
}

.workspace-note-history {
    display: grid;
    gap: .65rem;
    max-height: 16rem;
    margin: .75rem 0 1rem;
    overflow-y: auto;
}
.workspace-note-entry {
    padding: .75rem .85rem;
    border: 1px solid var(--border);
    border-radius: .5rem;
    background: #fafafa;
}
.workspace-note-entry p {
    margin: 0;
}
.workspace-note-entry .muted {
    margin-top: .3rem;
    font-size: .78rem;
}

.upcoming-rentals-page {
    width: min(100% - 2rem, 1180px);
    margin-inline: auto;
    padding-top: 1rem;
}
.rental-page-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
}
.rental-directory-panel {
    background: #fff;
}
.rental-period-controls {
    display: flex;
    gap: .5rem;
    padding: 1rem 0;
}
.rental-period-controls button[aria-pressed="true"] {
    background: #f47750;
    color: #fff;
}

.rental-directory-table th,
.rental-directory-table td {
    text-align: left;
    vertical-align: top;
}
@media (max-width: 720px) {
    .upcoming-rentals-page {
        width: 100%;
        padding: .75rem;
    }
    .rental-page-heading {
        align-items: stretch;
        flex-direction: column;
    }
    .rental-period-controls {
        overflow-x: auto;
    }
}

.supplies-page {
    width: min(100% - 2rem, 1320px);
    margin-inline: auto;
    padding-top: 1rem;
}
.supply-page-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
}
.supply-toolbar {
    display: grid;
    grid-template-columns: minmax(16rem, 1fr) auto;
    gap: .75rem;
    align-items: center;
}
.supply-filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(10rem, 1fr));
    gap: .75rem;
    margin-top: 1rem;
}

.supply-directory-table {
    min-width: 980px;
}
@media (max-width: 720px) {
    .supplies-page {
        width: 100%;
        padding: .75rem;
    }
    .supply-page-heading {
        align-items: stretch;
        flex-direction: column;
    }
    .supply-filters {
        grid-template-columns: 1fr;
    }
}

/* Application-wide Palmetto parity foundation, October 2026. */
:root {
    --navy: #4c316d;
    --blue: #f47750;
    --blue-dark: #d75c39;
    --aqua: #f1edf6;
    --cream: #f5f5f7;
    --border: #dedbe3;
    --shadow: 0 3px 14px rgba(46, 30, 60, .06);
    --ui-primary: #f47750;
    --ui-primary-hover: #d75c39;
    --ui-canvas: #f5f5f7;
    --ui-border: #dedbe3;
}
html, body { font-family: Roboto, "Helvetica Neue", Arial, sans-serif; }
body { background: var(--ui-canvas); }
main > .module-page-heading { margin-bottom: 1rem; }
main .table-wrap { overscroll-behavior-x: contain; scrollbar-width: thin; }
main table th { white-space: nowrap; }
main table td { vertical-align: top; }
main dialog { border: 1px solid var(--border); }
.intake-patient-search { display: grid; gap: .5rem; }
.intake-load-more { justify-self: start; }
.patient-diagnosis-row {
    display: grid; grid-template-columns: minmax(8rem, .7fr) minmax(12rem, 1.5fr);
    gap: .7rem 1rem; margin: 0 0 .8rem; padding: .8rem;
    border: 1px solid var(--border); border-radius: .35rem;
}
.patient-diagnosis-row legend { font-size: .9rem; font-weight: 600; }
.patient-diagnosis-row .diagnosis-primary-choice {
    display: flex; align-items: center; gap: .5rem;
}
.patient-diagnosis-row input[type=radio] { width: auto; }
.patient-diagnosis-row button { justify-self: end; align-self: end; }
.patient-document-action { display: inline-flex; text-decoration: none; }
.patient-document-action:not(:disabled) { cursor: pointer; }
.equipment-dialog { width: min(680px, calc(100vw - 2rem)); }
.equipment-form > label { display: grid; gap: .3rem; min-width: 0; }
.equipment-form input[type=file] { width: 100%; overflow: hidden; }
@media (max-width: 600px) {
    .patient-diagnosis-row { grid-template-columns: minmax(0, 1fr); }
    .patient-diagnosis-row button { justify-self: stretch; }
}

.directory-dialog { width: min(48rem, calc(100vw - 2rem)); max-height: 90vh; overflow-y: auto; border: 1px solid var(--border); border-radius: .5rem; padding: 1.5rem; }
.directory-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.directory-form-grid label { display: grid; gap: .35rem; }
.directory-form-grid input, .directory-form-grid select { width: 100%; min-width: 0; }
.patient-profile-dialog form { padding-bottom: 0; }
.patient-profile-actions { margin-bottom: 0; }
@media (max-width: 600px) { .directory-form-grid { grid-template-columns: 1fr; } }

.equipment-form label.equipment-checkbox { display: flex; align-items: center; gap: .65rem; }
.equipment-form label.equipment-checkbox input { width: 1.1rem; height: 1.1rem; min-height: 0; flex: 0 0 auto; }

.measurement-page { max-width: 76rem; margin: auto; }
.measurement-section { padding: 1.2rem; margin: 1rem 0; border: 1px solid var(--border); border-radius: .4rem; background: white; }
.measurement-section legend { color: var(--navy); font-weight: 650; }
.measurement-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.measurement-grid label, .measurement-notes { display: grid; gap: .4rem; }
.measurement-grid input { width: 100%; min-width: 0; }
.measurement-notes { margin: 1rem 0; }
.measurement-actions { padding: 1rem 0; }
@media (max-width: 650px) { .measurement-grid { grid-template-columns: 1fr; } }

.invoice-dialog { width: min(72rem, calc(100vw - 2rem)); height: min(88vh, 60rem); border: 1px solid var(--border); border-radius: .5rem; padding: 1.2rem; }
.invoice-dialog[open] { display: flex; flex-direction: column; gap: .8rem; }
.invoice-dialog h2, .invoice-dialog p { margin: 0; }
.invoice-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: .6rem; }
.invoice-toolbar label { display: grid; flex: 1 1 15rem; gap: .3rem; min-width: 0; }
.invoice-toolbar select { width: 100%; min-width: 0; }
.invoice-preview { flex: 1; min-height: 0; overflow: auto; background: #f1f1f3; }
.invoice-preview iframe { width: 100%; height: 100%; min-height: 22rem; border: 0; background: white; }
.invoice-preview img { display: block; max-width: 100%; margin: auto; }
.invoice-preview pre { white-space: pre-wrap; overflow-wrap: anywhere; padding: 1rem; }
.directory-form-grid textarea { width: 100%; min-height: 7rem; }

.aws-trial-notice{display:block;position:relative;z-index:100;background:#fff4d6;color:#332a10;padding:12px 18px;text-align:center;font:600 13px/1.5 system-ui;width:100%;box-sizing:border-box}
