:root {
  --bg: #f3f6fb;
  --panel: #ffffff;
  --panel-soft: #f8fbff;
  --line: #1d2a3a;
  --line-soft: #d7e1ee;
  --line-strong: #b7c7da;
  --muted: #5f6f82;
  --accent: #113d72;
  --accent-strong: #0b2f59;
  --accent-soft: #e8f0fb;
  --accent-soft-2: #f4f8fe;
  --success: #257148;
  --success-soft: #e8f6ee;
  --warning: #b97812;
  --warning-soft: #fff5df;
  --error: #c23a3a;
  --error-soft: #fff0f0;
  --shadow-sm: 0 1px 2px rgba(16, 37, 63, 0.06);
  --shadow-md: 0 10px 24px rgba(16, 37, 63, 0.08);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  background: linear-gradient(180deg, #f8fbff 0%, var(--bg) 180px, var(--bg) 100%);
  color: var(--line);
}

a {
  color: var(--accent);
}

.wrap {
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 24px;
}

.site-header {
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(17, 61, 114, 0.12);
  box-shadow: 0 6px 18px rgba(16, 37, 63, 0.05);
  backdrop-filter: blur(10px);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 18px;
  padding-bottom: 18px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.brand-logo {
  display: block;
  max-height: 58px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
}

.site-title {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent-strong);
}

.site-subtitle {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.top-nav {
  display: flex;
  gap: 10px;
  align-items: center;
}

.top-nav a {
  text-decoration: none;
  font-weight: 600;
  color: var(--accent-strong);
}

.top-nav > a:not(.nav-button) {
  padding: 10px 14px;
  border-radius: 999px;
}

.top-nav > a:not(.nav-button):hover {
  background: var(--accent-soft-2);
}

.nursing-home-top-nav {
  gap: 10px;
}

.nursing-home-top-nav .nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 126px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--accent-strong);
  text-decoration: none;
  font-weight: 700;
  line-height: 1;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.nursing-home-top-nav .nav-button:hover {
  background: var(--accent-soft-2);
  border-color: #9bb4d4;
}

.nursing-home-top-nav .nav-button.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 14px;
}

.facility-brand {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.facility-brand-fallback {
  min-width: 162px;
  padding: 0 10px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.nursing-home-facility-brand {
  width: 162px;
  height: 62px;
  justify-content: center;
  overflow: hidden;
}

.nursing-home-facility-brand.facility-brand-moundridge-manor {
  width: 192px;
  height: 76px;
}

.facility-brand-name {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  text-align: center;
  font-weight: 700;
  color: var(--accent-strong);
  line-height: 1.2;
}

.facility-brand-logo {
  display: block;
  max-height: 44px;
  max-width: 136px;
  width: auto;
  object-fit: contain;
}

.nursing-home-facility-brand .facility-brand-logo {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  object-position: center;
}

.user-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 0.94rem;
}

.page-shell {
  padding-top: 28px;
  padding-bottom: 34px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.page-header h2,
.card h2,
.card h3 {
  margin-top: 0;
  margin-bottom: 6px;
  color: var(--accent-strong);
  letter-spacing: -0.01em;
}

.action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.action-row form {
  margin: 0;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-md);
}

.narrow-card {
  max-width: 460px;
  margin: 0 auto;
}

.login-shell {
  min-height: calc(100vh - 220px);
  display: grid;
  align-items: center;
}

.login-card {
  padding: 24px;
}

.grid {
  display: grid;
  gap: 16px;
}

.two-up {
  grid-template-columns: minmax(260px, 320px) 1fr;
}

.admin-grid {
  grid-template-columns: repeat(2, minmax(280px, 1fr));
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 1fr);
  align-items: start;
}

.pharmacy-queue-dashboard {
  grid-template-columns: minmax(0, 2.35fr) minmax(260px, 0.8fr);
}

.stack-form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 600;
}

input,
select,
button,
textarea {
  font: inherit;
}

input[type="text"],
input[type="password"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  color: var(--line);
  box-shadow: inset 0 1px 1px rgba(12, 30, 53, 0.02);
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #7da2d4;
  box-shadow: 0 0 0 3px rgba(17, 61, 114, 0.12);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid var(--accent);
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  font-weight: 700;
  line-height: 1.2;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.button:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  transform: translateY(-1px);
}

.button-secondary {
  background: #fff;
  color: var(--accent-strong);
  border-color: var(--line-strong);
}

.button-secondary:hover {
  background: var(--accent-soft-2);
  border-color: #9bb4d4;
}

.small-button {
  min-height: 36px;
  padding: 8px 11px;
  font-size: 0.9rem;
}

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

