/* CSS Variables */
:root {
  --bg-primary: #071521;
  --bg-secondary: #0d2031;
  --bg-card: #13283b;
  --bg-card-hover: #18344c;
  --accent-teal: #00d4aa;
  --accent-cyan: #00b4d8;
  --accent-blue: #0077b6;
  --text-primary: #ffffff;
  --text-secondary: #a7b7c9;
  --text-muted: #6f849b;
  --border-color: #24445f;
  --danger: #ef4444;
  --success: #22c55e;
  --surface-shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
  --content-width: 1180px;
  --page-pad: 16px;
  --nav-height: 72px;
}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, rgba(0, 212, 170, 0.12), transparent 34rem),
    linear-gradient(135deg, #071521 0%, #0a1826 52%, #091827 100%);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

img,
svg {
  display: block;
}

.app {
  width: min(100%, var(--content-width));
  margin: 0 auto;
  padding: 0 var(--page-pad) calc(var(--nav-height) + 20px);
  position: relative;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 90;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  width: 100vw;
  margin: 0 calc(50% - 50vw);
  padding: 12px max(var(--page-pad), calc((100vw - var(--content-width)) / 2 + var(--page-pad)));
  background: rgba(7, 21, 33, 0.9);
  border-bottom: 1px solid rgba(36, 68, 95, 0.7);
  backdrop-filter: blur(18px);
}

.logo {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-teal), var(--accent-cyan));
  box-shadow: 0 12px 28px rgba(0, 212, 170, 0.24);
}

.logo-plus {
  width: 21px;
  height: 21px;
  color: #ffffff;
  stroke-width: 3;
}

.logo-text {
  min-width: 0;
}

.logo-text h1 {
  font-size: 14px;
  font-weight: 750;
  line-height: 1.15;
}

.logo-text span {
  display: block;
  max-width: 150px;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 10px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.global-search {
  position: relative;
  order: 3;
  flex: 1 0 100%;
  display: flex;
  align-items: center;
  min-width: 0;
}

.search-icon {
  position: absolute;
  left: 13px;
  width: 17px;
  height: 17px;
  color: var(--text-muted);
  pointer-events: none;
}

.global-search input {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px 10px 40px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  outline: none;
  background: rgba(19, 40, 59, 0.88);
  color: var(--text-primary);
  font: inherit;
  font-size: 13px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.global-search input:focus {
  border-color: var(--accent-teal);
  background: rgba(19, 40, 59, 0.98);
  box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.12);
}

.global-search input::placeholder {
  color: var(--text-muted);
}

.search-suggestions {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  z-index: 140;
  display: none;
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: rgba(9, 24, 38, 0.98);
  box-shadow: var(--surface-shadow);
}

.search-suggestions.is-open {
  display: grid;
}

.suggestion-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-bottom: 1px solid rgba(36, 68, 95, 0.72);
  background: transparent;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}

.suggestion-item:last-child {
  border-bottom: 0;
}

.suggestion-item:hover,
.suggestion-item:focus {
  background: rgba(0, 212, 170, 0.1);
}

.suggestion-item span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.suggestion-item strong {
  font-size: 13px;
  line-height: 1.2;
}

.suggestion-item small,
.suggestion-empty {
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.35;
}

.suggestion-empty {
  padding: 13px;
}

.lang-selector {
  display: none;
  align-items: center;
  gap: 4px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: rgba(19, 40, 59, 0.82);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
}

.chevron-icon {
  width: 14px;
  height: 14px;
  color: var(--text-secondary);
}

.notification {
  position: relative;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: rgba(19, 40, 59, 0.82);
}

.bell-icon {
  width: 19px;
  height: 19px;
  color: var(--text-primary);
}

.notification-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: 2px solid var(--bg-primary);
  border-radius: 50%;
  background: var(--danger);
  font-size: 9px;
  font-weight: 800;
}

.avatar {
  position: relative;
  width: 36px;
  height: 36px;
  overflow: hidden;
  border: 2px solid var(--accent-teal);
  border-radius: 50%;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-status {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 10px;
  height: 10px;
  border: 2px solid var(--bg-primary);
  border-radius: 50%;
  background: var(--success);
}

/* Hero */
.hero {
  position: relative;
  min-height: 228px;
  margin: 16px 0 20px;
  overflow: hidden;
  padding: 20px;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(0, 212, 170, 0.12), rgba(0, 180, 216, 0.06)),
    var(--bg-secondary);
  box-shadow: var(--surface-shadow);
}

.hero::before {
  content: "";
  position: absolute;
  inset: auto -54px -72px auto;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 212, 170, 0.2) 0%, transparent 70%);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 520px;
}

.hero h2 {
  max-width: 14ch;
  margin-bottom: 10px;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.17;
}

.gradient-text {
  background: linear-gradient(90deg, var(--accent-teal), var(--accent-cyan));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-ecg {
  position: relative;
  width: min(100%, 300px);
  height: 68px;
  margin-top: 14px;
}

.ecg-line {
  width: 100%;
  height: 100%;
  opacity: 0.86;
}

.ecg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 212, 170, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 170, 0.08) 1px, transparent 1px);
  background-size: 20px 20px;
}

.hero-actions {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 16px;
}

.hero-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: rgba(19, 40, 59, 0.84);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
  backdrop-filter: blur(10px);
}

.hero-btn:hover {
  border-color: var(--accent-teal);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

.btn-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: var(--accent-teal);
}

