/**/

body { padding-top: 70px; background-color: #d4e6f1 !important; }
.navbar-custom { background-color: #78909c; }
.patient-card { border: 2px solid #333; border-radius: 8px; margin-bottom: 30px; background-color: #fdfbf7; position: relative; }

/**/
.note-card { border-color: #78909c; border-style: dashed; }
.note-card .bed-number-box { background-color: #eceff1; }
.note-card .bed-number { font-size: 1.2rem !important; letter-spacing: 2px; color: #546e7a; }
.header-row { border-bottom: 2px solid #333; }
.bed-number-box { border-right: 2px solid #333; display: flex; flex-direction: column; align-items: center; justify-content: center; background-color: #f2efe9; position: relative; }
.bed-number { font-size: 2.5rem; font-weight: bold; line-height: 1; }
.sesso-symbol { display:inline-block; font-size:1.8rem; line-height:1; margin-left:6px; vertical-align:middle; cursor:default; user-select:none; -webkit-text-stroke:2px currentColor; }
.focus-mode .sesso-symbol { cursor:pointer; }
.bed-number-flex { display:flex; align-items:center; justify-content:center; }
.patient-info-box { padding: 15px; position: relative; }

.content-row { display: flex; min-height: 250px; border-bottom: 2px solid #333; }
.column-box { border-right: 2px solid #333; display: flex; flex-direction: column; }
.column-box:last-child { border-right: none; }

/**/

.piano-terapeutico-row { display: flex; flex-direction: column; width: 100%; min-height: 80px; }

.column-header { background-color: #e8e6e1; padding: 8px; font-weight: bold; text-align: center; border-bottom: 1px solid #ccc; user-select: none; }
.column-header-piano { background-color: #e8e6e1; padding: 8px 15px; font-weight: bold; text-align: left; border-bottom: 1px solid #ccc; user-select: none; color: #000; }

.editable-area { flex-grow: 1; padding: 10px; outline: none; min-height: 150px; overflow-y: auto; }
.editable-area:focus { background-color: #ffffff; box-shadow: inset 0 0 5px rgba(0,0,0,0.05); }
.editable-area-piano { min-height: 50px; }
/**/
/**/

.date-wrapper { position: relative; display: inline-flex; align-items: center; width: 120px; height: 30px;}
.date-input-hidden { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 10; }
.date-display { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: flex-end; gap: 5px; z-index: 1; pointer-events: none;}

/**/

/**/
.patient-card.focus-mode,
.alt-row.focus-mode {
  position: fixed !important;
  z-index: 1070 !important;
  box-shadow: 0 12px 48px rgba(0,0,0,0.28), 0 2px 8px rgba(0,0,0,0.10) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  background-color: #fff !important;
  border-radius: 10px !important;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
  transform: translateZ(0);          /**/
  -webkit-overflow-scrolling: touch; /**/
}

/**/
.alt-row-spacer {
  flex: 0 0 100%;
  height: 5px;
  background-color: #fdfbf7;
  border-top: none;
}

/**/
.alt-row.focus-mode .alt-col {
  background-color: #fdfbf7;
}
.alt-row.focus-mode .alt-col-info {
  background-color: #f2efe9 !important;
}

/**/
.alt-row.focus-mode .alt-editable,
.alt-row.focus-mode .editable-area {
  overflow-y: visible !important;
  overflow-x: visible !important;
  min-height: 0 !important;
}

/**/
.focus-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  padding: 6px 8px;
  background: #dde3ea;
  border-bottom: 1px solid #b0bec5;
  border-top: 1px solid #b0bec5;
  position: sticky;
  top: 0;
  z-index: 10;
  user-select: none;
}
.focus-toolbar .tb-btn {
  background: none;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  padding: 4px 8px;
  font-size: 0.85rem;
  color: #343a40;
  line-height: 1;
  transition: background 0.15s, border-color 0.15s;
}
.focus-toolbar .tb-btn:hover { background: #e9ecef; border-color: #ced4da; }
.focus-toolbar .tb-btn.active { background: #d0e4ff; border-color: #86b7fe; }
.focus-toolbar .tb-sep { width: 1px; height: 20px; background: #ced4da; margin: 0 4px; }
.tb-palette-wrap { position: relative; }
.tb-palette {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  padding: 8px;
  z-index: 100;
  width: 196px;
}
.tb-palette.open { display: block; }
.tb-palette-grid { display: grid; grid-template-columns: repeat(8, 20px); gap: 3px; margin-bottom: 6px; }
.tb-color-swatch { width: 20px; height: 20px; border-radius: 4px; border: 1px solid rgba(0,0,0,0.15); cursor: pointer; transition: transform 0.1s; }
.tb-color-swatch:hover { transform: scale(1.25); border-color: #343a40; }
.tb-no-color { width: 100%; font-size: 0.72rem; padding: 3px 0; background: none; border: 1px solid #ced4da; border-radius: 4px; cursor: pointer; color: #6c757d; }
.tb-no-color:hover { background: #f8f9fa; }
.tb-fsize-btn { display: block; width: 100%; text-align: left; padding: 5px 8px; font-size: 0.82rem; background: none; border: none; border-radius: 4px; cursor: pointer; color: #343a40; }
.tb-fsize-btn:hover { background: #e9ecef; }

/**/
.date-input-error { border-bottom: 2px solid #d32f2f !important; background-color: #fff5f5 !important; }
.date-error-msg { display: block; font-size: 0.65rem; color: #d32f2f; margin-top: 1px; line-height: 1.2; padding-left: 2px; }

/**/
.patient-card { position: relative; }
.card-locked {
  border: 2px solid #dc3545 !important;
  box-shadow: 0 0 0 4px rgba(220,53,69,0.18) !important;
  transition: border 0.2s, box-shadow 0.2s;
}
.lock-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: rgba(220, 53, 69, 0.07);
  pointer-events: all;
  cursor: not-allowed;
  border-radius: inherit;
}
.lock-badge {
  position: absolute;
  top: -11px;
  right: 14px;
  background: #dc3545;
  color: #fff;
  font-size: 0.68rem;
  padding: 3px 10px 3px 8px;
  border-radius: 20px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  z-index: 51;
  pointer-events: none;
  letter-spacing: 0.02em;
}

/**/
#opBar {
  display: none;
  position: fixed;
  top: 56px;
  left: 0; right: 0;
  z-index: 9998;
  background: linear-gradient(90deg, #37474f 0%, #78909c 50%, #37474f 100%);
  background-size: 200% 100%;
  animation: opBarPulse 1.6s linear infinite;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 7px 16px;
  text-align: center;
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}
@keyframes opBarPulse {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/**/
.tipo-palette-popup {
  position: absolute; top: calc(100% + 6px); left: 0;
  z-index: 9999; background: #fff; border: 1px solid #dee2e6;
  border-radius: 10px; padding: 10px;
  box-shadow: 0 4px 24px rgba(0,0,0,.18); width: 188px;
}

/**/
#opOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.25);
  z-index: 1040;
  cursor: wait;
}
#opOverlay.attivo { display: block; }

/**/
@keyframes _lockSpin { to { transform: rotate(360deg); } }

/**/
.focus-pencil-btn {
  display: none;
  position: absolute;
  top: 8px;
  right: 10px;
  width: 46px;
  height: 46px;
  background: linear-gradient(135deg, #fffde7 60%, #fff9c4 100%);
  border: 2px solid #f9a825;
  border-radius: 12px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  color: #f9a825;
  z-index: 10;
  transition: background 0.15s, transform 0.12s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(249,168,37,0.25);
}
.focus-pencil-btn::after {
  content: '';
  position: absolute;
  bottom: 6px;
  right: 7px;
  width: 8px;
  height: 8px;
  background: #ef9a9a;
  border-radius: 2px;
}
.focus-pencil-btn:hover {
  background: linear-gradient(135deg, #fff176 60%, #ffee58 100%);
  border-color: #f57f17;
  color: #e65100;
  transform: scale(1.12) rotate(-8deg);
  box-shadow: 0 4px 14px rgba(249,168,37,0.45);
}
.patient-card:hover .focus-pencil-btn { display: flex; }
.patient-card.focus-mode .bed-number-box .focus-pencil-btn { display: none !important; }
.patient-card.card-locked:hover .focus-pencil-btn { display: none !important; }

/**/
/**/
@keyframes _emergPulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(245,124,0,0.30); transform: scale(1); }
  50%      { box-shadow: 0 4px 14px rgba(245,124,0,0.65); transform: scale(1.05); }
}
@keyframes _emergSpin { to { transform: rotate(360deg); } }

.emerg-save-btn {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  border: 2px solid #b0bec5;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  z-index: 11;
  background: linear-gradient(135deg, #eceff1 60%, #cfd8dc 100%);
  color: #546e7a;
  transition: background 0.15s, transform 0.12s, box-shadow 0.15s, border-color 0.15s, color 0.15s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  user-select: none;
}
.emerg-save-btn:hover { transform: scale(1.10); }

/**/
.emerg-save-btn[data-state="idle"] {
  background: linear-gradient(135deg, #eceff1 60%, #cfd8dc 100%);
  border-color: #b0bec5;
  color: #546e7a;
}

/**/
.emerg-save-btn[data-state="dirty"] {
  background: linear-gradient(135deg, #ffe0b2 60%, #ffb74d 100%);
  border-color: #f57c00;
  color: #e65100;
  animation: _emergPulse 1.6s ease-in-out infinite;
}

/**/
.emerg-save-btn[data-state="saving"] {
  background: linear-gradient(135deg, #b3e5fc 60%, #4fc3f7 100%);
  border-color: #0288d1;
  color: #01579b;
  pointer-events: none;
  cursor: wait;
}
.emerg-save-btn[data-state="saving"] .emerg-floppy-icon {
  display: inline-block;
  width: 22px; height: 22px;
  border: 3px solid rgba(2,119,189,0.30);
  border-top-color: #0277bd;
  border-radius: 50%;
  animation: _emergSpin 0.7s linear infinite;
}

/**/
.emerg-save-btn[data-state="saved"] {
  background: linear-gradient(135deg, #c8e6c9 60%, #81c784 100%);
  border-color: #388e3c;
  color: #1b5e20;
}

/**/
.emerg-save-btn[data-state="error"] {
  background: linear-gradient(135deg, #ffcdd2 60%, #ef9a9a 100%);
  border-color: #c62828;
  color: #b71c1c;
  animation: _emergPulse 1.2s ease-in-out infinite;
}

/**/
.patient-card:not(.focus-mode) .emerg-save-btn { display: none !important; }

/**/
.patient-card.focus-mode .emerg-save-btn {
  position: fixed !important;
  z-index: 1080 !important;
}

/**/
#focusStatusBadge {
  position: fixed !important;
  top: 12px !important;
  left: 12px !important;
  right: auto !important;
  bottom: auto !important;
  z-index: 1080 !important;
  margin: 0 !important;
  font-size: 0.78rem !important;
  padding: 6px 10px !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25) !important;
  pointer-events: none; /**/
}

/**/
.swal2-container { z-index: 200000 !important; }

/**/
#modalCambiaTipologiaLetto { z-index: 1090 !important; }

/**/
/**/
.isolamento-banner {
  display: block;
  font-size: 1.25em;
  font-weight: 700;
  background: #ffcc80;              /**/
  color: #3e2723;
  text-transform: uppercase;
  border-left: 5px solid #ef6c00;
  border-radius: 4px;
  padding: 3px 8px;
  margin: 0 0 6px 0;
  cursor: pointer;
  user-select: none;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.isolamento-banner svg { vertical-align: -4px; margin-right: 6px; }

/**/
/**/
.rianimazione-banner {
  display: block;
  font-size: 1.25em;
  font-weight: 700;
  background: #ffcdd2;              /**/
  color: #7f1d1d;
  text-transform: uppercase;
  border-left: 5px solid #c62828;
  border-radius: 4px;
  padding: 3px 8px;
  margin: 0 0 6px 0;
  cursor: pointer;
  user-select: none;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.rianimazione-banner svg { vertical-align: -4px; margin-right: 6px; }

/**/
/**/
[data-field="NoteTerapia"].terapia-scaduta::before {
  content: "\23F0  Terapia da aggiornare (ultimo import da TrakCare oltre 24h fa)";
  display: block;
  font-size: 0.92em;
  font-weight: 700;
  background: #fff176;              /**/
  color: #4e3b00;
  border-left: 5px solid #f9a825;  /**/
  border-radius: 4px;
  padding: 3px 8px;
  margin: 0 0 6px 0;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  user-select: none;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

/**/
/**/
#labModalOverlay {
  position: fixed; inset: 0; z-index: 100500;
  background: rgba(17, 27, 33, 0.55);
  display: flex; align-items: center; justify-content: center;
}
.lab-modal {
  background: #fff; border-radius: 12px;
  box-shadow: 0 12px 48px rgba(0,0,0,.45);
  width: 80vw; height: 80vh; min-width: 360px;
  display: flex; flex-direction: column; overflow: hidden;
  position: relative;              /**/
}
.lab-modal-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; background: #eceff1; border-bottom: 1px solid #cfd8dc;
  flex: 0 0 auto;
}
.lab-modal-tit {
  font-weight: 700; color: #37474f; font-size: 1rem; flex: 0 1 auto; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lab-bar-spazio { flex: 1 1 auto; }
/**/
.lab-cerca {
  flex: 0 1 210px; max-width: 210px; padding: 6px 8px; font-size: 0.84rem;
  border: 1px solid #b0bec5; border-radius: 8px; background: #fff; color: #37474f; cursor: pointer;
}
.lab-btn-all { background: #6d4c41; color: #fff; }
.lab-btn-all:hover { background: #795548; }
/**/
@keyframes labFlash { 0%,100% { background: #e8f5e9; } 35% { background: #ffe082; } }
.lab-tab tr.lab-flash td { animation: labFlash 1.4s ease-in-out 1; }

/**/
.lab-allarmi {
  position: absolute; top: 52px; left: 18px; z-index: 6; width: 320px;
  background: #fff; border: 1px solid #cfd8dc; border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.3); padding: 12px 14px; font-size: 0.86rem;
}
.lab-all-tit { font-weight: 700; color: #37474f; margin-bottom: 8px; }
.lab-all-tit .bi { color: #6d4c41; margin-right: 4px; }
.lab-all-row { margin-bottom: 8px; }
.lab-all-row input { width: 62px; padding: 4px 6px; border: 1px solid #b0bec5; border-radius: 6px; font-size: 0.95rem; text-align: center; }
.lab-all-quick { display: flex; gap: 5px; margin-bottom: 8px; }
.lab-all-q { border: 1px solid #b0bec5; background: #eceff1; border-radius: 6px; padding: 3px 11px; cursor: pointer; font-weight: 600; }
.lab-all-q:hover { background: #cfd8dc; }
.lab-all-info { color: #78909c; font-size: 0.78rem; line-height: 1.4; margin-bottom: 10px; }
.lab-all-btns { display: flex; gap: 6px; justify-content: flex-end; }
.lab-modal-tit .bi { color: #c62828; margin-right: 4px; }
.lab-btn { border: none; border-radius: 8px; padding: 7px 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.lab-btn .bi { margin-right: 4px; }
.lab-btn-agg { background: #00695c; color: #fff; }
.lab-btn-agg:hover { background: #00796b; }
.lab-btn-multi { background: #546e7a; color: #fff; }
.lab-btn-multi:hover { background: #607d8b; }
.lab-btn-multi.lab-btn-on { background: #00838f; box-shadow: inset 0 0 0 2px #b2ebf2; }
.lab-btn-graf { background: #ef6c00; color: #fff; }
.lab-btn-graf:hover { background: #f57c00; }
.lab-btn-x { background: transparent; color: #546e7a; font-size: 1.2rem; padding: 2px 8px; }
.lab-btn-mini { padding: 4px 10px; font-size: 0.82rem; }
.lab-btn-si, .lab-btn-usa { background: #00695c; color: #fff; }
.lab-btn-no, .lab-btn-torna { background: #eceff1; color: #37474f; }
/**/
.lab-btn-vista { background: #fff; color: #37474f; border: 1px solid #b0bec5; display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; }
.lab-btn-vista:hover { background: #eceff1; }
.lab-vista-ic { display: inline-flex; align-items: center; justify-content: center; width: 21px; height: 21px; border-radius: 5px; opacity: .38; }
.lab-vista-ic .bi { margin-right: 0; }
.lab-vista-ic.lab-vista-on { background: #00695c; color: #fff; opacity: 1; }
.lab-vista-txt { font-weight: 700; font-size: 0.82rem; }
/**/
.lab-giorni { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 12px; background: #f1f8f6; border-bottom: 1px solid #b2dfdb; flex: 0 0 auto; }
.lab-gg { border: 1px solid #b2dfdb; background: #fff; border-radius: 6px; padding: 2px 9px; font-weight: 700; font-size: 0.8rem; color: #00695c; cursor: pointer; }
.lab-gg:hover { background: #e0f2f1; }
.lab-gg.lab-gg-on { background: #00695c; border-color: #00695c; color: #fff; }
/**/
.lab-cerca-wrap { position: relative; flex: 0 1 230px; max-width: 230px; }
.lab-cerca-wrap .lab-cerca { width: 100%; max-width: none; flex: none; cursor: text; }
.lab-cerca-lista {
  position: absolute; top: calc(100% + 3px); left: 0; width: 340px; max-width: 60vw;
  max-height: 46vh; overflow: auto; background: #fff; border: 1px solid #b0bec5;
  border-radius: 8px; box-shadow: 0 10px 28px rgba(0,0,0,.28); z-index: 7;
}
.lab-cerca-it { padding: 4px 10px; cursor: pointer; display: flex; gap: 10px; align-items: baseline; justify-content: space-between; }
.lab-cerca-it:hover { background: #e0f2f1; }
.lab-cerca-it b { font-size: 0.84rem; color: #263238; font-weight: 600; white-space: nowrap; }
.lab-cerca-g { font-size: 0.68rem; color: #90a4ae; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 55%; flex: 0 1 auto; }
.lab-cerca-vuoto { padding: 8px 10px; color: #90a4ae; font-size: 0.8rem; }
.lab-modal-body { flex: 1 1 auto; overflow: auto; padding: 10px 12px; position: relative; min-height: 0; }
/**/
.lab-modal-body.lab-centrato { display: flex; align-items: center; justify-content: center; }
.lab-vuoto { color: #546e7a; font-size: 0.92rem; padding: 18px 6px; max-width: 560px; line-height: 1.55; text-align: center; }
.lab-guida { font-size: 0.88rem; max-width: 580px; line-height: 1.5; }
.lab-avviso { padding: 7px 14px; font-size: 0.86rem; border-bottom: 1px solid #e0e0e0; flex: 0 0 auto; }
.lab-avviso-ok   { background: #e8f5e9; color: #1b5e20; }
.lab-avviso-info { background: #e3f2fd; color: #0d47a1; }
.lab-avviso-warn { background: #fff3e0; color: #6d4c00; }
.lab-avviso-err  { background: #ffebee; color: #b71c1c; }

/**/
.lab-tab { border-collapse: collapse; font-size: 0.78rem; }
.lab-tab th, .lab-tab td { border: 1px solid #e0e0e0; padding: 1px 5px; white-space: nowrap; text-align: center; }
.lab-tab thead th { background: #f5f7f8; position: sticky; top: 0; z-index: 2; padding: 2px 5px; line-height: 1.15; }
.lab-tab th.lab-dt .lab-d { font-weight: 700; }
.lab-tab th.lab-dt .lab-o { font-weight: 400; color: #78909c; font-size: 0.7rem; }
/**/
.lab-tab th.lab-nome, .lab-tab td.lab-nome {
  text-align: left; position: sticky; left: 0; background: #fff; z-index: 1;
  max-width: 220px; white-space: normal; line-height: 1.2;
}
.lab-tab thead th.lab-nome { background: #f5f7f8; z-index: 3; }
.lab-tab td.lab-rif, .lab-tab td.lab-um { color: #78909c; font-size: 0.72rem; }
.lab-tab tr.lab-gruppo td {
  text-align: left; font-weight: 700; background: #e8f5e9; color: #1b5e20;
  border-left: 4px solid #43a047; padding: 2px 6px; cursor: pointer;
}
.lab-gsticky { position: sticky; left: 6px; display: inline-block; }
.lab-tab tr.lab-gruppo.lab-sel td { background: #dcedc8; }
/**/
.lab-tab tbody tr[data-k] { cursor: pointer; }
.lab-tab tbody tr[data-k]:hover td { background: #f5fbfa; }
.lab-tab tbody tr[data-k]:hover td.lab-nome { background: #eef7f6; }
.lab-tab tbody tr.lab-sel td { background: #fff9c4 !important; }
.lab-tab tbody tr.lab-sel td.lab-nome { background: #fff59d !important; }
/**/
.lab-tab td.lab-alto  { color: #c62828; font-weight: 700; }
.lab-tab td.lab-basso { color: #1565c0; font-weight: 700; }
/**/
.lab-fr {
  font-size: 1.02em; line-height: 1; font-weight: 700;
  -webkit-text-stroke: .38px currentColor;
}
/**/
.lab-spark {
  display: inline-block; margin-top: 1px; padding: 0 3px;
  background: #f1f8f6; border: 1px solid #b2dfdb; border-radius: 5px;
  cursor: pointer; line-height: 0;
}
.lab-spark:hover { background: #e0f2f1; border-color: #26a69a; }

/**/
.lab-graf { display: flex; flex-direction: column; min-height: 100%; position: relative; }
.lab-graf-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; flex: 0 0 auto; }
.lab-graf-info { color: #78909c; font-size: 0.82rem; }
.lab-graf-top { display: flex; gap: 10px; align-items: stretch; flex: 0 0 auto; }
.lab-graf-svg { flex: 1 1 auto; min-width: 0; }
.lab-svg { width: 100%; height: auto; max-height: 46vh; display: block; }
.lab-graf-leg { width: 190px; flex: 0 0 auto; overflow: auto; max-height: 46vh; border-left: 1px solid #eceff1; padding-left: 8px; font-size: 0.8rem; }
.lab-leg-item { margin: 3px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lab-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.lab-graf-bot { flex: 1 1 auto; overflow: auto; min-height: 0; margin-top: 8px; border-top: 1px solid #eceff1; padding-top: 6px; }
.lab-tab-mini td.lab-nome, .lab-tab-mini th.lab-nome { max-width: 240px; }
/**/
.lab-tip {
  position: absolute; display: none; z-index: 5; pointer-events: none;
  background: #263238; color: #fff; padding: 6px 9px; border-radius: 6px;
  font-size: 0.78rem; line-height: 1.35; white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0,0,0,.35);
}

/**/
.lab-box {
  border-bottom: 2px solid #26a69a;
  margin-bottom: 6px;
  padding-bottom: 5px;
  user-select: none;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.lab-apri-btn {
  display: flex; align-items: center; justify-content: flex-start; gap: 7px;
  width: 100%; margin: 1px 0 3px; padding: 2px 8px;
  background: #f1f8f6; border: 1px solid #b2dfdb; border-radius: 5px;
  cursor: pointer; text-align: left; line-height: 1.1;
}
.lab-apri-btn:hover { background: #e0f2f1; border-color: #26a69a; }
.lab-apri-btn svg { flex: 0 0 auto; }
.lab-apri-txt { font-weight: 700; font-size: 0.82em; color: #00695c; letter-spacing: .01em; }
/**/
.patient-card:not(.focus-mode) .lab-apri-btn,
.patient-card:not(.focus-mode) .lab-remind { cursor: default; }
.patient-card:not(.focus-mode) .lab-apri-btn { opacity: .8; }
.patient-card:not(.focus-mode) .lab-remind:hover { filter: none; }
/**/
.lab-remind {
  display: block; margin: 0 0 3px; padding: 3px 9px;
  background: #fff176; color: #4e3b00; border-left: 5px solid #f9a825;
  border-radius: 4px; font-size: 1.09em; font-weight: 700; line-height: 1.25;
  user-select: none; cursor: pointer;
}
.lab-remind:hover { filter: brightness(0.96); }
/**/
.lab-remind-off { border-left-color: #c62828; }
/**/
.alt-diag-fourth .alt-editable { min-height: 2.6em; }
@media print { .lab-box { display: none !important; } }

/**/
/**/
.bed-status-icons {
  position: absolute;
  top: 8px;
  left: 10px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  z-index: 3;
  pointer-events: none;
}
.bed-status-ico {
  width: 40px;
  height: 40px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  border: 2px solid;
  flex-shrink: 0;
}
.bed-status-ico svg { width: 100%; height: 100%; display: block; }
.bed-status-ico.iso    { background: #e8f5e9; border-color: #43a047; }
.bed-status-ico.rianim { background: #ffebee; border-color: #c62828; }

/**/
/**/
.tb-btn.tb-scale {
  width: auto;
  padding: 0 8px;
  gap: 5px;
  display: inline-flex;
  align-items: center;
  color: #1565c0;
}
.tb-btn.tb-scale .tb-scale-label { font-size: 0.8rem; font-weight: 600; }
/**/
.scala-risultato {
  display: block;
  font-weight: 600;
  background: #e3f2fd;
  color: #0d47a1;
  border-left: 4px solid #1565c0;
  border-radius: 3px;
  padding: 2px 8px;
  margin: 0 0 4px 0;
  font-size: 0.95em;
  cursor: pointer;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.scala-risultato:hover { filter: brightness(0.96); }
.scala-risultato:last-child { margin-bottom: 0; }
/**/
.scale-box {
  border-bottom: 2px solid #90caf9;
  margin-bottom: 6px;
  padding-bottom: 5px;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
/**/
.terapia-box {
  border-bottom: 2px solid #26a69a;
  margin-bottom: 6px;
  padding-bottom: 5px;
  background: #f1f8f6;
  border-radius: 4px 4px 0 0;
  padding: 4px 6px 5px;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
/**/
.pregressi-box {
  border-bottom: 2px solid #ef9a9a;
  margin-bottom: 6px;
  background: #fdf4f4;
  border-radius: 4px 4px 0 0;
  padding: 4px 6px 5px;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.pregressi-box:empty { min-height: 4px; background: transparent; padding: 0 6px 2px; }
.pregressi-head {
  font-size: 0.72rem; font-weight: 700; color: #b71c1c;
  margin-bottom: 3px; text-transform: uppercase; letter-spacing: 0.03em;
}
/**/
.note-hdr {
  font-weight: 700;
  color: #37474f;
  user-select: none;
  -webkit-user-select: none;
  cursor: default;
  margin-bottom: 2px;
}
/**/
.terapia-box:empty { min-height: 4px; background: transparent; }
.patient-card.focus-mode .terapia-box:empty {
  text-align: center; padding: 12px 6px 14px; cursor: pointer; user-select: none; pointer-events: auto;
}
.patient-card.focus-mode .terapia-box:empty::before {
  content: "\f7de";
  font-family: "bootstrap-icons" !important; font-weight: normal !important; font-style: normal !important;
  display: block; text-align: center; font-size: 2.7rem; line-height: 1;
  color: #26a69a; opacity: 0.38; pointer-events: none; user-select: none;
}
.patient-card.focus-mode .terapia-box:empty::after {
  content: "clicca qui +";
  display: block; text-align: center; color: #00897b; font-weight: 700;
  font-size: 0.92rem; margin-top: 3px; pointer-events: none; user-select: none;
}
/**/
.editable-area.piano-mancante {
  border: 2px solid #e53935 !important;
  border-radius: 5px;
  background: #ffebee;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.editable-area.piano-mancante::before {
  display: block;
  content: "INSERIRE I PROBLEMI ATTIVI" !important;
  color: #c62828 !important;
  font-weight: 700 !important;
  font-style: normal !important;
}
.patient-card.focus-mode .editable-area.piano-mancante {
  border-color: transparent !important;
  background: transparent !important;
}
/**/
.patient-card.focus-mode .editable-area.piano-mancante::before { content: none !important; }
/**/
.editable-area[data-field="PianoTerapeutico"] { caret-color: transparent; cursor: default; }
.pa-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; padding: 1px 0; }
.pa-txt { flex: 1 1 auto; white-space: pre-wrap; word-break: break-word; }
.pa-az { flex: 0 0 auto; display: none; gap: 2px; }
.patient-card.focus-mode .pa-az { display: inline-flex; }
.pa-az button, .pa-add-btn { border: none; background: transparent; cursor: pointer; padding: 0 3px; line-height: 1; font-size: 0.95em; }
.pa-mod { color: #37474f; }
.pa-mod:hover { color: #00695c; }
.pa-del { color: #b0bec5; }
.pa-del:hover { color: #c62828; }
.pa-add { display: none; padding: 1px 0 3px; }
.patient-card.focus-mode .pa-add { display: block; }
.pa-add-btn { color: #00897b; font-size: 1.08em; }
.pa-add-btn:hover { color: #00695c; }
@media print { .pa-az, .pa-add { display: none !important; } }
/**/
.diaria-status-box {
  border-bottom: 2px solid #cfd8dc;
  margin-bottom: 6px;
  padding-bottom: 5px;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
/**/
.sc-criteri {
  max-height: 46vh; overflow-y: auto;
  border: 1px solid #eceff1; border-radius: 8px; padding: 2px 4px;
}
.sc-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 8px 8px; border-bottom: 1px solid #f1f3f4;
}
.sc-row:last-child { border-bottom: 0; }
.sc-lbl { flex: 1 1 45%; min-width: 148px; font-size: 0.9rem; color: #37474f; }
.sc-opts { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.sc-opt {
  border: 1.5px solid #d0d7de; background: #fff; color: #37474f;
  border-radius: 8px; padding: 7px 14px; font-size: 0.88rem; line-height: 1.2;
  cursor: pointer; white-space: nowrap; font-weight: 500;
  transition: background .12s, border-color .12s, color .12s, box-shadow .12s;
}
.sc-opt:hover { border-color: #1565c0; background: #eef5ff; }
.sc-opt.active {
  background: #1565c0; border-color: #1565c0; color: #fff; font-weight: 600;
  box-shadow: 0 1px 4px rgba(21,101,192,.35);
}
.sc-opt .sc-pt { font-size: 0.78rem; opacity: 0.7; margin-left: 5px; font-weight: 700; }
.sc-opt.active .sc-pt { opacity: 1; }
.sc-numwrap { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.sc-num {
  width: 96px; text-align: right; font-size: 0.9rem;
  border: 1.5px solid #cfd8dc; border-radius: 8px; padding: 5px 8px;
}
.sc-num:focus { outline: none; border-color: #1565c0; box-shadow: 0 0 0 2px rgba(21,101,192,.15); }
.sc-unit { font-size: 0.78rem; color: #78909c; min-width: 44px; }
.sc-risultato {
  margin-top: 12px; padding: 12px 14px; border-radius: 10px; text-align: center;
  background: #eceff1; transition: background .15s;
}
.sc-risultato.is-basso { background: #e8f5e9; }
.sc-risultato.is-alto  { background: #ffebee; }
.sc-ris-val { display: block; font-size: 1.7rem; font-weight: 700; color: #263238; }
.sc-ris-int { display: block; font-size: 0.85rem; color: #546e7a; line-height: 1.4; text-align: left; margin-top: 6px; }
.sc-risultato.is-basso .sc-ris-int, .sc-risultato.is-alto .sc-ris-int { color: #37474f; }
/**/
.cl-scala-sub {
  display: block; font-size: 0.8rem; color: #78909c;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 520px) {
  .sc-lbl { flex-basis: 100%; }
  .sc-opts, .sc-numwrap { margin-left: 0; }
}
/**/
.sc-info-tabs { margin: 6px 0 12px; }
.sc-tabbar { display: flex; gap: 6px; }
.sc-tab {
  flex: 1 1 0; border: 1px solid #d0d7de; background: #f4f2ee; color: #1565c0;
  border-radius: 7px 7px 0 0; padding: 7px 8px; font-size: 0.83rem; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: background .12s, color .12s, border-color .12s;
}
.sc-tab:hover { background: #eef5ff; border-color: #90b4e0; }
.sc-tab.active { background: #1565c0; border-color: #1565c0; color: #fff; }
.sc-tabpanel {
  border: 1px solid #d0d7de; border-top: none; border-radius: 0 0 8px 8px;
  padding: 10px 12px; font-size: 0.85rem; color: #455a64; line-height: 1.5; background: #fffdf9;
}
/**/
.scale-modal-popup { background: #f6f4ef !important; }
.sc-criteri { background: #fffdf9; }
/**/
.sc-descr {
  background: #e8f5e9;
  border-left: 4px solid #43a047;
  border-radius: 6px;
  padding: 8px 12px;
  margin: 4px 0 10px;
  font-size: 0.86rem;
  color: #2e5b1e;
  line-height: 1.45;
}
/**/
.sc-procedure {
  border: 1.5px solid #ffcc80;
  background: #fff8f0;
  border-radius: 8px;
  padding: 8px 12px;
  margin: 4px 0 12px;
  font-size: 0.85rem;
  color: #4e342e;
  line-height: 1.5;
}
.sc-procedure b { color: #37474f; }
.sc-procedure .risk-basso { color: #2e7d32; font-weight: 700; }
.sc-procedure .risk-alto { color: #c62828; font-weight: 700; }
.sc-procedure ul { margin: 2px 0 8px; padding-left: 18px; }
.sc-procedure li { margin: 1px 0; }
/**/
.bed-status-icons .bed-status-ico:not(:only-child) {
  width: 26px;
  height: 26px;
  border-radius: 7px;
}
.bed-status-icons .bed-status-ico:not(:only-child) { border-width: 1.5px; }
/**/
.patient-card .status-badge { z-index: 5; }

/**/
#btnAggiornamentoDisponibile {
  background: linear-gradient(135deg, #D97757 0%, #C15F3C 100%) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: 0 2px 8px rgba(193,95,60,0.40);
  transition: filter 0.15s, box-shadow 0.2s;
}
#btnAggiornamentoDisponibile:hover {
  filter: brightness(1.10);
  box-shadow: 0 4px 14px rgba(193,95,60,0.60);
}
#btnAggiornamentoDisponibile:disabled {
  opacity: 0.65;
  cursor: wait;
  box-shadow: none;
}

/**/
@keyframes _iconUpdatePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.45; transform: scale(1.18); }
}
#btnAggiornamentoDisponibile #iconUpdateBadge {
  color: #fff5d4; /**/
  display: inline-flex;
  transform-origin: center;
  animation: _iconUpdatePulse 1s ease-in-out infinite;
}
#btnAggiornamentoDisponibile:hover #iconUpdateBadge {
  animation-play-state: paused; /**/
}
#btnAggiornamentoDisponibile:disabled #iconUpdateBadge {
  animation: none;
  opacity: 0.7;
}


/**/
.alt-row {
  display: flex;
  flex-wrap: wrap;          /**/
  border: 2px solid #333;
  border-radius: 8px;
  margin-bottom: 12px;
  background-color: #fdfbf7;
  position: relative;
  min-height: 120px;
}

.alt-col {
  border-right: 2px solid #333;
  display: flex;
  flex-direction: column;
  position: relative;
}
.alt-col:last-child { border-right: none; }

/**/
.alt-col-info    { width: 12%; background-color: #f2efe9; }
.alt-col-diag    { width: 18%; }
.alt-col-diaria  { width: 53.5%; }
.alt-col-terapia { width: 16.5%; }

.alt-col-header {
  background-color: #e8e6e1;
  padding: 5px 8px;
  font-weight: bold;
  font-size: 0.78rem;
  text-align: center;
  border-bottom: 1px solid #ccc;
  user-select: none;
  text-transform: uppercase;
}

.alt-col-header-split {
  background-color: #e8e6e1;
  padding: 5px 8px;
  font-weight: bold;
  font-size: 0.78rem;
  text-align: center;
  border-bottom: 1px solid #ccc;
  border-top: 2px solid #333;
  user-select: none;
  text-transform: uppercase;
}

.alt-info-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 4px 4px;
  gap: 1px;
  flex-grow: 1;
}

.alt-bed-number {
  font-size: 2rem;
  font-weight: bold;
  line-height: 1;
}

.alt-nome {
  font-weight: bold;
  font-size: 1.1rem;
  text-align: center;
  text-transform: uppercase;
  outline: none;
  width: 100%;
  padding: 2px;
  min-height: 0;
  border-bottom: 1px solid #ccc;
  word-break: break-word;
}

.alt-allergie-label {
  font-size: 0.85rem;
  font-weight: bold;
  color: #c62828;
  text-transform: uppercase;
  margin-top: 3px;
  text-align: center;
}

.alt-allergie-val {
  font-size: 1.0rem;
  outline: none;
  width: 100%;
  padding: 2px 3px;
  min-height: 0;
  text-align: center;
  border-bottom: 1px solid #ccc;
  word-break: break-word;
}

/**/
.alt-info-row,
.alt-info-row-eta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  padding: 2px 3px;
  border-bottom: 1px solid #eee;
  box-sizing: border-box;
}

.alt-info-label {
  font-size: clamp(0.6rem, 1.2vw, 0.9rem);
  font-weight: bold;
  color: #333;
  line-height: 1.2;
  white-space: normal;
}

.alt-info-val {
  font-weight: normal;
  font-size: clamp(0.48rem, 0.95vw, 0.72rem);
  outline: none;
  width: 100%;
  max-width: 100%;
  padding: 0 2px;
  overflow: hidden;
  overflow-wrap: break-word;
  word-break: break-word;
  box-sizing: border-box;
}

/**/
.alt-col-info input.alt-info-val {
  font-size: clamp(0.48rem, 0.95vw, 0.72rem);
  white-space: nowrap;
  text-overflow: ellipsis;
  border: none;
  border-bottom: 1px solid #ccc;
  background: transparent;
}

/**/
span.valore-giorni.alt-info-val { font-weight: normal; }

/**/
.dim-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dashed #d6dee2;
}
.dim-checkbox-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  user-select: none;
  margin: 0;
}
.dim-checkbox {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: #f4a300;
  margin: 0;
  flex-shrink: 0;
}
.dim-checkbox-label {
  font-size: clamp(0.6rem, 1.1vw, 0.85rem);
  font-weight: bold;
  color: #333;
  line-height: 1.1;
}
.dim-data-info {
  font-size: clamp(0.55rem, 1vw, 0.78rem);
  color: #b8860b;
  font-weight: 600;
  font-style: italic;
}
.dim-data-info-empty { display: none; }
/**/
.dim-row[data-value=""] .dim-checkbox { accent-color: #aab; }

/**/
.dim-icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  border: 1.2px solid #b71c1c;
  line-height: 1;
  vertical-align: middle;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
  cursor: help;
  padding: 1px;
}
.dim-icon-badge svg { display: block; }

/**/
.dim-icon-corner {
  position: absolute;
  top: -6px;
  left: -6px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  border: 1px solid #b71c1c;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
  z-index: 2;
}
.dim-icon-corner svg { display: block; }

/**/
.dim-icon-list {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}
.dim-icon-list svg { display: block; }
/**/
.patient-card { scroll-margin-top: 90px; }
/**/
.bedstatus-icon-list {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}
.bedstatus-icon-list svg { display: block; }

/**/
.patient-card:not(.focus-mode) .dim-checkbox {
  cursor: not-allowed;
  opacity: 0.85;
}
.patient-card:not(.focus-mode) .dim-checkbox-wrap {
  cursor: not-allowed;
}

/**/
.tb-btn.tb-snapshot-recovery {
  position: relative;
}
.tb-snapshot-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #d32f2f;
  color: #fff;
  font-size: 0.6rem;
  font-weight: bold;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/**/
.modale-recupero-popup {
  max-width: 1100px !important;
}
.modal-recupero-snap {
  text-align: left;
  font-size: 0.85rem;
  color: #263238;
  max-height: 65vh;
  overflow-y: auto;
}
.snap-preview { padding: 4px 6px; }
.snap-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  padding: 6px 10px;
  background: #eceff1;
  border-radius: 6px;
}
.snap-tipo {
  font-weight: bold;
  font-size: 0.85rem;
  color: #37474f;
}
.snap-paginazione {
  font-size: 0.75rem;
  color: #607d8b;
  font-style: italic;
}
.snap-orari {
  font-size: 0.74rem;
  color: #607d8b;
  margin-bottom: 6px;
  padding: 0 10px;
}
.snap-hr {
  margin: 6px 0;
  border-color: #cfd8dc;
}
.snap-sez {
  margin-bottom: 8px;
  padding: 6px 10px;
  background: #fafafa;
  border-left: 3px solid #0288d1;
  border-radius: 0 4px 4px 0;
}
.snap-sez-titolo {
  font-weight: bold;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #0288d1;
  margin-bottom: 3px;
}
.snap-sez-corpo {
  font-size: 0.82rem;
  line-height: 1.45;
  color: #263238;
  white-space: normal;
  word-wrap: break-word;
}
.snap-nav-buttons {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #cfd8dc;
  text-align: center;
}

/**/
.alt-col-diag .alt-editable,
.alt-col-diaria .alt-editable,
.alt-col-terapia .alt-editable {
  flex-grow: 1;
  padding: 8px;
  outline: none;
  overflow-y: auto;
  font-size: 0.85rem;
}

.alt-diag-top {
  display: flex;
  flex-direction: column;
}

.alt-diag-top .alt-editable,
.alt-diag-bottom .alt-editable,
.alt-diag-fourth .alt-editable,
.alt-diag-third .alt-editable {
  flex-grow: 0;
  min-height: 40px;
}

.alt-diag-bottom {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
}

/**/
.alt-diag-fourth {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
}

/**/
.editable-area[data-placeholder]:empty::before,
.editable-area[data-placeholder].is-empty::before {
  content: attr(data-placeholder);
  color: #b0b0b0;
  font-style: italic;
  font-weight: normal;
  pointer-events: none;
  display: block;
  user-select: none;
}
/**/
.editable-area[data-placeholder]:focus:empty::before,
.editable-area[data-placeholder].is-empty:focus::before {
  opacity: 0.45;
}

/**/
/**/
.cl-check {
  display: inline-block;
  font-size: 1.05em;
  cursor: pointer;
  user-select: none;
  line-height: 1;
  padding: 0 2px;
  border-radius: 3px;
  vertical-align: middle;
}
.cl-check:hover { background: rgba(46,125,50,0.10); }
.cl-esito {
  margin-left: 1.6em;
  padding-left: 0;
  font-size: 0.92em;
  color: #455a64;
}
.cl-esito-arrow {
  user-select: none;
  color: #607d8b;
  margin-right: 2px;
}
/**/
.cl-esito.cl-esito-sbarrato {
  text-decoration: line-through;
  color: #8b9398;
}
.cl-esito.cl-esito-sbarrato .cl-esito-arrow { text-decoration: none; }
.cl-esito.cl-esito-sbarrato strong { text-decoration: line-through; }

/**/
.cl-item.cl-sbarrato { text-decoration: none; color: inherit; }

/**/
.focus-toolbar .tb-data-diaria,
.focus-toolbar .tb-data-check {
  padding: 2px 6px;
}

/**/
hr.cl-separator {
  border: 0;
  border-top: 1px solid #b0bec5;
  margin: 10px 0;
  height: 0;
}

.alt-diag-third {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
}

/**/
.alt-col-info .editable-area {
  flex-grow: 0 !important;
  flex-shrink: 0 !important;
  min-height: 0 !important;
  overflow: visible !important;
  height: auto !important;
}
/**/
.alt-col-info .editable-area.alt-info-val {
  flex-grow: 1 !important;
  flex-shrink: 1 !important;
  padding: 0 2px !important;
  min-height: 0 !important;
}

/**/
.alt-row.focus-mode .focus-pencil-btn { display: none !important; }

/**/
.alt-col-diag .alt-editable[data-field="Diagnosi"] {
  font-weight: bold;
  font-size: 1.0rem;
}

/**/
@media (max-width: 767.98px) {

  /**/
  .alt-col {
    width: 100% !important;
    border-right: none;
    border-bottom: 2px solid #333;
  }
  .alt-col-terapia,
  .alt-col:last-of-type { border-bottom: none; }

  /**/
  .alt-col-header,
  .alt-col-header-split {
    font-size: 0.8rem;
    text-align: left;
    padding: 7px 12px;
    letter-spacing: 0.03em;
  }
  .alt-col-header-split { border-top: 1px solid #b0bec5; }

  /**/
  .alt-info-box {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px 12px;
    align-items: start;
    padding: 8px 12px 10px;
  }
  /**/
  .alt-info-box > .bed-number-flex {
    grid-column: 1;
    justify-self: start;
    min-height: 52px;
    align-items: center;
  }
  .alt-info-box > .tipo-badge-wrap {
    grid-column: 2;
    justify-self: end;
    align-self: center;
    padding-right: 58px;
  }
  /**/
  .bed-status-icons { top: 10px; left: 12px; }
  .bed-status-ico { width: 34px; height: 34px; }
  .bed-status-icons .bed-status-ico:not(:only-child) { width: 30px; height: 30px; }
  .alt-col-info:has(.bed-status-icons) .alt-info-box { padding-top: 52px; }
  /**/
  .alt-info-box > .alt-nome,
  .alt-info-box > .alt-allergie-label,
  .alt-info-box > .alt-allergie-val,
  .alt-info-box > .dim-row { grid-column: 1 / -1; }
  /**/
  .alt-info-box > .alt-info-row:has([data-field="Ossigeno"]),
  .alt-info-box > .alt-info-row:has([data-field="Vitto"]) { grid-column: 1 / -1; }

  .alt-bed-number { font-size: 2.2rem; }
  .alt-nome { font-size: 1.3rem; padding: 4px 0 6px; }
  .alt-allergie-label { font-size: 0.9rem; margin-top: 6px; }
  .alt-allergie-val { font-size: 1rem; padding: 3px; }

  /**/
  .alt-info-label { font-size: 0.72rem; color: #546e7a; }
  .alt-info-val { font-size: 1rem; }
  /**/
  .alt-col-info input.alt-info-val { font-size: 16px; }

  /**/
  .alt-col-diag .alt-editable,
  .alt-col-diaria .alt-editable,
  .alt-col-terapia .alt-editable {
    font-size: 0.95rem;
    line-height: 1.45;
    padding: 10px 12px;
  }
  .alt-col-diag .alt-editable[data-field="Diagnosi"] { font-size: 1.05rem; }
  .editable-area { min-height: 80px; }
  .alt-diag-top .alt-editable,
  .alt-diag-bottom .alt-editable,
  .alt-diag-fourth .alt-editable,
  .alt-diag-third .alt-editable { min-height: 56px; }

  /**/
  .alt-row:not(.focus-mode) .alt-col-diaria .alt-editable { max-height: 50vh; }
  .alt-row:not(.focus-mode) .alt-col-terapia .alt-editable,
  .alt-row:not(.focus-mode) .alt-col-diag .alt-editable { max-height: 40vh; }
  /**/
  .alt-row.focus-mode .alt-editable { max-height: none !important; }

  /**/
  .focus-toolbar { gap: 4px; padding: 8px; }
  .focus-toolbar .tb-btn { padding: 7px 10px; font-size: 0.95rem; }
  .dim-checkbox { width: 20px; height: 20px; }
  /**/
  .cl-check { padding: 5px 7px; font-size: 1.2em; }

  /**/
  #cardsContainer.container-fluid { padding-left: 8px; padding-right: 8px; }
  .alt-row { margin-bottom: 16px; }

  /**/
  /**/
  #rubricaPanel {
    top: 62px !important;
    left: 8px !important;
    right: 8px !important;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px)) !important;
    width: auto !important;
    height: auto !important;
  }
  /**/
  .modal-body { overflow-x: auto; }
}

/**/
@media (hover: none) {
  .patient-card .focus-pencil-btn { display: flex !important; }
  .patient-card.card-locked .focus-pencil-btn,
  .alt-row.focus-mode .focus-pencil-btn,
  .patient-card.focus-mode .focus-pencil-btn { display: none !important; }
}

/**/
@media (hover: none) and (min-width: 768px) {
  .alt-info-val,
  .alt-col-info input.alt-info-val { font-size: clamp(0.62rem, 0.95vw, 0.72rem); }
}

/**/
@supports (padding: env(safe-area-inset-top)) {
  .navbar.fixed-top { padding-top: calc(0.5rem + env(safe-area-inset-top, 0px)); }
  body {
    padding-top: calc(70px + env(safe-area-inset-top, 0px));
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
}

/**/
html.modo-rubrica body { padding-top: 0 !important; background: #263238 !important; overflow: hidden; }
html.modo-rubrica #appBodyContent,
html.modo-rubrica #backupCheckOverlay,
html.modo-rubrica #versionUpdateOverlay { display: none !important; }
html.modo-rubrica #rubricaPanel {
  top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
  width: auto !important; height: auto !important;
  border-radius: 0 !important; box-shadow: none !important;
  background: #263238 !important;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}
html.modo-rubrica #rubricaPanelHeader { display: none !important; }

/**/
html.modulo-rubrica-spento .modulo-rubrica,
html.modulo-terapia-spento .modulo-terapia,
html.modulo-laboratorio-spento .modulo-laboratorio,
html.modulo-scale-spento .modulo-scale,
html.modulo-dimissioni-spento .modulo-dimissioni { display: none !important; }
/**/
html.modulo-terapia-spento .patient-card.focus-mode .terapia-box:empty { padding: 0; cursor: auto; }
html.modulo-terapia-spento .patient-card.focus-mode .terapia-box:empty::before,
html.modulo-terapia-spento .patient-card.focus-mode .terapia-box:empty::after,
html.modulo-terapia-spento [data-field="NoteTerapia"].terapia-scaduta::before { content: none !important; display: none !important; }
/**/
html.modo-rubrica .rubrica-spenta:not([hidden]) ~ #rubricaPanel { display: none !important; }
.rubrica-spenta:not([hidden]) { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 9500; display: flex; align-items: center; justify-content: center; padding: 24px; background: #263238; color: #eceff1; text-align: center; }
.rubrica-spenta-testo { max-width: 420px; }
.rubrica-spenta-testo .bi-telephone-x { font-size: 48px; color: #90a4ae; }
.rubrica-spenta-testo p { margin: 12px 0 0; font-size: 18px; }
.rubrica-spenta-testo .rubrica-spenta-sotto { font-size: 14px; color: #b0bec5; margin-bottom: 20px; }
