/* ═══════════════════════════════════════════════════════════════
   AURA DENTAL TELEGRAM MINI APP — LUXURY GLASS THEME
   ═══════════════════════════════════════════════════════════════ */

body.tma-body {
  background: #090e17;
  color: #f8fafc;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', Roboto, sans-serif;
  padding: 0;
  margin: 0;
  overflow-x: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
}

.tma-container {
  max-width: 480px;
  margin: 0 auto;
  padding: 12px 14px 40px;
}

/* ROLE SWITCHER BAR */
.tma-role-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 14, 23, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.tma-role-pill {
  display: flex;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 3px;
  gap: 3px;
}
.tma-role-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.tma-role-btn.active {
  background: #0284c7;
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.4);
}

/* VIEWS */
.tma-view {
  display: none;
  flex-direction: column;
  gap: 12px;
  animation: fadeInTma 0.2s ease-out;
}
.tma-view.active {
  display: flex;
}
@keyframes fadeInTma {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* CARDS */
.tma-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.card-head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.card-sec-tag {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #38bdf8;
}
.card-title-sm {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}

/* PATIENT HERO */
.patient-hero-card {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.2) 0%, rgba(15, 23, 42, 0.6) 100%);
  border-color: rgba(56, 189, 248, 0.3);
}
.patient-profile-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.patient-avatar-box {
  position: relative;
  width: 54px;
  height: 54px;
}
.patient-avatar-box img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #38bdf8;
}
.patient-verified-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 16px;
  height: 16px;
  background: #10b981;
  color: #ffffff;
  border-radius: 50%;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  border: 1.5px solid #090e17;
}
.tma-sub-tag {
  font-size: 10.5px;
  color: #94a3b8;
  font-weight: 700;
}
.tma-patient-name {
  font-size: 19px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.02em;
  margin: 1px 0;
}
.tma-status-chip {
  font-size: 11px;
  font-weight: 700;
  color: #38bdf8;
}

