/* =========================================================
   AUTH, DASHBOARD & CLINICAL RECORDS
   Aesthetic: Dark Charcoal Glass & Pure White Pill UI (Matching Hero & Site Theme)
   ========================================================= */

/* --- Header Layout & Perfect Horizontal Alignment --- */
.site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  padding: clamp(16px, 2.4vh, 26px) clamp(16px, 3.2vw, 36px) 0;
  display: flex;
  justify-content: center;
  z-index: 100;
  pointer-events: none;
}

.site-header.dashboard-header-bar {
  position: sticky;
  top: 0;
  background: rgba(10, 10, 12, 0.9);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 14px clamp(16px, 3.2vw, 36px);
  pointer-events: auto;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 980px !important;
  gap: clamp(10px, 1.6vw, 18px) !important;
  pointer-events: auto;
}

.logo-btn {
  width: 48px !important;
  height: 48px !important;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(20, 20, 24, 0.9) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5) !important;
  display: grid;
  place-items: center;
  transition: all 0.2s ease;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
}

.logo-btn:hover {
  transform: scale(1.05);
  border-color: rgba(255, 255, 255, 0.35) !important;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.7) !important;
}

.logo-btn img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

/* Nav Pill adjustments for logged-in and landing states - Black Glass Theme */
.nav-pill {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 1 auto !important;
  max-width: fit-content !important;
  min-width: 0 !important;
  height: 48px !important;
  padding: 4px 8px !important;
  border-radius: 999px !important;
  background: rgba(18, 18, 22, 0.88) !important;
  backdrop-filter: blur(18px) !important;
  -webkit-backdrop-filter: blur(18px) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
  list-style: none !important;
  margin: 0 !important;
  gap: 2px !important;
}

.nav-pill li {
  display: flex;
  align-items: center;
  height: 100%;
}

.nav-link {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 100% !important;
  padding: 0 clamp(12px, 1.4vw, 18px) !important;
  font-family: var(--font-sans) !important;
  font-weight: 500 !important;
  font-size: 13.5px !important;
  letter-spacing: -0.01em !important;
  color: rgba(255, 255, 255, 0.65) !important;
  opacity: 0.85 !important;
  white-space: nowrap !important;
  border-radius: 999px !important;
  transition: all 0.2s ease !important;
  cursor: pointer !important;
  background: transparent !important;
  border: none !important;
}

.nav-link:hover {
  opacity: 1 !important;
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

.nav-link.active {
  opacity: 1 !important;
  font-weight: 600 !important;
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.14) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
}

/* Navigation User Profile Badge & Logout */
.nav-auth-group {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-shrink: 0 !important;
}

.nav-user-chip {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  height: 48px !important;
  padding: 0 16px !important;
  background: var(--pill-dark, #28282a) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 999px !important;
  font-family: var(--font-sans) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #ffffff !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2) !important;
}

.nav-user-chip i {
  color: #ffffff !important;
  font-size: 13px !important;
}

.nav-user-name {
  color: #ffffff !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
}

.nav-user-role-badge {
  font-size: 10px !important;
  font-weight: 600 !important;
  letter-spacing: 0.4px !important;
  text-transform: uppercase !important;
  padding: 2px 7px !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
  margin-left: 2px !important;
  white-space: nowrap !important;
}

.nav-logout-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  height: 48px !important;
  padding: 0 16px !important;
  background: var(--pill-dark, #28282a) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 999px !important;
  color: #d4d4d8 !important;
  font-family: var(--font-sans) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2) !important;
}

.nav-logout-btn:hover {
  background: #323234 !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  transform: translateY(-1px) !important;
}

