/* MED is a global operations page. Keep these styles scoped to /mm/med. */
.shell.screen-med .med-overview-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin: 0 0 16px;
}
.shell.screen-med .med-overview-heading h2 {
    margin: 5px 0 4px;
    color: hsl(var(--foreground));
    font-size: clamp(20px, 2vw, 25px);
    line-height: 1.2;
}
.shell.screen-med .med-overview-heading p,
.shell.screen-med .med-filter-heading p {
    margin: 0;
    color: hsl(var(--muted-foreground));
    font-size: 13px;
    line-height: 1.5;
}
.shell.screen-med .med-kicker {
    display: block;
    color: hsl(var(--muted-foreground));
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
}
.shell.screen-med .med-overview-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: none;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius-md);
    background: hsl(var(--card));
    color: hsl(var(--foreground));
    font-size: 12px;
    font-weight: 650;
    text-decoration: none;
}
.shell.screen-med .med-overview-link:hover { background: hsl(var(--muted) / .5); }
.shell.screen-med .med-overview-link:focus-visible,
.shell.screen-med .med-table-wrap:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 3px; }

.shell.screen-med .med-summary { margin-bottom: 24px; }
.shell.screen-med .med-summary .med-stat-card {
    min-height: 145px;
    padding: 18px 20px;
    background: hsl(var(--card));
    border-color: hsl(var(--border));
}
.shell.screen-med .med-summary .med-stat-card > span { color: hsl(var(--muted-foreground)); }
.shell.screen-med .med-summary .med-stat-card > strong {
    color: hsl(var(--foreground));
    font-size: clamp(24px, 2vw, 31px);
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}
.shell.screen-med .med-summary .med-stat-card > small { color: hsl(var(--muted-foreground)); }
.shell.screen-med .med-summary .med-stat-card.attention {
    border-color: hsl(var(--primary) / .5);
    background: hsl(var(--primary) / .07);
}
.shell.screen-med .med-summary .med-stat-card.attention > strong { color: hsl(var(--foreground)); }

.shell.screen-med .med-cases-panel { display: grid; gap: 18px; }
.shell.screen-med .med-cases-panel .panel-head {
    align-items: flex-start;
    gap: 16px;
    margin: 0;
}
.shell.screen-med .med-cases-panel .panel-head h2 { margin: 5px 0 6px; }
.shell.screen-med .med-cases-panel .panel-head p { max-width: 65ch; line-height: 1.5; }
.shell.screen-med .med-cases-panel .count-badge {
    flex: none;
    margin-left: auto;
    border-color: hsl(var(--border));
    background: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
}
.shell.screen-med .med-decision-note {
    padding: 14px 16px;
    border: 1px solid hsl(var(--border));
    border-left: 3px solid hsl(var(--primary));
    border-radius: var(--radius-md);
    background: hsl(var(--muted) / .35);
}
.shell.screen-med .med-decision-note strong { color: hsl(var(--foreground)); font-size: 13px; }
.shell.screen-med .med-decision-note p {
    max-width: 92ch;
    margin: 4px 0 0;
    color: hsl(var(--muted-foreground));
    font-size: 13px;
    line-height: 1.55;
}
.shell.screen-med .manual-med { margin: 0; }
.shell.screen-med .manual-med .action-content { background: hsl(var(--card)); }
.shell.screen-med .manual-med .form-actions { flex-wrap: wrap; }
.shell.screen-med .manual-med .detail-list code,
.shell.screen-med .med-table code { overflow-wrap: anywhere; white-space: normal; }
.shell.screen-med .med-filter-heading h3 {
    margin: 0 0 3px;
    color: hsl(var(--foreground));
    font-size: 15px;
}
.shell.screen-med .med-filters {
    gap: 12px;
    margin: 0;
    padding: 16px;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius-lg);
    background: hsl(var(--muted) / .25);
}
.shell.screen-med .med-filters > label { min-width: 0; }
.shell.screen-med .med-filters input,
.shell.screen-med .med-filters select { min-width: 0; width: 100%; }
.shell.screen-med .med-filters .form-actions { align-self: end; margin: 0; }
.shell.screen-med .med-results-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    color: hsl(var(--foreground));
    font-size: 14px;
}
.shell.screen-med .med-results-heading span { color: hsl(var(--muted-foreground)); font-size: 12px; }
.shell.screen-med .med-cases-panel > .med-table-wrap { margin-top: 0; overflow-x: auto; }
.shell.screen-med .med-table { min-width: 1030px; }
.shell.screen-med .med-table th,
.shell.screen-med .med-table td { vertical-align: top; }
.shell.screen-med .med-table td { line-height: 1.45; }
.shell.screen-med .med-table td:first-child,
.shell.screen-med .med-table td:nth-child(4) { font-variant-numeric: tabular-nums; }
.shell.screen-med .med-table .muted-state { display: block; margin-top: 6px; line-height: 1.45; }
.shell.screen-med .med-table .confirm-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.shell.screen-med .med-table .confirm-actions button { white-space: normal; text-align: left; }
.shell.screen-med .med-table .med-empty { padding: 36px 20px; text-align: center; }
.shell.screen-med .med-table .med-empty strong,
.shell.screen-med .med-table .med-empty span { display: block; }
.shell.screen-med .med-table .med-empty strong { margin-bottom: 5px; color: hsl(var(--foreground)); font-size: 15px; }
.shell.screen-med .med-table .med-empty span { color: hsl(var(--muted-foreground)); font-size: 13px; }

@media (max-width: 700px) {
    .shell.screen-med .med-overview-heading { align-items: flex-start; flex-direction: column; }
    .shell.screen-med .med-summary .med-stat-card { min-height: 125px; padding: 16px; }
    .shell.screen-med .med-cases-panel { gap: 16px; }
    .shell.screen-med .med-cases-panel .panel-head { flex-direction: column; }
    .shell.screen-med .med-cases-panel .count-badge { margin-left: 0; }
    .shell.screen-med .med-filters { padding: 14px; }
    .shell.screen-med .med-filters .form-actions,
    .shell.screen-med .med-filters .form-actions button { width: 100%; }
    .shell.screen-med .manual-med .inline-form,
    .shell.screen-med .manual-med .form-actions { align-items: stretch; }
    .shell.screen-med .manual-med .form-actions button { width: 100%; }
}
