/* 2.4: daily management and renewal workflow */
.team-view[hidden] {
  display: none !important;
}

.side-nav {
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}

.nav-link {
  position: relative;
}

.nav-count {
  min-width: 22px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  margin-left: auto;
  padding: 0 6px;
  color: #173e36;
  background: #f4d98f;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 850;
}

.nav-count.danger {
  color: #fff;
  background: #b94a42;
}

.today-hero {
  min-height: 138px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 30px;
  color: #fff;
  background: #173e36;
  border: 1px solid #173e36;
  border-radius: 8px;
}

.today-date {
  color: #b9cbc5;
  font-size: 12px;
  font-weight: 750;
}

.today-hero h2 {
  margin: 5px 0 6px;
  font-size: 25px;
  line-height: 1.25;
}

.today-hero p {
  max-width: 760px;
  margin: 0;
  color: #d6e2de;
}

.today-health {
  min-width: 138px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 16px;
  color: #e6efec;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
}

.today-health span {
  width: 9px;
  height: 9px;
  background: #65c59a;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(101, 197, 154, 0.13);
}

.today-health.warn span { background: #e0ae45; }
.today-health.danger span { background: #e7776d; }

.today-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
}

.today-kpi {
  min-height: 112px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 3px solid var(--teal);
  border-radius: 8px;
}

.today-kpi.warn { border-top-color: var(--yellow); }
.today-kpi.danger { border-top-color: var(--red); }
.today-kpi.blue { border-top-color: var(--blue); }

.today-kpi-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.today-kpi-value {
  font-size: 25px;
  font-weight: 880;
  line-height: 1;
}

.today-kpi-sub {
  color: var(--muted);
  font-size: 11px;
}

.today-action-strip {
  padding: 16px;
  background: #f7faf9;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.today-action-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.today-action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.today-action-card {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 68px;
  padding: 12px;
  color: var(--ink);
  text-align: left;
  background: #fff;
  border: 1px solid var(--soft-line);
  border-radius: 7px;
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.today-action-card:hover {
  border-color: #8eb9ad;
  box-shadow: 0 5px 14px rgba(31, 71, 61, .08);
  transform: translateY(-1px);
}

.today-action-number {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: #1c7666;
  background: #e5f2ed;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 850;
}

.today-action-copy {
  min-width: 0;
}

.today-action-copy strong,
.today-action-copy small {
  display: block;
}

.today-action-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.today-action-copy small {
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.today-action-arrow {
  color: var(--teal);
  font-size: 18px;
  line-height: 1;
}

.today-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.75fr);
  gap: 14px;
  align-items: start;
}

.today-layout.is-personal-workbench {
  grid-template-columns: minmax(0, 1fr);
}

.today-main-column,
.today-side-column {
  display: grid;
  gap: 14px;
}

.segmented-control {
  display: inline-flex;
  padding: 3px;
  background: #e6ecea;
  border-radius: 7px;
}

.segmented-control button {
  min-height: 28px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 750;
}

.segmented-control button.active {
  color: var(--brand);
  background: #fff;
  box-shadow: 0 1px 4px rgba(20, 40, 34, 0.1);
}

.today-task-list {
  display: grid;
  min-height: 240px;
}

.today-task-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  min-height: 78px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--soft-line);
}

.today-task-item:last-child { border-bottom: 0; }
.today-task-item.done { opacity: 0.58; }
.today-task-item.done strong { text-decoration: line-through; }

.task-priority {
  width: 8px;
  height: 32px;
  background: var(--teal);
  border-radius: 4px;
}

.task-priority.warn { background: var(--yellow); }
.task-priority.danger { background: var(--red); }
.task-priority.info { background: var(--blue); }

.task-copy {
  min-width: 0;
}

.task-copy strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.task-copy span {
  color: var(--muted);
  font-size: 12px;
}

.task-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.task-action-icon,
.icon-action {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-weight: 800;
}

.task-action-icon:hover,
.icon-action:hover { color: var(--brand); border-color: #9db9b1; }
.icon-action.danger:hover { color: var(--red); border-color: #d9aaa6; }

.quick-task-form {
  display: grid;
  grid-template-columns: minmax(240px, 1.5fr) minmax(130px, 0.7fr) 150px 150px auto;
  gap: 10px;
  padding: 14px;
  align-items: end;
}

.snapshot-list,
.focus-list {
  display: grid;
  padding: 4px 14px 10px;
}

.snapshot-row,
.focus-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--soft-line);
}

.snapshot-row:last-child,
.focus-item:last-child { border-bottom: 0; }
.snapshot-row span,
.focus-item span { color: var(--muted); font-size: 12px; }
.snapshot-row strong { white-space: nowrap; font-size: 14px; }
.focus-item { justify-content: flex-start; }
.focus-item::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  margin-top: 6px;
  background: var(--teal);
  border-radius: 50%;
}
.focus-item.warn::before { background: var(--yellow); }
.focus-item.danger::before { background: var(--red); }

.panel-link-btn {
  width: 100%;
  min-height: 40px;
  color: var(--teal);
  background: #f7faf9;
  border-top: 1px solid var(--soft-line);
  font-weight: 750;
}