/* Sections */
.section {
  margin-bottom: 22px;
}

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

.section-header h3 {
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 780;
  line-height: 1.25;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.view-all {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 2px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}

.view-icon {
  width: 14px;
  height: 14px;
}

.live-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
  font-size: 10px;
  font-weight: 800;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

/* Shared Cards */
.quick-item,
.health-card,
.status-card,
.tele-card,
.market-item,
.legal-item,
.compliance-badges,
.insight-card {
  border: 1px solid var(--border-color);
  background: rgba(19, 40, 59, 0.92);
}

.quick-item,
.market-item,
.legal-item,
.insight-card,
.tele-card {
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.quick-item:hover,
.market-item:hover,
.legal-item:hover,
.insight-card:hover,
.tele-card:hover {
  border-color: var(--accent-teal);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

/* Quick Access Grid */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.quick-item {
  display: flex;
  min-height: 86px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 4px;
  border-radius: 10px;
  cursor: pointer;
}

.quick-icon,
.market-icon,
.legal-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-teal);
}

.quick-icon {
  width: 34px;
  height: 34px;
}

.quick-icon svg {
  width: 23px;
  height: 23px;
}

.quick-item span,
.market-item span,
.legal-item span {
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.25;
  text-align: center;
}

/* Health Dashboard */
.health-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.health-card {
  min-height: 116px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px;
  border-radius: 10px;
}

.health-label {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 650;
}

.health-value {
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.15;
}

.health-unit {
  color: var(--text-muted);
  font-size: 10px;
}

.health-chart {
  width: 100%;
  height: 28px;
  margin-top: auto;
}

.health-status {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.status-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 70px;
  padding: 12px;
  border-radius: 10px;
}

.status-icon {
  display: flex;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(0, 212, 170, 0.11);
  color: var(--accent-teal);
}

.status-icon svg {
  width: 21px;
  height: 21px;
}

.status-info {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.status-title {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
}

.status-value {
  color: var(--text-secondary);
  font-size: 12px;
}

/* Telemedicine */
.tele-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.tele-card {
  position: relative;
  overflow: hidden;
  min-height: 118px;
  padding: 14px;
  border-radius: 10px;
}

.tele-main {
  min-height: 184px;
}

.tele-info {
  position: relative;
  z-index: 1;
  max-width: 68%;
}

.tele-title {
  display: block;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.28;
}

.tele-subtitle,
.tele-wait {
  display: block;
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 11px;
}

.tele-doctor {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.tele-doctor img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
}

.doctor-name {
  display: block;
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 700;
}

.doctor-role {
  display: block;
  color: var(--text-muted);
  font-size: 9px;
}

.join-btn {
  width: fit-content;
  min-height: 38px;
  margin-top: 12px;
  padding: 8px 18px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent-teal), var(--accent-cyan));
  color: #ffffff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.tele-img {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 118px;
  height: 144px;
  border-radius: 12px 0 0 0;
  object-fit: cover;
  object-position: top;
  mask-image: linear-gradient(to left, black 58%, transparent);
  -webkit-mask-image: linear-gradient(to left, black 58%, transparent);
}

.tele-count {
  display: block;
  margin-top: 8px;
  color: var(--accent-teal);
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

.tele-count-label {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
}

.wait-bar {
  width: 100%;
  height: 5px;
  overflow: hidden;
  margin-top: 14px;
  border-radius: 999px;
  background: var(--bg-secondary);
}

.wait-progress {
  width: 60%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-teal), var(--accent-cyan));
}

.tele-conference {
  display: flex;
  flex-direction: column;
}

.conference-avatars {
  display: flex;
  margin-top: auto;
  padding-top: 12px;
}

.c-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-left: -8px;
  border: 2px solid var(--bg-card);
  border-radius: 50%;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 10px;
}

.c-avatar:first-child {
  margin-left: 0;
}

.c-avatar-more {
  background: var(--accent-teal);
  color: #ffffff;
  font-weight: 800;
}

/* Marketplace */
.market-scroll,
.insights-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}

.market-scroll::-webkit-scrollbar,
.insights-scroll::-webkit-scrollbar {
  display: none;
}

.market-item {
  scroll-snap-align: start;
  flex: 0 0 92px;
  display: flex;
  min-height: 102px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px 8px;
  border-radius: 10px;
  cursor: pointer;
}

.market-icon {
  width: 34px;
  height: 34px;
}

.market-icon svg {
  width: 23px;
  height: 23px;
}

.market-soon {
  border-color: rgba(0, 212, 170, 0.7);
  background: rgba(0, 212, 170, 0.08);
}

.soon-badge {
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(0, 212, 170, 0.15);
  color: var(--accent-teal) !important;
  font-size: 8px !important;
  font-weight: 800 !important;
}

/* Legal */
.legal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.legal-item {
  display: flex;
  min-height: 92px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 6px;
  border-radius: 10px;
  cursor: pointer;
}

.legal-icon {
  width: 30px;
  height: 30px;
}

.legal-icon svg {
  width: 20px;
  height: 20px;
}

.compliance-badges {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  border-radius: 10px;
}

.badge {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.badge svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--accent-teal);
}

.badge span {
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.2;
}

/* Insights */
.insight-card {
  scroll-snap-align: start;
  flex: 0 0 142px;
  overflow: hidden;
  border-radius: 10px;
  cursor: pointer;
}

.insight-card img {
  width: 100%;
  aspect-ratio: 1.45;
  object-fit: cover;
}

