/* =============================================
   ASKEP AI PLAN  (.ak-*)
   ============================================= */

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

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

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

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

.ak-title-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* buttons */
.ak-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.ak-btn--outline {
  background: #fff;
  color: #1e293b;
  border: 1.5px solid #1e293b;
}

.ak-btn--outline:hover {
  background: #1e293b;
  color: #fff;
}

.ak-btn--primary {
  background: #2563eb;
  color: #fff;
  border: 1.5px solid #2563eb;
}

.ak-btn--primary:hover {
  background: #1d4ed8;
}

/* ---------- AI Banner ---------- */
.ak-banner {
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
  border-radius: 14px;
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  color: #fff;
}

.ak-banner-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.ak-banner-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ak-banner-title {
  margin: 0 0 4px;
  font-size: 1.15rem;
  font-weight: 700;
}

.ak-banner-desc {
  margin: 0;
  font-size: 0.88rem;
  opacity: 0.85;
  line-height: 1.4;
}

.ak-banner-tags {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.ak-tag {
  background: rgba(255, 255, 255, 0.18);
  padding: 0.45rem 0.9rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ---------- Tabs ---------- */
.ak-tabs {
  display: flex;
  gap: 0;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

.ak-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex: 0 0 auto;
  padding: 0.75rem 1.5rem;
  background: none;
  border: none;
  font-size: 0.88rem;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
  border-bottom: 2px solid transparent;
}

.ak-tab:hover:not(:disabled) {
  color: #1e293b;
  background: #f8fafc;
}

.ak-tab.active {
  color: #2563eb;
  font-weight: 600;
  border-bottom-color: #2563eb;
  background: #f0f5ff;
}

.ak-tab:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ---------- Card (shared) ---------- */
.ak-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1.5rem 2rem;
}

.ak-card-heading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 1.25rem;
}

.ak-card-heading svg {
  color: #3b82f6;
  flex-shrink: 0;
}

/* ---------- Assessment form ---------- */
.ak-form-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.ak-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.4rem;
}

.ak-select,
.ak-input,
.ak-textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  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;
  font-family: inherit;
}

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

.ak-textarea {
  resize: vertical;
  min-height: 100px;
}

/* patient preview */
.ak-patient-preview {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: 0.75rem;
  padding: 0.85rem 1rem;
  background: #f0f5ff;
  border: 1px solid #dbeafe;
  border-radius: 10px;
}

.ak-patient-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ak-patient-preview strong {
  display: block;
  font-size: 0.95rem;
  color: #0f172a;
}

.ak-patient-preview span {
  display: block;
  font-size: 0.82rem;
  color: #64748b;
}

/* vital grid */
.ak-vital-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.ak-vital-item {
  /* just a wrapper */
}

/* ---------- Generate section ---------- */
.ak-generate {
  text-align: center;
  padding: 2rem 1.5rem;
  background: #f8fafc;
  border: 2px dashed #cbd5e1;
  border-radius: 14px;
}

.ak-btn-generate {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 2rem;
  background: linear-gradient(135deg, #1e40af, #3b82f6);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.ak-btn-generate:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
}

.ak-btn-generate:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.ak-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ak-spin 0.7s linear infinite;
}

@keyframes ak-spin {
  to { transform: rotate(360deg); }
}

.ak-generate-note {
  margin: 0.85rem 0 0;
  font-size: 0.85rem;
  color: #64748b;
}

/* ==================== PLAN TAB ==================== */
.ak-plan {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* plan header */
.ak-plan-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1.5rem 2rem;
}

.ak-plan-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 4px;
}

.ak-plan-meta {
  font-size: 0.85rem;
  color: #64748b;
  margin: 2px 0;
}

.ak-confidence {
  text-align: center;
  padding: 0.65rem 1rem;
  background: linear-gradient(135deg, #10b981, #34d399);
  border-radius: 10px;
  color: #fff;
  flex-shrink: 0;
}

.ak-confidence-val {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
}

.ak-confidence-lbl {
  display: block;
  font-size: 0.7rem;
  opacity: 0.85;
  letter-spacing: 0.3px;
}

/* ---------- Diagnosis cards ---------- */
.ak-dx-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ak-dx {
  padding: 1.15rem 1.25rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fafbfc;
}

.ak-dx-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.ak-dx-name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  flex: 1;
}

.ak-priority {
  padding: 0.2rem 0.7rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.ak-priority--tinggi {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.ak-priority--sedang {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fed7aa;
}

.ak-priority--rendah {
  background: #f0fdf4;
  color: #059669;
  border: 1px solid #bbf7d0;
}

.ak-dx-detail {
  margin: 0.3rem 0;
  font-size: 0.88rem;
  color: #475569;
  line-height: 1.45;
}

/* ---------- Intervention cards ---------- */
.ak-int-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ak-int {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.25rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fafbfc;
}

.ak-int-body {
  flex: 1;
}

.ak-int-name {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

.ak-int-rationale {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: #475569;
  line-height: 1.4;
}

.ak-freq {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  background: #dbeafe;
  color: #1d4ed8;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.ak-btn-sm {
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1.5px solid #d1d5db;
  background: #fff;
  color: #374151;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.ak-btn-sm:hover {
  border-color: #3b82f6;
  color: #3b82f6;
}

/* ---------- Outcome cards ---------- */
.ak-out-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ak-out {
  padding: 1.15rem 1.25rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fafbfc;
}

.ak-out-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.ak-out-name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  flex: 1;
}

.ak-timeframe {
  padding: 0.2rem 0.7rem;
  background: #f0f9ff;
  color: #0369a1;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.ak-out-lbl {
  margin: 0 0 0.3rem;
  font-size: 0.88rem;
  color: #374151;
}

.ak-out-indicators {
  margin: 0;
  padding-left: 1.2rem;
}

.ak-out-indicators li {
  font-size: 0.85rem;
  color: #475569;
  line-height: 1.5;
  margin: 0.15rem 0;
}

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

  .ak-banner {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
    padding: 1.25rem;
  }

  .ak-banner-left {
    flex-direction: column;
    align-items: center;
  }

  .ak-banner-tags {
    justify-content: center;
    flex-wrap: wrap;
  }

  .ak-tabs {
    flex-direction: column;
  }

  .ak-tab {
    justify-content: center;
    border-bottom: none;
    border-left: 2px solid transparent;
  }

  .ak-tab.active {
    border-bottom: none;
    border-left-color: #2563eb;
  }

  .ak-vital-grid {
    grid-template-columns: 1fr;
  }

  .ak-plan-header {
    flex-direction: column;
    gap: 1rem;
  }

  .ak-dx-top,
  .ak-out-top {
    flex-direction: column;
    gap: 0.4rem;
  }

  .ak-int {
    flex-direction: column;
  }

  .ak-card {
    padding: 1.25rem;
  }
}

@media (max-width: 480px) {
  .ak-card {
    padding: 1rem;
  }

  .ak-btn-generate {
    width: 100%;
    justify-content: center;
  }

  .ak-generate {
    padding: 1.25rem 1rem;
  }
}