/* ============================================================
   Teleconsultation design system
   ============================================================ */

:root {
  --teal-900: #073b3a;
  --teal-800: #0b5250;
  --teal-700: #0f6d6a;
  --teal-600: #0f8f8a;
  --teal-500: #17a8a2;
  --teal-100: #d5f1ef;
  --teal-50: #eefaf9;

  --ink-900: #101a20;
  --ink-700: #2b3a42;
  --ink-500: #5b6b74;
  --ink-400: #7d8d96;
  --ink-300: #aab7be;

  --bg: #f4f7f9;
  --surface: #ffffff;
  --line: #e2eaee;

  --green: #14804a;
  --green-bg: #e3f6ec;
  --amber: #92591a;
  --amber-bg: #fdf1de;
  --blue: #1a5fb4;
  --blue-bg: #e4eefc;
  --red: #b3261e;
  --red-bg: #fdeceb;

  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(16, 26, 32, 0.06), 0 1px 3px rgba(16, 26, 32, 0.04);
  --shadow-md: 0 8px 24px rgba(16, 26, 32, 0.1);
  --shadow-lg: 0 24px 60px rgba(16, 26, 32, 0.16);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    "Apple Color Emoji", sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink-900);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--teal-600); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -0.015em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
p { margin: 0 0 1em; }

.container { width: min(1140px, 92vw); margin: 0 auto; }

.hidden { display: none !important; }
.muted { color: var(--ink-500); }
.small { font-size: .875rem; }
.center { text-align: center; }

/* ------------------------------------------------ buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  border: 1px solid transparent;
  background: var(--teal-600);
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: .95rem;
  padding: .7rem 1.3rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s ease, transform .05s ease, box-shadow .15s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: var(--teal-700); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; }

.btn-ghost {
  background: transparent;
  color: var(--ink-700);
  border-color: var(--line);
}
.btn-ghost:hover { background: #fff; border-color: var(--ink-300); }

.btn-soft { background: var(--teal-50); color: var(--teal-700); }
.btn-soft:hover { background: var(--teal-100); }

.btn-danger { background: var(--red); }
.btn-danger:hover { background: #8f1e18; }

.btn-sm { padding: .42rem .8rem; font-size: .83rem; border-radius: 8px; }
.btn-icon { padding: .45rem .6rem; }

/* ------------------------------------------------ forms */

.field { margin-bottom: 1.05rem; }
.field label {
  display: block;
  font-size: .84rem;
  font-weight: 600;
  color: var(--ink-700);
  margin-bottom: .35rem;
}
.input, select.input, textarea.input {
  width: 100%;
  font: inherit;
  font-size: .95rem;
  color: var(--ink-900);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .68rem .8rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus {
  outline: none;
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(23, 168, 162, .18);
}
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }

/* ------------------------------------------------ cards / badges */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  padding: .25rem .55rem;
  border-radius: 999px;
  background: #eef2f4;
  color: var(--ink-500);
}
.badge::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge-scheduled { background: var(--blue-bg); color: var(--blue); }
.badge-active { background: var(--green-bg); color: var(--green); }
.badge-completed { background: #eceff1; color: var(--ink-500); }
.badge-cancelled { background: var(--red-bg); color: var(--red); }
.badge-expired { background: var(--amber-bg); color: var(--amber); }

/* ------------------------------------------------ top nav */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-weight: 750;
  letter-spacing: -.02em;
  font-size: 1.05rem;
  color: var(--ink-900);
}
.brand:hover { text-decoration: none; }
.brand-logo {
  height: 36px;
  width: auto;
  display: block;
}
.nav-links { display: flex; align-items: center; gap: 1.4rem; }
.nav-links a { color: var(--ink-700); font-weight: 600; font-size: .93rem; }
.nav-links a:hover { color: var(--teal-700); text-decoration: none; }

/* ------------------------------------------------ landing */