.sign-in-btn {
  height: 48px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  padding: 0 22px !important;
  border-radius: 999px !important;
  border: none !important;
  background: var(--pill-dark, #28282a) !important;
  color: var(--sign-in-text, #c8c8c8) !important;
  font-family: var(--font-sans) !important;
  font-weight: 500 !important;
  font-size: 13.5px !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2) !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.sign-in-btn:hover {
  background: #323234 !important;
  color: #ffffff !important;
  transform: translateY(-1px) !important;
}

/* =========================================================
   AUTH VIEW (LOGIN & SIGNUP)
   ========================================================= */

.auth-view-hero-wrapper {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: clamp(100px, 14vh, 125px);
  padding-bottom: clamp(40px, 6vh, 60px);
  padding-left: clamp(16px, 3vw, 24px);
  padding-right: clamp(16px, 3vw, 24px);
  overflow-y: auto;
  box-sizing: border-box;
}

.auth-view-hero-wrapper .bg {
  position: fixed;
  inset: 0;
  background: #000;
  overflow: hidden;
  z-index: 0;
}

.auth-card-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 480px;
  margin-top: auto;
  margin-bottom: auto;
  position: relative;
  z-index: 10;
  box-sizing: border-box;
}

.auth-card {
  position: relative;
  width: 100%;
  background: rgba(18, 18, 20, 0.88);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 28px;
  padding: 40px 34px;
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.75),
    0 0 0 1px rgba(255, 255, 255, 0.06);
  animation: authFadeUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes authFadeUp {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.auth-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #a1a1aa;
  font-size: 14px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-close-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  transform: scale(1.05);
}

.auth-header {
  text-align: center;
  margin-bottom: 26px;
}

.auth-icon-badge {
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #28282a;
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: grid;
  place-items: center;
  font-size: 20px;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.auth-title {
  font-family: var(--font-sans);
  font-size: 23px;
  font-weight: 600;
  color: #ffffff;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  font-size: 13.5px;
  color: #a1a1aa;
  margin: 0;
  line-height: 1.5;
}

/* Role & Mode Toggle Tabs - Mirroring .nav-pill */
.auth-role-tabs,
.auth-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: #28282a;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 24px;
}

.auth-role-tab,
.auth-mode-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: transparent;
  border: none;
  color: #a1a1aa;
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
}

.auth-role-tab.active,
.auth-mode-tab.active {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.auth-role-tab i,
.auth-mode-tab i {
  font-size: 13.5px;
}

/* Auth Alerts */
.auth-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 20px;
}

.auth-alert.error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.auth-alert.success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}

/* Google OAuth Button & Divider */
.google-auth-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
  width: 100%;
}

.google-btn-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  min-height: 0;
}

.google-custom-btn {
  width: 100%;
  max-width: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 11px 20px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.google-custom-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.32);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

.google-custom-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.google-loading-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #93c5fd;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  margin-top: 10px;
}

.auth-divider {
  width: 100%;
  display: flex;
  align-items: center;
  text-align: center;
  margin-top: 20px;
  color: #71717a;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-divider span {
  padding: 0 12px;
}

/* Auth Form */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.auth-field label {
  font-size: 12.5px;
  font-weight: 500;
  color: #d4d4d8;
  letter-spacing: 0.2px;
}

.auth-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-wrapper i {
  position: absolute;
  left: 16px;
  color: #71717a;
  font-size: 14px;
  pointer-events: none;
}

.auth-input-wrapper input {
  width: 100%;
  padding: 12px 18px 12px 44px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 13.5px;
  outline: none;
  transition: all 0.2s ease;
}

.auth-input-wrapper input:focus {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12);
}

.auth-input-wrapper input::placeholder {
  color: #71717a;
}

/* Primary Submit Button - Matching .cta-btn */
.auth-submit-btn {
  margin-top: 6px;
  width: 100%;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  background: #ffffff;
  color: #000000;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14.5px;
  cursor: pointer;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.15),
    0 0 22px rgba(255, 255, 255, 0.28);
  transition: all 0.25s ease;
}

.auth-submit-btn:hover:not(:disabled) {
  background: #f4f4f5;
  transform: translateY(-2px);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.25),
    0 0 30px rgba(255, 255, 255, 0.4);
}

.auth-submit-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.auth-loading-spinner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Demo quick fill chips */
.auth-demo-chips {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.demo-chips-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #71717a;
  text-align: center;
}

