/* Forms, pop-up forms, tabs, profile header, alerts, risk pills, calendar */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--slate);
}

.form-group input,
.form-group select,
.form-group textarea {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.84rem;
  font-family: 'DM Sans', sans-serif;
  color: var(--navy);
  background: #fff;
  transition: border 0.15s;
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--teal-light);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.12);
}

.form-group textarea {
  min-height: 80px;
  resize: vertical;
}

.form-span-2 {
  grid-column: span 2;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
}

.modal {
  background: var(--card);
  border-radius: 16px;
  width: 100%;
  max-width: 820px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
}

.modal-header {
  padding: 20px 28px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  font-size: 1.15rem;
}

.modal-body {
  padding: 24px 28px;
}

.modal-footer {
  padding: 16px 28px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.close-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f1f5f9;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.close-btn:hover {
  background: #e2e8f0;
}

.tab-bar {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid var(--border);
  overflow-x: auto;
  margin-bottom: 24px;
  scrollbar-width: none;
}

.tab-bar::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  padding: 10px 16px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.15s;
}

.tab-btn:hover {
  color: var(--teal);
}

.tab-btn.active {
  color: var(--teal);
  border-bottom-color: var(--teal);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.search-bar {
  position: relative;
  display: flex;
  align-items: center;
}

.search-bar input {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px 8px 36px;
  font-size: 0.84rem;
  width: 260px;
  outline: none;
  font-family: 'DM Sans', sans-serif;
}

.search-bar input:focus {
  border-color: var(--teal-light);
}

.search-bar .icon {
  position: absolute;
  left: 11px;
  color: var(--muted);
  font-size: 0.9rem;
}

.section-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 16px;
}

.section-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-card-header h3 {
  font-size: 0.95rem;
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
}

.profile-header {
  background: linear-gradient(135deg, var(--navy) 0%, #1e3a5f 100%);
  border-radius: 12px;
  padding: 24px 28px;
  margin-bottom: 24px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 20px;
}

.profile-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.profile-name {
  font-size: 1.4rem;
  color: #fff;
}

.profile-meta {
  display: flex;
  gap: 16px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.profile-meta span {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  gap: 5px;
}

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
}

.empty-state .icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.empty-state h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--slate);
  font-family: 'DM Sans', sans-serif;
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 0.82rem;
}

.alert {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  animation: slideIn 0.25s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-success {
  background: #052e16;
  color: #bbf7d0;
}

.alert-error {
  background: #450a0a;
  color: #fecaca;
}

@keyframes slideIn {
  from {
    transform: translateX(120%);
  }

  to {
    transform: translateX(0);
  }
}

.risk-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
}

.risk-low {
  background: #dcfce7;
  color: #15803d;
}

.risk-medium {
  background: #fef9c3;
  color: #a16207;
}

.risk-high {
  background: #fee2e2;
  color: #b91c1c;
}

.risk-critical {
  background: #4c0519;
  color: #fda4af;
}

.detail-row {
  display: flex;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.83rem;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  min-width: 180px;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.78rem;
}

.detail-value {
  color: var(--navy);
  flex: 1;
}

::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

.page {
  display: none;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.cal-header {
  background: #f8fafc;
  padding: 10px;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--slate);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.cal-day {
  background: #fff;
  min-height: 100px;
  padding: 8px;
}
.cal-day.other-month {
  background: #f8fafc;
  color: var(--muted);
}
.cal-date {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--slate);
}
.cal-event {
  font-size: 0.7rem;
  padding: 4px;
  border-radius: 4px;
  margin-bottom: 4px;
  display: block;
  cursor: pointer;
  text-decoration: none;
  word-break: break-word;
  line-height: 1.2;
  transition: opacity 0.2s;
}
.cal-event:hover { opacity: 0.8; }
.cal-event-health { background: #fee2e2; color: #b91c1c; }
.cal-event-education { background: #dbeafe; color: #1d4ed8; }
.cal-event-identity { background: #fef9c3; color: #a16207; }
.cal-event-protection { background: #fce7f3; color: #be185d; }
.cal-event-family { background: #e0e7ff; color: #4338ca; }
.cal-event-participation { background: #dcfce7; color: #15803d; }
.cal-event-referrals { background: #f3e8ff; color: #7e22ce; }
.cal-event-caseplan { background: #fce7f3; color: #be185d; }
.cal-event-event { background: #ffedd5; color: #c2410c; }
.cal-event-program { background: #ccfbf1; color: #0f766e; }
.cal-event-inclusion { background: #fef3c7; color: #b45309; }
.cal-agenda { display: none; }

.page.active {
  display: block;
}

#mobile-bar,
#nav-backdrop {
  display: none;
}