.insight-title {
  display: block;
  padding: 9px 10px 3px;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.25;
}

.insight-desc {
  display: block;
  min-height: 40px;
  padding: 0 10px 10px;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.35;
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-around;
  min-height: var(--nav-height);
  padding: 8px 6px max(10px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border-color);
  background: rgba(7, 21, 33, 0.94);
  backdrop-filter: blur(20px);
}

.nav-item {
  display: flex;
  min-width: 54px;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s, transform 0.2s;
}

.nav-item:hover,
.nav-item.active {
  color: var(--accent-teal);
}

.nav-item:hover {
  transform: translateY(-1px);
}

.nav-icon {
  width: 22px;
  height: 22px;
}

.nav-item span {
  font-size: 10px;
  font-weight: 650;
  line-height: 1.2;
}

.section-last {
  margin-bottom: 24px;
}

/* Routed Pages */
.home-shell {
  display: contents;
}

.route-shell {
  display: block;
  width: 100%;
  margin: 16px 0 24px;
}

[data-route] {
  cursor: pointer;
}

.route-hero {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(0, 212, 170, 0.12), rgba(0, 180, 216, 0.05)),
    var(--bg-secondary);
  box-shadow: var(--surface-shadow);
}

.route-hero h2 {
  margin: 4px 0 8px;
  font-size: 28px;
  line-height: 1.12;
}

.route-hero p {
  max-width: 760px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.55;
}

.eyebrow {
  color: var(--accent-teal) !important;
  font-size: 11px !important;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.back-link,
.primary-action,
.route-card a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: fit-content;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid rgba(0, 212, 170, 0.42);
  border-radius: 9px;
  background: rgba(0, 212, 170, 0.1);
  color: var(--accent-teal);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.primary-action {
  border: 0;
  background: linear-gradient(135deg, var(--accent-teal), var(--accent-cyan));
  color: #ffffff;
  cursor: pointer;
}

.small-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.route-icon {
  width: 28px;
  height: 28px;
  color: var(--accent-teal);
}

.route-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.route-card,
.metric-card,
.form-panel,
.record-table,
.chart-panel,
.profile-panel,
.call-room {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: rgba(19, 40, 59, 0.92);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.route-card {
  display: flex;
  min-height: 128px;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
}

.route-card h3,
.form-panel h3,
.chart-panel h3 {
  font-size: 16px;
  line-height: 1.25;
}

.route-card p,
.route-card li,
.clean-list li {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
}

.route-card ul,
.clean-list {
  display: grid;
  gap: 8px;
  padding-left: 18px;
}

.doctor-profile-card {
  overflow: hidden;
  padding: 0;
}

.doctor-media {
  position: relative;
  width: 100%;
  min-height: 210px;
  background: var(--bg-secondary);
}

.doctor-photo {
  width: 100%;
  height: 230px;
  object-fit: cover;
  object-position: center top;
}

.doctor-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}

.doctor-placeholder-icon {
  width: 72px;
  height: 72px;
  color: var(--accent-teal);
}

.doctor-badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(7, 21, 33, 0.84);
  color: var(--accent-teal);
  font-size: 11px;
  font-weight: 800;
}

.doctor-copy,
.doctor-actions {
  display: grid;
  gap: 10px;
}

.doctor-copy {
  padding: 16px;
}

.doctor-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.doctor-actions a {
  justify-content: center;
}

.scanner-panel {
  display: grid;
  grid-template-columns: minmax(260px, 380px) minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.scanner-frame {
  position: relative;
  overflow: hidden;
  min-height: 360px;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(90deg, rgba(36, 68, 95, 0.7) 1px, transparent 1px),
    linear-gradient(rgba(36, 68, 95, 0.7) 1px, transparent 1px),
    rgba(19, 40, 59, 0.92);
  background-size: 42px 42px;
}

.scanner-icon {
  width: 82px;
  height: 82px;
  color: var(--accent-teal);
}

.scan-line {
  position: absolute;
  left: 10%;
  right: 10%;
  height: 2px;
  background: var(--accent-teal);
  box-shadow: 0 0 22px rgba(0, 212, 170, 0.7);
  animation: scannerSweep 2.2s linear infinite;
}

@keyframes scannerSweep {
  from {
    transform: translateY(-150px);
  }
  to {
    transform: translateY(150px);
  }
}

.site-footer {
  grid-column: 1 / -1;
  margin: 28px 0 0;
  padding: 22px;
  border: 1px solid var(--border-color);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(0, 212, 170, 0.09), rgba(0, 180, 216, 0.04)),
    rgba(13, 32, 49, 0.94);
  box-shadow: var(--surface-shadow);
}

.footer-brand {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(36, 68, 95, 0.8);
}

.footer-logo {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.footer-logo h2 {
  margin: 0 0 6px;
  font-size: 18px;
  line-height: 1.1;
}

.footer-logo p,
.site-footer p,
.footer-bottom {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.55;
}

.footer-logo p,
.site-footer p {
  margin: 0;
}

.footer-trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.footer-trust span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid rgba(0, 212, 170, 0.28);
  border-radius: 999px;
  background: rgba(0, 212, 170, 0.08);
  color: var(--accent-teal);
  font-size: 12px;
  font-weight: 800;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  padding: 20px 0;
}

.footer-grid section {
  display: grid;
  align-content: start;
  gap: 9px;
}

