/* 院长端：一页看板 + 名册维护。
   只写这一端特有的排布；卡片、按钮、表单、表格、页签、弹层全部复用 app.css。
   信息密度优先：数字等宽、行高紧凑、同一列对齐。 */

.a-wrap { padding-top: 18px; }

/* ── 页头与页签 ── */
.a-head { align-items: flex-end; margin-bottom: 12px; }
.a-head h1 { font-size: 23px; }
.a-head .sub { line-height: 1.55; max-width: 820px; }
.a-head-right { align-items: center; gap: 8px; }
.a-sync {
  font-size: 12px; color: var(--faint);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.a-tabs { margin-bottom: 14px; }
.a-banner { margin-bottom: 12px; }

/* ── 看板：四个数字 ── */
.a-nums {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px; margin-bottom: 14px;
}
.a-num {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 11px 16px 10px;
}
.a-num-v {
  font-size: 31px; line-height: 1.1; font-weight: 600;
  font-variant-numeric: tabular-nums; letter-spacing: -.5px;
}
.a-num-v.a-text { font-size: 22px; line-height: 1.45; letter-spacing: 0; }
.a-num-l {
  margin-top: 3px; font-size: 13px; color: var(--muted);
  display: flex; flex-direction: column; gap: 1px;
}
.a-num-l span { font-size: 12px; color: var(--faint); }
.a-num.bad .a-num-v { color: var(--red); }
.a-num.warn .a-num-v { color: var(--amber); }
.a-num.ok .a-num-v { color: var(--green); }

/* 浅色按钮里的 loading 圈不能是白的，否则看不见 */
.a-wrap .btn.ghost .spin, .a-wrap .btn.danger .spin {
  border-color: rgba(42, 35, 29, .22); border-top-color: var(--ink);
}

/* ── 看板：班次 / 本班 / 未闭合 / 交接 ── */
.a-cols {
  display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr);
  gap: 12px; margin-bottom: 14px;
}
.a-block { margin-bottom: 14px; }
.a-cols .card h3, .a-block h3 { font-size: 15px; }
.a-cols .card h3 .sub, .a-block h3 .sub {
  font-weight: 400; color: var(--muted); font-size: 12.5px; margin-left: 8px;
}

.a-shift {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 0; border-top: 1px solid var(--line-2);
}
.a-shift:first-child { border-top: 0; padding-top: 1px; }
.a-shift-l { min-width: 0; }
.a-shift-l b { font-size: 15px; }
.a-shift-l span { display: block; font-size: 12.5px; color: var(--muted); }
.a-shift-r {
  margin-left: auto; display: flex; flex-direction: column;
  align-items: flex-end; gap: 2px; flex: none;
}
.a-shift-t { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }

