/* QLive Premium — flagship tier.
   Luxury spacing, larger type, softer surfaces, deeper motion. This should read
   as a complete clinic operating system rather than a queue tool. */

:root {
  --sidebar-w: 258px;
  --topbar-h: 70px;
  --lux: clamp(20px, 2.6vw, 34px);
}

.tier-premium body, body.tier-premium { letter-spacing: -.005em; }

.tier-premium .app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.tier-premium .topbar {
  grid-column: 1 / -1;
  padding-inline: var(--lux);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
}
.tier-premium .brand { font-size: 1.14rem; }
.tier-premium .brand-sub {
  background: linear-gradient(120deg, var(--brand), var(--violet));
  color: #fff; border: 0; letter-spacing: .18em;
}

.tier-premium .sidebar {
  border-right: 1px solid var(--line);
  background: var(--surface);
  padding: var(--lux) 16px;
  position: sticky; top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
}
.tier-premium .sidebar-label {
  font-family: var(--font-mono); font-size: .6rem; letter-spacing: .2em;
  text-transform: uppercase; color: var(--faint); font-weight: 600;
  padding: 0 12px; margin: 26px 0 10px;
}
.tier-premium .sidebar-label:first-child { margin-top: 0; }
.tier-premium .sidebar a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 13px; border-radius: var(--r-md);
  font-size: .9rem; font-weight: 550; color: var(--muted);
  margin-bottom: 3px; position: relative;
  transition: background-color .3s var(--ease), color .3s, transform .4s var(--ease);
}
.tier-premium .sidebar a svg { width: 18px; height: 18px; flex: none; }
.tier-premium .sidebar a:hover { background: var(--surface-2); color: var(--ink); transform: translateX(3px); }
.tier-premium .sidebar a[aria-current="page"] {
  background: linear-gradient(100deg, var(--brand-tint), transparent);
  color: var(--brand-text); font-weight: 650;
}
.tier-premium .sidebar a[aria-current="page"]::before {
  content: ""; position: absolute; left: 0; top: 22%; bottom: 22%;
  width: 3px; border-radius: 3px; background: var(--brand);
}

.tier-premium .main { grid-column: 2; max-width: none; padding: var(--lux); }
.tier-premium .page-head { margin-bottom: var(--lux); }
.tier-premium .page-head h1 { font-size: clamp(1.7rem, 3.4vw, 2.35rem); letter-spacing: -.045em; }
.tier-premium .page-head p { font-size: .95rem; margin-top: 6px; }

@media (max-width: 940px) {
  .tier-premium .app { grid-template-columns: 1fr; }
  .tier-premium .sidebar {
    position: static; height: auto; border-right: 0;
    border-bottom: 1px solid var(--line);
    display: flex; gap: 6px; overflow-x: auto; padding: 12px;
  }
  .tier-premium .sidebar-label, .tier-premium .sidebar-foot { display: none; }
  .tier-premium .sidebar a { margin-bottom: 0; white-space: nowrap; }
  .tier-premium .sidebar a[aria-current="page"]::before { display: none; }
  .tier-premium .main { grid-column: 1; }
}

/* ---- Surfaces ---- */
.tier-premium .panel {
  border-radius: var(--r-xl);
  box-shadow: 0 1px 2px rgba(10,15,28,.04), 0 12px 32px -20px rgba(10,15,28,.22);
  border-color: var(--line-soft);
}
[data-theme="dark"] .tier-premium .panel { box-shadow: 0 18px 40px -24px rgba(0,0,0,.8); }
.tier-premium .panel-head { padding: 18px 22px; background: transparent; border-bottom: 1px solid var(--line-soft); }
.tier-premium .panel-title { font-size: 1rem; }
.tier-premium .panel-body { padding: 22px; }

.tier-premium .stat {
  border-radius: var(--r-xl); padding: 22px;
  border-color: var(--line-soft);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(10,15,28,.04);
}
.tier-premium .stat-value { font-size: clamp(1.8rem, 3.6vw, 2.4rem); }
.tier-premium .stat-label { font-size: .8rem; margin-bottom: 14px; }