.demo-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  color: #d4d4d8;
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.demo-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.auth-footer-toggle {
  text-align: center;
  margin-top: 18px;
  font-size: 13px;
  color: #a1a1aa;
}

.auth-link-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  font-weight: 600;
  padding: 0 4px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-link-btn:hover {
  color: #e4e4e7;
}

/* =========================================================
   DOCTOR GATE CARD (PROTECTED RECORDING ACCESS)
   ========================================================= */

.doctor-gate-card {
  max-width: 580px;
  margin: 40px auto;
  text-align: center;
  background: rgba(20, 20, 22, 0.85);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 24px;
  padding: 44px 34px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.5);
}

.gate-icon-badge {
  width: 60px;
  height: 60px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: #28282a;
  border: 1px solid rgba(255, 255, 255, 0.35);
  display: grid;
  place-items: center;
  font-size: 24px;
  color: #ffffff;
}

.gate-title {
  font-size: 21px;
  font-weight: 600;
  color: #ffffff;
  margin: 0 0 10px;
}

.gate-desc {
  font-size: 14px;
  color: #a1a1aa;
  line-height: 1.6;
  margin: 0 0 26px;
}

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

/* =========================================================
   DASHBOARDS (DOCTOR & PATIENT)
   ========================================================= */

.dashboard-page-view {
  min-height: calc(100vh - 120px);
  background: #000000;
  padding-bottom: 80px;
}

.dashboard-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 24px 60px;
}

.dashboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 34px;
  flex-wrap: wrap;
}

.dashboard-welcome {
  flex: 1;
  min-width: 280px;
}

.dashboard-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-bottom: 12px;
  background: #28282a;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.dashboard-title {
  font-size: 30px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 8px;
  letter-spacing: -0.03em;
}

.dashboard-subtitle {
  font-size: 14.5px;
  color: #a1a1aa;
  margin: 0;
  line-height: 1.5;
}

/* Prominent Start Consultation Button (White Pill) */
.btn-start-consultation {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 26px;
  background: #ffffff;
  color: #000000;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.2),
    0 0 22px rgba(255, 255, 255, 0.25);
  transition: all 0.25s ease;
}

.btn-start-consultation:hover {
  background: #f4f4f5;
  transform: translateY(-2px);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.3),
    0 0 32px rgba(255, 255, 255, 0.4);
}

/* Patient Portal Notice */
.patient-portal-notice {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 22px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  margin-bottom: 30px;
}

.patient-portal-notice i {
  font-size: 22px;
  color: #ffffff;
}

.patient-portal-notice strong {
  display: block;
  font-size: 14px;
  color: #ffffff;
  margin-bottom: 2px;
}

.patient-portal-notice p {
  margin: 0;
  font-size: 13px;
  color: #a1a1aa;
}

/* Dashboard Metrics */
.dashboard-metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-bottom: 32px;
}

.dashboard-metric-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  background: rgba(18, 18, 20, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  backdrop-filter: blur(12px);
}

.metric-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #28282a;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 18px;
}

.metric-info {
  display: flex;
  flex-direction: column;
}

.metric-value {
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
}

.metric-label {
  font-size: 12px;
  color: #a1a1aa;
}

/* Consultations Table Card */
.dashboard-table-card {
  background: rgba(18, 18, 20, 0.75);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

.dashboard-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
}

.table-title-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.table-title-area h3 {
  font-size: 17px;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
}

.table-counter-badge {
  font-size: 11.5px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #d4d4d8;
}

.dashboard-search-box {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 270px;
}

.dashboard-search-box i {
  position: absolute;
  left: 14px;
  color: #71717a;
  font-size: 13px;
}

.dashboard-search-box input {
  width: 100%;
  padding: 9px 30px 9px 36px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: #ffffff;
  font-size: 13px;
  outline: none;
  transition: all 0.2s ease;
}

.dashboard-search-box input:focus {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.09);
}

