/* VON24 Design System — complements Tailwind */

:root {
  --von-primary: #4f46e5;
  --von-primary-dark: #4338ca;
  --von-bg: #f8fafc;
  --von-card: #ffffff;
  --von-border: #e2e8f0;
  --von-text: #0f172a;
  --von-muted: #64748b;
  --von-sidebar: #0c1222;
  --von-sidebar-border: rgb(148 163 184 / 0.08);
  --von-sidebar-width: 260px;
  --von-sidebar-collapsed: 136px;
  --von-sidebar-transition: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.dark {
  --von-bg: #020617;
  --von-card: #0f172a;
  --von-border: #1e293b;
  --von-text: #f1f5f9;
  --von-muted: #94a3b8;
  --von-sidebar: #030712;
  --von-sidebar-border: rgb(148 163 184 / 0.1);
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--von-bg);
  color: var(--von-text);
}

.font-mono-clinical {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

.von-card {
  background: var(--von-card);
  border: 1px solid var(--von-border);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
}

.von-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 40px;
  padding: 0 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

.von-btn-primary {
  background: var(--von-primary);
  color: #fff;
}

.von-btn-primary:hover {
  background: var(--von-primary-dark);
}

.von-btn-secondary {
  background: transparent;
  border: 1px solid var(--von-border);
  color: var(--von-text);
}

.von-btn-secondary:hover {
  background: rgb(148 163 184 / 0.12);
}

.von-btn-danger {
  background: #e11d48;
  color: #fff;
}

.von-input {
  width: 100%;
  min-height: 40px;
  padding: 0 0.75rem;
  border-radius: 0.375rem;
  border: 1px solid var(--von-border);
  background: var(--von-card);
  color: var(--von-text);
}

.von-input:focus {
  outline: none;
  border-color: var(--von-primary);
  box-shadow: 0 0 0 2px rgb(79 70 229 / 0.25);
}

.von-table th {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--von-muted);
  background: rgb(248 250 252);
}

.dark .von-table th {
  background: rgb(30 41 59);
}

.von-table tbody tr:hover {
  background: rgb(148 163 184 / 0.08);
}

.von-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.von-badge-success { background: #d1fae5; color: #047857; }
.von-badge-warning { background: #fef3c7; color: #b45309; }
.von-badge-danger { background: #ffe4e6; color: #be123c; }
.von-badge-info { background: #e0e7ff; color: #4338ca; }

.von-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

.von-main-wrap {
  flex: 1;
  display: block;
  min-height: calc(100vh - 64px);
}

/* —— Premium SaaS sidebar —— */
.von-sidebar {
  width: var(--von-sidebar-width);
  background: linear-gradient(180deg, var(--von-sidebar) 0%, #0a0f1a 100%);
  color: #cbd5e1;
  position: fixed;
  inset: 0 auto 0 0;
  height: 100vh;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--von-sidebar-border);
  transition: width var(--von-sidebar-transition);
  overflow: hidden;
  z-index: 30;
  min-width: 0;
}

.von-sidebar.collapsed {
  width: var(--von-sidebar-collapsed);
  overflow: hidden;
}

.von-sidebar-brand-rail {
  flex-shrink: 0;
  padding: 1rem 0.5rem 0.85rem;
  display: flex;
  justify-content: center;
  border-bottom: 1px solid rgb(148 163 184 / 0.08);
}

.von-sidebar-brand-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.15rem 0;
  text-decoration: none;
  text-align: center;
  color: #fff;
}

.von-sidebar-brand-card:hover {
  color: #fff;
}

.von-sidebar-brand-emblem {
  width: 100%;
  display: flex;
  justify-content: center;
}

.von-sidebar-brand-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.von-sidebar-brand-card.is-logo-only {
  gap: 0;
}

.von-sidebar-brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: #fff;
  border-radius: 14px;
  padding: 0.35rem;
  transition: background var(--von-sidebar-transition);
}

.von-sidebar-brand-link:hover {
  background: rgb(255 255 255 / 0.04);
}

.von-sidebar-logo {
  flex-shrink: 0;
}

.von-sidebar-brand-rail .von-sidebar-logo-mark {
  width: 62px;
  height: 62px;
  border-radius: 18px;
}

.von-sidebar-logo-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  font-weight: 700;
  font-size: 1.125rem;
  color: #fff;
  box-shadow: 0 4px 14px rgb(99 102 241 / 0.45);
}

.von-sidebar-logo-mark--image {
  overflow: hidden;
  padding: 4px;
  background: #fff;
  box-shadow: 0 4px 16px rgb(15 23 42 / 0.14);
  border: 1px solid rgb(226 232 240 / 0.95);
}

.von-sidebar-brand-rail .von-sidebar-logo-mark--image {
  padding: 6px;
  box-shadow: 0 12px 28px rgb(15 23 42 / 0.2);
}

.von-sidebar-logo-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 10px;
}

