/* =============================================
   PASIEN PAGE  (.ps-*)
   ============================================= */

.ps-page {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ---------- Title row ---------- */
.ps-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.ps-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}

.ps-subtitle {
  font-size: 0.9rem;
  color: #64748b;
  margin: 4px 0 0;
}

.ps-btn-add {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  border: 1.5px solid #1e293b;
  border-radius: 10px;
  background: #fff;
  color: #1e293b;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ps-btn-add:hover {
  background: #1e293b;
  color: #fff;
}

/* ---------- Stat cards ---------- */
.ps-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.ps-stat-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1.4rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: box-shadow 0.15s ease;
}

.ps-stat-card:hover {
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
}

.ps-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.ps-stat-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.4px;
  margin-bottom: 2px;
}

.ps-stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
}

/* ---------- List card ---------- */
.ps-list-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
}

.ps-list-header {
  padding: 1.5rem 2rem 1.25rem;
}

.ps-list-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 1rem;
}

.ps-filters {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.ps-search {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 420px;
}

.ps-search svg {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}

.ps-search input {
  width: 100%;
  padding: 0.7rem 1rem 0.7rem 2.75rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.9rem;
  color: #1e293b;
  background: #f8fafc;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ps-search input::placeholder {
  color: #94a3b8;
}

.ps-search input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  background: #fff;
}

.ps-select {
  padding: 0.7rem 1rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.9rem;
  color: #1e293b;
  background: #f8fafc;
  cursor: pointer;
  transition: border-color 0.15s;
}

.ps-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ---------- Cards ---------- */
.ps-cards {
  display: flex;
  flex-direction: column;
}

.ps-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: #94a3b8;
}

.ps-empty p {
  margin: 0.75rem 0 0;
  font-size: 0.95rem;
}

.ps-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem 2rem;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.12s;
}

.ps-card:last-child {
  border-bottom: none;
}

.ps-card:hover {
  background: #f8fafc;
}

.ps-card-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  color: #fff;
  font-size: 1.35rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.ps-card-body {
  flex: 1;
  min-width: 0;
}

.ps-card-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #2563eb;
  margin: 0 0 2px;
}

.ps-card-meta {
  font-size: 0.82rem;
  color: #64748b;
  margin: 0 0 2px;
}

.ps-card-diag {
  font-size: 0.9rem;
  color: #334155;
  margin: 0 0 6px;
}

/* Status badges */
.ps-badge {
  display: inline-block;
  padding: 0.22rem 0.7rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.ps-badge--inap {
  background: #dcfce7;
  color: #16a34a;
}

.ps-badge--jalan {
  background: #dbeafe;
  color: #1d4ed8;
}

.ps-badge--pulang {
  background: #f1f5f9;
  color: #475569;
}

/* Action buttons */
.ps-card-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex-shrink: 0;
}

.ps-act {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  transition: transform 0.12s, box-shadow 0.12s;
}

.ps-act:hover {
  transform: scale(1.12);
}

.ps-act--view {
  background: linear-gradient(135deg, #3b82f6, #1e40af);
}

.ps-act--view:hover {
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.35);
}

.ps-act--edit {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.ps-act--edit:hover {
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.35);
}

.ps-act--askep {
  background: linear-gradient(135deg, #10b981, #059669);
}

.ps-act--askep:hover {
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.35);
}

.ps-act--report {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.ps-act--report:hover {
  box-shadow: 0 4px 10px rgba(139, 92, 246, 0.35);
}

.ps-act--delete {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.ps-act--delete:hover {
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.35);
}

/* ---------- Pagination ---------- */
.ps-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2rem;
  border-top: 1px solid #f1f5f9;
  background: #f8fafc;
}

.ps-page-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.ps-page-btn:hover:not(:disabled) {
  border-color: #3b82f6;
  color: #3b82f6;
}

.ps-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ps-page-nums {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.ps-page-num {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
}

.ps-page-num:hover {
  background: #f1f5f9;
}

.ps-page-num.active {
  background: #2563eb;
  color: #fff;
}

.ps-page-dots {
  color: #94a3b8;
  font-size: 0.9rem;
  padding: 0 0.2rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .ps-title-row {
    flex-direction: column;
  }

  .ps-stats {
    grid-template-columns: 1fr;
  }

  .ps-card {
    flex-wrap: wrap;
    padding: 1.25rem 1.25rem;
    gap: 1rem;
  }

  .ps-card-actions {
    flex-direction: row;
    width: 100%;
    justify-content: flex-end;
  }

  .ps-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .ps-search {
    max-width: none;
  }

  .ps-pagination {
    flex-direction: column;
    gap: 0.75rem;
  }

  .ps-page-nums {
    order: -1;
  }
}

@media (max-width: 480px) {
  .ps-list-header {
    padding: 1.25rem 1rem 1rem;
  }

  .ps-card {
    padding: 1rem;
  }

  .ps-card-name {
    font-size: 1rem;
  }

  .ps-pagination {
    padding: 1rem;
  }
}

/* Styles for Intervention List */
.intervention-list {
  padding: 2rem;
  background: #f8fafc;
}

.intervention-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.intervention-card {
  background: white;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  flex: 1 1 calc(50% - 1.5rem);
  max-width: calc(50% - 1.5rem);
}

.intervention-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.intervention-header p {
  font-size: 0.875rem;
  color: #6b7280;
}

.priority {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-right: 0.5rem;
}

.priority.tinggi {
  background: #ef4444;
  color: white;
}

.priority.sedang {
  background: #f59e0b;
  color: white;
}

.frequency {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  background: #e5e7eb;
  color: #374151;
}

.intervention-body p {
  margin-top: 1rem;
  font-size: 0.875rem;
  color: #374151;
}

.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 10px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-implement {
  background: #10b981;
  color: white;
  margin-right: 0.5rem;
}

.btn-detail {
  background: #3b82f6;
  color: white;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Styles for Detail Page */
.detail-container {
  padding: 2rem;
  background: #f8fafc;
}

.detail-card {
  background: white;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  max-width: 600px;
  margin: 0 auto;
}

.detail-card h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.detail-card p {
  font-size: 1rem;
  color: #374151;
  margin-bottom: 0.5rem;
}

/* =============================================
   MODAL OVERLAY & MODAL  (shared across pages)
   ============================================= */
.ps-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  overflow-y: auto;
}

.ps-modal {
  background: #fff;
  border-radius: 16px;
  padding: 28px 32px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  animation: psModalIn 0.25s ease;
}

@keyframes psModalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.ps-modal h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 16px;
}

/* ---------- Form groups ---------- */
.ps-form-group {
  margin-bottom: 14px;
}

.ps-form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 4px;
}

.ps-form-group input,
.ps-form-group select,
.ps-form-group textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.92rem;
  color: #1e293b;
  background: #f9fafb;
  transition: border 0.2s;
  box-sizing: border-box;
}

.ps-form-group input:focus,
.ps-form-group select:focus,
.ps-form-group textarea:focus {
  border-color: #3b82f6;
  outline: none;
  background: #fff;
}

/* ---------- Detail rows ---------- */
.ps-detail-row {
  display: flex;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.92rem;
}

.ps-detail-row strong {
  min-width: 140px;
  color: #64748b;
  font-weight: 600;
}

.ps-detail-row span {
  color: #0f172a;
}

/* ---------- Modal actions ---------- */
.ps-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.ps-btn-cancel {
  padding: 8px 20px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: #64748b;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.ps-btn-cancel:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.ps-btn-save {
  padding: 8px 20px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.ps-btn-save:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.ps-btn-save:disabled,
.ps-btn-cancel:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}