.student-entry-grid {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(150px, 0.9fr) minmax(140px, 0.8fr) 130px 150px auto;
  gap: 10px;
  padding: 14px;
  align-items: end;
}

.student-filter-row {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) 150px 170px 170px auto;
  gap: 10px;
  padding: 14px;
  align-items: end;
  border-bottom: 1px solid var(--line);
}

.student-workspace {
  display: grid;
  grid-template-columns: minmax(330px, 0.7fr) minmax(560px, 1.3fr);
  min-height: 590px;
}

.student-list {
  min-width: 0;
  max-height: 690px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
}

.student-list-item {
  width: 100%;
  display: grid;
  grid-template-columns: 4px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 92px;
  padding: 13px 15px 13px 0;
  color: var(--ink);
  text-align: left;
  background: #fff;
  border-bottom: 1px solid var(--soft-line);
}

.student-list-item:hover,
.student-list-item.selected { background: #f5f9f8; }
.student-list-item.selected { box-shadow: inset 3px 0 0 var(--teal); }

.student-risk-bar { align-self: stretch; background: var(--green); }
.student-risk-bar.medium { background: var(--yellow); }
.student-risk-bar.high { background: var(--orange); }
.student-risk-bar.urgent { background: var(--red); }

.student-list-copy { min-width: 0; }
.student-list-copy strong { font-size: 14px; }
.student-list-copy p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.student-list-copy small { display: block; margin-top: 6px; color: #7f8b87; }

.risk-chip {
  min-height: 23px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  color: #286a50;
  background: #e5f3ec;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
}

.risk-chip.medium,
.risk-chip.warn { color: #8a650d; background: #fbf1d5; }
.risk-chip.high { color: #9b4d1f; background: #f8e7db; }
.risk-chip.urgent,
.risk-chip.danger { color: #9a3832; background: #f8e2e0; }

.student-detail {
  min-width: 0;
  padding: 18px;
  background: #fbfcfc;
}

.student-empty,
.empty-workbench {
  min-height: 220px;
  display: grid;
  place-items: center;
  padding: 30px;
  color: var(--muted);
  text-align: center;
}

.student-empty[hidden],
#studentDetailContent[hidden] {
  display: none !important;
}

.student-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 15px;
}

.student-detail-head h3 {
  margin: 7px 0 2px;
  font-size: 21px;
}

.student-detail-head p { margin: 0; color: var(--muted); }

.communication-advice {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  padding: 13px 15px;
  color: #234e45;
  background: #eaf4f1;
  border-left: 4px solid var(--teal);
  border-radius: 6px;
}

.communication-advice.urgent { color: #71352f; background: #faeae8; border-left-color: var(--red); }
.communication-advice.high { color: #744326; background: #fbede4; border-left-color: var(--orange); }
.communication-advice.medium { color: #715818; background: #fbf4df; border-left-color: var(--yellow); }
.communication-advice strong { font-size: 13px; }
.communication-advice span { font-size: 12px; }

.student-detail-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 11px;
}

.student-detail-form .full-row { grid-column: 1 / -1; }
.student-detail-form textarea { min-height: 74px; resize: vertical; }

.operations-pulse-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.pulse-content {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  padding: 8px 14px 14px;
}

.pulse-metric {
  padding: 12px;
  border-right: 1px solid var(--soft-line);
}
.pulse-metric:last-child { border-right: 0; }
.pulse-metric span { display: block; color: var(--muted); font-size: 11px; }
.pulse-metric strong { display: block; margin-top: 4px; font-size: 18px; }
.pulse-metric small { color: var(--muted); }

@media (max-width: 1320px) {
  .today-kpi-grid { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
  .today-action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-task-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-task-form .primary-btn { min-height: 40px; }
  .student-entry-grid { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
  .student-entry-grid .primary-btn { min-height: 40px; }
}

@media (max-width: 1080px) {
  .today-layout,
  .student-workspace,
  .operations-pulse-grid { grid-template-columns: 1fr; }
  .student-list { max-height: 430px; border-right: 0; border-bottom: 1px solid var(--line); }
  .student-filter-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .today-hero { min-height: 0; align-items: flex-start; flex-direction: column; padding: 20px; }
  .today-hero h2 { font-size: 21px; }
  .today-health { min-width: 0; }
  .today-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .today-action-grid { grid-template-columns: 1fr; }
  .quick-task-form,
  .student-entry-grid,
  .student-filter-row,
  .student-detail-form { grid-template-columns: 1fr; }
  .student-detail-form .full-row { grid-column: auto; }
  .student-workspace { min-height: 0; }
  .student-detail { padding: 14px; }
  .task-actions .task-jump-label { display: none; }
  .pulse-content { grid-template-columns: 1fr; }
  .pulse-metric { border-right: 0; border-bottom: 1px solid var(--soft-line); }
}

@media (max-width: 440px) {
  .today-kpi-grid { grid-template-columns: 1fr; }
  .today-task-item { grid-template-columns: 8px minmax(0, 1fr); }
  .task-actions { grid-column: 2; justify-content: flex-end; }
}

@media print {
  #todayModule .quick-task-form,
  #studentsModule .entry-panel,
  .student-filter-row,
  .task-actions { display: none !important; }
}