/* ---- Doctor command cards ---- */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.doc-card {
  border-radius: var(--r-xl);
  border: 1px solid var(--line-soft);
  background: var(--surface);
  overflow: hidden;
  transition: border-color .35s, box-shadow .45s var(--ease), transform .45s var(--ease);
}
.doc-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.doc-card.is-active { border-color: color-mix(in srgb, var(--brand) 34%, transparent); }
.doc-card.is-paused { opacity: .72; border-color: color-mix(in srgb, var(--amber) 40%, transparent); }
.doc-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px; border-bottom: 1px solid var(--line-soft);
}
.doc-avatar {
  width: 42px; height: 42px; border-radius: 13px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--brand), var(--brand-600));
  color: #fff; font-family: var(--font-display); font-weight: 750; font-size: .84rem;
}
.doc-name { font-family: var(--font-display); font-weight: 700; color: var(--ink); font-size: .96rem; letter-spacing: -.02em; }
.doc-meta { font-size: .765rem; color: var(--faint); }
.doc-body { padding: 18px; }
.doc-token {
  font-family: var(--font-mono); font-weight: 700; line-height: 1;
  font-size: clamp(2.4rem, 5vw, 3rem); letter-spacing: -.05em; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.doc-patient { font-size: .9rem; color: var(--text); margin-top: 6px; font-weight: 550; }
.doc-sub { font-size: .78rem; color: var(--faint); }
.doc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.doc-queue { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.doc-queue-row {
  display: flex; align-items: center; gap: 10px; padding: 7px 0;
  font-size: .82rem; color: var(--muted);
}
.doc-queue-row .t { font-family: var(--font-mono); font-weight: 700; color: var(--brand-text); min-width: 34px; }
.doc-queue-row .n { flex: 1; color: var(--text); }

/* ---- Patient profile ---- */
.profile-head { display: flex; gap: 18px; align-items: center; margin-bottom: 20px; }
.profile-avatar {
  width: 64px; height: 64px; border-radius: 20px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--brand), var(--violet));
  color: #fff; font-family: var(--font-display); font-weight: 750; font-size: 1.15rem;
}
.profile-head h3 { font-size: 1.25rem; letter-spacing: -.03em; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px,1fr)); gap: 1px; background: var(--line-soft); border-radius: var(--r-md); overflow: hidden; margin-bottom: 20px; }
.profile-grid > div { background: var(--surface); padding: 14px 16px; }
.profile-grid .k { font-family: var(--font-mono); font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.profile-grid .v { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; color: var(--ink); margin-top: 3px; }

/* ---- Consultation timeline ---- */
.timeline { position: relative; padding-left: 30px; }
.timeline::before {
  content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px;
  width: 2px; background: var(--line); border-radius: 2px;
}
.tl-item { position: relative; padding-bottom: 20px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -26px; top: 4px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--line-strong);
}
.tl-item.done::before { background: var(--brand); border-color: var(--brand); }
.tl-item.warn::before { background: var(--amber); border-color: var(--amber); }
.tl-label { font-family: var(--font-display); font-weight: 650; color: var(--ink); font-size: .92rem; }
.tl-time { font-family: var(--font-mono); font-size: .76rem; color: var(--faint); }
.tl-note { font-size: .82rem; color: var(--muted); margin-top: 2px; }

/* ---- Premium TV ---- */
.tv-premium .tv-now-token {
  background: linear-gradient(180deg, #fff, var(--brand-300));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 60px rgba(75,123,251,.5));
}
.tv-room-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px,1fr)); gap: 16px; }
.tv-room {
  padding: 22px; border-radius: var(--r-xl);
  background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.09);
  transition: background-color .6s var(--ease), border-color .6s var(--ease);
}
.tv-room.active {
  background: linear-gradient(150deg, rgba(75,123,251,.16), rgba(59,91,219,.07));
  border-color: rgba(75,123,251,.32);
}
.tv-room .r { font-family: var(--font-mono); font-size: .64rem; letter-spacing: .22em; text-transform: uppercase; color: rgba(255,255,255,.45); }
.tv-room .t { font-family: var(--font-mono); font-weight: 700; font-size: clamp(2.4rem,5.5vw,3.6rem); line-height: 1; letter-spacing: -.05em; color: #fff; margin: 8px 0 4px; }
.tv-room.active .t { color: var(--brand-300); text-shadow: 0 0 48px rgba(75,123,251,.55); }
.tv-room .n { font-size: .95rem; color: rgba(255,255,255,.75); }
.tv-room .d { font-size: .78rem; color: rgba(255,255,255,.42); margin-top: 8px; }

@keyframes tokenIn {
  0%   { opacity: 0; transform: translateY(22px) scale(.9); filter: blur(10px); }
  100% { opacity: 1; transform: none; filter: blur(0); }
}
.token-anim { animation: tokenIn .85s cubic-bezier(.16,1,.3,1); }

/* ---- Premium patient view ---- */
.pt-premium .pt-card {
  border-radius: 32px; padding: 34px 26px;
  border-color: var(--line-soft);
  background: linear-gradient(170deg, var(--surface), var(--surface-2));
  box-shadow: 0 24px 60px -32px rgba(10,15,28,.35);
}
.pt-premium .pt-token {
  font-size: clamp(4rem, 22vw, 5.6rem);
  background: linear-gradient(160deg, var(--brand-400), var(--brand-700));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
[data-theme="dark"] .pt-premium .pt-token {
  background: linear-gradient(160deg, #fff, var(--brand-300));
  -webkit-background-clip: text; background-clip: text;
}
.pt-ring { width: 168px; height: 168px; margin: 0 auto 18px; position: relative; }
.pt-ring svg { transform: rotate(-90deg); }
.pt-ring .track { fill: none; stroke: var(--surface-3); stroke-width: 9; }
.pt-ring .fill {
  fill: none; stroke: var(--brand); stroke-width: 9; stroke-linecap: round;
  transition: stroke-dashoffset 1.1s cubic-bezier(.16,1,.3,1);
}
.pt-ring-label {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}

/* ---- Motion ---- */
.tier-premium .main { animation: luxIn .6s cubic-bezier(.16,1,.3,1) both; }
@keyframes luxIn { from { opacity: 0; transform: translateY(14px); } }
.tier-premium .stat, .tier-premium .doc-card { animation: luxIn .7s cubic-bezier(.16,1,.3,1) both; }
.tier-premium .stat:nth-child(2), .tier-premium .doc-card:nth-child(2) { animation-delay: 60ms; }
.tier-premium .stat:nth-child(3), .tier-premium .doc-card:nth-child(3) { animation-delay: 120ms; }
.tier-premium .stat:nth-child(4), .tier-premium .doc-card:nth-child(4) { animation-delay: 180ms; }
.tier-premium .stat:nth-child(5) { animation-delay: 240ms; }

@media (prefers-reduced-motion: reduce) {
  .tier-premium .main, .tier-premium .stat, .tier-premium .doc-card, .token-anim { animation: none !important; }
}