.von-sidebar-brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  opacity: 1;
  transition: opacity var(--von-sidebar-transition), width var(--von-sidebar-transition);
}

.von-sidebar.collapsed .von-sidebar-brand-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
  pointer-events: none;
}

.von-sidebar-brand-name {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.von-sidebar-brand-copy .von-sidebar-brand-name {
  font-size: 0.78rem;
  line-height: 1.25;
  white-space: normal;
  word-break: break-word;
}

.von-sidebar-brand-tag {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  font-weight: 500;
}

.von-sidebar-brand-copy .von-sidebar-brand-tag {
  color: #94a3b8;
  font-size: 0.56rem;
}

/* Nav scroll */
.von-sidebar-nav {
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.85rem 0.5rem 0.65rem;
  scrollbar-width: thin;
  scrollbar-color: rgb(100 116 139 / 0.35) transparent;
}

.von-sidebar.collapsed .von-sidebar-nav {
  overflow-x: hidden;
  padding: 0.7rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

/* Nav items */
.von-nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 0.7rem 0.3rem 0.65rem;
  margin-bottom: 4px;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #94a3b8;
  text-decoration: none;
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  transition:
    color var(--von-sidebar-transition),
    background var(--von-sidebar-transition),
    transform var(--von-sidebar-transition),
    box-shadow var(--von-sidebar-transition),
    border-color var(--von-sidebar-transition);
}

.von-sidebar.collapsed .von-nav-item {
  width: 100%;
  min-height: 82px;
  height: auto;
  padding: 0.75rem 0.35rem 0.7rem;
  margin-bottom: 4px;
  border-radius: 14px;
  border-left: none;
  gap: 0.35rem;
}

.von-nav-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 10px;
  transition: transform var(--von-sidebar-transition), background var(--von-sidebar-transition);
}

.von-sidebar.collapsed .von-nav-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 14px;
}

.von-nav-icon {
  width: 1.5rem;
  height: 1.5rem;
}

.von-nav-label {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  text-align: center;
  line-height: 1.15;
  font-size: 0.69rem;
  opacity: 1;
  transition: opacity 0.15s ease;
}

.von-sidebar.collapsed .von-nav-label {
  opacity: 1;
  width: 100%;
  height: auto;
  overflow: visible;
  position: static;
  pointer-events: auto;
}