.search-clear-btn {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: #a1a1aa;
  font-size: 12px;
  cursor: pointer;
}

/* Consultations Table */
.table-responsive-wrapper {
  overflow-x: auto;
}

.consultations-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}

.consultations-table th {
  padding: 14px 24px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #71717a;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.consultation-row {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.15s ease;
}

.consultation-row:hover {
  background: rgba(255, 255, 255, 0.035);
}

.consultations-table td {
  padding: 16px 24px;
  vertical-align: middle;
}

.patient-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.patient-avatar-mini {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #28282a;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 13px;
  flex-shrink: 0;
}

.patient-name-text {
  display: block;
  font-weight: 600;
  color: #ffffff;
}

.consultation-id-sub {
  font-size: 11.5px;
  color: #71717a;
}

.date-cell {
  color: #d4d4d8;
  white-space: nowrap;
}

.date-cell i {
  color: #71717a;
  margin-right: 6px;
}

.complaint-cell {
  max-width: 280px;
}

.complaint-text {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #a1a1aa;
}

.turns-cell {
  white-space: nowrap;
}

.turns-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 12px;
  color: #d4d4d8;
}

.status-cell {
  white-space: nowrap;
}

.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
}

.status-tag.finalized {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
}

.action-cell {
  text-align: right;
  white-space: nowrap;
}

.btn-view-record {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-view-record:hover {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
  transform: translateY(-1px);
}

/* Empty & Loading States */
.dashboard-empty-state,
.dashboard-loading-state,
.dashboard-error-state {
  text-align: center;
  padding: 60px 24px;
}

.empty-icon-wrap {
  width: 60px;
  height: 60px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #28282a;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: grid;
  place-items: center;
  font-size: 22px;
  color: #a1a1aa;
}

.dashboard-empty-state h4 {
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  margin: 0 0 8px;
}

.dashboard-empty-state p,
.dashboard-loading-state p,
.dashboard-error-state p {
  font-size: 14px;
  color: #a1a1aa;
  max-width: 440px;
  margin: 0 auto 20px;
  line-height: 1.5;
}

.dashboard-loading-state .spinner {
  font-size: 26px;
  color: #ffffff;
  margin-bottom: 14px;
}

.dashboard-error-state i {
  font-size: 26px;
  color: #ef4444;
  margin-bottom: 14px;
}

/* =========================================================
   CONSULTATION DETAIL VIEW
   ========================================================= */

.detail-page-view {
  min-height: calc(100vh - 120px);
  background: #000000;
  padding-bottom: 80px;
}

.detail-view-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 24px 60px;
}

.detail-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-back:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.detail-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
  font-size: 12px;
  font-weight: 600;
}

.detail-header-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 28px;
  background: rgba(18, 18, 20, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 22px;
  margin-bottom: 28px;
  flex-wrap: wrap;
  backdrop-filter: blur(16px);
}

.detail-header-main {
  display: flex;
  align-items: center;
  gap: 18px;
}

.detail-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #28282a;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 20px;
}

.detail-patient-name {
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}

.detail-meta-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.detail-meta-item {
  font-size: 13px;
  color: #a1a1aa;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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

/* Detail Grid (Dialogue Left, Note Right) */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 960px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

.detail-panel {
  background: rgba(18, 18, 20, 0.8);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  padding: 24px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.detail-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.panel-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-title-group h3 {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
}

.read-only-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #d4d4d8;
}

.detail-dialogue-content {
  max-height: 640px;
  overflow-y: auto;
  padding-right: 6px;
}

.detail-raw-text {
  font-size: 14px;
  line-height: 1.6;
  color: #d4d4d8;
  white-space: pre-wrap;
}

.dialogue-raw-view pre {
  font-family: inherit;
  font-size: 13.5px;
  color: #d4d4d8;
  white-space: pre-wrap;
  margin: 0;
  line-height: 1.6;
}

/* Detail Note Cards */
.detail-note-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.note-card-section {
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
}

.note-card-section.plan-highlight {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.16);
}