.hero {
  background:
    radial-gradient(1100px 420px at 82% -10%, rgba(23,168,162,.28), transparent 60%),
    linear-gradient(165deg, var(--teal-900), #0a2f36 55%, #0b2733);
  color: #eafaf8;
  padding: clamp(2.5rem, 7vw, 5rem) 0 clamp(3rem, 8vw, 6rem);
}
.hero h1 { color: #fff; max-width: 15ch; }
.hero p.lead {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: #b9dcd9;
  max-width: 54ch;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: center;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }
.btn-lg { padding: .9rem 1.6rem; font-size: 1rem; border-radius: 12px; }
.btn-white { background: #fff; color: var(--teal-900); }
.btn-white:hover { background: #eafaf8; }
.btn-outline {
  background: transparent;
  border-color: rgba(255,255,255,.4);
  color: #fff;
}
.btn-outline:hover { background: rgba(255,255,255,.1); }

.join-box {
  background: rgba(255,255,255,.97);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  box-shadow: var(--shadow-lg);
  color: var(--ink-900);
}
.join-box h3 { font-size: 1.1rem; margin-bottom: .3rem; }
.join-box p { font-size: .9rem; color: var(--ink-500); }

.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem 1.6rem;
  margin-top: 2.4rem;
  color: #a8cfcc;
  font-size: .88rem;
}
.trust-strip span { display: inline-flex; gap: .45rem; align-items: center; }

.section { padding: clamp(2.6rem, 6vw, 4.5rem) 0; }
.section-alt { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.eyebrow {
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--teal-600);
  margin-bottom: .5rem;
}

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.feature {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.feature .ico {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: var(--teal-50);
  color: var(--teal-700);
  display: grid; place-items: center;
  font-size: 1.2rem;
  margin-bottom: .9rem;
}
.feature h3 { font-size: 1.05rem; }
.feature p { font-size: .93rem; color: var(--ink-500); margin: 0; }

.steps { counter-reset: step; display: grid; gap: 1rem; }
.step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
}
.step::before {
  counter-increment: step;
  content: counter(step);
  flex: 0 0 auto;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--teal-600);
  color: #fff;
  font-weight: 700;
  font-size: .9rem;
  display: grid; place-items: center;
}
.step h4 { margin: 0 0 .2rem; font-size: 1rem; }
.step p { margin: 0; font-size: .92rem; color: var(--ink-500); }

.footer {
  padding: 2.2rem 0;
  color: var(--ink-500);
  font-size: .88rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .6rem;
}

/* ------------------------------------------------ auth pages */

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
  background:
    radial-gradient(800px 380px at 15% -10%, rgba(23,168,162,.18), transparent 60%),
    var(--bg);
}
.auth-card {
  width: min(430px, 94vw);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 2.1rem;
  box-shadow: var(--shadow-md);
}
.auth-card h1 { font-size: 1.5rem; }
.auth-card .sub { color: var(--ink-500); font-size: .93rem; margin-bottom: 1.5rem; }
.auth-foot { text-align: center; font-size: .9rem; color: var(--ink-500); margin-top: 1.2rem; }

.alert {
  border-radius: 10px;
  padding: .7rem .9rem;
  font-size: .9rem;
  margin-bottom: 1rem;
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid #f6cfcc;
}
.alert-ok { background: var(--green-bg); color: var(--green); border-color: #bfe7d2; }

/* ------------------------------------------------ dashboard */

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 0;
}
.topbar .who { font-size: .88rem; color: var(--ink-500); }
.topbar .who b { color: var(--ink-900); display: block; font-size: .96rem; }

.page { padding: 1.8rem 0 3.5rem; }
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.3rem;
}
.page-head h1 { font-size: 1.55rem; margin: 0; }
.page-head .sub { color: var(--ink-500); font-size: .93rem; }

.tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tab {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-500);
  font: inherit;
  font-size: .86rem;
  font-weight: 600;
  padding: .45rem .9rem;
  border-radius: 999px;
  cursor: pointer;
}
.tab:hover { border-color: var(--ink-300); color: var(--ink-700); }
.tab[aria-selected="true"] {
  background: var(--teal-600);
  border-color: var(--teal-600);
  color: #fff;
}

.table-card { overflow: hidden; }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th {
  text-align: left;
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--ink-400);
  background: #fbfcfd;
  padding: .75rem 1.1rem;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
}
.table td { padding: .85rem 1.1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #fafcfd; }
.table .name { font-weight: 650; }
.table .email { color: var(--ink-500); font-size: .86rem; }
.actions { display: flex; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; }

.empty {
  padding: 3.2rem 1.5rem;
  text-align: center;
  color: var(--ink-500);
}
.empty h3 { color: var(--ink-700); font-size: 1.05rem; }

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .8rem 1.1rem;
  border-top: 1px solid var(--line);
  font-size: .87rem;
  color: var(--ink-500);
  background: #fbfcfd;
}

/* ------------------------------------------------ modal */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(9, 20, 26, .55);
  backdrop-filter: blur(2px);
  display: grid;
  place-items: center;
  padding: 1rem;
  z-index: 100;
  animation: fade .15s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: min(560px, 96vw);
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-height: 92vh;
  overflow: auto;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 { font-size: 1.15rem; margin: 0; }
.modal-body { padding: 1.4rem 1.5rem; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: .6rem;
  padding: 1.1rem 1.5rem;
  border-top: 1px solid var(--line);
  background: #fbfcfd;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.x-btn {
  border: none;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--ink-400);
  cursor: pointer;
  padding: .2rem .4rem;
}
.x-btn:hover { color: var(--ink-700); }