.footer-grid h3 {
  margin: 0 0 4px;
  color: var(--text-primary);
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.footer-grid a,
.footer-grid p {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  color: var(--text-secondary);
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: color 0.2s, transform 0.2s;
}

.footer-grid a:hover,
.footer-grid a:focus {
  color: var(--accent-teal);
  transform: translateX(2px);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid rgba(36, 68, 95, 0.8);
}

.wide-card {
  margin-bottom: 16px;
}

.card-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title-row div {
  min-width: 0;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: auto;
}

.pill-row span {
  padding: 5px 8px;
  border: 1px solid rgba(167, 183, 201, 0.16);
  border-radius: 999px;
  background: rgba(7, 21, 33, 0.42);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
}

.metric-card {
  display: grid;
  gap: 6px;
  min-height: 134px;
  padding: 14px;
}

.metric-card span {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 750;
}

.metric-card strong {
  font-size: 30px;
  line-height: 1;
}

.metric-card small {
  color: var(--text-muted);
  font-size: 11px;
}

.form-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
  padding: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.form-grid label {
  display: grid;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.form-grid input,
.form-grid select {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--border-color);
  border-radius: 9px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font: inherit;
}

.record-table {
  overflow: hidden;
  margin-bottom: 16px;
}

.table-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  padding: 13px;
  border-bottom: 1px solid rgba(36, 68, 95, 0.65);
}

.table-row:last-child {
  border-bottom: 0;
}

.table-row span {
  color: var(--text-secondary);
  font-size: 12px;
}

.table-row span:first-child {
  color: var(--text-primary);
  font-weight: 800;
}

.table-row a {
  color: var(--accent-teal);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.table-head {
  display: none;
}

.chart-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
  padding: 14px;
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 8px;
  height: 180px;
  padding: 10px;
  border-radius: 10px;
  background:
    linear-gradient(rgba(0, 212, 170, 0.06) 1px, transparent 1px),
    var(--bg-secondary);
  background-size: 100% 36px;
}

.bar-chart span {
  border-radius: 999px 999px 4px 4px;
  background: linear-gradient(180deg, var(--accent-teal), var(--accent-blue));
}

.profile-panel {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding: 14px;
}

.profile-panel img {
  width: 74px;
  height: 74px;
  flex: 0 0 auto;
  border: 2px solid var(--accent-teal);
  border-radius: 50%;
  object-fit: cover;
}

.profile-panel p {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.selected-card {
  border-color: var(--accent-teal);
  background: rgba(0, 212, 170, 0.1);
}

.call-room {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.video-tile {
  display: grid;
  min-height: 260px;
  place-items: center;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(0, 212, 170, 0.16), rgba(0, 180, 216, 0.08)),
    var(--bg-secondary);
  color: var(--text-secondary);
}

.call-icon {
  width: 58px;
  height: 58px;
  color: var(--accent-teal);
}

.call-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.call-actions button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--border-color);
  border-radius: 9px;
  background: var(--bg-secondary);
  color: var(--text-primary);
}

@media (min-width: 390px) {
  .lang-selector {
    display: flex;
  }

  .hero-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .quick-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .health-status {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 640px) {
  :root {
    --page-pad: 24px;
  }

  .header {
    flex-wrap: nowrap;
  }

  .global-search {
    order: 0;
    flex: 1 1 360px;
    max-width: 520px;
  }

  .route-hero {
    grid-template-columns: 1fr auto;
    align-items: end;
    padding: 24px;
  }

  .back-link {
    grid-column: 1 / -1;
  }

  .route-hero h2 {
    font-size: 40px;
  }

  .route-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .metrics-grid,
  .service-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .doctor-grid,
  .list-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .table-row {
    grid-template-columns: 1.4fr 0.8fr 0.8fr 1fr auto;
    align-items: center;
  }

  .table-head {
    display: grid;
    background: rgba(7, 21, 33, 0.45);
  }

  .table-head span {
    color: var(--text-primary);
    font-weight: 800;
  }

  .hero-content {
    position: static;
  }

  .hero h2 {
    position: relative;
    z-index: 1;
  }

  .hero {
    min-height: 250px;
    padding: 26px;
  }

  .hero h2 {
    font-size: 36px;
  }

  .hero-ecg {
    position: absolute;
    top: 38px;
    right: 22px;
    width: 330px;
    height: 96px;
    margin: 0;
  }

  .hero-actions {
    max-width: 620px;
    margin-top: 34px;
  }

  .section-header h3 {
    font-size: 18px;
  }

  .quick-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
  }

  .quick-item {
    min-height: 104px;
  }

  .quick-item span,
  .market-item span,
  .legal-item span {
    font-size: 11px;
  }

  .health-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
  }

  .tele-grid {
    grid-template-columns: 1.45fr 1fr;
    gap: 10px;
  }

  .tele-main {
    grid-row: span 2;
  }

  .legal-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .compliance-badges {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 12px;
  }

  .insight-card {
    flex-basis: 176px;
  }
}