.note-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.note-section-title i {
  font-size: 13px;
  color: #ffffff;
}

.note-section-title h4 {
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #a1a1aa;
  margin: 0;
}

.note-section-body {
  font-size: 14px;
  color: #ffffff;
  line-height: 1.6;
  margin: 0;
  white-space: pre-wrap;
}

.medication-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.medication-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  font-size: 12.5px;
  color: #ffffff;
}

.translated-plan-box {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.translated-plan-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #34d399;
  margin-bottom: 6px;
}

.translated-plan-body {
  font-size: 13.5px;
  color: #ffffff;
  line-height: 1.5;
  margin: 0;
}

.detail-loading-box,
.detail-error-box {
  text-align: center;
  padding: 80px 20px;
  background: rgba(18, 18, 20, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  max-width: 500px;
  margin: 60px auto;
  backdrop-filter: blur(20px);
}

.detail-spinner {
  font-size: 30px;
  color: #ffffff;
  margin-bottom: 16px;
}

.detail-error-box i {
  font-size: 30px;
  color: #ef4444;
  margin-bottom: 16px;
}

.detail-error-box h3 {
  font-size: 20px;
  color: #fff;
  margin: 0 0 8px;
}

.detail-error-box p {
  font-size: 14px;
  color: #a1a1aa;
  margin: 0 0 20px;
}

/* --- Finalize Controls (Patient Name & Dashboard Jump) --- */
.finalize-controls-group {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  width: 100%;
}

.patient-name-field-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 260px;
}

.patient-name-field-wrap label {
  font-size: 13px;
  font-weight: 500;
  color: #d4d4d8;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.patient-name-input {
  flex: 1;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 13.5px;
  outline: none;
}

.patient-name-input:focus {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.09);
}

.saved-badge-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
  margin-bottom: 14px;
}

.saved-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 999px;
  color: #6ee7b7;
  font-size: 13px;
  font-weight: 500;
}

.btn-dashboard-jump {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: #ffffff;
  border: none;
  border-radius: 999px;
  color: #000000;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-dashboard-jump:hover {
  background: #f4f4f5;
  transform: translateY(-1px);
}

.save-error-badge {
  padding: 8px 14px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 999px;
  color: #fca5a5;
  font-size: 13px;
  width: 100%;
  margin-bottom: 12px;
}

/* ==========================================================================
   LIVE CLINICAL RED-FLAG DANGER DETECTION SYSTEM
   Urgent, impossible-to-miss emergency alert banners & simulation triggers
   ========================================================================== */

@keyframes redFlagPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7), 0 0 25px rgba(220, 38, 38, 0.5);
    border-color: rgba(239, 68, 68, 0.9);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(239, 68, 68, 0), 0 0 38px rgba(220, 38, 38, 0.7);
    border-color: rgba(254, 202, 202, 1);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0), 0 0 25px rgba(220, 38, 38, 0.5);
    border-color: rgba(239, 68, 68, 0.9);
  }
}

@keyframes beaconShake {
  0%, 100% { transform: scale(1) rotate(0deg); }
  20%, 60% { transform: scale(1.15) rotate(-8deg); }
  40%, 80% { transform: scale(1.15) rotate(8deg); }
}

.red-flag-alert-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  margin-bottom: 24px;
  z-index: 50;
}

.red-flag-card {
  position: relative;
  background: linear-gradient(135deg, rgba(69, 10, 10, 0.95) 0%, rgba(127, 29, 29, 0.92) 50%, rgba(153, 27, 27, 0.88) 100%);
  border: 2px solid rgba(239, 68, 68, 0.9);
  border-radius: 18px;
  padding: 20px 24px;
  color: #ffffff;
  animation: redFlagPulse 3s infinite ease-in-out;
  backdrop-filter: blur(12px);
  overflow: hidden;
}

.red-flag-card-glow {
  position: absolute;
  top: -50%;
  left: -20%;
  width: 140%;
  height: 200%;
  background: radial-gradient(circle at 20% 20%, rgba(239, 68, 68, 0.25) 0%, transparent 60%);
  pointer-events: none;
}