.von-nav-badge {
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 9999px;
  background: rgb(99 102 241 / 0.9);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.von-sidebar.collapsed .von-nav-badge:not(.von-nav-badge-dot) {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 0.5rem;
  width: 0.5rem;
  height: 0.5rem;
  padding: 0;
  font-size: 0;
}

.von-nav-badge-dot {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 8px;
  height: 8px;
  min-width: 0;
  padding: 0;
  background: #f43f5e;
  box-shadow: 0 0 0 2px var(--von-sidebar);
}

.von-nav-badge-dot:not([hidden]) {
  display: block;
}

/* Hover */
.von-nav-item:hover {
  color: #e2e8f0;
  background: rgb(255 255 255 / 0.05);
}

.von-sidebar.collapsed .von-nav-item:hover .von-nav-icon-wrap {
  transform: scale(1.05);
  background: rgb(255 255 255 / 0.06);
}

/* Active */
.von-nav-item.active {
  color: #fff;
  background: linear-gradient(90deg, rgb(99 102 241 / 0.35) 0%, rgb(99 102 241 / 0.08) 100%);
  border-left-color: #a5b4fc;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.06);
}

.von-sidebar.collapsed .von-nav-item.active {
  background: transparent;
  border-left: none;
  box-shadow: none;
}

.von-sidebar.collapsed .von-nav-item.active .von-nav-icon-wrap {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #a78bfa 100%);
  box-shadow:
    0 8px 24px rgb(99 102 241 / 0.45),
    0 0 0 1px rgb(255 255 255 / 0.12) inset;
  transform: scale(1.05);
  animation: von-nav-glow-pulse 2.5s ease-in-out infinite;
}

@keyframes von-nav-glow-pulse {
  0%,
  100% {
    box-shadow:
      0 8px 22px rgb(99 102 241 / 0.4),
      0 0 0 1px rgb(255 255 255 / 0.1) inset;
  }
  50% {
    box-shadow:
      0 10px 28px rgb(139 92 246 / 0.55),
      0 0 20px rgb(99 102 241 / 0.25),
      0 0 0 1px rgb(255 255 255 / 0.14) inset;
  }
}

.von-nav-item-btn {
  cursor: pointer;
  background: transparent;
  font: inherit;
  width: 100%;
  text-align: left;
}

.von-sidebar.collapsed .von-nav-item-btn {
  width: 48px;
}

/* Tooltips (collapsed only) */
.von-nav-tooltip {
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  background: #1e293b;
  color: #f8fafc;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  z-index: 100;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.35);
  border: 1px solid rgb(148 163 184 / 0.15);
  transition:
    opacity 0.15s ease,
    transform 0.15s ease,
    visibility 0.15s;
}

.dark .von-nav-tooltip {
  background: #f8fafc;
  color: #0f172a;
  border-color: rgb(15 23 42 / 0.1);
}

.von-sidebar .von-nav-tooltip {
  display: none;
}

.von-sidebar.collapsed .von-nav-item:hover .von-nav-tooltip,
.von-sidebar.collapsed .von-sidebar-user:hover .von-nav-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

/* Footer */
.von-sidebar-footer {
  flex-shrink: 0;
  padding: 0.25rem 0.5rem 1rem;
}

.von-sidebar.collapsed .von-sidebar-footer {
  padding: 0.25rem 0.4rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.von-sidebar-footer-actions {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.von-sidebar.collapsed .von-sidebar-footer-actions {
  align-items: center;
  width: 100%;
}

.von-sidebar-user {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  max-width: 100%;
  padding: 0.65rem 0.3rem;
  margin-top: 2px;
  border-radius: 14px;
  text-decoration: none;
  color: #cbd5e1;
  border: 1px solid transparent;
  transition:
    background var(--von-sidebar-transition),
    transform var(--von-sidebar-transition);
  position: relative;
}

.von-sidebar.collapsed .von-sidebar-user {
  width: 100%;
  min-height: 86px;
  height: auto;
  padding: 0.65rem 0.2rem;
  justify-content: center;
  margin-top: 4px;
}

.von-sidebar-user:hover {
  background: rgb(255 255 255 / 0.06);
  color: #fff;
}

.von-sidebar.collapsed .von-sidebar-user:hover {
  transform: scale(1.05);
}

.von-sidebar-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #334155, #475569);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 2px solid rgb(99 102 241 / 0.5);
  box-shadow: 0 4px 12px rgb(0 0 0 / 0.25);
}

.von-sidebar-avatar--photo {
  display: block;
  object-fit: cover;
  background: #fff;
  color: transparent;
}

.von-sidebar.collapsed .von-sidebar-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
}

.von-sidebar-user-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  width: 100%;
  text-align: center;
  opacity: 1;
  transition: opacity var(--von-sidebar-transition);
}

.von-sidebar.collapsed .von-sidebar-user-meta {
  opacity: 1;
  width: 100%;
  height: auto;
  overflow: visible;
  position: static;
  pointer-events: auto;
}

.von-sidebar-user-name {
  font-size: 0.72rem;
  font-weight: 600;
  color: #f1f5f9;
  line-height: 1.2;
}

.von-sidebar-user-action {
  font-size: 0.64rem;
  color: #64748b;
}

.von-content {
  flex: 1;
  overflow: auto;
  margin-left: var(--von-sidebar-collapsed);
  min-height: calc(100vh - 64px);
  padding: 1.5rem;
}

.von-topbar {
  height: 64px;
  width: calc(100% - var(--von-sidebar-collapsed));
  margin-left: var(--von-sidebar-collapsed);
  border-bottom: 1px solid var(--von-border);
  background: var(--von-card);
  display: flex;
  align-items: center;
  padding: 0 1rem;
  gap: 1rem;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 35;
}

.von-topbar-brand {
  flex-shrink: 0;
}

.von-topbar-brand--clinic-logo {
  width: var(--von-sidebar-collapsed);
  display: flex;
  justify-content: center;
}

