/* ============================================================
   SOKA CARE - DASHBOARD CSS
   ============================================================ */

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}

.stat-card:hover {
  border-color: var(--accent-border);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.stat-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.stat-card .label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.stat-card .number {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -0.5px;
}

.stat-card .icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-light);
  border: 1px solid var(--accent-border);
  flex-shrink: 0;
}

.stat-card .icon-box svg {
  width: 22px;
  height: 22px;
  color: var(--accent);
}

.stat-card.danger .icon-box {
  background: var(--danger-bg);
  border-color: var(--danger-border);
}

.stat-card.danger .icon-box svg { color: var(--danger); }

/* ============================================================
   VIEW TOGGLE
   ============================================================ */
.view-toggle {
  display: inline-flex;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: 16px;
}

.view-toggle button {
  padding: 7px 16px;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.view-toggle button:hover { color: var(--text-primary); }

.view-toggle button.active {
  background: var(--bg-body);
  color: var(--accent-text);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}

/* ============================================================
   ALERT POIN
   ============================================================ */
.alert-poin {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  border-left: 4px solid var(--danger);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 16px;
}

.alert-poin .title {
  font-weight: 600;
  color: var(--danger);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.alert-poin .title svg { width: 16px; height: 16px; }

.alert-poin .item {
  font-size: 13px;
  color: var(--text-primary);
  padding: 3px 0;
}

.alert-poin .item strong { color: var(--danger); }

/* ============================================================
   BATCH SUMMARY
   ============================================================ */
.batch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.batch-card {
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  cursor: pointer;
  transition: all var(--transition);
}

.batch-card:hover {
  border-color: var(--accent-border);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.batch-card .batch-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.batch-card .batch-title svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

.batch-card .batch-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.batch-card .batch-stats strong {
  color: var(--text-primary);
  font-weight: 700;
}

.progress-bar {
  height: 6px;
  background: var(--bg-active);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.filter-bar select,
.filter-bar input {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--bg-body);
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition);
  font-family: inherit;
  width: auto;
  min-width: 0;
}

.filter-bar select:focus,
.filter-bar input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.filter-bar .search-input {
  flex: 1;
  min-width: 180px;
}

.filter-bar .date-range-group {
  display: none;
  gap: 8px;
  align-items: center;
}

.filter-bar .date-range-group.show { display: flex; }

.filter-bar .date-range-group span {
  color: var(--text-muted);
  font-size: 12px;
}

.filter-bar .btn-refresh {
  margin-left: auto;
}

/* ============================================================
   REPORT CARD GRID
   ============================================================ */
.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.report-card {
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
}

.report-card:hover {
  border-color: var(--accent-border);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.report-card .img-wrap {
  height: 160px;
  background: var(--bg-subtle);
  position: relative;
  overflow: hidden;
}

.report-card .img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.report-card:hover .img-wrap img { transform: scale(1.05); }

.report-card .img-wrap .no-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--border-strong);
}

.report-card .img-wrap .no-photo svg { width: 40px; height: 40px; }

.report-card .photo-badge {
  position: absolute;
  bottom: 10px; right: 10px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  background: rgba(0,0,0,0.7);
  color: white;
  display: flex;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(4px);
}

.report-card .photo-badge svg { width: 12px; height: 12px; }

.report-card .body {
  padding: 14px 16px;
}

.report-card .body .name {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 14px;
  margin-bottom: 4px;
}

.report-card .body .meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.report-card .body .notes {
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 8px;
}

.report-card .body .treatment-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.report-card .body .treatment-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  padding: 4px 8px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
}

.report-card .body .treatment-item .name { color: var(--text-primary); }

.report-card .footer {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
}

/* ============================================================
   TRAINEE CARD GRID
   ============================================================ */
.trainee-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.trainee-card {
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all var(--transition);
}

.trainee-card:hover {
  border-color: var(--accent-border);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.trainee-card .name {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 15px;
  margin-bottom: 4px;
}

.trainee-card .meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.trainee-card .badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.trainee-card .stats-row {
  display: flex;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-secondary);
}

.trainee-card .stats-row strong {
  color: var(--text-primary);
  font-weight: 700;
}

/* ============================================================
   PHOTO VIEWER MODAL
   ============================================================ */
.photo-viewer {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.95);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.photo-viewer.show { display: flex; }

.photo-viewer img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
}

.photo-viewer .close-btn {
  position: absolute;
  top: 20px; right: 20px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.photo-viewer .close-btn:hover { background: rgba(255,255,255,0.2); }
.photo-viewer .close-btn svg { width: 20px; height: 20px; color: white; }

.photo-viewer .nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.photo-viewer .nav-btn:hover { background: rgba(255,255,255,0.2); }
.photo-viewer .nav-btn svg { width: 24px; height: 24px; color: white; }
.photo-viewer .nav-btn.prev { left: 20px; }
.photo-viewer .nav-btn.next { right: 20px; }

.photo-viewer .counter {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 14px;
  background: rgba(0,0,0,0.6);
  padding: 6px 16px;
  border-radius: var(--radius-full);
}

/* ============================================================
   TIMELINE (Rapor)
   ============================================================ */
.timeline-item {
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 10px;
  transition: all var(--transition);
}

.timeline-item:hover { border-color: var(--accent-border); }

.timeline-item .row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.timeline-item .thumb {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-subtle);
  flex-shrink: 0;
  cursor: pointer;
  border: 1px solid var(--border);
}

.timeline-item .thumb img { width: 100%; height: 100%; object-fit: cover; }

.timeline-item .thumb .no-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--border-strong);
}

.timeline-item .thumb .no-photo svg { width: 24px; height: 24px; }

.timeline-item .detail { flex: 1; min-width: 0; }

.timeline-item .top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.timeline-item .date { font-size: 11px; color: var(--text-muted); font-weight: 600; }

.timeline-item .title {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
  margin-bottom: 4px;
}

.timeline-item .desc {
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  margin-top: 6px;
}

.timeline-item .photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.timeline-item .photo-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid var(--border);
  transition: transform var(--transition);
}

.timeline-item .photo-grid img:hover { transform: scale(1.05); }

/* ============================================================
   RAPOR MODAL STATS
   ============================================================ */
.rapor-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.rapor-stat {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}

.rapor-stat .val { font-size: 22px; font-weight: 700; color: var(--text-primary); }
.rapor-stat .lbl { font-size: 10px; color: var(--text-secondary); text-transform: uppercase; font-weight: 600; margin-top: 4px; letter-spacing: 0.4px; }

/* ============================================================
   LOAD MORE
   ============================================================ */
.load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .report-grid, .trainee-grid { grid-template-columns: 1fr; }
  .filter-bar { padding: 10px; }
  .filter-bar .search-input { min-width: 100%; }
  .filter-bar .btn-refresh { margin-left: 0; width: 100%; }
  .rapor-stats { grid-template-columns: repeat(3, 1fr); }
  .rapor-stat { padding: 8px; }
  .rapor-stat .val { font-size: 18px; }
  .rapor-stat .lbl { font-size: 9px; }
}