/* App-specific styles for booking pages — matches MedDispatch theme */

/* ── Header ── */
.app-header {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
}

.header-brand svg {
  color: var(--accent);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--fg-secondary);
  text-decoration: none;
  transition: color 0.2s, background 0.2s;
}

.nav-link:hover {
  color: var(--fg-primary);
  background: rgba(255,255,255,0.05);
}

.nav-link-admin {
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.nav-link-admin:hover {
  border-color: rgba(255,255,255,0.1);
}

/* ── Page Layout ── */
.page-wrapper {
  min-height: calc(100vh - 64px);
  padding: 60px 24px 80px;
}

.container {
  max-width: 760px;
  margin: 0 auto;
}

.page-header {
  margin-bottom: 40px;
}

.page-title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.page-subtitle {
  font-size: 1rem;
  color: var(--fg-secondary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── Alert ── */
.alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.alert-error {
  background: rgba(255, 107, 74, 0.1);
  border: 1px solid rgba(255, 107, 74, 0.2);
  color: #ff6b4a;
}

.alert-success {
  background: rgba(0, 212, 170, 0.1);
  border: 1px solid rgba(0, 212, 170, 0.2);
  color: var(--accent);
}

/* ── Form Sections ── */
.form-section {
  margin-bottom: 40px;
}

.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 32px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 20px;
}

.section-num {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(0, 212, 170, 0.1);
  border: 1px solid rgba(0, 212, 170, 0.2);
  border-radius: 6px;
  padding: 3px 10px;
  letter-spacing: 0.05em;
}

/* ── Service Grid ── */
.service-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.service-option {
  display: block;
  cursor: pointer;
}

.service-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.service-option-inner {
  display: flex;
  gap: 14px;
  padding: 20px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 14px;
  transition: border-color 0.2s, background 0.2s;
}

.service-option:hover .service-option-inner {
  border-color: rgba(0, 212, 170, 0.25);
}

.service-option.selected .service-option-inner {
  border-color: var(--accent);
  background: rgba(0, 212, 170, 0.05);
}

.service-option-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  flex-shrink: 0;
}

.service-blood .service-option-icon { background: rgba(255,107,74,0.12); color: var(--accent-warm); }
.service-sports-physical .service-option-icon { background: rgba(59,130,246,0.12); color: var(--accent-blue); }
.service-iv-hydration .service-option-icon { background: rgba(0,212,170,0.12); color: var(--accent); }
.service-drug-testing .service-option-icon { background: rgba(168,85,247,0.12); color: var(--accent-purple); }

.service-option-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.service-option-name {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
}

.service-option-desc {
  font-size: 0.82rem;
  color: var(--fg-secondary);
  line-height: 1.4;
}

/* ── Form Elements ── */
.form-row {
  margin-bottom: 16px;
}

.form-row:last-child {
  margin-bottom: 0;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--fg-secondary);
}

.form-input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 0.95rem;
  font-family: var(--font-body);
  color: var(--fg-primary);
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}

.form-input:focus {
  border-color: var(--accent);
}

.form-input::placeholder {
  color: var(--fg-muted);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  transition: opacity 0.2s, transform 0.15s;
  text-decoration: none;
  line-height: 1;
}

.btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: #0a1628;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--fg-secondary);
  border: 1px solid var(--border);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.82rem;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
  border-radius: 12px;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-icon:hover {
  opacity: 0.8;
}

.btn-danger {
  background: rgba(255, 107, 74, 0.1);
  color: var(--accent-warm);
  cursor: pointer;
}

/* ── Form Actions ── */
.form-actions {
  padding-top: 12px;
}

/* ── Confirmation Card ── */
.confirmation-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 40px;
  text-align: center;
}

.confirmation-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(0, 212, 170, 0.1);
  color: var(--accent);
  margin-bottom: 24px;
}

.confirmation-title {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}

.confirmation-subtitle {
  font-size: 1rem;
  color: var(--fg-secondary);
  margin-bottom: 32px;
}

.confirmation-details {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 20px 24px;
  text-align: left;
  margin-bottom: 32px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

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

.detail-label {
  font-size: 0.85rem;
  color: var(--fg-muted);
  font-weight: 500;
}

.detail-value {
  font-size: 0.9rem;
  color: var(--fg-primary);
  text-align: right;
}

.confirmation-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

/* ── Admin Dashboard ── */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 24px;
  text-align: center;
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
}

.appointments-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.appointments-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.appointments-table th {
  background: var(--bg-secondary);
  padding: 12px 16px;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--fg-muted);
  border-bottom: 1px solid var(--border);
}