.von-topbar-brand .von-sidebar-brand-link {
  color: var(--von-text);
  padding: 0;
  border-radius: 0;
}

.von-topbar-brand .von-sidebar-brand-link--logo-only {
  gap: 0;
  width: 100%;
  justify-content: center;
}

.von-topbar-brand--clinic-logo .von-sidebar-logo {
  display: flex;
  justify-content: center;
  width: 100%;
}

.von-topbar-brand--clinic-logo .von-sidebar-logo-mark {
  width: 52px;
  height: 52px;
  border-radius: 16px;
}

.von-topbar-brand--clinic-logo .von-sidebar-logo-mark--image {
  padding: 5px;
  box-shadow: 0 10px 24px rgb(15 23 42 / 0.12);
}

.von-topbar-brand .von-sidebar-brand-link:hover {
  background: transparent;
}

.von-topbar-brand .von-sidebar-brand-name {
  color: var(--von-text);
  white-space: nowrap;
}

.von-topbar-brand .von-sidebar-brand-tag {
  color: var(--von-muted);
}

.von-topbar-actions {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.von-topbar-context {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  overflow: hidden;
}

.von-topbar-context-title {
  max-width: 100%;
  color: var(--von-text);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.von-topbar-context-subtitle {
  max-width: 100%;
  color: var(--von-muted);
  font-size: 0.74rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.von-topbar-tools {
  min-width: 0;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.von-topbar-search {
  position: relative;
  display: flex;
  flex: 0 1 26rem;
  min-width: 18rem;
  width: min(30rem, 100%);
  max-width: 100%;
}

.von-topbar-search-box {
  position: relative;
  min-width: 0;
  width: 100%;
}

.von-topbar-search-box .von-input {
  padding-left: 2.5rem;
  padding-right: 2.5rem;
}

.von-topbar-search-icon,
.von-topbar-search-clear {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--von-muted);
}

.von-topbar-search-icon {
  left: 0.8rem;
  pointer-events: none;
}

.von-topbar-search-clear {
  right: 0.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 9999px;
  border: none;
  background: transparent;
  cursor: pointer;
}

.von-topbar-search-clear:hover {
  background: rgb(148 163 184 / 0.12);
  color: var(--von-text);
}

.von-topbar-search-panel {
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  z-index: 80;
  width: 100%;
  min-width: 20rem;
  max-width: min(34rem, calc(100vw - 2rem));
  background: var(--von-card);
  border: 1px solid var(--von-border);
  border-radius: 0.9rem;
  box-shadow: 0 14px 40px rgb(15 23 42 / 0.14);
  overflow: hidden;
}

.dark .von-topbar-search-panel {
  box-shadow: 0 14px 40px rgb(0 0 0 / 0.32);
}

.von-topbar-search-status {
  margin: 0;
  padding: 0.9rem 1rem 0.75rem;
  font-size: 0.8rem;
  color: var(--von-muted);
}

.von-topbar-search-results {
  max-height: 22rem;
  overflow-y: auto;
  padding: 0.35rem;
}

.von-topbar-search-row {
  padding: 0.8rem 1rem;
}

.von-topbar-search-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.8rem;
  border-radius: 0.85rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.von-topbar-search-card + .von-topbar-search-card {
  margin-top: 0.35rem;
}

.von-topbar-search-card:hover,
.von-topbar-search-card.is-active {
  background: rgb(238 242 255 / 0.72);
  border-color: rgb(165 180 252);
  transform: translateY(-1px);
}

.dark .von-topbar-search-card:hover,
.dark .von-topbar-search-card.is-active {
  background: rgb(30 41 59);
  border-color: rgb(79 70 229 / 0.5);
}

.von-topbar-search-avatar {
  width: 2.5rem;
  height: 2.5rem;
  margin-top: 0.05rem;
}

.von-topbar-search-body {
  flex: 1 1 auto;
  min-width: 0;
}

.von-topbar-search-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.von-topbar-search-uhid {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  background: rgb(224 231 255);
  color: rgb(67 56 202);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.28rem 0.55rem;
}

.dark .von-topbar-search-uhid {
  background: rgb(49 46 129 / 0.35);
  color: rgb(199 210 254);
}

.von-topbar-search-name {
  color: var(--von-text);
  font-size: 0.92rem;
  font-weight: 700;
}

.von-topbar-search-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.45rem;
}

.von-topbar-search-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 9999px;
  background: rgb(248 250 252);
  color: rgb(71 85 105);
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.34rem 0.55rem;
}

.dark .von-topbar-search-chip {
  background: rgb(30 41 59);
  color: rgb(203 213 225);
}

.von-topbar-search-chip.is-gender {
  color: rgb(79 70 229);
}

.von-topbar-search-chip.is-phone {
  color: rgb(14 116 144);
}

.von-topbar-search-chip-icon,
.von-topbar-search-address-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.von-topbar-search-address {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  margin-top: 0.45rem;
  color: var(--von-muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.von-topbar-search-address > span:last-child {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.von-topbar-search-action {
  flex: 0 0 auto;
  min-height: 2.4rem;
  padding: 0 0.8rem;
  margin-top: 0.1rem;
  border-radius: 0.75rem;
}

.von-topbar-search-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  min-height: 5rem;
  color: var(--von-muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.von-topbar-search-loader {
  width: 3rem;
  height: 0.65rem;
}

.von-topbar-search-loading-copy {
  white-space: nowrap;
}

.clinic-add-appt-trigger {
  white-space: nowrap;
}

.von-topbar-user-photo {
  display: block;
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  object-fit: cover;
  border: 1px solid rgb(224 231 255);
  background: #fff;
}

.von-topbar-user-menu {
  position: relative;
  flex: 0 0 auto;
  padding-left: 0.5rem;
  border-left: 1px solid var(--von-border);
}

.von-topbar-user-trigger {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.25rem 0.45rem 0.25rem 0.35rem;
  border-radius: 0.9rem;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  transition: background 0.18s ease, box-shadow 0.18s ease;
}

.von-topbar-user-trigger:hover,
.von-topbar-user-menu:focus-within .von-topbar-user-trigger {
  background: rgb(148 163 184 / 0.08);
}

.von-topbar-user-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  line-height: 1.15;
}

.von-topbar-user-name {
  max-width: 8.5rem;
  color: var(--von-text);
  font-size: 0.96rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.von-topbar-user-role {
  max-width: 8.5rem;
  color: var(--von-muted);
  font-size: 0.74rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.von-topbar-user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 0.45rem);
  z-index: 75;
  min-width: 12rem;
  padding: 0.45rem;
  border: 1px solid var(--von-border);
  border-radius: 0.9rem;
  background: var(--von-card);
  box-shadow: 0 14px 32px rgb(15 23 42 / 0.14);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.von-topbar-user-menu:hover .von-topbar-user-dropdown,
.von-topbar-user-menu:focus-within .von-topbar-user-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.von-topbar-user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  min-height: 2.5rem;
  padding: 0.55rem 0.7rem;
  border-radius: 0.7rem;
  color: var(--von-text);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
}

.von-topbar-user-dropdown-item:hover {
  background: rgb(148 163 184 / 0.09);
}

.von-topbar-user-dropdown-icon {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  color: var(--von-muted);
}

.dark .von-topbar-user-dropdown {
  box-shadow: 0 14px 32px rgb(0 0 0 / 0.35);
}

.dark .von-topbar-user-trigger:hover,
.dark .von-topbar-user-menu:focus-within .von-topbar-user-trigger {
  background: rgb(30 41 59 / 0.8);
}

.dark .von-topbar-user-dropdown-item:hover {
  background: rgb(30 41 59);
}

/* Side drawer: light blur */
.von-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgb(15 23 42 / 0.35);
  backdrop-filter: blur(2px);
  z-index: 40;
}

/* Center modals: dim only — no blur; panel stacks above overlay for clicks */
.von-modal-host {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  pointer-events: none;
}

.von-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgb(15 23 42 / 0.45);
  z-index: 0;
  pointer-events: auto;
}

.von-modal-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-height: 85vh;
  overflow: auto;
  pointer-events: auto;
  box-shadow: 0 20px 50px rgb(15 23 42 / 0.2);
}

.von-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(640px, 100vw);
  background: var(--von-card);
  border-left: 1px solid var(--von-border);
  z-index: 50;
  box-shadow: -8px 0 24px rgb(15 23 42 / 0.12);
}