.a-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.a-mini-item { border-left: 2px solid var(--line); padding-left: 10px; }
.a-mini-item b {
  display: block; font-size: 22px; line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.a-mini-item span { font-size: 12.5px; color: var(--muted); }

.a-open-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 0; border-top: 1px solid var(--line-2);
}
.a-open-row:first-child { border-top: 0; padding-top: 2px; }
.a-open-main { flex: 1; min-width: 0; }
.a-open-text { font-size: 14.5px; line-height: 1.5; }
.a-open-meta { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.a-open-src { font-size: 12px; color: var(--faint); white-space: nowrap; padding-top: 3px; flex: none; }

.a-sheet { padding: 10px 0 2px; border-top: 1px solid var(--line-2); }
.a-sheet:first-child { border-top: 0; padding-top: 2px; }
.a-sheet-h { display: flex; align-items: baseline; gap: 10px; }
.a-sheet-h b { font-size: 14.5px; }
.a-sheet-time { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.a-sheet-h .pill { margin-left: auto; }
.a-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.a-chip {
  display: inline-flex; align-items: baseline; gap: 5px;
  font-size: 13px; line-height: 1.6; padding: 2px 9px; border-radius: 7px;
  background: var(--paper-2); border: 1px solid var(--line-2); color: var(--ink-2);
}
.a-chip-k { font-style: normal; font-size: 11.5px; color: var(--faint); letter-spacing: .5px; }
.a-chip.miss { background: var(--red-s); border-color: #E3B7AE; color: var(--red); font-weight: 600; }
.a-chip.advice { background: var(--blue-s); border-color: #CFDDEA; color: var(--blue); }
.a-chip.fact { background: var(--paper); color: var(--muted); }
.a-warn { margin-top: 8px; font-size: 12.5px; color: var(--amber); }
.a-zero { font-size: 13.5px; color: var(--muted); line-height: 1.7; }
.a-zero span { display: block; font-size: 12.5px; color: var(--faint); }
.a-caliber { margin: 8px 0 0; font-size: 12.5px; color: var(--faint); line-height: 1.7; }

/* ── 名册：统计条、机构、楼层与班组 ── */
.a-counts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.a-counts .pill { font-variant-numeric: tabular-nums; }
.a-counts b { color: var(--ink); font-weight: 600; }

.a-toolbar { display: flex; align-items: baseline; gap: 10px; margin-bottom: 9px; }
.a-toolbar h2 {
  margin: 0; font-size: 15px; letter-spacing: 1px;
  color: var(--muted); font-weight: 600;
}
.a-hint { font-size: 12.5px; color: var(--faint); font-weight: 400; letter-spacing: 0; }
.a-toolbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.a-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 22px; }
.a-place { display: flex; flex-direction: column; }
.a-place .a-list { flex: 1; }

.a-list { display: flex; flex-direction: column; }
.a-list-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0; border-top: 1px solid var(--line-2); font-size: 14px;
}
.a-list-row:first-child { border-top: 0; }
.a-list-row > div:first-child { min-width: 0; }
.a-list-sub { margin-left: 8px; font-size: 12.5px; color: var(--muted); }
.a-list-act { margin-left: auto; display: flex; gap: 6px; flex: none; }

.a-addline { display: flex; align-items: flex-end; gap: 8px; margin-top: 10px; }
.a-addline .field { margin-bottom: 0; flex: 1; min-width: 0; }
.a-addline .field > label { font-size: 12px; }
.a-addline .btn { flex: none; }
.a-addline-2 .field:first-child { flex: 1.4; }
.a-addline + .errline { margin-top: 8px; }

.a-formfoot { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.a-formfoot .a-note { margin-right: auto; }
.a-formfoot .btn { flex: none; }
.a-note { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.a-opt { font-size: 11.5px; color: var(--faint); font-weight: 400; }

/* ── 表格：比通用表格再紧一档 ── */
.tbl.a-dense th, .tbl.a-dense td { padding: 8px 12px; }
.tbl.a-dense th.a-th-actions { text-align: right; }
.tbl.a-dense td.actions { white-space: nowrap; }
.tbl.a-dense td.a-clip { max-width: 210px; }
.a-key { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.a-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
}
.a-sub { font-size: 12px; color: var(--muted); line-height: 1.5; }
.a-clip {
  max-width: 340px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── 家属与设备 ── */
.a-fam-list { display: flex; flex-direction: column; gap: 10px; }
.a-fam {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
.a-fam-hd {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; background: var(--paper-2);
  border-bottom: 1px solid var(--line-2);
}
.a-fam-hd b { font-size: 14.5px; }
.a-fam-bed { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.a-fam-note { margin-left: auto; font-size: 12px; color: var(--faint); }
.a-fam-hd .btn { margin-left: auto; }
.a-fam-body { padding: 0 14px 2px; }
.a-fam-empty { padding: 10px 0; font-size: 13px; color: var(--muted); }

.a-link {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 8px 0; border-top: 1px solid var(--line-2); font-size: 14px;
}
.a-link:first-child { border-top: 0; }
.a-link-main { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.a-phone { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.a-link-state {
  display: flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--muted);
}
.a-link-act { margin-left: auto; display: flex; gap: 6px; }

/* ── 弹层里的邀请码 / 配对码 ── */
.a-secret { display: flex; flex-direction: column; gap: 10px; padding: 4px 0 2px; }
.a-secret-label { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.a-secret-note { font-size: 12.5px; color: var(--muted); line-height: 1.65; }
.a-linkbox { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.a-url { flex: 1; min-width: 0; overflow-wrap: anywhere; line-height: 1.9; }

/* 设备表的状态里有配对码和有效期，窄屏让它横向滚动而不是挤成三行 */
.tbl.a-kiosk th, .tbl.a-kiosk td { white-space: nowrap; }
.a-bigcode {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 38px; font-weight: 600; letter-spacing: 8px;
  text-align: center; padding: 12px 0 12px 8px;
  background: var(--paper); border: 1px dashed var(--line);
  border-radius: var(--radius); font-variant-numeric: tabular-nums;
}

.a-dialog-form { padding-top: 2px; }
.a-dialog-form .errline { margin-bottom: 10px; }
.a-dialog-form .form-row .field { margin-bottom: 10px; }
.a-dialog-form .a-note { margin: 2px 0 6px; }

/* ── 窄屏 ── */
@media (max-width: 900px) {
  .a-nums { grid-template-columns: 1fr 1fr; }
  .a-cols { grid-template-columns: 1fr; }
  .a-pair { grid-template-columns: 1fr; }
  .a-head { flex-wrap: wrap; }
  .a-head-right { margin-left: 0; width: 100%; justify-content: flex-end; }
}

@media (max-width: 560px) {
  .a-num-v { font-size: 26px; }
  .a-formfoot { flex-wrap: wrap; }
  .a-formfoot .btn { width: 100%; }
  .a-formfoot .a-note { margin-right: 0; }
  .a-num-v.a-text { font-size: 20px; }
  .a-addline { flex-wrap: wrap; }
  .a-addline .field { flex-basis: 100%; }
  .a-addline .btn { width: 100%; }
  .a-toolbar { flex-wrap: wrap; }
  .a-toolbar-right { margin-left: 0; }
  .a-link { align-items: flex-start; }
  .a-link-act { margin-left: 0; width: 100%; }
  .a-linkbox .code { flex-basis: 100%; }
  .a-fam-hd { flex-wrap: wrap; }
  .a-fam-hd .btn { margin-left: 0; }
}

/* 工号：跟在姓名后面的小字，一眼看出是哪一个「李秀莲」。 */
.a-pid {
  margin-left: 4px;
  padding: 0 4px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}


/* archive lookup: one input + one button, no date picker */
.a-lookup {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.a-lookup label { font-weight: 600; font-size: 13.5px; }
.a-lookup input {
  flex: 1; min-width: 220px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}
.a-lookup input:focus { outline: 2px solid var(--clay); outline-offset: 1px; }
.a-lookup-hint { font-size: 13px; color: var(--muted); }
.a-lookup-hint.bad { color: var(--red); }

/* 补录条目的出处：跟在条目后面，小字，不抢内容 */
.a-chip-by {
  margin-left: 6px;
  font-style: normal;
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* urgent strip: the three things a director must know right now */
.a-urgent {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--red);
  border-radius: var(--radius);
  background: var(--red-s);
  font-size: 13.5px;
}

/* coverage bar: named / blanket / unmentioned, exclusive and summing to total */
.a-cov-bar {
  display: flex;
  height: 12px;
  margin: 10px 0 8px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--line);
}
.a-cov-bar i { display: block; height: 100%; }
.a-cov-bar .named { background: var(--green); }
.a-cov-bar .blanket { background: var(--amber); }
.a-cov-bar .miss { background: var(--red); }
.a-cov-line {
  display: flex; flex-wrap: wrap; gap: 6px 18px;
  font-size: 13px;
}
.a-cov-line span { display: inline-flex; align-items: center; gap: 6px; }
.a-cov-line .bad { color: var(--red); }
.a-cov-line .ok { color: var(--green); }
.a-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.a-dot.named { background: var(--green); }
.a-dot.blanket { background: var(--amber); }
.a-dot.miss { background: var(--red); }

/* details: the rows behind a number, only taking space when opened */
.a-detail { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); }
.a-detail summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.a-detail summary span {
  margin-left: 4px; padding: 0 5px;
  border-radius: 8px; background: var(--line);
  font-size: 11.5px;
}
.a-detail-list { margin: 8px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.7; }

.a-print-only { display: none; }

@media print {
  .topbar, .a-tabs, .a-toolbar, .a-lookup, .a-head-right,
  .btn, .toast, .modal-scrim { display: none !important; }
  body { background: #fff; }
  .wrap { max-width: none; padding: 0; }
  .card { border-color: #bbb; box-shadow: none; break-inside: avoid; }
  .a-print-only { display: block; }
}

/* shift row is a button now: same look, plus a hint that it opens */
.a-shift-btn {
  width: 100%;
  background: none;
  border-left: 0; border-right: 0; border-bottom: 0;
  font: inherit; color: inherit; text-align: left;
  cursor: pointer;
}
.a-shift-btn:hover { background: var(--paper); }
.a-shift-btn:focus-visible { outline: 2px solid var(--clay); outline-offset: -2px; }
.a-shift-more { font-size: 12px; color: var(--clay); white-space: nowrap; }

/* clickable number card (receipt): same look, plus a hint */
.a-num-btn {
  width: 100%;
  font: inherit; color: inherit; text-align: left;
  cursor: pointer;
}
.a-num-btn:hover { border-color: var(--clay); }
.a-num-btn:focus-visible { outline: 2px solid var(--clay); outline-offset: 2px; }
.a-num-more { display: block; margin-top: 4px; font-size: 12px; color: var(--clay); }

/* print: screen-only hints do not belong on paper */
@media print {
  .a-num-more, .a-shift-more { display: none !important; }
  .a-detail { break-inside: avoid; }
  .a-detail summary { color: var(--ink); }
}

/* print header: institution, day, printed at */
.a-print-head { display: none; }
.a-footnote { border-top: 0; margin-top: 4px; }
.a-footnote summary { color: var(--faint); }
.a-sub-block { margin-top: 12px; }
.a-sub-block h4 { font-size: 13.5px; margin: 0 0 6px; }
.a-sub-block h4 .sub { margin-left: 6px; font-weight: 400; color: var(--faint); font-size: 12.5px; }
/* jump target flash: a card that scrolls into view blinks once */
.a-flash { animation: a-flash 1.2s ease-out 1; }
@keyframes a-flash {
  0% { box-shadow: 0 0 0 3px var(--clay); }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@media print {
  .a-print-head {
    display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap;
    margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid #999;
    font-size: 12px;
  }
  .a-print-head b { font-size: 15px; }
}
