/* Admin and review screen. Colors measured from the mockup boards (DEV-S2-3). */
.admin main.wide { max-width: 1200px; }
.admin main.full { max-width: none; padding: 12px 16px 96px; }
.admin-header .tool-name { color: var(--muted); font-size: 0.9rem; }
/* the header links match the public site's nav (src/styles/global.css .nav-links): gap 30px, 15px Inter 500, body color, ink on hover */
.admin-nav { display: flex; flex-wrap: wrap; gap: 30px; align-items: center; }
.admin-nav a { text-decoration: none; font-family: "Inter", sans-serif; font-size: 15px; font-weight: 500; line-height: 1.65; color: #4B4E57;
               min-height: 44px; display: inline-flex; align-items: center; }
.admin-nav a:hover { color: #2C2F36; }
/* the account avatar: a 40 px lavender circle with the admin's initials, in a 44 px button; its menu needs no script */
.avatar-menu { position: relative; }
.avatar { list-style: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; cursor: pointer; border-radius: 50%; }
.avatar::-webkit-details-marker { display: none; }
.avatar-circle { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: #B49AC8;
                 color: #fff; font: 700 15px/1 "Inter", sans-serif; letter-spacing: 0.02em; }
.avatar-menu .menu { position: absolute; right: 0; top: 48px; z-index: 30; min-width: 200px; background: var(--card); border: 1px solid var(--hair);
                     border-radius: 12px; box-shadow: 0 6px 18px rgba(44, 47, 54, 0.12); padding: 6px; }
.avatar-menu .menu a, .avatar-menu .menu-btn { display: flex; align-items: center; width: 100%; min-height: 44px; padding: 8px 12px; border: 0; background: none;
                     border-radius: 8px; color: var(--ink); font: 500 15px "Inter", sans-serif; text-decoration: none; cursor: pointer; }
.avatar-menu .menu a:hover, .avatar-menu .menu-btn:hover { background: var(--panel); }
/* compact pill buttons (viewer and panel controls, 44 px tall) */
.btn.pill, button.pill { min-height: 44px; padding: 8px 16px; font-size: 0.95rem; }
form.inline { display: inline; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 16px; }
.chip { border: 1px solid var(--hair2); border-radius: 999px; padding: 6px 12px; text-decoration: none; color: var(--body); min-height: 36px; display: inline-flex; gap: 6px; align-items: center; }
.chip.on { background: var(--panel); color: var(--ink); font-weight: 600; }
.chip .count { color: var(--muted); }
table.queue { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 14px; overflow: hidden; }
table.queue th, table.queue td { text-align: left; padding: 10px; border-bottom: 1px solid var(--hair); vertical-align: top; }
.status { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--panel); font-size: 0.9rem; }

/* READY TO SEND */
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; border-radius: 14px; padding: 12px 16px; margin: 10px 0; }
.banner .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.banner.notready { background: #F1EEF0; border: 1px dashed #C9BFC5; color: #6E6A70; }
.banner.notready .dot { background: #B9B1B6; }
.banner.ready { background: #D6F0DF; border: 1px solid #2E8B57; color: #1B5E36; }
.banner.ready strong { color: #1F4D31; }
.banner.ready .dot { background: #2E8B57; }

/* the three areas */
/* the header: name and save time on the first row, the meta line and the buttons on the second (Luis's walkthrough) */
.app-head { display: grid; grid-template-columns: 1fr auto; column-gap: 16px; row-gap: 4px; align-items: center; }
.app-head h1 { margin: 0; grid-column: 1; grid-row: 1; }
.app-head .saved-line { grid-column: 2; grid-row: 1; justify-self: end; align-self: start; font-size: 0.8rem; color: var(--muted); }
.app-head > .meta { grid-column: 1; grid-row: 2; margin: 0; }
.app-actions { grid-column: 2; grid-row: 2; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
@media (max-width: 900px) { .app-head { grid-template-columns: 1fr; } .app-head .saved-line, .app-head > .meta, .app-actions { grid-column: 1; grid-row: auto; justify-self: start; } .app-actions { justify-content: flex-start; } }
.date-u { text-decoration: underline; }
.workspace { display: grid; grid-template-columns: minmax(280px, 360px) 1fr minmax(260px, 340px); gap: 12px; align-items: start; }
.panel { background: var(--card); border: 1px solid var(--hair); border-radius: 14px; padding: 12px; min-height: 200px; }
.panel.collapsed, .panel.popped { padding: 0; min-height: 0; background: none; border: 0; }
.workspace:has(#panel-items.collapsed, #panel-items.popped) { grid-template-columns: 48px 1fr minmax(260px, 340px); }
.workspace:has(#panel-report.collapsed, #panel-report.popped) { grid-template-columns: minmax(280px, 360px) 1fr 48px; }
.workspace:has(#panel-items.collapsed, #panel-items.popped):has(#panel-report.collapsed, #panel-report.popped) { grid-template-columns: 48px 1fr 48px; }
.rail { writing-mode: vertical-rl; min-height: 240px; width: 44px; border-radius: 12px; border: 1px solid var(--hair2); background: var(--panel); color: var(--ink); cursor: pointer; display: flex; gap: 8px; align-items: center; justify-content: center; font: 600 0.9rem "Inter", sans-serif; }
.panel.popped .rail { background: #75638D; color: #fff; border-color: #75638D; }
.rail .dot { width: 8px; height: 8px; border-radius: 50%; background: #2E8B57; }
.panel-ctl { display: flex; justify-content: flex-end; gap: 8px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; }
.panel-head h2 { margin: 4px 0; font-size: 1.1rem; }
.viewer .strip { text-align: center; font-weight: 600; letter-spacing: 0.04em; color: #6E6A70; background: #F1EEF0; border-radius: 8px; padding: 6px; }
.viewer-ctl { margin: 8px 0; }
.viewer-ctl .ctl-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin: 6px 0; }
.viewer-ctl .ctl-row.ctl-left { justify-content: flex-start; }
.viewer-ctl .ctl-grp { display: flex; flex-wrap: wrap; gap: 8px; }
.viewer-ctl select, .viewer-ctl input { width: auto; min-width: 70px; }
.viewer-ctl select { max-width: 280px; }
.viewer-ctl #page-input { width: 84px; }
.well { background: #EEE8EB; border-radius: 12px; padding: 16px; overflow: auto; text-align: center; }
.well img { background: #fff; box-shadow: 0 2px 12px rgba(44, 47, 54, 0.12); max-width: 100%; }
.well img.z2 { max-width: none; width: 150%; }
.well img.z3 { max-width: none; width: 200%; }
option.changed { color: #C2610C; }
.rcard { border: 1px solid var(--hair); border-radius: 12px; padding: 10px 12px; margin: 10px 0; background: #fff; }
.rcard.done { border-color: #2E8B57; }
.rcard header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rcard h3 { margin: 0; font-size: 1rem; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.grid3 input, .lines input { min-height: 40px; }
table.lines, table.checks { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.lines td, table.lines th, table.checks td, table.checks th { padding: 4px 6px; border-bottom: 1px solid var(--hair); text-align: left; }
tr.r-Failed td { color: var(--error); font-weight: 600; }
ul.lookups { list-style: none; padding: 0; margin: 0; }
.counts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; margin: 8px 0; }
.counts div { background: var(--panel); border-radius: 10px; padding: 6px; }
.counts strong { display: block; font-size: 1.3rem; color: var(--ink); }
.counts span { font-size: 0.8rem; color: var(--muted); }
.brow { border-left: 4px solid #C2610C; padding: 6px 10px; margin: 8px 0; background: #fff; }
.brow.customer { border-left-color: #3A72B0; }
.notice.small { font-size: 0.9rem; padding: 8px 10px; }
.btn-danger { border-color: #C2610C; color: #8A4B08; }
.bottom-bar { display: none; }
.tabs { display: none; }
pre.preview, .mail pre { white-space: pre-wrap; background: var(--panel); border-radius: 10px; padding: 10px; }
img.first-page { max-width: 100%; box-shadow: 0 2px 12px rgba(44, 47, 54, 0.12); }
input.unknown { border-color: #C2610C; }
.group label { display: block; margin: 6px 0; }
.popout main { max-width: 560px; }
.live { font-size: 0.9rem; }

/* iPhone layout (the Phone board): three tabs and a fixed bottom bar */
@media (max-width: 767px) {
  .workspace { display: block; }
  .workspace > .panel { display: none; }
  .workspace > .panel.tab-on { display: block; }
  .panel-ctl, .rail { display: none !important; }
  .tabs { display: flex; gap: 4px; background: #F5EEF2; border-radius: 999px; padding: 4px; margin: 8px 0; }
  .tab { flex: 1; min-height: 44px; border: 0; border-radius: 999px; background: transparent; font: 600 0.95rem "Inter", sans-serif; color: var(--body); }
  .tab.on { background: #fff; color: var(--ink); }
  .bottom-bar { display: flex; gap: 8px; position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 12px; background: var(--card); border-top: 1px solid var(--hair); z-index: 5; }
  .bottom-bar > * { flex: 1; }
  .bottom-bar .btn { width: 100%; }
  .app-actions .btn, .actions .btn { min-height: 44px; }
  .admin-nav a { min-height: 44px; }
  .counts { grid-template-columns: repeat(2, 1fr); }
}

/* the build line at the bottom of the report card, one item per line; rows that jump the viewer */
.buildline { list-style: none; padding: 0; margin: 12px 0 0; color: var(--muted); font-size: 0.9rem; }
.buildline li { margin: 2px 0; }
tr.jump, .brow[data-page], h3.jump[data-page] { cursor: pointer; }
/* Lookup Tables (Luis's walkthrough): links as pills, hospitals in their own column, counts right-aligned */
.pill-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.lk-table th.num, .lk-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.lk-table tbody tr:hover { background: var(--panel); }
.lk-table td a { font-weight: 500; }
.due-chip { background: #F6E7C8; color: #6B4E0F; }

/* Stage 3: the queue's search, lane filter and sortable headers; the refund flag */
.queue-search { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
.queue-search input[type=search] { min-height: 44px; min-width: 260px; padding: 8px 12px; border: 1px solid var(--hair2, #E3D8DE); border-radius: 10px; font: inherit; }
.queue-search select { min-height: 44px; padding: 8px 10px; border: 1px solid var(--hair2, #E3D8DE); border-radius: 10px; font: inherit; }
.queue th a { color: inherit; text-decoration: none; }
.queue th[aria-sort="ascending"] a::after { content: " \2191"; }
.queue th[aria-sort="descending"] a::after { content: " \2193"; }
.queue .flag { display: inline-block; margin-top: 4px; font-size: 0.85rem; font-weight: 600; color: #B42318; }

/* Intake Answers, questionnaire mirror (Stage 13) */
.ans-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: start; }
.ans-jump { position: sticky; top: 12px; z-index: 20; }
.ans-jump ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.ans-jump a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 12px; border-radius: 12px; color: var(--body); text-decoration: none; font-weight: 500; }
.ans-jump a:hover { background: var(--panel); color: var(--ink); }
.ans-jump .num, .ans-sec h2 .num { color: var(--lavender-text); font-variant-numeric: tabular-nums; }
.ans-sec { scroll-margin-top: 16px; }
.ans-sec h2 { margin-top: 0; }
.ans-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); margin: 0; }
.ans-grid > dt, .ans-grid > dd { margin: 0; padding: 10px 0; border-top: 1px solid var(--hair); }
.ans-grid > dt { padding-right: 16px; color: var(--ink); font-weight: 500; }
.ans-grid > dd { min-width: 0; overflow-wrap: anywhere; }
.ans-grid > dt:first-of-type, .ans-grid > dt:first-of-type + dd { border-top: 0; }
.row-card { margin: 0 0 10px; padding: 2px 14px 6px; background: var(--card); border: 1px solid var(--hair2); border-radius: 14px; }
.row-card.nested { background: var(--panel); }
.row-card:last-child { margin-bottom: 0; }
.row-head { margin: 8px 0 0; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.ans-grid .na { color: var(--muted); }
.file-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--hair2); background: var(--panel); color: var(--muted); font-size: 0.9rem; }
.file-pill.attached { color: var(--ok); }
.ans-grid .override-now { margin: 0; }
.ans-grid .override-now .tag { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--lavender); color: var(--ink); font-size: 0.8rem; font-weight: 600; }
.ans-orig { margin: 4px 0 0; color: var(--muted); font-size: 0.9rem; }
.reveal { display: inline; }
.reveal summary { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; list-style: none; color: var(--link); }
.reveal summary::-webkit-details-marker { display: none; }
.reveal .mask { color: var(--muted); letter-spacing: 0.1em; }
.reveal .hide-word, .reveal[open] .show-word, .reveal[open] .mask { display: none; }
.reveal[open] .hide-word { display: inline; }
.reveal .secret { margin-left: 8px; color: var(--body); }
@media (max-width: 900px) {
  .ans-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .ans-jump { top: 0; margin: 0 -4px; padding: 8px 4px; background: var(--cream); }
  .ans-jump ol { flex-direction: row; gap: 8px; overflow-x: auto; }
  .ans-jump a { white-space: nowrap; border: 1px solid var(--hair2); border-radius: 999px; background: var(--card); }
  .ans-sec { scroll-margin-top: 72px; }
}
@media (max-width: 767px) {
  .ans-grid { grid-template-columns: minmax(0, 1fr); }
  .ans-grid > dt { padding-bottom: 2px; }
  .ans-grid > dd { padding-top: 0; border-top: 0; }
}