.appointments-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--fg-secondary);
  vertical-align: middle;
}

.appointments-table tr:last-child td {
  border-bottom: none;
}

.appointments-table tr:hover td {
  background: rgba(255,255,255,0.02);
}

.appt-datetime {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.appt-date {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--fg-primary);
}

.appt-time {
  font-size: 0.82rem;
  color: var(--fg-muted);
}

.service-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(0,212,170,0.08);
  color: var(--accent);
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.contact-info a {
  color: var(--accent-blue);
  text-decoration: none;
}

.contact-info a:hover {
  text-decoration: underline;
}

.status-select {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 0.82rem;
  font-family: var(--font-body);
  color: var(--fg-secondary);
  cursor: pointer;
  outline: none;
}

.status-select.status-pending { border-color: rgba(255, 200, 0, 0.3); color: #ffc800; }
.status-select.status-confirmed { border-color: rgba(0, 212, 170, 0.3); color: var(--accent); }
.status-select.status-completed { border-color: rgba(59, 130, 246, 0.3); color: var(--accent-blue); }
.status-select.status-cancelled { border-color: rgba(255, 107, 74, 0.3); color: var(--accent-warm); }
.status-select.status-discontinued { border-color: rgba(255, 107, 74, 0.3); color: var(--accent-warm); }

.status-badge.status-signed { background: rgba(0,212,170,0.1); color: var(--accent); }

.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--fg-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

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

/* ── Footer ── */
.app-footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
}

.footer-inner {
  max-width: 600px;
  margin: 0 auto;
}

.footer-brand {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.footer-tagline {
  font-size: 0.82rem;
  color: var(--fg-muted);
}

/* ── Tab Bar ── */
.tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
  overflow-x: auto;
}

.tab-item {
  padding: 10px 18px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--fg-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

.tab-item:hover {
  color: var(--fg-secondary);
}

.tab-item.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-content {
  display: none;
}

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

/* ── EHR Tables ── */
.ehr-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.ehr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.ehr-table th {
  background: var(--bg-secondary);
  padding: 12px 16px;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--fg-muted);
  border-bottom: 1px solid var(--border);
}

.ehr-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--fg-secondary);
  vertical-align: middle;
}

.ehr-table tr:last-child td {
  border-bottom: none;
}

.ehr-table tr:hover td {
  background: rgba(255,255,255,0.02);
}

/* ── Encounter Cards ── */
.encounter-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.encounter-card:hover {
  border-color: rgba(0,212,170,0.25);
}

/* ── Treatment Plan Cards ── */
.treatment-plan-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 14px;
}

/* ── Status Badges ── */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
}

.badge-active {
  background: rgba(0,212,170,0.1);
  color: var(--accent);
}

.badge-completed {
  background: rgba(59,130,246,0.1);
  color: var(--accent-blue);
}

.badge-discontinued {
  background: rgba(255,107,74,0.1);
  color: var(--accent-warm);
}

.badge-processing {
  background: rgba(255,200,0,0.1);
  color: #ffc800;
}

.badge-delivered {
  background: rgba(255,200,0,0.1);
  color: #ffc800;
}

.badge-unsigned {
  background: rgba(255,107,74,0.1);
  color: var(--accent-warm);
}

/* ── Chain of Custody Status Badges ── */
.coc-incomplete {
  background: rgba(255,107,74,0.1);
  color: var(--accent-warm);
}

.coc-complete {
  background: rgba(0,212,170,0.1);
  color: var(--accent);
}

.coc-lab-received {
  background: rgba(59,130,246,0.1);
  color: var(--accent-blue);
}

/* ── Tab Content Panel ── */
.tab-content-panel {
  padding-top: 4px;
}

/* ── Consent Forms ── */
.consent-info-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 32px;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.consent-info-box p {
  margin: 0;
  color: var(--fg-secondary);
}

.consent-text-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 24px;
}

.consent-text-block p {
  margin: 0 0 12px;
  line-height: 1.6;
  color: var(--fg-secondary);
}

.consent-text-block p:last-child {
  margin-bottom: 0;
}

.consent-list {
  margin: 12px 0 0 20px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.consent-list li {
  line-height: 1.5;
  color: var(--fg-secondary);
}

.consent-field-label {
  font-size: 0.88rem;
  color: var(--fg-secondary);
  font-weight: 500;
  margin-bottom: 10px;
  display: block;
}

.consent-field-input {
  display: inline-block;
  width: auto;
  margin-left: 8px;
}

.signature-section {
  margin-top: 16px;
}

.signature-pad-wrapper {
  border: 2px solid var(--border);
  border-radius: 10px;
  background: #fff;
  margin-bottom: 10px;
  overflow: hidden;
}

.signature-pad {
  display: block;
  width: 100%;
  height: 140px;
  cursor: crosshair;
}

.signature-hint {
  font-size: 0.78rem;
  color: var(--fg-muted);
  margin-top: 4px;
  margin-bottom: 0;
}

.guardian-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}

