/* Home "Oggi in clinica" — tutto sotto .screen-home, solo token di app.css */
.screen-home { display: flex; flex-direction: column; gap: 18px; max-width: 1280px; }
.screen-home .ico { width: 18px; height: 18px; flex: none; }
.screen-home .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.screen-home h2 { font-size: 16px; }
.screen-home .h-muted { color: var(--ink-3); font-weight: 400; font-size: 12.5px; }
.screen-home .h-row-sub { display: block; color: var(--ink-2); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.screen-home mark { background: var(--amber-soft); color: inherit; border-radius: 2px; padding: 0 1px; }

/* ---------- testata: data + ricerca ---------- */
.screen-home .h-head { display: flex; flex-direction: column; gap: 10px; }
.screen-home .h-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--ink-2); font-size: 13px; }
.screen-home .h-date { color: var(--ink); font-weight: 600; text-transform: capitalize; }
.screen-home .h-dot { width: 1px; height: 12px; background: var(--line-strong); margin-inline: 4px; }
.screen-home .h-meta .example-flag { margin-left: auto; }
.screen-home .h-search { position: relative; display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 0 12px; box-shadow: var(--shadow); }
.screen-home .h-search:focus-within { border-color: var(--primary); outline: 3px solid var(--primary-soft); }
.screen-home .h-search > .ico { color: var(--ink-3); width: 20px; height: 20px; }
.screen-home .h-search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 13px 0; font-size: 15px; outline: none; }
.screen-home .h-search input::placeholder { color: var(--ink-3); }
.screen-home .h-search kbd { font-family: var(--font-data); font-size: 11px; color: var(--ink-3); border: 1px solid var(--line); border-radius: calc(var(--r-sm) - 2px); padding: 1px 6px; }
.screen-home .h-res { position: absolute; left: -1px; right: -1px; top: calc(100% + 6px); z-index: 10; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow); padding: 6px; max-height: 420px; overflow-y: auto; }
.screen-home .h-hit { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: var(--r-sm); }
.screen-home .h-hit:hover, .screen-home .h-hit.is-active { background: var(--surface-2); }
.screen-home .h-hit-k { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.screen-home .h-hit-k svg { width: 17px; height: 17px; }
.screen-home .k-p { background: var(--primary-soft); color: var(--primary); }
.screen-home .k-c { background: var(--blue-soft); color: var(--blue); }
.screen-home .h-hit-t { flex: 1; min-width: 0; }
.screen-home .h-hit-go { font-size: 11.5px; color: var(--ink-3); }
.screen-home .h-res-empty { padding: 10px; color: var(--ink-3); font-size: 13px; }

/* ---------- cifre del giorno: una sola striscia, celle compatte ---------- */
.screen-home .h-pulse { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: hidden; }
.screen-home .h-stat { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 4px; padding: 12px 16px; border-left: 1px solid var(--line); min-width: 0; position: relative; }
.screen-home .h-stat:first-child { border-left: 0; }
.screen-home .h-stat:hover { background: var(--surface-2); }
.screen-home .h-stat:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.screen-home .h-stat-l { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); }
.screen-home .h-stat-l .ico { width: 15px; height: 15px; color: var(--ink-3); }
.screen-home .h-stat-v { font-family: var(--font-display); font-size: 24px; font-weight: 600; line-height: 1.1; color: var(--ink); letter-spacing: -.01em; }
.screen-home .h-stat-s { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; font-size: 12px; color: var(--ink-3); min-height: 20px; }
.screen-home .h-stat-s b { color: var(--ink); font-weight: 500; }
.screen-home .h-stat.is-live .h-stat-l::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); margin-left: 2px; }