@media (min-width: 900px) {
  :root {
    --page-pad: 32px;
  }

  .app {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 0 18px;
    padding-bottom: 42px;
    padding-left: 116px;
  }

  .route-shell {
    grid-column: 1 / -1;
    margin-top: 24px;
  }

  .route-hero {
    min-height: 220px;
    padding: 32px;
  }

  .route-hero h2 {
    font-size: 52px;
  }

  .metrics-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .service-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .header {
    grid-column: 1 / -1;
    min-height: 76px;
    margin-left: calc(50% - 50vw);
    padding-left: max(24px, calc((100vw - var(--content-width)) / 2 + 24px));
    padding-right: max(24px, calc((100vw - var(--content-width)) / 2 + 24px));
  }

  .logo-icon {
    width: 44px;
    height: 44px;
  }

  .logo-text h1 {
    font-size: 17px;
  }

  .logo-text span {
    max-width: none;
    font-size: 12px;
  }

  .hero,
  .section-last {
    grid-column: 1 / -1;
  }

  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 440px;
    gap: 24px;
    align-items: end;
    min-height: 300px;
    margin-top: 24px;
    padding: 34px;
  }

  .hero h2 {
    max-width: 16ch;
    font-size: 48px;
  }

  .hero-ecg {
    top: 34px;
    right: 40px;
    width: 430px;
    height: 130px;
  }

  .hero-actions {
    grid-template-columns: 1fr;
    align-self: end;
    max-width: none;
    margin-top: 0;
  }

  .hero-btn {
    justify-content: flex-start;
    min-height: 58px;
    padding: 14px 18px;
    font-size: 14px;
  }

  .section {
    margin-bottom: 26px;
  }

  .section:nth-of-type(2) {
    grid-column: 1 / -1;
  }

  .section:nth-of-type(3) {
    grid-column: span 7;
  }

  .section:nth-of-type(4) {
    grid-column: span 5;
  }

  .section:nth-of-type(5) {
    grid-column: span 7;
  }

  .section:nth-of-type(6) {
    grid-column: span 5;
  }

  .quick-grid {
    grid-template-columns: repeat(10, minmax(0, 1fr));
  }

  .quick-item {
    min-height: 112px;
  }

  .health-grid {
    gap: 12px;
  }

  .health-card {
    min-height: 132px;
    padding: 14px;
  }

  .tele-grid {
    grid-template-columns: 1fr 1fr;
    height: calc(100% - 36px);
  }

  .tele-main {
    grid-column: 1 / -1;
    grid-row: auto;
    min-height: 194px;
  }

  .market-scroll,
  .insights-scroll {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
  }

  .market-item,
  .insight-card {
    flex-basis: auto;
  }

  .market-item {
    width: auto;
  }

  .legal-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .bottom-nav {
    top: 98px;
    right: auto;
    bottom: auto;
    left: max(18px, calc((100vw - var(--content-width)) / 2 + 24px));
    width: 76px;
    min-height: auto;
    flex-direction: column;
    justify-content: flex-start;
    gap: 8px;
    padding: 12px 8px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: var(--surface-shadow);
  }

  .nav-item {
    width: 100%;
    min-width: 0;
    min-height: 64px;
    justify-content: center;
    border-radius: 10px;
  }

  .nav-item.active {
    background: rgba(0, 212, 170, 0.12);
  }

  .nav-item span {
    font-size: 9px;
  }
}

@media (max-width: 720px) {
  .scanner-panel,
  .doctor-actions,
  .footer-brand,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .scanner-frame {
    min-height: 300px;
  }

  .site-footer {
    margin-bottom: 10px;
    padding: 18px;
  }

  .footer-trust {
    justify-content: flex-start;
  }

  .footer-bottom {
    display: grid;
  }
}

