/* Hoàn thiện số liệu — patient picker + missing data / attachments / backup */
.fin-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.fin-list { position: sticky; top: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 110px); }
.fin-list .fin-tools { display: flex; gap: 6px; }
.fin-list .fin-tools input { flex: 1; min-width: 0; }
.fin-list .fin-tools select { width: auto; }
.fin-items { overflow-y: auto; margin: 0 -6px; padding: 0 6px; display: flex; flex-direction: column; gap: 4px; }
.fin-pt { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 7px 9px; border-radius: var(--radius-sm); border: 1px solid transparent;
  cursor: pointer; background: none; text-align: left; font: inherit; color: inherit; width: 100%; }
.fin-pt:hover { background: var(--panel-2); }
.fin-pt.active { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 35%, transparent); }
.fin-pt .sid { font: 700 13px var(--mono); }
.fin-pt .nm { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fin-pt .badges { grid-column: 1 / -1; display: flex; gap: 6px; align-items: center; font-size: 11px; color: var(--muted); }
.fin-pt .badges .bar { flex: 1; max-width: 90px; }
.fin-pt .done { color: var(--ok); font-weight: 700; }
.fin-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.fin-main > .card + .card { margin-top: 0; }
.fin-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.fin-head h2 { margin: 0; }
.fin-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.fin-stat { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; cursor: pointer; background: var(--panel); text-align: left; font: inherit; color: inherit; }
.fin-stat:hover { border-color: var(--brand); }
.fin-stat .k { font-size: 12px; color: var(--muted); }
.fin-stat .v { font-size: 20px; font-weight: 700; margin: 2px 0 6px; }
.fin-main .card-head h3 { flex: 0 1 auto; }
.fin-step {display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; font-size: 13px; flex: none; }
.fin-sec { padding: 8px 0; border-top: 1px dashed var(--line-2); }
.fin-sec:first-of-type { border-top: 0; }
.fin-qa { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.fin-att { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.fin-tile { display: grid; grid-template-columns: 28px 1fr; gap: 4px 10px; padding: 10px 12px; border: 1px solid var(--line); border-left-width: 4px;
  border-radius: var(--radius-sm); background: var(--panel); cursor: pointer; text-align: left; font: inherit; color: inherit; }
.fin-tile:hover { box-shadow: var(--shadow); }
.fin-tile .ic { grid-row: span 2; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.fin-tile b { font-size: 13.5px; line-height: 1.3; }
.fin-tile .d { font-size: 12px; color: var(--muted); line-height: 1.35; }
.fin-tile.s-thieu { border-left-color: var(--bad); }
.fin-tile.s-thieu .ic { background: var(--bad-soft); color: var(--bad); }
.fin-tile.s-mot_phan { border-left-color: var(--warn); }
.fin-tile.s-mot_phan .ic { background: var(--warn-soft); color: var(--warn); }
.fin-tile.s-du { border-left-color: var(--ok); }
.fin-tile.s-du .ic { background: var(--ok-soft); color: var(--ok); }
.fin-tile.s-khong_ap_dung, .fin-tile.s-bo_qua { border-left-color: var(--line-2); opacity: .8; }
.fin-tile.s-khong_ap_dung .ic, .fin-tile.s-bo_qua .ic { background: var(--panel-2); color: var(--muted); }
.fin-files { max-height: 220px; overflow-y: auto; }
.fin-files li { display: flex; gap: 8px; align-items: center; padding: 4px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.fin-files li .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fin-files ul { list-style: none; margin: 0; padding: 0; }
.fin-files li .n .why { display: block; white-space: normal; font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.fin-kqbar { border-top: 1px dashed var(--line-2); padding-top: 8px; display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
.fin-editor-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.fin-backup .row .btn { flex: 1 1 180px; justify-content: center; }
.fin-backup .last { font-size: 11.5px; color: var(--muted); display: block; margin-top: 2px; font-weight: 400; }
.fin-backup .bk { display: flex; flex-direction: column; align-items: center; line-height: 1.25; padding-top: 8px; padding-bottom: 8px; }
.fv.flash { outline: 3px solid var(--brand); outline-offset: 2px; transition: outline-color .4s; }
@media (max-width: 900px) {
  .fin-layout { grid-template-columns: 1fr; }
  .fin-list { position: static; max-height: 46vh; }
}
@media (max-width: 560px) { .fin-stats { grid-template-columns: 1fr; } .fin-att { grid-template-columns: 1fr; } }
