/* Healthcare Dashboard — compact single-viewport density */

body.ia-body.nexa-dash-body {
  height: 100dvh;
  max-height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.nexa-dash-body .ia-app,
.nexa-dash-body.ia-body .ia-app.ia-copilot,
.nexa-dash-body .ia-copilot.ia-app {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden !important;
}

.nexa-dash-body .ia-sidebar {
  position: sticky;
  top: 0;
  align-self: stretch;
  height: 100%;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.nexa-dash-main {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--ia-bg, #f0f4f9);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* Main scrolls when needed; cards stay content-sized (no viewport fill) */

/* ——— Header ——— */
.nexa-dash-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.45rem 1rem;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--ia-border, #e2e8f0);
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(14px);
  flex-shrink: 0;
}

.nexa-dash-greeting h1 {
  margin: 0;
  font-size: clamp(0.95rem, 1.35vw, 1.1rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ia-navy, #0f172a);
  line-height: 1.2;
}

.nexa-dash-greeting p {
  margin: 0.05rem 0 0;
  color: var(--ia-muted, #64748b);
  font-size: 0.68rem;
  font-weight: 500;
}

.nexa-dash-search {
  flex: 0 1 280px;
  max-width: 280px;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--ia-border, #e2e8f0);
  background: #f8fafc;
  color: var(--ia-muted, #64748b);
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  text-align: left;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.nexa-dash-search span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nexa-dash-search:hover {
  border-color: rgba(14, 165, 183, 0.32);
  background: #fff;
  color: var(--ia-navy, #0f172a);
}

.nexa-dash-search .ia-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--ia-primary, #21c3d6);
  opacity: 0.85;
}

.nexa-dash-top-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.nexa-doctor-profile {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.22rem 0.65rem 0.22rem 0.22rem;
  border-radius: 999px;
  border: 1px solid var(--ia-border, #e2e8f0);
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.nexa-doctor-profile__avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  object-fit: cover;
  object-position: center top;
  display: block;
  flex-shrink: 0;
  background: linear-gradient(135deg, #0ea5b7, #21c3d6);
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(14, 165, 183, 0.35);
}

.nexa-doctor-profile__meta {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  line-height: 1.1;
  padding-right: 0.2rem;
  min-width: 0;
}

.nexa-doctor-profile__meta strong {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ia-navy, #0f172a);
  letter-spacing: -0.01em;
}

.nexa-doctor-profile__role {
  font-size: 0.58rem;
  font-weight: 600;
  color: var(--ia-muted, #64748b);
}

/* Legacy AI status styles kept for safety if referenced elsewhere */
.nexa-ai-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.55rem 0.25rem 0.28rem;
  border-radius: 999px;
  border: 1px solid var(--ia-border, #e2e8f0);
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.nexa-ai-status:hover {
  border-color: rgba(14, 165, 183, 0.35);
  box-shadow: 0 3px 10px rgba(14, 165, 183, 0.1);
}

.nexa-ai-status__mark {
  width: 1.45rem !important;
  height: 1.45rem !important;
  border-radius: 999px !important;
}

.nexa-ai-status__mark .ia-icon {
  width: 11px !important;
  height: 11px !important;
}

.nexa-ai-status__meta {
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1.1;
  padding-right: 0.15rem;
}

.nexa-ai-status__meta strong {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--ia-navy, #0f172a);
}

.nexa-ai-status__online {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.58rem;
  font-weight: 600;
  color: #059669;
}

/* ——— Content ——— */
.nexa-dash-content {
  padding: 0.75rem 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: min(1220px, 100%);
  margin: 0 auto;
  flex: 0 0 auto;
  height: auto;
  min-height: 0;
}

.nexa-dash-section-title {
  margin: 0 0 0.28rem;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--ia-navy, #0f172a);
  letter-spacing: -0.01em;
}

/* ——— Quick Actions ——— */
.nexa-qa-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
}

.nexa-qa-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.5rem;
  border-radius: 10px;
  border: 1px solid var(--ia-border, #e2e8f0);
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.nexa-qa-card .ia-icon-wrap {
  display: grid !important;
  place-items: center;
  place-content: center;
  width: 1.65rem;
  height: 1.65rem;
  min-width: 1.65rem;
  min-height: 1.65rem;
  border-radius: 8px;
  line-height: 0;
}

.nexa-qa-card .ia-icon-wrap > .ia-icon,
.nexa-qa-card .ia-icon-wrap > svg {
  width: 13px;
  height: 13px;
  margin: 0;
}

.nexa-qa-card:hover {
  border-color: rgba(14, 165, 183, 0.28);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}

.nexa-qa-card:active {
  transform: translateY(0);
}

.nexa-qa-card strong {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ia-navy, #0f172a);
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.nexa-qa-card span {
  display: block;
  margin-top: 0.02rem;
  font-size: 0.6rem;
  color: var(--ia-muted, #64748b);
  font-weight: 500;
  line-height: 1.2;
}

/* ——— Mid grid ——— */
.nexa-dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 0.85fr;
  gap: 0.75rem;
  align-items: stretch;
  grid-auto-rows: auto;
  height: auto;
  flex: 0 0 auto;
}

/* Bottom row: content-driven heights — do not fill leftover viewport */
.nexa-dash-grid--bottom {
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  align-items: start;
  flex: 0 0 auto;
  min-height: 0;
  height: auto;
}

.nexa-card {
  background: #fff;
  border: 1px solid var(--ia-border, #e2e8f0);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 0;
}

/* Top mid-grid cards share row height; bottom cards hug content */
.nexa-dash-grid:not(.nexa-dash-grid--bottom) > .nexa-card {
  align-self: stretch;
}

.nexa-dash-grid--bottom > .nexa-card,
.nexa-dash-grid--bottom > .nexa-ai-panel {
  align-self: start;
  height: auto;
}

.nexa-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.nexa-card__head h2 {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ia-navy, #0f172a);
  letter-spacing: -0.015em;
}

.nexa-card__eyebrow {
  font-size: 0.58rem;
  font-weight: 600;
  color: var(--ia-muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ——— Metrics ——— */
.nexa-overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem;
}

.nexa-metric {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.25rem;
  padding: 0.35rem 0.4rem;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #eef2f7;
}

.nexa-metric strong {
  display: block;
  font-size: 1.05rem;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--ia-navy, #0f172a);
  font-weight: 700;
}

.nexa-metric > div > span {
  display: block;
  margin-top: 0.06rem;
  font-size: 0.62rem;
  color: var(--ia-slate, #334155);
  font-weight: 600;
}

.nexa-metric__hint {
  display: block;
  margin-top: 0.08rem;
  font-size: 0.55rem;
  font-style: normal;
  color: var(--ia-muted, #64748b);
  font-weight: 500;
  line-height: 1.2;
}

.nexa-metric .ia-icon-wrap {
  display: grid !important;
  place-items: center;
  place-content: center;
  width: 1.3rem;
  height: 1.3rem;
  min-width: 1.3rem;
  min-height: 1.3rem;
  line-height: 0;
}

.nexa-metric .ia-icon-wrap > .ia-icon,
.nexa-metric .ia-icon-wrap > svg {
  width: 11px;
  height: 11px;
  margin: 0;
}

/* ——— Lists ——— */
.nexa-appt-list,
.nexa-activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.nexa-appt-item,
.nexa-activity-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.28rem 0.15rem;
  border: none;
  border-bottom: 1px solid #f1f5f9;
  background: transparent;
  font: inherit;
  text-align: left;
  color: inherit;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.nexa-appt-item:last-child,
.nexa-activity-item:last-child {
  border-bottom: none;
}

.nexa-appt-item:hover,
.nexa-activity-item:hover {
  background: #f8fafc;
}

.nexa-appt-item__time {
  min-width: 3.7rem;
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--ia-primary, #21c3d6);
}

.nexa-appt-item__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.04rem;
}

.nexa-appt-item__name {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ia-navy, #0f172a);
  line-height: 1.15;
}

.nexa-appt-item__meta {
  font-size: 0.58rem;
  color: var(--ia-muted, #64748b);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.nexa-appt-status {
  display: inline-flex;
  align-items: center;
  padding: 0.05rem 0.3rem;
  border-radius: 999px;
  font-size: 0.55rem;
  font-weight: 700;
  background: #ecfdf5;
  color: #047857;
  text-transform: capitalize;
}

.nexa-appt-status--pending,
.nexa-appt-status--scheduled {
  background: #eff6ff;
  color: #1d4ed8;
}

.nexa-appt-status--cancelled {
  background: #fef2f2;
  color: #b91c1c;
}

.nexa-appt-item__chevron {
  color: var(--ia-muted, #64748b);
  opacity: 0.7;
}

.nexa-activity-item__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.02rem;
}

.nexa-activity-item__title {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ia-navy, #0f172a);
  line-height: 1.2;
}

.nexa-activity-item__sub {
  font-size: 0.58rem;
  color: var(--ia-muted, #64748b);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nexa-activity-item__time {
  font-size: 0.58rem;
  color: var(--ia-muted, #64748b);
  white-space: nowrap;
  font-weight: 500;
}

.nexa-empty {
  margin: 0;
  padding: 0.4rem 0.2rem;
  color: var(--ia-muted, #64748b);
  font-size: 0.7rem;
  text-align: center;
}

.nexa-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  padding: 0.45rem 0.35rem;
  text-align: center;
}

.nexa-empty-state__icon {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 8px;
  background: #f1f5f9;
  color: var(--ia-muted, #64748b);
  margin-bottom: 0.05rem;
}

.nexa-empty-state__icon .ia-icon {
  width: 13px;
  height: 13px;
}

.nexa-empty-state strong {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ia-slate, #334155);
}

.nexa-empty-state span {
  display: block;
  font-size: 0.62rem;
  color: var(--ia-muted, #64748b);
  font-weight: 500;
}

/* ——— NABH ——— */
.nexa-nabh {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.2rem;
  padding: 0;
}

.nexa-nabh-ring {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 0.05rem 0 0.1rem;
}

.nexa-nabh-ring svg {
  width: 72px;
  height: 72px;
  transform: rotate(-90deg);
}

.nexa-nabh-ring__label {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}

.nexa-nabh-ring__label strong {
  font-size: 0.95rem;
  letter-spacing: -0.03em;
  color: var(--ia-navy, #0f172a);
  font-weight: 700;
}

.nexa-nabh-ring__label span {
  display: block;
  font-size: 0.5rem;
  color: var(--ia-muted, #64748b);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.nexa-nabh__title {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ia-navy, #0f172a);
}

.nexa-nabh__meta {
  margin: 0;
  font-size: 0.6rem;
  color: var(--ia-muted, #64748b);
  font-weight: 500;
  max-width: 11rem;
  line-height: 1.3;
}

.nexa-nabh__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.2rem;
  padding: 0.28rem 0.7rem;
  border-radius: 7px;
  border: 1px solid rgba(14, 165, 183, 0.22);
  background: var(--ia-primary-soft, #e6fafc);
  color: var(--ia-primary-dark, #0ea5b7);
  font-size: 0.66rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.nexa-nabh__btn:hover {
  background: #d5f5f9;
  border-color: rgba(14, 165, 183, 0.4);
  text-decoration: none;
}

/* ——— AI panel ——— */
.nexa-ai-panel {
  border-radius: 12px;
  border: 1px solid rgba(14, 165, 183, 0.16);
  background:
    linear-gradient(180deg, #f8fbff 0%, #fff 48%),
    #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  padding: 0.85rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0;
  height: auto;
  align-self: start;
}

.nexa-ai-panel__head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.35rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid #eef2f7;
}

.nexa-ai-panel__head .ia-nexa-icon-wrap--panel {
  flex-shrink: 0;
}

.nexa-ai-panel__head .ia-ai-mark {
  display: none;
}

.nexa-ai-panel__head h2 {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ia-navy, #0f172a);
  letter-spacing: -0.02em;
}

.nexa-ai-panel__head p {
  margin: 0.04rem 0 0;
  color: var(--ia-muted, #64748b);
  font-size: 0.64rem;
  font-weight: 500;
}

.nexa-ai-panel__prompt {
  margin: 0 0 0.3rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ia-slate, #334155);
}

.nexa-ai-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 0.4rem;
}

.nexa-ai-chip {
  border: 1px solid var(--ia-border, #e2e8f0);
  background: #fff;
  color: var(--ia-slate, #334155);
  border-radius: 999px;
  padding: 0.2rem 0.5rem;
  font: inherit;
  font-size: 0.62rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.nexa-ai-chip:hover {
  border-color: rgba(14, 165, 183, 0.35);
  background: var(--ia-primary-soft, #e6fafc);
  color: var(--ia-primary-dark, #0ea5b7);
}

.nexa-ai-form {
  display: flex;
  gap: 0.35rem;
  align-items: stretch;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.nexa-ai-form input {
  flex: 1;
  min-width: 0;
  height: 2.35rem;
  border: 1px solid var(--ia-border, #e2e8f0);
  border-radius: 10px;
  padding: 0 0.7rem;
  font: inherit;
  font-size: 0.74rem;
  background: #fff;
  color: var(--ia-navy, #0f172a);
  box-sizing: border-box;
}

.nexa-ai-form input:focus {
  outline: none;
  border-color: var(--ia-primary, #21c3d6);
  box-shadow: 0 0 0 2px rgba(14, 165, 183, 0.14);
}

.nexa-ai-form:focus-within {
  box-shadow: none;
}

.nexa-ai-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  border: none;
  border-radius: 10px;
  height: 2.35rem;
  padding: 0 0.85rem;
  background: var(--ia-primary, #21c3d6);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 0.68rem;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(14, 165, 183, 0.22);
  transition: background 0.15s ease;
  box-sizing: border-box;
}

.nexa-ai-form button:hover {
  background: var(--ia-primary-dark, #0ea5b7);
}

.nexa-ai-form button .ia-icon {
  width: 12px;
  height: 12px;
}

/* Sidebar assistant card removed — Chat with Nexa is a floating FAB */

/* ——— Responsive ——— */
@media (max-width: 1180px) {
  .nexa-qa-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .nexa-qa-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nexa-dash-grid {
    grid-template-columns: 1fr 1fr;
  }

  .nexa-dash-grid .nexa-card--nabh {
    grid-column: 1 / -1;
  }

  .nexa-dash-grid--bottom {
    grid-template-columns: 1fr;
  }

  .nexa-dash-main {
    overflow-y: auto;
  }
}

@media (max-width: 900px) {
  .nexa-dash-body .ia-sidebar {
    position: fixed;
    z-index: 200;
    height: 100dvh;
    max-height: 100dvh;
  }

  .nexa-dash-main {
    width: 100%;
  }

  .nexa-dash-topbar {
    flex-wrap: wrap;
  }

  .nexa-dash-search {
    order: 3;
    max-width: none;
    flex: 1 1 100%;
    width: 100%;
  }
}

@media (max-width: 720px) {
  .nexa-qa-grid,
  .nexa-dash-grid,
  .nexa-overview-grid {
    grid-template-columns: 1fr;
  }

  .nexa-dash-content {
    padding: 0.55rem 0.7rem;
  }
}