@media (min-width: 1180px) {
  .app {
    gap: 0 22px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) 480px;
  }

  .hero-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero-btn {
    justify-content: center;
  }

  .health-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

}

  .hero {
    grid-template-columns: minmax(0, 1fr) 480px;
  }

  .hero-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero-btn {
    justify-content: center;
  }

  .health-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .tele-img {
    width: 132px;
    height: 158px;
  }

  .insights-scroll {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

/* ==========================================================================
   ABDM HEALTH PLATFORM THEMES & EXTENSIONS
   ========================================================================== */

/* Theme Variables Overrides */
body.theme-slate-dark {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --bg-card-hover: #334155;
  --accent-teal: #38bdf8;
  --accent-cyan: #818cf8;
  --accent-blue: #6366f1;
  --border-color: #334155;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.1), transparent 34rem),
    linear-gradient(135deg, #0f172a 0%, #0f172a 52%, #1e293b 100%);
}

body.theme-ocean-blue {
  --bg-primary: #0a1128;
  --bg-secondary: #001f54;
  --bg-card: #0a3069;
  --bg-card-hover: #10458a;
  --accent-teal: #00b4d8;
  --accent-cyan: #90e0ef;
  --accent-blue: #0077b6;
  --border-color: #0d3069;
  background:
    radial-gradient(circle at top left, rgba(0, 180, 216, 0.12), transparent 34rem),
    linear-gradient(135deg, #0a1128 0%, #03071e 52%, #001f54 100%);
}

body.theme-emerald-light {
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --accent-teal: #059669;
  --accent-cyan: #10b981;
  --accent-blue: #2563eb;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  background:
    radial-gradient(circle at top left, rgba(5, 150, 105, 0.08), transparent 34rem),
    linear-gradient(135deg, #f8fafc 0%, #f1f5f9 52%, #e2e8f0 100%);
  color: #0f172a;
}
body.theme-emerald-light .global-search input {
  background: #ffffff;
  color: #0f172a;
}
body.theme-emerald-light .search-suggestions {
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}
body.theme-emerald-light .header {
  background: rgba(248, 250, 252, 0.9);
  border-bottom-color: #cbd5e1;
}
body.theme-emerald-light .bottom-nav {
  background: rgba(248, 250, 252, 0.96);
  border-top-color: #cbd5e1;
}
body.theme-emerald-light .quick-item,
body.theme-emerald-light .health-card,
body.theme-emerald-light .status-card,
body.theme-emerald-light .tele-card,
body.theme-emerald-light .market-item,
body.theme-emerald-light .legal-item,
body.theme-emerald-light .insight-card,
body.theme-emerald-light .route-card,
body.theme-emerald-light .metric-card,
body.theme-emerald-light .form-panel {
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

/* Accessibility Modes */
body.accessibility-large-font {
  font-size: 19px;
}
body.accessibility-large-font h1 { font-size: 26px !important; }
body.accessibility-large-font h2 { font-size: 32px !important; }
body.accessibility-large-font h3 { font-size: 24px !important; }
body.accessibility-large-font p, body.accessibility-large-font span, body.accessibility-large-font a, body.accessibility-large-font button { font-size: 16px !important; }

body.accessibility-high-contrast {
  --bg-primary: #000000;
  --bg-secondary: #111111;
  --bg-card: #000000;
  --bg-card-hover: #222222;
  --accent-teal: #00ffcc;
  --accent-cyan: #00ffff;
  --accent-blue: #00aaff;
  --text-primary: #ffffff;
  --text-secondary: #ffff00;
  --text-muted: #ffffff;
  --border-color: #ffffff;
  background: #000000;
  color: #ffffff;
}
body.accessibility-high-contrast * {
  border-color: #ffffff !important;
}

/* Focus Indicator */
*:focus-visible {
  outline: 3px solid var(--accent-teal) !important;
  outline-offset: 2px !important;
}

/* Center Scanner FAB Button style */
.nav-item.fab-scan {
  position: relative;
  top: -16px;
  background: linear-gradient(135deg, var(--accent-teal), var(--accent-cyan));
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 212, 170, 0.35);
  color: #ffffff !important;
  border: 4px solid var(--bg-primary);
  z-index: 110;
  transition: transform 0.2s, box-shadow 0.2s;
}
.nav-item.fab-scan:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 12px 28px rgba(0, 212, 170, 0.5);
}
.nav-item.fab-scan svg {
  width: 25px;
  height: 25px;
  color: #ffffff;
}
.nav-item.fab-scan span {
  display: none;
}

/* Full Login / Registration Screens */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 460px;
  padding: 30px 24px;
  border-radius: 16px;
  background: rgba(19, 40, 59, 0.94);
  border: 1px solid var(--border-color);
  box-shadow: var(--surface-shadow);
  backdrop-filter: blur(14px);
}

.login-card h2 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 8px;
  text-align: center;
}

.login-card .subtitle {
  color: var(--text-secondary);
  font-size: 13px;
  text-align: center;
  margin-bottom: 24px;
}

.role-prefill-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}

.prefill-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 10px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s;
}

.prefill-btn:hover {
  border-color: var(--accent-teal);
  background: var(--bg-card-hover);
}

.prefill-btn.active {
  border-color: var(--accent-teal);
  background: rgba(0, 212, 170, 0.15);
  box-shadow: 0 0 0 2px var(--accent-teal);
}

.prefill-btn svg {
  width: 20px;
  height: 20px;
  color: var(--accent-teal);
}

.prefill-btn span {
  font-size: 12px;
  font-weight: 700;
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 11px;
  margin: 16px 0;
}
.divider::before,
.divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}
.divider:not(:empty)::before {
  margin-right: .5em;
}
.divider:not(:empty)::after {
  margin-left: .5em;
}

/* Modals Controller */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7, 21, 33, 0.85);
  backdrop-filter: blur(8px);
  padding: 16px;
  animation: fadeIn 0.2s ease-out;
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 500px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--surface-shadow);
  overflow: hidden;
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-header h3 {
  font-size: 16px;
  font-weight: 750;
}