.von-mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--von-card);
  border-top: 1px solid var(--von-border);
  z-index: 30;
}

@media (max-width: 767px) {
  .von-sidebar {
    display: none !important;
  }

  .von-sidebar.mobile-open {
    display: flex !important;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 60;
    width: var(--von-sidebar-width) !important;
    box-shadow: 8px 0 32px rgb(0 0 0 / 0.35);
  }

  .von-sidebar.mobile-open.collapsed {
    width: var(--von-sidebar-width) !important;
  }

  .von-sidebar.mobile-open .von-nav-label,
  .von-sidebar.mobile-open .von-sidebar-brand-text,
  .von-sidebar.mobile-open .von-sidebar-user-meta {
    opacity: 1;
    width: auto;
    height: auto;
    position: static;
    pointer-events: auto;
  }

  .von-sidebar.mobile-open .von-nav-item {
    width: auto;
    height: auto;
    flex-direction: row;
    justify-content: flex-start;
    padding: 0.5rem 0.75rem;
    margin-bottom: 2px;
    gap: 0.75rem;
  }

  .von-sidebar.mobile-open .von-nav-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .von-sidebar.mobile-open .von-nav-label {
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.875rem;
  }

  .von-sidebar.mobile-open .von-nav-tooltip {
    display: none;
  }
  .von-mobile-nav { display: flex; }
  .von-content { padding-bottom: 5rem; }
  .von-topbar {
    width: 100%;
    margin-left: 0;
    gap: 0.75rem;
    padding: 0 0.75rem;
  }

  .von-topbar-actions {
    gap: 0.4rem;
  }

  .von-topbar-context {
    min-width: 8rem;
  }

  .von-topbar-context-subtitle {
    display: none;
  }

  .von-topbar-tools {
    gap: 0.4rem;
  }

  .von-topbar-user-trigger {
    gap: 0.55rem;
    padding-right: 0.3rem;
  }

  .von-topbar-user-name {
    max-width: 6rem;
  }

  .von-topbar-user-role {
    max-width: 6rem;
  }

  .von-topbar-brand .von-sidebar-brand-text {
    display: none;
  }

  .clinic-add-appt-trigger {
    min-height: 36px;
    padding: 0 0.75rem;
  }

  .von-topbar-search {
    flex-basis: 14rem;
    min-width: 12rem;
    width: min(16rem, 52vw);
  }

  .von-content {
    margin-left: 0;
    min-height: 0;
  }
}