/* ---------- pannelli affiancati ---------- */
.screen-home .h-cols { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.screen-home .h-panel { padding: 14px 6px 8px; min-width: 0; }
.screen-home .h-panel-h { display: flex; align-items: center; gap: 8px; padding: 0 10px 8px; }
.screen-home .h-panel-h h2 { flex: 1; }
.screen-home .h-more { font-size: 12.5px; color: var(--primary); padding: 4px 8px; }
.screen-home .h-more svg { width: 14px; height: 14px; }
.screen-home .h-count { font-family: var(--font-data); font-size: 11.5px; background: var(--surface-2); color: var(--ink-2); border-radius: 999px; padding: 1px 8px; }
.screen-home .h-list { list-style: none; margin: 0; padding: 0; }
.screen-home .h-list li + li { border-top: 1px solid var(--line); }
.screen-home .h-row { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px; border-radius: var(--r-sm); }
.screen-home .h-row:hover { background: var(--surface-2); }
.screen-home .h-row:focus-visible { outline: 2px solid var(--primary); }
.screen-home .h-time { font-size: 13px; color: var(--ink); width: 44px; flex: none; }
.screen-home .h-row-main { flex: 1; min-width: 0; }
.screen-home .h-row-end { display: flex; align-items: center; gap: 6px; flex: none; }
.screen-home .h-doc { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); font-size: 10.5px; font-weight: 600; }
.screen-home .h-foot, .screen-home .h-empty { margin: 6px 10px 4px; font-size: 12px; color: var(--ink-3); }
.screen-home .h-empty { display: flex; align-items: center; gap: 6px; padding: 10px 0; }