.patient-quick-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 12px;
  padding: 10px 12px;
}
.metric-mini-box {
  display: flex;
  flex-direction: column;
}
.m-label { font-size: 10.5px; color: #94a3b8; font-weight: 600; }
.m-val { font-size: 14px; font-weight: 900; margin-top: 2px; }

/* TIMELINE */
.tma-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.timeline-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
}
.timeline-step:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 13px;
  top: 26px;
  bottom: -10px;
  width: 2px;
  background: rgba(255, 255, 255, 0.1);
}
.timeline-step.done::before {
  background: #10b981;
}
.t-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  flex-shrink: 0;
}
.timeline-step.done .t-circle {
  background: #10b981;
  color: #ffffff;
}
.timeline-step.active .t-circle {
  background: #0284c7;
  color: #ffffff;
  box-shadow: 0 0 14px rgba(2, 132, 199, 0.8);
}
.t-content {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.t-content strong {
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
}
.t-content span {
  font-size: 11.5px;
  color: #94a3b8;
}

/* DENTAL JAW 32 TEETH MAP */
.dental-jaw-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 12px 8px;
  margin-bottom: 10px;
}
.jaw-title {
  font-size: 10.5px;
  font-weight: 700;
  color: #94a3b8;
  text-align: center;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.teeth-row {
  display: flex;
  justify-content: center;
  gap: 3px;
  overflow-x: auto;
  padding: 2px 0;
}
.t-btn {
  width: 22px;
  height: 30px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 5px;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.t-btn:hover, .t-btn.selected {
  transform: scale(1.15);
  z-index: 2;
}
.t-btn.veneer { background: #38bdf8; border-color: #38bdf8; color: #090e17; }
.t-btn.implant { background: #818cf8; border-color: #818cf8; color: #ffffff; }
.t-btn.healthy { background: rgba(16, 185, 129, 0.3); border-color: #10b981; color: #10b981; }
.t-btn.treat { background: rgba(245, 158, 11, 0.3); border-color: #f59e0b; color: #f59e0b; }

.jaw-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 10px 0;
}
.teeth-legend {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: #94a3b8;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 6px;
}
.dot-legend {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  vertical-align: middle;
  margin-right: 3px;
}
.dot-veneer { background: #38bdf8; }
.dot-implant { background: #818cf8; }
.dot-healthy { background: #10b981; }
.dot-treat { background: #f59e0b; }

.tooth-detail-card {
  background: rgba(2, 132, 199, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 12px;
  padding: 10px 12px;
  animation: fadeInTma 0.2s ease-out;
}
.badge-veneer {
  background: #38bdf8;
  color: #090e17;
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
}

/* BOOKING SLOTS & CHIPS */
.service-tma-chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 12px;
}
.s-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #e2e8f0;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}
.s-chip.active {
  background: rgba(2, 132, 199, 0.25);
  border-color: #38bdf8;
  color: #ffffff;
}

.slot-select-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}
.slot-box {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
}
.slot-box.active {
  background: #0284c7;
  border-color: #38bdf8;
}
.slot-day { font-size: 10px; color: #94a3b8; display: block; }
.slot-box.active .slot-day { color: #e0f2fe; }
.slot-time { font-size: 15px; font-weight: 900; color: #ffffff; display: block; margin: 1px 0; }
.slot-doc { font-size: 9.5px; color: #94a3b8; display: block; }
.slot-box.active .slot-doc { color: #e0f2fe; }

.btn-tma-main {
  width: 100%;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border: none;
  font-size: 14px;
  font-weight: 800;
  padding: 13px 16px;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.4);
  transition: transform 0.15s ease;
}
.btn-tma-main:active { transform: scale(0.98); }

/* ROLE 2 DOCTOR STYLES */
.doc-kpi-card {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border-color: rgba(255, 255, 255, 0.15);
}
.doc-online-pill {
  font-size: 10.5px;
  font-weight: 800;
  color: #10b981;
  background: rgba(16, 185, 129, 0.15);
  padding: 3px 8px;
  border-radius: 999px;
}
.doc-kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}
.kpi-box {
  background: rgba(0, 0, 0, 0.25);
  padding: 10px 12px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
}
.kpi-box span { font-size: 10.5px; color: #94a3b8; }
.kpi-box strong { font-size: 17px; font-weight: 900; color: #ffffff; margin-top: 2px; }

.kanban-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.kanban-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px;
}
.kanban-item.urgent { border-left: 3px solid #38bdf8; }
.kanban-item.new-lead { border-left: 3px solid #10b981; }

.k-item-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}
.k-patient-name { font-size: 14.5px; font-weight: 800; color: #ffffff; display: block; }
.k-phone { font-size: 11px; color: #94a3b8; }
.k-treatment-desc { font-size: 12px; color: #cbd5e1; margin-bottom: 10px; line-height: 1.4; }

.badge-status {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
}
.badge-status.in-chair { background: rgba(56, 189, 248, 0.2); color: #38bdf8; }
.badge-status.confirmed { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.badge-status.new { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }

.k-actions-row {
  display: flex;
  gap: 6px;
}
.btn-k-action {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}
.btn-k-action.primary {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

.tma-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px 12px;
  color: #ffffff;
  font-size: 12.5px;
  outline: none;
}

/* ROLE 3 ADMIN SALES PITCH */
.admin-pitch-card {
  background: linear-gradient(135deg, #1e1b4b 0%, #0f172a 100%);
  border-color: rgba(99, 102, 241, 0.3);
}
.roi-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.roi-box {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
}
.r-num { font-size: 20px; font-weight: 900; margin-bottom: 2px; }
.r-label { font-size: 10.5px; color: #94a3b8; line-height: 1.35; }

.sys-health-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sys-item {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  background: rgba(0,0,0,0.2);
  padding: 8px 10px;
  border-radius: 8px;
}

.text-brand { color: #38bdf8 !important; }
.text-green { color: #10b981 !important; }
.text-blue { color: #60a5fa !important; }
.live-pulse-badge {
  font-size: 10.5px;
  font-weight: 800;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
  padding: 2px 7px;
  border-radius: 6px;
}

.tma-shade-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tma-shade-btn.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #38bdf8;
}