.red-flag-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.red-flag-title-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.red-flag-beacon {
  font-size: 28px;
  display: inline-block;
  animation: beaconShake 2.5s infinite ease-in-out;
}

.red-flag-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.red-flag-badge-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: #ef4444;
  color: #ffffff;
  padding: 3px 8px;
  border-radius: 6px;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
}

.red-flag-time {
  font-size: 12px;
  color: #fca5a5;
  font-weight: 500;
}

.red-flag-pattern-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.red-flag-ack-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #ffffff;
  color: #991b1b;
  border: none;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transition: all 0.2s ease;
}

.red-flag-ack-btn:hover {
  background: #fee2e2;
  color: #7f1d1d;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.red-flag-body-message {
  margin: 0 0 14px 0;
  font-size: 15px;
  line-height: 1.5;
  color: #fee2e2;
  font-weight: 500;
}

.red-flag-trigger-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.red-flag-trigger-label {
  font-size: 12px;
  font-weight: 700;
  color: #fca5a5;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.red-flag-keywords-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.red-flag-keyword-pill {
  display: inline-block;
  background: rgba(239, 68, 68, 0.35);
  border: 1px solid rgba(248, 113, 113, 0.5);
  color: #fef2f2;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
}

.red-flag-disclaimer-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #fecaca;
  opacity: 0.9;
  font-style: italic;
  border-top: 1px solid rgba(239, 68, 68, 0.3);
  padding-top: 10px;
}

.red-flag-disclaimer-row i {
  color: #f87171;
  font-size: 14px;
}

/* Simulation Tray */
.red-flag-sim-tray {
  margin-top: 20px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 14px;
}

.red-flag-sim-tray.pre-recording {
  margin-top: 24px;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}

.red-flag-sim-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.sim-title {
  font-size: 13px;
  font-weight: 700;
  color: #f43f5e;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sim-subtitle {
  font-size: 12px;
  color: #a1a1aa;
}

.red-flag-sim-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sim-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #e4e4e7;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sim-chip:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
  transform: translateY(-1px);
}

/* ==========================================================================
   Patient QR Code Sharing Component
   ========================================================================== */
.patient-share-qr-card {
  background: linear-gradient(135deg, #111827 0%, #0f172a 100%);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 16px;
  padding: 1.5rem;
  margin: 1.25rem 0 1.5rem 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1.75rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 0 15px rgba(59, 130, 246, 0.1);
  text-align: left;
}

@media (max-width: 680px) {
  .patient-share-qr-card {
    flex-direction: column;
    text-align: center;
    gap: 1.25rem;
    padding: 1.25rem;
  }
}

.qr-code-wrapper {
  background: #ffffff;
  padding: 14px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

.qr-info-column {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  flex: 1;
  min-width: 0;
}

.qr-badge-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.qr-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(37, 99, 235, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #60a5fa;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.qr-expiry-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #34d399;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
}

.qr-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #f8fafc;
  margin: 0;
}

.qr-patient-instruction {
  background: rgba(59, 130, 246, 0.08);
  border-left: 3px solid #3b82f6;
  padding: 0.6rem 0.85rem;
  border-radius: 0 8px 8px 0;
  font-size: 0.9rem;
  color: #e2e8f0;
  margin: 0;
}

.qr-patient-instruction strong {
  color: #60a5fa;
}

.qr-link-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0.4rem 0.65rem;
  max-width: 100%;
}

.qr-link-input {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-family: monospace;
  font-size: 0.8rem;
  flex: 1;
  outline: none;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-qr-action {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #1e293b;
  border: 1px solid #334155;
  color: #e2e8f0;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-qr-action:hover {
  background: #334155;
  color: #ffffff;
}

.btn-qr-action.primary {
  background: #2563eb;
  border-color: #3b82f6;
  color: #ffffff;
}

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

.qr-buttons-cluster {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}