@media (min-width: 768px) {
  .von-mobile-nav { display: none !important; }
}

.von-notify-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  z-index: 70;
  width: min(22rem, calc(100vw - 2rem));
  background: var(--von-card);
  border: 1px solid var(--von-border);
  border-radius: 0.75rem;
  box-shadow: 0 10px 40px rgb(15 23 42 / 0.12);
  overflow: hidden;
}

.dark .von-notify-panel {
  box-shadow: 0 10px 40px rgb(0 0 0 / 0.35);
}

.von-notify-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--von-border);
}

.von-notify-list {
  max-height: 18rem;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 0;
}

.von-notify-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  text-align: left;
  border: none;
  background: transparent;
  cursor: pointer;
  border-bottom: 1px solid var(--von-border);
}

.von-notify-item:hover {
  background: rgb(148 163 184 / 0.08);
}

.von-notify-item.unread {
  background: rgb(79 70 229 / 0.06);
}

.von-notify-dot {
  flex-shrink: 0;
  width: 0.5rem;
  height: 0.5rem;
  margin-top: 0.35rem;
  border-radius: 9999px;
  background: #f43f5e;
}

.von-notify-panel-footer {
  padding: 0.5rem 1rem;
  border-top: 1px solid var(--von-border);
}

/* Appointment calendar grids (no Tailwind arbitrary classes — CDN-safe) */
.von-cal-day-rows {
  border: 1px solid var(--von-border);
  border-radius: 0.5rem;
  overflow: hidden;
  background: var(--von-card);
}

.von-cal-day-row {
  display: flex;
  align-items: stretch;
  border-top: 1px solid var(--von-border);
  min-height: 56px;
}

.von-cal-day-row:first-child {
  border-top: none;
}

.von-cal-day-time {
  width: 80px;
  flex-shrink: 0;
  padding: 0.75rem 0.5rem;
  font-size: 0.75rem;
  color: #64748b;
  background: rgb(248 250 252);
  border-right: 1px solid var(--von-border);
}

.dark .von-cal-day-time {
  background: rgb(30 41 59);
  color: #94a3b8;
}

.von-cal-day-slot {
  flex: 1;
  position: relative;
  min-height: 56px;
  min-width: 0;
  padding: 4px 8px;
  cursor: pointer;
  background: var(--von-card);
}