.modal-close {
  background: transparent;
  border: 0;
  color: var(--text-secondary);
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.modal-close:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.modal-body {
  padding: 18px;
  max-height: 75vh;
  overflow-y: auto;
}

/* ABHA Holographic Card */
.abha-card-preview {
  position: relative;
  width: 100%;
  max-width: 380px;
  min-height: 220px;
  margin: 16px auto;
  border-radius: 14px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(135deg, #0d304f 0%, #071521 100%);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.abha-card-preview::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(125deg, transparent 40%, rgba(0, 212, 170, 0.15) 50%, transparent 60%);
  animation: holographic 6s linear infinite;
  pointer-events: none;
}

.abha-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.abha-card-header img {
  height: 22px;
}

.abha-card-header span {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--accent-teal);
}

.abha-card-body {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 12px;
}

.abha-card-avatar {
  width: 80px;
  height: 94px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: var(--bg-secondary);
  overflow: hidden;
}

.abha-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.abha-card-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.abha-card-info strong {
  font-size: 13px;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.abha-card-info p {
  font-size: 10px;
  color: var(--text-secondary);
  margin: 0;
}

.abha-card-info .abha-num {
  font-size: 14px;
  font-weight: 800;
  color: var(--accent-teal);
  letter-spacing: 0.5px;
  margin: 2px 0;
}

.abha-card-footer {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 8px;
}

.abha-card-footer .address {
  font-size: 9px;
  color: var(--text-muted);
}

.abha-card-qr {
  width: 44px;
  height: 44px;
  background: #ffffff;
  padding: 2px;
  border-radius: 4px;
}

.abha-card-qr img {
  width: 100%;
  height: 100%;
}

@keyframes holographic {
  0% { transform: translateX(-100%) translateY(-100%); }
  100% { transform: translateX(100%) translateY(100%); }
}

/* NHA Credentials Certificate */
.certificate-frame {
  position: relative;
  border: 8px double #a1824a;
  background: #fbf8f2;
  color: #1e1e1e;
  padding: 24px;
  font-family: 'Georgia', serif;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  border-radius: 8px;
}

.certificate-watermark {
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image: url('https://csspicker.dev/api/image/?q=emblem+india&image_type=vector');
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
}

.certificate-header {
  text-align: center;
  margin-bottom: 20px;
}

.certificate-header h4 {
  font-size: 18px;
  color: #1b4d3e;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.certificate-header p {
  font-size: 11px;
  color: #555555;
  margin: 0;
}

.certificate-title {
  text-align: center;
  font-size: 22px;
  color: #a1824a;
  margin: 16px 0;
  font-weight: 700;
}

.certificate-recipient {
  text-align: center;
  font-size: 16px;
  margin-bottom: 12px;
}

.certificate-recipient strong {
  font-size: 20px;
  color: #111111;
  display: block;
  margin: 4px 0;
}

.certificate-body {
  text-align: center;
  font-size: 12px;
  line-height: 1.6;
  color: #444444;
  margin-bottom: 24px;
}

.certificate-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-top: 1px solid #e5d8c3;
  padding-top: 14px;
  font-size: 10px;
  color: #666666;
}

.nha-seal {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #a1824a;
  border: 2px dashed #ffffff;
  display: grid;
  place-items: center;
  color: #ffffff;
  font-weight: 800;
  font-size: 9px;
  transform: rotate(-15deg);
}

/* Slide-out Notification Drawer */
.notification-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.4);
}
.notification-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 380px;
  z-index: 310;
  background: var(--bg-card);
  border-left: 1px solid var(--border-color);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  animation: slideLeft 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.notification-drawer-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.notification-drawer-header h3 {
  font-size: 16px;
  font-weight: 750;
}
.notification-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}
.notification-item {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  margin-bottom: 8px;
  display: flex;
  gap: 10px;
  transition: background 0.2s;
}
.notification-item:hover {
  background: var(--bg-card-hover);
}
.notification-item.unread {
  border-left: 3px solid var(--accent-teal);
}
.notification-item-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 212, 170, 0.11);
  color: var(--accent-teal);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.notification-item-content {
  font-size: 11px;
}
.notification-item-content strong {
  display: block;
  font-size: 12px;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.notification-item-content span {
  color: var(--text-secondary);
}
.notification-item-content small {
  display: block;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Toast Success Banner */
.setu-toast {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  box-shadow: var(--surface-shadow);
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
  animation: toastFade 3s forwards;
}
.setu-toast svg {
  color: var(--accent-teal);
  width: 16px;
  height: 16px;
}

/* Prefilled and Selection Utilities */
.selected-card {
  border-color: var(--accent-teal) !important;
  background: rgba(0, 212, 170, 0.08) !important;
  box-shadow: 0 0 0 2px var(--accent-teal) !important;
}

.unauthorized-card {
  max-width: 480px;
  margin: 40px auto;
  padding: 30px;
  text-align: center;
}
.unauthorized-card svg {
  width: 48px;
  height: 48px;
  color: var(--danger);
  margin: 0 auto 16px;
}

/* Keyframes animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { transform: translateY(15px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes slideLeft {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
@keyframes toastFade {
  0% { transform: translate(-50%, 15px); opacity: 0; }
  10%, 90% { transform: translate(-50%, 0); opacity: 1; }
  100% { transform: translate(-50%, -10px); opacity: 0; }
}

/* ==========================================================================
   AESTHETIC EXTENSIONS & CUSTOM MODULE STYLING
   ========================================================================== */

/* Header Profile Menu Dropdown */
.profile-menu-container {
  position: relative;
  display: inline-block;
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 500;
  display: none;
  flex-direction: column;
  width: 250px;
  padding: 8px 0;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--surface-shadow);
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.profile-dropdown.is-open {
  display: flex;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  text-align: left;
  border: 0;
  background: transparent;
  width: 100%;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: rgba(0, 212, 170, 0.08);
  color: var(--accent-teal);
  outline: none;
}

.dropdown-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.dropdown-item:hover svg,
.dropdown-item:focus svg {
  color: var(--accent-teal);
}

.dropdown-divider {
  border: 0;
  border-top: 1px solid var(--border-color);
  margin: 6px 0;
}

/* Mobile Footer Responsive Fix (Critical) */
@media (max-width: 720px) {
  .site-footer {
    padding: 20px 14px 84px !important;
  }
  
  .footer-brand {
    grid-template-columns: 1fr !important;
    gap: 14px;
    text-align: center;
  }
  
  .footer-logo {
    flex-direction: column;
    align-items: center;
  }
  
  .footer-logo p {
    font-size: 12px;
  }
  
  .footer-trust {
    justify-content: center !important;
    gap: 6px;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 20px 12px !important;
    padding: 24px 0 16px !important;
  }
  
  .footer-grid section {
    gap: 8px;
  }
  
  .footer-grid h3 {
    font-size: 12px;
    border-bottom: 1px solid rgba(36, 68, 95, 0.4);
    padding-bottom: 4px;
    margin-bottom: 6px;
  }
  
  .footer-grid a {
    font-size: 12px;
    padding: 4px 0;
  }

  .footer-bottom {
    grid-template-columns: 1fr !important;
    text-align: center;
    gap: 12px;
    font-size: 11px;
  }
  
  .social-links {
    justify-content: center !important;
  }
}

/* Social media list in footer */
.social-links {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}

.social-links a:hover {
  border-color: var(--accent-teal);
  background: rgba(0, 212, 170, 0.1);
  color: var(--accent-teal);
  transform: translateY(-2px);
}

/* New Healthcare Modules Common Elements */
.med-grid, .lab-grid, .blood-grid, .hospital-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

/* Glassmorphic Cards */
.med-card, .lab-card, .blood-card, .hospital-card {
  display: flex;
  flex-direction: column;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: rgba(19, 40, 59, 0.72);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.med-card:hover, .lab-card:hover, .blood-card:hover, .hospital-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-teal);
  background: var(--bg-card-hover);
  box-shadow: var(--surface-shadow);
}

/* Medicine card specifics */
.med-image {
  width: 100%;
  height: 120px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg-secondary);
  margin-bottom: 12px;
  border: 1px solid var(--border-color);
}