.feedback-banner {
  margin: 0;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
}

.feedback-warning {
  color: #7f1d1d;
  border-color: #f1b3b3;
  background: var(--error-soft);
  font-weight: 700;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.metric-card {
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.metric-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.metric-value {
  display: block;
  margin-bottom: 8px;
  font-size: 2rem;
  line-height: 1;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.section-heading h3,
.section-heading p {
  margin-top: 0;
}

.stack-list {
  display: grid;
  gap: 12px;
}

.list-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.list-row p {
  margin-bottom: 0;
}

.list-metrics {
  display: grid;
  gap: 4px;
  text-align: right;
  font-weight: 700;
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
}

.filter-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.queue-filter-bar {
  grid-template-columns: minmax(280px, 1.6fr) auto;
  gap: 14px;
  margin-bottom: 14px;
}

.queue-search-field {
  margin: 0;
}

.queue-filter-pills {
  align-items: center;
}

.helper-box {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 13px 14px;
  background: #fff;
}

.draft-panel {
  margin-bottom: 14px;
}

.logo-preview {
  display: block;
  max-width: 100%;
  max-height: 72px;
  width: auto;
  object-fit: contain;
}

.logo-preview-app {
  max-height: 88px;
}

.scan-bar {
  display: flex;
  align-items: end;
  gap: 16px;
  margin-top: 16px;
}

.scan-workspace {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.scan-input-group {
  flex: 1;
  min-width: 0;
}

.scan-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.camera-scan-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #d9e5f2;
  border-radius: 14px;
  background: linear-gradient(180deg, #fbfdff 0%, #f4f8fe 100%);
}

.camera-scan-panel[hidden] {
  display: none !important;
}

.camera-scan-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.camera-scan-preview-frame {
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  overflow: hidden;
  background: #0d1b2a;
  min-height: 220px;
}

.camera-scan-video {
  display: block;
  width: 100%;
  min-height: 220px;
  max-height: 360px;
  object-fit: cover;
  background: #0d1b2a;
}

.camera-scan-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.camera-privacy-note {
  margin: 0;
}

.compact-feedback {
  margin: 0;
  padding: 8px 10px;
}

.entry-divider {
  align-self: flex-start;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 29px;
  min-height: 44px;
  padding: 0 6px;
  font-weight: 700;
  color: var(--muted);
}

.preview-panel {
  border: 1px solid #d9e5f2;
  border-radius: 14px;
  padding: 16px;
  background: linear-gradient(180deg, #fafcff 0%, #f5f9fe 100%);
}

.preview-panel-empty .preview-grid {
  display: none;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 10px;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.preview-field {
  display: grid;
  gap: 6px;
}

.preview-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.preview-value {
  display: block;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #fff;
  font-family: Consolas, "Courier New", monospace;
  white-space: pre-wrap;
  word-break: break-all;
}

.table-scroll {
  overflow-x: auto;
  scrollbar-color: #9bb4d4 #edf3fb;
}

.table-scroll-sync-group {
  display: grid;
  gap: 8px;
}

.table-scroll-sync {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-color: #9bb4d4 #edf3fb;
}

.table-scroll-sync-inner {
  height: 1px;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table th,
.data-table td {
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  padding: 10px;
  vertical-align: top;
  background: #fff;
}

.data-table th:first-child,
.data-table td:first-child {
  border-left: 1px solid var(--line-soft);
}

.data-table thead th {
  border-top: 1px solid var(--line-soft);
  background: #f7faff;
  color: var(--accent-strong);
  font-size: 0.92rem;
}

.data-table thead th:first-child {
  border-top-left-radius: 12px;
}

.data-table thead th:last-child {
  border-top-right-radius: 12px;
}

.data-table tbody tr:last-child td:first-child {
  border-bottom-left-radius: 12px;
}

.data-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 12px;
}

.data-table th {
  text-align: left;
  white-space: nowrap;
}

.reorder-table th:nth-child(1),
.reorder-table td:nth-child(1) {
  min-width: 180px;
}

.reorder-table th:nth-child(2),
.reorder-table td:nth-child(2) {
  min-width: 170px;
}

.reorder-table th:nth-child(3),
.reorder-table td:nth-child(3) {
  min-width: 300px;
}

.reorder-table th:nth-child(4),
.reorder-table td:nth-child(4) {
  min-width: 170px;
}

.reorder-table th:nth-child(5),
.reorder-table td:nth-child(5) {
  min-width: 360px;
}

.table-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.summary-chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid #d9e5f2;
  border-radius: 999px;
  background: #f8fbff;
  color: var(--accent-strong);
  font-weight: 700;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: none;
  line-height: 1.2;
}

.status-pdf-ready {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-color: #cbdcf2;
}

.status-resubmission-pdf-ready,
.status-pending-pdf {
  background: var(--warning-soft);
  color: #8a5a08;
  border-color: #efd39c;
}

.status-archive-saved-copy,
.status-archive-copy-saved,
.status-resubmission-archive-saved,
.status-fax-copy-saved {
  background: var(--success-soft);
  color: var(--success);
  border-color: #b7dfc7;
}

.status-submitted,
.status-sent-to-pharmacy,
.status-sent-to-pioneer,
.status-new,
.status-in-process,
.status-active,
.status-processed-by-pioneer {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-color: #c6d9f2;
}

.status-ready,
.status-completed {
  background: var(--success-soft);
  color: var(--success);
  border-color: #b7dfc7;
}

.status-archived,
.status-optional,
.status-warning,
.status-waiting-on-provider,
.status-on,
.status-off {
  background: var(--warning-soft);
  color: #8a5a08;
  border-color: #efd39c;
}

.status-problem-sending,
.status-handoff-failed,
.status-needs-setup,
.status-file-missing {
  background: var(--error-soft);
  color: #992c2c;
  border-color: #f0b0b0;
}

.barcode-box {
  display: inline-flex;
  min-width: 200px;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  background: #fff;
}

.barcode-box svg {
  max-width: 100%;
  height: auto;
}

.mono-cell {
  font-family: Consolas, "Courier New", monospace;
  word-break: break-all;
}

.audit-details {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.table-input {
  min-width: 340px;
  padding: 8px 10px;
}

.user-comment-input,
.user-comment-text {
  font-weight: 700;
}

.submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  background: #fbfdff;
}

.flash-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.flash {
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.flash-success {
  border-color: #b7dfc7;
  background: var(--success-soft);
  color: #185431;
}

.flash-error {
  border-color: #f0b0b0;
  background: var(--error-soft);
  color: #7f1d1d;
  max-width: 820px;
}

.search-form {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-sm);
}

.search-form input[type="search"] {
  min-width: 220px;
}

.inline-form {
  display: contents;
}

.facility-editor-list {
  display: grid;
  gap: 12px;
}

.facility-editor {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.readiness-grid,
.facility-readiness-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.facility-readiness-grid {
  grid-column: 1 / -1;
}

.readiness-box {
  display: grid;
  gap: 8px;
}

.readiness-anchor {
  color: inherit;
  text-decoration: none;
}

.readiness-anchor .readiness-box {
  height: 100%;
}

.readiness-anchor:hover .readiness-box {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}

.branding-grid {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  gap: 16px;
}

.helper-action-row {
  margin-top: -2px;
}

.toggle-filter-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin: 0 0 14px;
}

.facility-helper-actions {
  grid-column: 1 / -1;
}

.facility-logo-preview {
  display: flex;
  align-items: center;
  min-height: 72px;
}

.readiness-box p {
  margin: 0;
}

.readiness-pill {
  justify-self: start;
}

.readiness-ready {
  background: var(--success-soft);
  color: var(--success);
  border-color: #b7dfc7;
}

.readiness-needs-setup {
  background: var(--error-soft);
  color: #992c2c;
  border-color: #f0b0b0;
}

.readiness-optional {
  background: var(--warning-soft);
  color: #8a5a08;
  border-color: #efd39c;
}

.stacked-cell,
.summary-cell {
  min-width: 0;
}

.stacked-cell {
  display: grid;
  gap: 4px;
}

.compact-main-table th,
.compact-main-table td {
  padding: 8px;
}

.compact-main-table th:nth-child(1),
.compact-main-table td:nth-child(1) {
  min-width: 170px;
}

.compact-main-table th:nth-child(2),
.compact-main-table td:nth-child(2) {
  min-width: 220px;
}

.compact-main-table th:nth-child(3),
.compact-main-table td:nth-child(3) {
  min-width: 150px;
}

.compact-main-table th:nth-child(4),
.compact-main-table td:nth-child(4) {
  min-width: 210px;
}

.compact-main-table th:nth-child(5),
.compact-main-table td:nth-child(5) {
  min-width: 160px;
}

.compact-main-table th:nth-child(6),
.compact-main-table td:nth-child(6) {
  width: 92px;
}

.compact-main-table th:nth-child(7),
.compact-main-table td:nth-child(7),
.compact-main-table th:nth-child(8),
.compact-main-table td:nth-child(8) {
  min-width: 110px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.center-cell {
  text-align: center;
}

.resubmission-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border: 1px solid #d8c086;
  border-radius: 999px;
  background: var(--warning-soft);
  color: #8a5a08;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.resubmission-meta,
.table-note {
  display: grid;
  gap: 6px;
}

.resubmission-meta p,
.table-note p {
  margin: 0;
}

.resend-panel {
  display: grid;
  gap: 10px;
}

.resend-panel summary {
  list-style: none;
}

.resend-panel summary::-webkit-details-marker {
  display: none;
}

.resend-form {
  margin-top: 10px;
  min-width: 320px;
}

.warning-text {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #efd39c;
  border-radius: 12px;
  background: var(--warning-soft);
  color: #7b5308;
  font-weight: 600;
}

.compact-raw-cell {
  max-width: 180px;
}

.duplicate-row-match td {
  background: var(--warning-soft);
}

.inquiry-list {
  display: grid;
  gap: 8px;
  margin-top: 6px;
}

.inquiry-row {
  font-weight: 500;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}

.inquiry-row:hover {
  background: #f9fbff;
  border-color: #bfd0e5;
}

.inquiry-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.inquiry-row span {
  line-height: 1.35;
}

.quick-action-grid {
  display: grid;
  gap: 8px;
}

.quick-action-grid form,
.action-stack {
  display: grid;
  gap: 8px;
}

.action-stack form {
  margin: 0;
}

.action-stack .button,
.action-stack form .button,
.sent-orders-action-stack > .button,
.sent-orders-action-stack > details > summary.button,
.sent-orders-action-stack form .button {
  width: 100%;
}

.sent-orders-action-stack {
  min-width: 164px;
}

.sent-orders-action-stack > .button,
.sent-orders-action-stack > details > summary.button,
.sent-orders-action-stack form .button {
  min-height: 38px;
  padding: 8px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sent-orders-action-stack > details {
  width: 100%;
}

.compact-line-form {
  min-width: 220px;
}

.compact-line-form textarea,
.compact-line-form select {
  width: 100%;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.submission-detail-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(420px, 1.35fr);
  gap: 16px;
  align-items: start;
}

.submission-details-card {
  min-width: 0;
}

.submission-workflow-card {
  min-width: 0;
  border-color: #bfd0e5;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.submission-details-grid .helper-box,
.workflow-summary-box {
  min-height: 100%;
}

.submission-badge-row {
  justify-content: flex-end;
}

.detail-callout {
  margin-top: 12px;
}

.workflow-actions-row {
  margin-top: 14px;
}

.line-field-patient {
  min-width: 160px;
  max-width: 220px;
}

.line-field-drug {
  min-width: 320px;
}

.line-field-response {
  min-width: 180px;
}

.line-field-comment {
  min-width: 340px;
}

.detail-value {
  font-size: 1.4rem;
}

.detail-status {
  line-height: 1.15;
}

.detail-status-new,
.detail-status-in-process,
.detail-status-sent-to-pioneer,
.detail-status-sent-to-pharmacy,
.detail-status-processed-by-pioneer,
.detail-status-active {
  color: var(--accent-strong);
}

.detail-status-completed,
.detail-status-ready {
  color: var(--success);
}

.detail-status-archived,
.detail-status-waiting-on-provider,
.detail-status-optional {
  color: #8a5a08;
}

.detail-status-problem-sending,
.detail-status-handoff-failed,
.detail-status-needs-setup {
  color: #992c2c;
}

@media (max-width: 900px) {
  .header-row,
  .page-header,
  .submit-row,
  .scan-bar,
  .camera-scan-header,
  .preview-header,
  .table-actions,
  .section-heading,
  .list-row {
    flex-direction: column;
    align-items: stretch;
  }

  .two-up,
  .admin-grid,
  .facility-editor,
  .preview-grid,
  .dashboard-grid,
  .submission-detail-layout,
  .filter-bar,
  .branding-grid {
    grid-template-columns: 1fr;
  }

  .header-user {
    flex-direction: column;
    align-items: stretch;
  }

  .user-meta {
    align-items: flex-start;
  }

  .top-nav {
    flex-wrap: wrap;
  }

  .nursing-home-top-nav .nav-button {
    min-width: 0;
    flex: 1 1 140px;
  }

  .list-metrics {
    text-align: left;
  }
}

@media print {
  body {
    background: #fff;
  }

  .site-header,
  .flash-stack,
  .button,
  .search-form {
    display: none !important;
  }

  .card {
    border-width: 1px;
    box-shadow: none;
    break-inside: avoid;
  }
}
