/* ============================================================
   assets/css/teachers.css
   Teacher & Staff module styles
   ============================================================ */

/* ── Staff List ───────────────────────────────────────────── */
.staff-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 16px;
}
.staff-filters .form-group { margin-bottom: 0; flex: 1; min-width: 140px; }

.staff-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gray-200);
  flex-shrink: 0;
}
.staff-avatar-initials {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
  flex-shrink: 0;
}
.staff-avatar-wrap { display: flex; align-items: center; gap: 10px; }
.staff-name { font-weight: 600; font-size: 13.5px; color: var(--gray-900); }
.staff-id   { font-size: 11px; color: var(--gray-400); }

/* Type badge */
.type-teacher { background: #dbeafe; color: #1d4ed8; }
.type-staff   { background: #ede9fe; color: #7c3aed; }

/* Live indicator */
.live-indicator {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 500;
}
.live-indicator .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success);
  animation: pulse 2s infinite;
  flex-shrink: 0;
}
.live-indicator.offline .dot { background: var(--gray-300); animation: none; }

/* ── Profile Page ─────────────────────────────────────────── */
.teacher-profile-header {
  display: flex; align-items: flex-start; gap: 24px;
  padding: 24px;
  background: linear-gradient(135deg, #0f2d1a 0%, #1a6b3a 100%);
  border-radius: var(--radius) var(--radius) 0 0;
  color: #fff;
}
.teacher-photo {
  width: 100px; height: 100px;
  border-radius: 16px; object-fit: cover;
  border: 3px solid rgba(255,255,255,.4);
  flex-shrink: 0;
}
.teacher-photo-initials {
  width: 100px; height: 100px;
  border-radius: 16px;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 38px; font-weight: 700;
  border: 3px solid rgba(255,255,255,.4);
  flex-shrink: 0;
}
.teacher-profile-info { flex: 1; }
.teacher-name {
  font-family: var(--font-heading);
  font-size: 22px; font-weight: 700; line-height: 1.2; margin-bottom: 4px;
}
.teacher-designation { font-size: 14px; opacity: .8; margin-bottom: 8px; }
.teacher-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.teacher-meta-item {
  background: rgba(255,255,255,.18);
  border-radius: 6px; padding: 4px 10px;
  font-size: 12px; font-weight: 500;
}

/* Profile tabs */
.teacher-tabs {
  display: flex; border-bottom: 2px solid var(--gray-200);
  background: #fff; overflow-x: auto;
}
.teacher-tab {
  padding: 12px 20px;
  font-size: 13.5px; font-weight: 500;
  color: var(--gray-500); cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px; white-space: nowrap;
  transition: var(--transition);
  display: flex; align-items: center; gap: 6px;
}
.teacher-tab:hover { color: var(--primary); }
.teacher-tab.active {
  color: var(--primary); border-bottom-color: var(--primary); font-weight: 600;
}
.teacher-tab-content { display: none; }
.teacher-tab-content.active { display: block; }

/* ── KPI Score Display ────────────────────────────────────── */
.kpi-score-circle {
  width: 80px; height: 80px;
  border-radius: 50%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-family: var(--font-heading);
  border: 4px solid;
  flex-shrink: 0;
}
.kpi-score-circle.excellent { border-color: var(--success); color: var(--success); background: #dcfce7; }
.kpi-score-circle.good      { border-color: #3b82f6;        color: #3b82f6;        background: #dbeafe; }
.kpi-score-circle.average   { border-color: var(--warning); color: var(--warning); background: #fef3c7; }
.kpi-score-circle.poor      { border-color: var(--danger);  color: var(--danger);  background: #fee2e2; }
.kpi-score-num  { font-size: 22px; font-weight: 700; line-height: 1; }
.kpi-score-max  { font-size: 10px; color: var(--gray-400); }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.kpi-card {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex; align-items: center; gap: 12px;
  transition: var(--transition);
}
.kpi-card:hover { border-color: var(--primary); background: var(--primary-10); }
.kpi-info { flex: 1; }
.kpi-month { font-size: 12px; color: var(--gray-500); }
.kpi-notes { font-size: 11px; color: var(--gray-400); margin-top: 3px;
             overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Salary Table ─────────────────────────────────────────── */
.salary-paid   { color: var(--success); font-weight: 600; }
.salary-unpaid { color: var(--danger);  font-weight: 600; }

/* ── Attendance Timeline ──────────────────────────────────── */
.att-timeline {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 340px; overflow-y: auto; padding-right: 4px;
}
.att-timeline-item {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--gray-50);
  border-left: 3px solid;
  font-size: 13px;
}
.att-timeline-item.present { border-color: var(--success); }
.att-timeline-item.absent  { border-color: var(--danger);  background: #fef2f2; }
.att-timeline-item.leave   { border-color: var(--warning); background: #fffbeb; }
.att-timeline-date { font-weight: 500; color: var(--gray-700); min-width: 90px; }
.att-timeline-time { color: var(--gray-500); font-size: 12px; flex: 1; }
.att-timeline-hours {
  font-weight: 600; color: var(--primary);
  font-size: 12px; white-space: nowrap;
}

/* ── Live Monitor ─────────────────────────────────────────── */
.live-monitor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.live-monitor-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
  display: flex; align-items: center; gap: 12px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.live-monitor-card::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px; background: var(--success);
}
.live-monitor-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.live-monitor-avatar {
  width: 46px; height: 46px; border-radius: 50%;
  object-fit: cover; border: 2px solid #dcfce7;
}
.live-monitor-avatar-init {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--primary-10); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700;
}
.live-monitor-name { font-size: 13.5px; font-weight: 600; color: var(--gray-900); }
.live-monitor-desig { font-size: 11.5px; color: var(--gray-500); }
.live-monitor-time  { font-size: 11px; color: var(--success); font-weight: 500; margin-top: 2px; }
.live-monitor-badge {
  position: absolute; top: 10px; right: 10px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(22,163,74,.2);
  animation: pulse 2s infinite;
}

/* Absent card */
.live-monitor-card.absent::before { background: var(--gray-300); }
.live-monitor-card.absent .live-monitor-badge {
  background: var(--gray-300);
  box-shadow: none; animation: none;
}

/* ── Check-in Page ────────────────────────────────────────── */
.checkin-card {
  max-width: 480px;
  margin: 0 auto;
}
.checkin-clock {
  font-family: var(--font-heading);
  font-size: 48px; font-weight: 700;
  color: var(--primary);
  text-align: center;
  letter-spacing: 2px;
  margin: 8px 0;
}
.checkin-date {
  text-align: center; color: var(--gray-500);
  font-size: 14px; margin-bottom: 24px;
}
.checkin-status-box {
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 12px;
}
.checkin-status-box.in   { background: #dcfce7; border: 1px solid #86efac; }
.checkin-status-box.out  { background: #fee2e2; border: 1px solid #fca5a5; }
.checkin-status-box.none { background: var(--gray-100); border: 1px solid var(--gray-200); }
.checkin-status-icon { font-size: 28px; }
.checkin-status-text { flex: 1; }
.checkin-status-label { font-weight: 600; font-size: 15px; }
.checkin-status-time  { font-size: 13px; color: var(--gray-500); }

.btn-checkin {
  width: 100%;
  padding: 14px;
  font-size: 16px; font-weight: 600;
  font-family: var(--font-heading);
  border-radius: var(--radius);
  border: none; cursor: pointer;
  transition: var(--transition);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-checkin.in  { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(26,107,58,.35); }
.btn-checkin.in:hover { background: var(--primary-dark); }
.btn-checkin.out { background: var(--danger); color: #fff; box-shadow: 0 4px 12px rgba(220,38,38,.25); }
.btn-checkin.out:hover { background: #b91c1c; }
.btn-checkin:disabled { opacity: .6; cursor: not-allowed; transform: none !important; }

/* IP warning */
.ip-warning {
  background: #fef3c7; border: 1px solid #fcd34d;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px; color: #92400e;
  display: flex; gap: 8px; align-items: flex-start;
  margin-bottom: 16px;
}

/* ── Form Styles ──────────────────────────────────────────── */
.salary-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px 20px;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .teacher-profile-header { flex-direction: column; align-items: center; text-align: center; }
  .live-monitor-grid { grid-template-columns: 1fr 1fr; }
  .salary-form-grid  { grid-template-columns: 1fr 1fr; }
  .kpi-grid          { grid-template-columns: 1fr 1fr; }
  .checkin-clock     { font-size: 36px; }
}

@media (max-width: 480px) {
  .live-monitor-grid { grid-template-columns: 1fr; }
  .salary-form-grid  { grid-template-columns: 1fr; }
  .kpi-grid          { grid-template-columns: 1fr; }
}

/* Print */
@media print {
  .teacher-tabs, .staff-filters, .btn,
  .topbar, .sidebar, .checkin-card { display: none !important; }
  .teacher-tab-content { display: block !important; }
  .teacher-profile-header {
    background: none !important; color: var(--gray-900) !important;
    border: 1px solid var(--gray-200);
  }
}