.screen-home .h-todo-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; }
.screen-home .h-todo-ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--ink-2); }
.screen-home .h-todo-ico svg { width: 16px; height: 16px; }
.screen-home .t-crit .h-todo-ico { background: var(--red-soft); color: var(--red); }
.screen-home .t-warn .h-todo-ico { background: var(--amber-soft); color: var(--amber); }
.screen-home .t-info .h-todo-ico { background: var(--blue-soft); color: var(--blue); }
.screen-home .t-crit .h-row-sub { color: var(--red); }
.screen-home .h-todo-main { all: unset; cursor: pointer; flex: 1; min-width: 0; }
.screen-home .h-todo-main b { font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.screen-home .h-todo-main:hover b { color: var(--primary); }
.screen-home .h-todo-main:focus-visible { outline: 2px solid var(--primary); border-radius: calc(var(--r-sm) - 2px); }
.screen-home .h-todo-act { padding: 4px 10px; font-size: 12px; flex: none; }

/* ---------- tutte le funzioni ---------- */
.screen-home .h-funcs { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.screen-home .h-sec-h { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.screen-home .h-sec-h > div:first-child { flex: 1; min-width: 220px; }
.screen-home .h-sec-h h2 { font-size: 18px; }
.screen-home .h-sub { margin: 2px 0 0; font-size: 13px; color: var(--ink-2); }
.screen-home .h-fn-tools { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.screen-home .h-filter { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-sm); padding: 0 8px; }
.screen-home .h-filter .ico { width: 15px; height: 15px; color: var(--ink-3); }
.screen-home .h-filter input { border: 0; background: transparent; padding: 6px 0; width: 160px; font-size: 13px; outline: none; }
.screen-home .h-filter:focus-within { border-color: var(--primary); }
.screen-home .h-src-toggle { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.screen-home .h-src-toggle input { accent-color: var(--primary); }
.screen-home .h-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--ink-3); }
.screen-home .h-legend span { display: inline-flex; align-items: center; gap: 6px; }
.screen-home .h-legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.screen-home .lg-ready { background: var(--primary); }
.screen-home .lg-soon { border: 1.5px solid var(--ink-3); }
.screen-home .lg-sub { border-radius: 3px !important; width: 14px !important; background: var(--surface-2); border: 1px solid var(--line); }

.screen-home .h-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.screen-home .h-group { padding: 10px 6px 8px; min-width: 0; }
.screen-home .h-group.is-wide { grid-column: span 2; }
.screen-home .h-group.is-tall { grid-row: span 2; }
.screen-home .h-group-h { display: flex; align-items: center; gap: 8px; padding: 2px 8px 8px; color: var(--primary); }
.screen-home .h-group-h h3 { font-size: 14px; color: var(--ink); flex: 1; }
.screen-home .h-group-n { font-size: 11px; color: var(--ink-3); }
.screen-home .h-fn-list { list-style: none; margin: 0; padding: 0; }
.screen-home .h-group.is-wide .h-fn-list { columns: 2; column-gap: 8px; }
.screen-home .h-fn { display: flex; align-items: center; gap: 4px; break-inside: avoid; border-radius: var(--r-sm); }
.screen-home .h-fn:hover { background: var(--surface-2); }
.screen-home .h-fn-main { all: unset; box-sizing: border-box; cursor: pointer; flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: var(--r-sm); color: var(--ink-2); font-size: 13px; }
.screen-home .h-fn-main:focus-visible { outline: 2px solid var(--primary); }
.screen-home .h-fn-main > svg { width: 17px; height: 17px; flex: none; color: var(--ink-3); }
.screen-home .h-fn-l { flex: 1; min-width: 0; }
.screen-home .h-fn-src { display: none; font-size: 10.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.screen-home .show-src .h-fn-src { display: block; }
.screen-home .h-fn.is-ready .h-fn-main { color: var(--ink); font-weight: 600; }
.screen-home .h-fn.is-ready .h-fn-main > svg { color: var(--primary); }
.screen-home .h-fn-badge { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: none; }
.screen-home .h-fn-badge svg { width: 13px; height: 13px; }
.screen-home .h-fn.is-replaced .h-fn-l { color: var(--ink-3); }
.screen-home .h-fn-tag { font-size: 10.5px; color: var(--ink-3); border: 1px dashed var(--line); border-radius: 999px; padding: 0 6px; flex: none; }
.screen-home .h-fn-subs { display: inline-flex; gap: 2px; padding-right: 4px; flex: none; }
.screen-home .h-fn-sub { all: unset; cursor: pointer; font-size: 10.5px; color: var(--ink-3); padding: 2px 6px; border-radius: calc(var(--r-sm) - 2px); border: 1px solid transparent; }
.screen-home .h-fn-sub:hover { border-color: var(--line); background: var(--surface); color: var(--ink); }
.screen-home .h-fn-sub:focus-visible { outline: 2px solid var(--primary); }

/* ---------- inventario ---------- */
.screen-home .h-inv { border: 1px dashed var(--line); border-radius: var(--r-md); padding: 14px 16px; display: grid; grid-template-columns: auto 1fr; gap: 6px 24px; align-items: center; color: var(--ink-2); margin-top: 6px; }
.screen-home .h-inv-h { display: flex; align-items: center; gap: 8px; grid-column: 1 / -1; }
.screen-home .h-inv-h svg { color: var(--ink-3); }
.screen-home .h-inv-h h2 { font-size: 14px; color: var(--ink); }
.screen-home .h-inv-nums { display: flex; gap: 22px; margin: 0; }
.screen-home .h-inv-nums div { display: flex; flex-direction: column-reverse; }
.screen-home .h-inv-nums dt { font-size: 11.5px; color: var(--ink-3); }
.screen-home .h-inv-nums dd { margin: 0; font-size: 20px; color: var(--ink); font-weight: 500; }
.screen-home .h-inv-p { margin: 0; font-size: 12.5px; max-width: 72ch; }
.screen-home .h-inv-p .mono { font-size: 11.5px; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .screen-home .h-group.is-tall { grid-row: auto; }
  .screen-home .h-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .screen-home .h-inv { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .screen-home .h-cols { grid-template-columns: minmax(0, 1fr); }
  .screen-home .h-pulse { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .screen-home .h-stat:nth-child(3) { border-left: 0; }
  .screen-home .h-stat:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 700px) {
  .screen-home .h-groups { grid-template-columns: minmax(0, 1fr); }
  .screen-home .h-group.is-wide { grid-column: auto; }
  .screen-home .h-group.is-wide .h-fn-list { columns: 1; }
  .screen-home .h-search kbd { display: none; }
  .screen-home .h-meta .example-flag { margin-left: 0; }
  .screen-home .h-stat { padding: 10px 12px; }
  .screen-home .h-stat-v { font-size: 20px; }
  .screen-home .h-fn-tools { width: 100%; }
  .screen-home .h-filter { flex: 1; }
  .screen-home .h-filter input { width: 100%; }
  .screen-home .h-inv-nums { flex-wrap: wrap; gap: 12px 20px; }
}
