/* ============================================================
   Tizon — מרכז בקרה (טאב 16) · v242
   ------------------------------------------------------------
   לפני: שבעה כרטיסים בשבעה צבעים שונים, כותרות בגרדיאנטים,
   אימוג'י בכל כותרת, והכל בעמודה אחת ארוכה.
   עכשיו:
     • אריחי מדדים לבנים ואחידים. רק אריח שדורש פעולה (שאלון או יומן
       שמחכים) מקבל הדגשה זהובה — tizon_hub_look.js מסמן אותו.
     • שתי עמודות: תיבת השאלונים במרכז, וכל השאר בעמודת צד.
     • כרטיסים לבנים עם כותרת, הסבר בשורה אחת ופעולות משמאל.
   הקוד שממלא את המספרים והרשימות לא השתנה. חלק ממנו כותב סגנון
   ישירות על הכפתורים, ולכן כמה כללים כאן מסומנים !important.
   ============================================================ */

.tzh {
  --g: var(--tz-green, #2F5233);
  --g-dark: var(--tz-green-dark, #24401F);
  --gold: var(--tz-gold, #B89742);
  --gold-dark: var(--tz-gold-dark, #8A6F2C);
  --ink: var(--tz-ink, #1E293B);
  --ink2: var(--tz-ink-2, #475569);
  --ink3: var(--tz-ink-3, #64748B);
  --line: var(--tz-line, #E2E8F0);
  --soft: var(--tz-line-soft, #F1F5F9);
  font-family: var(--tz-font, Heebo, Arial, sans-serif);
  color: var(--ink);
}

/* ---------- כותרת ---------- */
.tzh-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 4px 0 20px; }
.tzh-eyebrow { font-size: .78rem; font-weight: 700; color: var(--gold-dark); letter-spacing: .02em; }
.tzh-head h2 { margin: 2px 0 0; font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.tzh-greet { font-size: .95rem; color: var(--ink3); margin-top: 4px; }

/* ---------- מדדים ---------- */
.tzh-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.tzh-kpi {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: right;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px 14px;
  font-family: inherit; color: var(--ink); cursor: pointer; min-width: 0;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.tzh-kpi:hover { border-color: #cbd5e1; box-shadow: 0 6px 18px rgba(16, 24, 16, .08); transform: translateY(-1px); }
.tzh-kpi:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.tzh-kpi-ic { width: 32px; height: 32px; border-radius: 9px; background: var(--soft); color: var(--g); display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.tzh-kpi-ic svg, .tzh-quick svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.tzh-kpi-l { font-size: .8rem; font-weight: 700; color: var(--ink3); }
.tzh-kpi-v { font-size: 2rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--ink); }
.tzh-kpi-s { font-size: .74rem; color: var(--ink3); line-height: 1.35; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; width: 100%; }
/* דורש פעולה */
.tzh-kpi.is-hot { border-color: #e6d3a2; background: linear-gradient(180deg, #FFFCF3, #fff 70%); }
.tzh-kpi.is-hot .tzh-kpi-ic { background: #FBF3DC; color: var(--gold-dark); }
.tzh-kpi.is-hot::after { content: ''; position: absolute; top: 14px; left: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(184, 151, 66, .18); }

/* ---------- התראות ---------- */
#tab16 #hubAlertsArea:not(:empty) { margin-bottom: 20px; }

/* ---------- פריסה ---------- */
.tzh-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.tzh-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.tzh-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; min-width: 0; }
.tzh-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.tzh-card-head h3 { margin: 0; font-size: 1.05rem; font-weight: 800; color: var(--ink); }
.tzh-card-head p { margin: 3px 0 0; font-size: .8rem; color: var(--ink3); }
.tzh-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.tzh-btn { border: 1px solid var(--line); background: #fff; color: var(--ink2); border-radius: 9px; min-height: 34px; padding: 0 12px; font: 600 .82rem inherit; font-family: inherit; cursor: pointer; white-space: nowrap; }
.tzh-btn:hover { border-color: #cbd5e1; color: var(--ink); background: #F8FAFC; }
.tzh-link, #tab16 #tzSubSelBtn {
  border: 0 !important; background: none !important; color: var(--g) !important; font: 700 .82rem inherit !important;
  font-family: inherit !important; cursor: pointer; padding: 6px 8px !important; border-radius: 8px !important; min-height: 0 !important;
}
.tzh-link:hover, #tab16 #tzSubSelBtn:hover { background: var(--soft) !important; }
.tzh-pill { background: var(--soft); color: var(--ink2); border-radius: 999px; padding: 3px 10px; font-size: .8rem; font-weight: 700; }
.tzh-empty { color: var(--ink3); font-size: .86rem; text-align: center; padding: 22px 10px; }
.tzh-gap { flex: 1; }

/* ---------- תיבת השאלונים ---------- */
.tzh-seg { display: flex; gap: 4px; background: var(--soft); border-radius: 12px; padding: 4px; margin-bottom: 10px; }
#tab16 .hubTypeBtn {
  flex: 1; border: 0 !important; background: transparent !important; color: var(--ink2) !important; border-radius: 9px !important;
  min-height: 40px; padding: 0 14px !important; font: 700 .9rem inherit !important; font-family: inherit !important; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
#tab16 .hubTypeBtn.active { background: #fff !important; color: var(--ink) !important; box-shadow: 0 1px 3px rgba(16, 24, 16, .12); }
.tzh-count { background: var(--gold); color: #fff; border-radius: 999px; padding: 0 7px; font-size: .74rem; font-weight: 800; line-height: 1.6; }
.tzh-arrived:not(:empty) { font-size: .86rem; font-weight: 700; color: var(--gold-dark); margin: 4px 2px 8px; }
.tzh-filters { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 4px 0 12px; border-bottom: 1px solid var(--soft); margin-bottom: 12px; }
#tab16 .hubFilterBtn {
  border: 1px solid var(--line) !important; background: #fff !important; color: var(--ink2) !important; border-radius: 999px !important;
  height: 30px; padding: 0 12px !important; font: 600 .8rem inherit !important; font-family: inherit !important; cursor: pointer;
}
#tab16 .hubFilterBtn:hover { border-color: #cbd5e1 !important; }
#tab16 .hubFilterBtn.active { background: var(--ink) !important; border-color: var(--ink) !important; color: #fff !important; }

/* ---------- כרטיס שאלון (renderSubmissionsList) ---------- */
.tzh-sub {
  display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px;
  transition: border-color .15s, box-shadow .15s;
}
.tzh-sub:hover { border-color: #cbd5e1; box-shadow: 0 4px 14px rgba(16, 24, 16, .06); }
.tzh-sub.is-new { border-inline-start: 3px solid var(--gold); }
.tzh-sub.is-warn { border-color: #fecaca; }
.tzh-sub-main { flex: 1; min-width: 220px; }
.tzh-sub-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.tzh-sub-name { font-size: 1rem; color: var(--ink); }
.tzh-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: .72rem; font-weight: 700; background: var(--soft); color: var(--ink2); white-space: nowrap; }
.tzh-chip--new  { background: #FBF3DC; color: var(--gold-dark); }
.tzh-chip--viewed, .tzh-chip--proc { background: #EEF2F7; color: #334155; }
.tzh-chip--done { background: #ECFDF3; color: #166534; }
.tzh-chip--arch { background: var(--soft); color: var(--ink3); }
.tzh-chip--bad  { background: #FEF2F2; color: #B91C1C; }
.tzh-sub-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .82rem; color: var(--ink2); margin-top: 2px; }
.tzh-sub-meta--soft { color: var(--ink3); font-size: .78rem; }
.tzh-sub-meta span { display: inline-flex; align-items: center; gap: 5px; direction: rtl; }
.tzh-sub-meta svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; opacity: .8; }
.tzh-sub-cond { font-size: .8rem; color: var(--ink2); margin-top: 6px; }
.tzh-sub-cond b { color: var(--ink3); font-weight: 600; }
.tzh-sub-quote { font-size: .84rem; color: var(--ink); margin-top: 8px; padding: 8px 12px; background: #FAFBFA; border-inline-start: 2px solid var(--line); border-radius: 0 8px 8px 0; line-height: 1.55; }
.tzh-sub-actions { display: flex; flex-wrap: wrap; gap: 6px; align-self: center; }
.tzh-sa { border: 1px solid var(--line); background: #fff; color: var(--ink2); border-radius: 8px; min-height: 34px; padding: 0 12px; font: 600 .8rem inherit; font-family: inherit; cursor: pointer; white-space: nowrap; }
.tzh-sa:hover { border-color: #cbd5e1; color: var(--ink); }
.tzh-sa--primary { background: var(--g); border-color: var(--g); color: #fff; }
.tzh-sa--primary:hover { background: var(--g-dark); color: #fff; }
.tzh-sa--danger { color: #B91C1C; }
.tzh-sa--danger:hover { background: #FEF2F2; color: #B91C1C; border-color: #fecaca; }
.tzh-sub .tzSubPick { margin-top: 3px; }
@media (max-width: 620px) { .tzh-sub-actions { width: 100%; } .tzh-sa--primary { flex: 1; } }

/* ---------- עמודת הצד ---------- */
.tzh-rp { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--soft); }
.tzh-rp:last-child { border-bottom: 0; }
.tzh-rp-main { min-width: 0; }
.tzh-rp-name { font-weight: 700; font-size: .92rem; color: var(--ink); }
.tzh-rp-meta { font-size: .76rem; color: var(--ink3); margin-top: 2px; direction: rtl; }

.tzh-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tzh-quick button {
  display: flex; align-items: center; gap: 10px; border: 1px solid var(--soft); background: #FAFBFA; border-radius: 10px;
  min-height: 44px; padding: 0 12px; font: 600 .86rem inherit; font-family: inherit; color: var(--ink); cursor: pointer; text-align: right;
}
.tzh-quick button svg { color: var(--g); }
.tzh-quick button:hover { border-color: var(--line); background: #fff; }
#hubRecentPatientsList, #hubSignedList { max-height: 420px; overflow: auto; }

/* ---------- מסכים ---------- */
@media (max-width: 1280px) { .tzh-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .tzh-grid { grid-template-columns: 1fr; } }
@media (max-width: 620px) {
  .tzh-head h2 { font-size: 1.5rem; }
  .tzh-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tzh-kpi { padding: 12px; }
  .tzh-kpi-v { font-size: 1.6rem; }
  .tzh-card { padding: 16px; }
  .tzh-card-head { flex-wrap: wrap; }
  .tzh-quick { grid-template-columns: 1fr; }
}