.consent-portal-note {
  font-size: 0.88rem;
  color: var(--fg-muted);
  margin-bottom: 24px;
  text-align: center;
}

/* ── Admin Nav ── */
.admin-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--fg-secondary);
  text-decoration: none;
  border: 1px solid transparent;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
  font-family: var(--font-heading);
}

.admin-nav-link:hover {
  color: var(--fg-primary);
  background: rgba(255,255,255,0.05);
}

.admin-nav-link.active {
  color: var(--accent);
  background: rgba(0,212,170,0.06);
  border-color: rgba(0,212,170,0.2);
}

.admin-nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #0a1628;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 7px;
  min-width: 18px;
  text-align: center;
}

/* ── Staff Messaging ── */
.message-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.message-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: border-color 0.2s;
  text-decoration: none;
  display: block;
}

.message-card:hover {
  border-color: rgba(0,212,170,0.25);
}

.message-card.unread {
  border-left: 3px solid var(--accent);
}

.message-card.deleted {
  opacity: 0.5;
}

.message-subject {
  font-weight: 600;
  color: var(--fg-primary);
  margin-bottom: 4px;
}

.message-meta {
  font-size: 0.8rem;
  color: var(--fg-muted);
  margin-top: 4px;
}

.message-preview {
  font-size: 0.85rem;
  color: var(--fg-secondary);
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thread-message {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 14px;
}

.thread-message-sender {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 6px;
}

.thread-message-time {
  font-size: 0.78rem;
  color: var(--fg-muted);
  float: right;
}

.thread-message-body {
  font-size: 0.9rem;
  color: var(--fg-secondary);
  line-height: 1.6;
}

.reply-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 24px;
  margin-top: 24px;
}

.reply-form textarea {
  width: 100%;
  min-height: 100px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.9rem;
  font-family: var(--font-body);
  color: var(--fg-primary);
  resize: vertical;
  margin-bottom: 12px;
}

.reply-form textarea:focus {
  border-color: var(--accent);
  outline: none;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .service-grid { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .confirmation-card { padding: 32px 24px; }
  .appointments-table { font-size: 0.8rem; }
  .appointments-table th, .appointments-table td { padding: 10px 8px; }
  .appointments-table th:nth-child(3),
  .appointments-table td:nth-child(3),
  .appointments-table th:nth-child(4),
  .appointments-table td:nth-child(4) { display: none; }
  .header-nav .nav-link:not(.nav-link-admin) { display: none; }
  .tab-bar { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .ehr-table-wrap { overflow-x: auto; }
}

/* ── Pricing Page ── */
.service-card-tagline {
  font-size: 0.92rem;
  color: var(--fg-secondary);
  margin: -4px 0 16px;
  line-height: 1.5;
}

.tier-price {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--accent);
  margin-bottom: 16px;
}

.tier-billing {
  font-weight: 400;
  color: var(--fg-secondary);
  font-size: 0.9rem;
}

.tier-features {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--fg-secondary);
  font-size: 0.92rem;
}

.tier-features li {
  padding-left: 18px;
  position: relative;
  line-height: 1.55;
}

.service-blood .tier-features li::before { color: var(--accent-warm); }
.service-physicals .tier-features li::before { color: var(--accent-blue); }
.service-iv .tier-features li::before { color: var(--accent); }
.service-drug .tier-features li::before { color: var(--accent-purple); }

.tier-features li::before {
  content: '•';
  position: absolute;
  left: 0;
  font-weight: 700;
}

/* ── Pricing FAQ ── */
.pricing-faq .section-label { margin-bottom: 24px; }

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  transition: border-color 0.2s;
}

.faq-item[open] { border-color: rgba(0, 212, 170, 0.25); }

.faq-item summary {
  cursor: pointer;
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--fg-primary);
  font-size: 0.98rem;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: '+';
  color: var(--accent);
  font-size: 1.2rem;
  line-height: 1;
  font-weight: 600;
}

.faq-item[open] summary::after { content: '−'; }

.faq-item p {
  margin-top: 10px;
  color: var(--fg-secondary);
  font-size: 0.92rem;
  line-height: 1.6;
}