.link-box {
  display: flex;
  gap: .5rem;
  align-items: center;
  background: var(--teal-50);
  border: 1px dashed var(--teal-500);
  border-radius: 10px;
  padding: .6rem .7rem;
}
.link-box code {
  font-size: .82rem;
  word-break: break-all;
  color: var(--teal-800);
  flex: 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ------------------------------------------------ toast */

.toasts {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  z-index: 200;
}
.toast {
  background: var(--ink-900);
  color: #fff;
  padding: .8rem 1.05rem;
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  font-size: .9rem;
  max-width: 340px;
  animation: slide .2s ease;
}
.toast.ok { background: var(--green); }
.toast.err { background: var(--red); }
@keyframes slide { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ------------------------------------------------ join page */

.join-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
  background:
    radial-gradient(700px 320px at 85% -10%, rgba(23,168,162,.2), transparent 60%),
    var(--bg);
}
.join-brand { margin-bottom: 1.4rem; }
.join-card {
  width: min(470px, 94vw);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 2.2rem;
  box-shadow: var(--shadow-md);
  text-align: center;
}
.avatar {
  width: 62px; height: 62px;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--teal-500), var(--teal-800));
  color: #fff;
  display: grid; place-items: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 auto 1rem;
}
.detail-list {
  list-style: none;
  padding: 0;
  margin: 1.4rem 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.detail-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .75rem 1rem;
  font-size: .92rem;
  border-bottom: 1px solid var(--line);
}
.detail-list li:last-child { border-bottom: none; }
.detail-list .k { color: var(--ink-500); }
.detail-list .v { font-weight: 600; text-align: right; }