.med-tag, .badge-status {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 2px 8px;
  font-size: 9px;
  font-weight: 800;
  border-radius: 4px;
  text-transform: uppercase;
}

.med-tag.prescription {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.med-tag.otc {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

/* Shopping Cart Drawer */
.cart-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 400;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(100%, 420px);
  height: 100%;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
  box-shadow: var(--surface-shadow);
  z-index: 450;
  display: flex;
  flex-direction: column;
  animation: slideLeft 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-primary);
}

.cart-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  position: relative;
}

.cart-item-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.quantity-controller {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.qty-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.qty-btn:hover {
  border-color: var(--accent-teal);
  background: rgba(0, 212, 170, 0.1);
}

.cart-footer {
  padding: 20px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  font-weight: 750;
  font-size: 15px;
}

/* Lab Booking Calendar Slots */
.slot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.slot-btn {
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.slot-btn.active {
  border-color: var(--accent-teal);
  background: rgba(0, 212, 170, 0.1);
  color: var(--accent-teal);
}

/* Blood Bank Donor Registry Table */
.donor-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 12px;
}

.donor-table th, .donor-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.donor-table th {
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-weight: 750;
}

.donor-table tr:hover td {
  background: rgba(0, 212, 170, 0.03);
}

/* Government Pledge Certificate Styled Frame */
.certificate-frame {
  position: relative;
  background: #fdfdfd;
  color: #1e293b;
  border: 8px double #10b981;
  border-radius: 4px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  font-family: 'Outfit', 'Georgia', serif;
  text-align: center;
  max-width: 580px;
  margin: 10px auto;
  overflow: hidden;
}

.certificate-watermark {
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' width='300' height='300' opacity='0.03'%3E%3Cpath d='M50 5 L95 25 L95 75 L50 95 L5 75 L5 25 Z' fill='%2310b981'/%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
  pointer-events: none;
}

.certificate-header h4 {
  color: #0f766e;
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.certificate-header p {
  color: #64748b;
  font-size: 9px;
  text-transform: uppercase;
  margin-top: 2px;
}

.certificate-title {
  color: #0d9488;
  font-size: 20px;
  font-weight: 800;
  margin: 18px 0;
  border-bottom: 2px solid #cbd5e1;
  padding-bottom: 8px;
}

.certificate-recipient {
  font-size: 12px;
  color: #475569;
}

.certificate-recipient strong {
  display: block;
  font-size: 18px;
  color: #0f172a;
  margin: 8px 0;
}

.certificate-body {
  font-size: 11px;
  line-height: 1.6;
  color: #475569;
  margin: 14px 0 20px;
  font-style: italic;
}

.certificate-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  text-align: left;
  border-top: 1px solid #e2e8f0;
  padding-top: 14px;
  font-size: 10px;
}

.nha-seal {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 2px dashed #10b981;
  color: #10b981;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 900;
  transform: rotate(-10deg);
}

/* ECG Graph Line Animation */
.ecg-line path {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: ecgSweep 4s linear infinite;
}

@keyframes ecgSweep {
  to {
    stroke-dashoffset: 0;
  }
}

/* Bluetooth sync pulsing animation */
.pulse-sync-icon {
  animation: syncPulse 1.5s infinite ease-in-out;
}

@keyframes syncPulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.6; }
  100% { transform: scale(1); opacity: 1; }
}

.sync-bar-progress {
  width: 0;
  height: 100%;
  background: var(--accent-teal);
  transition: width 0.1s linear;
}

/* Water logger CSS wave */
.water-tank {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  border: 2px solid var(--border-color);
  background: var(--bg-secondary);
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.water-wave {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(0deg, #0284c7, var(--accent-cyan));
  transition: height 0.5s ease-out;
}

.water-text {
  position: relative;
  z-index: 10;
  font-weight: 800;
  font-size: 13px;
  color: var(--text-primary);
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

/* Global Theme variables fallback overrides */
.route-card, .metric-card {
  transition: background-color 0.2s, border-color 0.2s;
}

.form-grid input, .form-grid select {
  background: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

.form-grid input:focus, .form-grid select:focus {
  border-color: var(--accent-teal) !important;
}

