/* ==========================================================================
   DASHBOARD 2 — "Clinical Overview"
   A different composition from the main dashboard: hero summary, sparkline
   KPIs, patient-flow chart, live schedule timeline, ER queue, task list.
   Uses the same tokens/components as the rest of the template.
   ========================================================================== */

/* ---- Hero ---- */
.hero-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-6);
  align-items: center;
  padding: var(--space-8);
  border-radius: var(--radius-lg);
  color: #fff;
  background:
    radial-gradient(900px 360px at 92% -30%, rgba(255, 255, 255, 0.16), transparent 60%),
    linear-gradient(135deg, #0E7C86 0%, #0A4F63 55%, #123B57 100%);
  margin-bottom: var(--space-6);
}
.hero-card__date { font-size: 13px; color: rgba(255, 255, 255, 0.72); margin-bottom: 8px; }
.hero-card h1 { color: #fff; font-size: 1.75rem; margin-bottom: 6px; }
.hero-card p { color: rgba(255, 255, 255, 0.84); margin: 0 0 var(--space-5); max-width: 480px; }
.hero-card__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-btn-light { background: #fff; color: #0A4F63; }
.hero-btn-light:hover { color: #0A4F63; filter: brightness(0.95); }
.hero-btn-ghost { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.35); color: #fff; }
.hero-btn-ghost:hover { background: rgba(255, 255, 255, 0.18); color: #fff; }
.hero-card__stats { display: flex; gap: 12px; }
.hero-chip {
  min-width: 112px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.hero-chip strong { display: block; font-size: 1.45rem; line-height: 1.1; color: #fff; }
.hero-chip span { font-size: 12px; color: rgba(255, 255, 255, 0.74); }
@media (max-width: 991px) {
  .hero-card { grid-template-columns: 1fr; padding: var(--space-6); }
  .hero-card__stats { flex-wrap: wrap; }
}

/* ---- KPI cards with sparklines ---- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); margin-bottom: var(--space-6); }
@media (max-width: 1200px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 576px) { .kpi-grid { grid-template-columns: 1fr; } }
.kpi-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.kpi-card__label { font-size: var(--fs-small); color: var(--color-text-secondary); font-weight: var(--fw-medium); }
.kpi-card__row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.kpi-card__value { font-size: 1.75rem; font-weight: var(--fw-bold); letter-spacing: -0.02em; color: var(--color-text-primary); line-height: 1.1; }
.kpi-card__spark { width: 96px; height: 34px; flex-shrink: 0; }
.kpi-card__foot { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--color-text-muted); }
.kpi--primary { color: var(--color-primary); }
.kpi--success { color: var(--color-success); }
.kpi--warning { color: var(--color-warning); }
.kpi--info { color: var(--color-info); }

/* ---- Grid rows ---- */
.d2-row { display: grid; gap: var(--space-4); margin-bottom: var(--space-6); align-items: start; }
.d2-row--wide { grid-template-columns: 1.7fr 1fr; }
.d2-row--mid { grid-template-columns: 1.2fr 1fr; }
@media (max-width: 991px) { .d2-row--wide, .d2-row--mid { grid-template-columns: 1fr; } }

.flow-legend { display: flex; gap: var(--space-4); flex-wrap: wrap; margin-top: var(--space-3); }

/* ---- Bed occupancy ---- */
.donut-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  pointer-events: none;
}
.donut-center strong { font-size: 1.6rem; letter-spacing: -0.02em; }
.donut-center span { font-size: 12px; color: var(--color-text-muted); }
.ward-row { margin-top: var(--space-3); }
.ward-row__top { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 4px; color: var(--color-text-secondary); }

/* ---- Today's schedule timeline ---- */
.tday { list-style: none; margin: 0; padding: 0; }
.tday-item { display: grid; grid-template-columns: 64px 12px 1fr; gap: 12px; padding-bottom: var(--space-4); position: relative; }
.tday-item:last-child { padding-bottom: 0; }
.tday-item::before {
  content: '';
  position: absolute; left: 81px; top: 18px; bottom: -2px; width: 1px;
  background: var(--color-border);
}
.tday-item:last-child::before { display: none; }
.tday-time { font-size: 12px; font-weight: var(--fw-semibold); color: var(--color-text-muted); text-align: right; padding-top: 8px; }
.tday-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--color-border-strong); margin-top: 9px; position: relative; z-index: 1; }
.tday-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.tday-card__name { font-weight: var(--fw-semibold); font-size: var(--fs-small); }
.tday-card__sub { font-size: 12px; color: var(--color-text-muted); }
.tday-item.is-done .tday-dot { background: var(--color-success); }
.tday-item.is-now .tday-dot { background: var(--color-primary); box-shadow: 0 0 0 4px var(--color-primary-soft); }
.tday-item.is-now .tday-card { border-color: var(--color-primary); background: var(--color-primary-soft); }

/* ---- ER queue + staff ---- */
.er-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--color-border); }
.er-item:last-child { border-bottom: none; padding-bottom: 0; }
.er-item:first-child { padding-top: 0; }
.er-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.er-dot--critical { background: var(--color-danger); box-shadow: 0 0 0 4px var(--color-danger-soft); }
.er-dot--urgent { background: var(--color-warning); }
.er-dot--stable { background: var(--color-success); }
.er-item__meta { flex: 1; min-width: 0; }
.er-item__name { font-size: var(--fs-small); font-weight: var(--fw-semibold); }
.er-item__sub { font-size: 12px; color: var(--color-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duty-row { margin-top: var(--space-4); }
.duty-row:first-child { margin-top: 0; }
.duty-row__top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.avatar-stack { display: flex; margin-bottom: var(--space-4); }
.avatar-stack .avatar { width: 32px; height: 32px; font-size: 11px; border: 2px solid var(--color-card); margin-left: -8px; }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* ---- Tasks ---- */
.task-item { display: flex; align-items: flex-start; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--color-border); cursor: pointer; font-size: var(--fs-small); }
.task-item:last-child { border-bottom: none; }
.task-item input { width: 17px; height: 17px; accent-color: var(--color-primary); margin-top: 1px; flex-shrink: 0; cursor: pointer; }
.task-item input:checked + span { text-decoration: line-through; color: var(--color-text-muted); }
.task-item small { display: block; color: var(--color-text-muted); font-size: 12px; }