.spinner {
  width: 42px; height: 42px;
  border: 3px solid var(--teal-100);
  border-top-color: var(--teal-600);
  border-radius: 50%;
  margin: 0 auto 1rem;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------ room */

body.room-mode { background: #0a0f13; overflow: hidden; }

.room {
  height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  color: #e8f1f3;
}
.room-bar {
  position: relative;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .8rem 1.2rem;
  background: rgba(10, 15, 19, .95);
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.room-bar .brand { color: #fff; }
.room-brand-logo { height: 26px; }
.room-title { font-size: .92rem; color: #9db3bb; }
.room-title b { color: #fff; font-weight: 650; }

.stage {
  position: relative;
  display: grid;
  place-items: center;
  padding: 1rem;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}
.videos {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}
video {
  background: #05090c;
  border-radius: 16px;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}
#remoteVideo { width: 100%; height: 100%; }
#localVideo {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: min(230px, 30vw);
  aspect-ratio: 4 / 3;
  height: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
  border: 1px solid rgba(255,255,255,.14);
  transform: scaleX(-1);
}
#localVideo.mirrored-off { transform: none; }

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  background: radial-gradient(600px 300px at 50% 35%, rgba(23,168,162,.14), transparent 70%), #0a0f13;
  border-radius: 16px;
  padding: 2rem;
  z-index: 3;
}
.overlay h2 { color: #fff; font-size: 1.35rem; }
.overlay p { color: #93a8b1; max-width: 44ch; }
.overlay .share {
  display: flex;
  gap: .5rem;
  align-items: center;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 10px;
  padding: .55rem .7rem;
  max-width: min(520px, 86vw);
  margin: 0 auto;
}
.overlay .share code {
  font-size: .78rem;
  color: #9fd8d4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  text-align: left;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .8rem;
  font-weight: 650;
  padding: .32rem .7rem;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: #cfe0e5;
  border: 1px solid rgba(255,255,255,.1);
}
.status-pill .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ink-300);
}
.status-pill[data-state="connected"] .dot { background: #2fd07f; box-shadow: 0 0 0 3px rgba(47,208,127,.22); }
.status-pill[data-state="connecting"] .dot,
.status-pill[data-state="reconnecting"] .dot { background: #f2b03d; }
.status-pill[data-state="waiting"] .dot { background: #6ec8ff; }
.status-pill[data-state="ended"] .dot { background: #ff6b6b; }

.stats {
  display: flex;
  gap: .5rem;
  align-items: center;
  font-size: .76rem;
  color: #93a8b1;
  font-variant-numeric: tabular-nums;
}
.stat-chip {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 8px;
  padding: .25rem .5rem;
}
.stat-chip.bad { color: #ffb4b4; border-color: rgba(255,107,107,.4); }
.stat-chip.good { color: #8ee9bf; }
.relay-badge {
  background: rgba(242,176,61,.16);
  border: 1px solid rgba(242,176,61,.45);
  color: #ffd68a;
}
.bars { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; }
.bars i { width: 3px; background: #3d505a; border-radius: 2px; display: block; }
.bars i:nth-child(1) { height: 4px; }
.bars i:nth-child(2) { height: 7px; }
.bars i:nth-child(3) { height: 10px; }
.bars.lvl-1 i:nth-child(1),
.bars.lvl-2 i:nth-child(-n+2),
.bars.lvl-3 i { background: #2fd07f; }
.bars.lvl-0 i { background: #ff6b6b; }

.controls {
  position: relative;
  z-index: 7;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  padding: 1rem;
  background: rgba(10, 15, 19, .98);
  border-top: 1px solid rgba(255,255,255,.07);
  flex-wrap: wrap;
}
.ctl {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: 1.15rem;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .15s ease;
}
.ctl:hover { background: rgba(255,255,255,.16); }
.ctl.off { background: #c9372f; border-color: #c9372f; }
.ctl.end { background: #c9372f; border-color: #c9372f; width: auto; padding: 0 1.4rem; border-radius: 999px; font-weight: 650; font-size: .92rem; }
.ctl.end:hover { background: #a82a23; }

.device-pick {
  display: flex;
  gap: .5rem;
  align-items: center;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  padding: .3rem .3rem .3rem .8rem;
}
.device-pick select {
  background: transparent;
  border: none;
  color: #dbe7ea;
  font: inherit;
  font-size: .8rem;
  max-width: 160px;
  outline: none;
}
.device-pick select option { color: #111; }
.device-pick span { font-size: .74rem; color: #8ea3ab; text-transform: uppercase; letter-spacing: .06em; }

/* ------------------------------------------------ responsive */

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .row-2 { grid-template-columns: 1fr; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border-bottom: 1px solid var(--line); padding: .4rem 0; }
  .table td { border: none; padding: .3rem 1rem; }
  .actions { justify-content: flex-start; padding-top: .4rem; }
  #localVideo { width: 120px; right: 10px; bottom: 10px; }
}

/* ------------------------------------------------ plans & usage */

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  margin: 1.6rem 0;
}
.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.3rem;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: border-color .15s ease, box-shadow .15s ease, transform .1s ease;
}
.plan:hover { border-color: var(--teal-500); box-shadow: var(--shadow-sm); }
.plan.selected { border-color: var(--teal-600); box-shadow: 0 0 0 3px rgba(23,168,162,.16); }
.plan.featured { border-color: var(--teal-500); }
.plan.current { border-color: var(--teal-600); box-shadow: 0 0 0 3px rgba(23,168,162,.16); }
.plan-tag.current {
  left: auto;
  right: 1.1rem;
  background: var(--ink-700);
}
.plan-tag {
  position: absolute;
  top: -.7rem;
  left: 1.1rem;
  background: var(--teal-600);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: .2rem .55rem;
  border-radius: 999px;
}
.plan h3 { font-size: 1.02rem; margin: 0; }
.plan .price {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: .35rem 0 .1rem;
}
.plan .price small { font-size: .82rem; font-weight: 600; color: var(--ink-500); }
.plan .allowance { font-size: .88rem; font-weight: 600; color: var(--teal-700); }
.plan p { font-size: .87rem; color: var(--ink-500); margin: .5rem 0 1rem; }
.plan .btn { margin-top: auto; }

.usage {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1rem 1.2rem;
  margin-bottom: 1.2rem;
  box-shadow: var(--shadow-sm);
}
.usage-main { flex: 1 1 260px; min-width: 220px; }
.usage-title { font-weight: 650; font-size: .96rem; }
.usage-sub { font-size: .85rem; color: var(--ink-500); }
.meter {
  height: 8px;
  border-radius: 999px;
  background: var(--teal-50);
  overflow: hidden;
  margin-top: .55rem;
}
.meter span {
  display: block;
  height: 100%;
  background: var(--teal-600);
  border-radius: 999px;
}
.meter span.warn { background: var(--amber); }
.meter span.full { background: var(--red); }
.usage-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .8rem;
  margin-bottom: 1.2rem;
}
.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .8rem 1rem;
}
.stat .k {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--ink-400);
  font-weight: 700;
}
.stat .v { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.02em; }
.stat .n { font-size: .8rem; color: var(--ink-500); }

/* ------------------------------------------------ show-up log */

.att-both { background: var(--green-bg); color: var(--green); }
.att-provider { background: var(--amber-bg); color: var(--amber); }
.att-patient { background: var(--blue-bg); color: var(--blue); }
.att-nobody { background: #eceff1; color: var(--ink-500); }

.att-grid { display: grid; gap: .7rem; margin-top: .4rem; }
.att-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: .8rem;
  align-items: baseline;
  padding: .55rem .7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: .9rem;
}
.att-row .k { color: var(--ink-500); font-weight: 600; }
.att-row code { font-size: .85rem; }