.von-cal-day-slot:hover {
  background: rgb(238 242 255 / 0.6);
}

.von-cal-appt-chip {
  position: absolute;
  left: 8px;
  right: 8px;
  border-radius: 0.5rem;
  border-width: 1px;
  border-style: solid;
  padding: 0.35rem 0.5rem;
  font-size: 0.75rem;
  line-height: 1.25;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.von-cal-slot {
  cursor: pointer;
}

.von-cal-slot:hover {
  background: rgb(148 163 184 / 0.06);
}

.von-cal-week-head,
.von-cal-week-row {
  display: grid;
  grid-template-columns: 56px repeat(7, minmax(0, 1fr));
}

.von-cal-week-cell {
  position: relative;
  min-height: 48px;
  border-top: 1px solid var(--von-border);
  border-left: 1px solid var(--von-border);
  cursor: pointer;
  background: var(--von-card);
}

.von-cal-week-cell:hover {
  background: rgb(238 242 255 / 0.5);
}

.von-cal-time-gutter {
  min-width: 56px;
}

.von-cal-day-head {
  background: var(--von-card);
}

.von-cal-today {
  outline: 2px solid rgb(79 70 229 / 0.35);
  outline-offset: -2px;
}

.von-cal-other-month {
  background: rgb(248 250 252);
  color: rgb(148 163 184);
}

.dark .von-cal-other-month {
  background: rgb(15 23 42 / 0.5);
  color: rgb(100 116 139);
}

.von-cal-month-cell {
  transition: background 0.15s ease;
}

.von-cal-month-cell:hover {
  background: rgb(238 242 255 / 0.5);
}

.von-appt-detail-field {
  padding: 0.5rem 0;
}

.von-appt-detail-field dd {
  margin: 0;
}

/* Doctor dashboard — quick actions */
.von-quick-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .von-quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .von-quick-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.von-quick-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  text-align: left;
  background: var(--von-card);
  border: 1px solid var(--von-border);
  border-radius: 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  cursor: pointer;
  width: 100%;
}

a.von-quick-card {
  text-decoration: none;
  color: inherit;
}

.von-quick-card:hover {
  border-color: var(--von-primary);
  box-shadow: 0 4px 14px rgb(79 70 229 / 0.12);
  transform: translateY(-1px);
}

.von-quick-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 10px;
  background: rgb(238 242 255);
  color: var(--von-primary);
}

.dark .von-quick-icon {
  background: rgb(49 46 129 / 0.35);
  color: rgb(165 180 252);
}

.von-quick-body {
  flex: 1;
  min-width: 0;
}

.von-quick-title {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--von-text);
  line-height: 1.3;
}

.von-quick-desc {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.75rem;
  color: var(--von-muted);
  line-height: 1.35;
}

.von-quick-badge {
  flex-shrink: 0;
  min-width: 1.75rem;
  height: 1.75rem;
  padding: 0 0.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: var(--von-primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

.von-fav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.von-fav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--von-border);
  background: transparent;
  cursor: pointer;
  transition: background 0.15s ease;
}

.von-fav-item:hover {
  background: rgb(238 242 255 / 0.6);
}

.dark .von-fav-item:hover {
  background: rgb(49 46 129 / 0.2);
}

.von-fav-avatar {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  background: rgb(224 231 255);
  color: var(--von-primary);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.von-search-modal {
  max-width: 32rem;
  background: var(--von-card);
  border-radius: 12px;
  border: 1px solid var(--von-border);
}

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

.von-search-results {
  max-height: 50vh;
  overflow-y: auto;
}

.von-search-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1.25rem;
  border: none;
  border-bottom: 1px solid var(--von-border);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.von-search-row:hover {
  background: rgb(248 250 252);
}

.dark .von-search-row:hover {
  background: rgb(30 41 59);
}

.von-pws-fav-btn {
  padding: 0.35rem;
  border-radius: 8px;
  color: rgb(148 163 184);
  transition: color 0.15s ease, background 0.15s ease;
}

.von-pws-fav-btn:hover {
  color: rgb(245 158 11);
  background: rgb(254 243 199 / 0.4);
}

.von-pws-fav-btn.is-favorite {
  color: rgb(245 158 11);
}

/* Only hide Alpine-controlled overlays until hydrated */
[x-cloak].von-alpine-cloak { display: none !important; }

/* Messaging Center */
.von-msg-thread {
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.von-msg-thread:hover {
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
}
