:root {
  /* Matched to vouchorthoticlabs.com: navy + sky accent, not green */
  --brand: #0A2540;
  --brand-soft: #E8EEF5;
  --accent: #7DD3FC;
  --accent-dark: #38BDF8;
  --accent-ink: #0A2540;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #F8FAFC;
  --orange: #ea580c;
  --ok: #16a34a;
  --ok-soft: #dcfce7;
  /* Legacy aliases so existing class names keep working */
  --green: var(--accent);
  --green-dark: var(--brand);
  --green-soft: var(--brand-soft);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
}

.layout { display: flex; min-height: 100vh; }

/* ---------- sidebar ---------- */

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 22px 0;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand { padding: 0 22px 20px; }
.brand-name { font-size: 26px; font-weight: 800; letter-spacing: 1px; color: var(--brand); }
.brand-sub { font-size: 10px; letter-spacing: 2.5px; color: var(--muted); margin-top: 2px; }

.sidebar nav { display: flex; flex-direction: column; gap: 2px; padding: 0 12px; }
.sidebar nav a {
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}
.sidebar nav a:hover { background: var(--bg); }
.sidebar nav a.active { background: var(--green-soft); color: var(--green-dark); font-weight: 600; }

.sidebar-footer { margin-top: auto; padding: 20px 22px 0; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); }
.footer-head { font-size: 10px; letter-spacing: 1.5px; margin-bottom: 6px; }
.sidebar-footer a { color: var(--green-dark); }

/* ---------- content ---------- */

.content { flex: 1; padding: 34px 40px 60px; max-width: 1060px; }

h1 { margin: 0 0 4px; font-size: 26px; }
h2 { margin: 0 0 10px; font-size: 17px; }
.subtitle { color: var(--muted); margin: 0 0 22px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 22px;
  margin-bottom: 18px;
}

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

.flight-card {
  background:
    radial-gradient(1200px 180px at 85% 20%, rgba(125, 211, 252, 0.18), transparent 55%),
    linear-gradient(120deg, #061828, var(--brand));
  color: #fff;
  border-radius: 14px;
  padding: 22px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 18px;
  overflow: hidden;
  position: relative;
}
.flight-card.is-active .flight-number {
  animation: number-pulse 2.4s ease-in-out infinite;
}
.flight-left {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-shrink: 0;
  z-index: 1;
}
.flight-number { font-size: 52px; font-weight: 800; line-height: 1; }
.flight-title { font-size: 19px; font-weight: 700; }
.flight-sub { opacity: 0.85; font-size: 14px; margin-top: 2px; }

.flight-track {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: 460px;
  margin-left: auto;
  z-index: 1;
}
.flight-endpoint {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.flight-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(125, 211, 252, 0.22);
  position: relative;
  z-index: 2;
  animation: endpoint-throb 2s ease-in-out infinite;
}
.flight-clinic .flight-dot {
  animation-delay: 1s;
}
.flight-pulse {
  position: absolute;
  top: 0;
  left: 50%;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  border-radius: 50%;
  border: 2px solid rgba(125, 211, 252, 0.7);
  animation: endpoint-ring 2s ease-out infinite;
  pointer-events: none;
}
.flight-clinic .flight-pulse { animation-delay: 1s; }
.flight-label {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.8;
  font-weight: 600;
}
.flight-path {
  position: relative;
  flex: 1;
  height: 56px;
  min-width: 100px;
}
.flight-rail {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 3px;
  margin-top: -1.5px;
  border-radius: 999px;
  background: repeating-linear-gradient(
    90deg,
    rgba(125, 211, 252, 0.95) 0 10px,
    transparent 10px 18px
  );
  background-size: 28px 3px;
  animation: rail-drift 0.85s linear infinite;
  box-shadow: 0 0 12px rgba(125, 211, 252, 0.35);
}
.flight-glow {
  position: absolute;
  top: 50%;
  left: 0;
  width: 28%;
  height: 10px;
  margin-top: -5px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(125, 211, 252, 0.85), transparent);
  filter: blur(4px);
  animation: glow-sweep 2.2s ease-in-out infinite;
  pointer-events: none;
}
.flight-spark {
  position: absolute;
  top: 50%;
  width: 5px;
  height: 5px;
  margin-top: -2.5px;
  border-radius: 50%;
  background: #e0f2fe;
  box-shadow: 0 0 8px #7dd3fc;
  animation: spark-fly 2.8s linear infinite;
  opacity: 0;
}
.flight-spark-1 { animation-delay: 0s; }
.flight-spark-2 { animation-delay: 0.9s; }
.flight-spark-3 { animation-delay: 1.8s; }

.flight-parcel {
  position: absolute;
  top: 50%;
  left: 0;
  width: 44px;
  height: 34px;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.4));
  animation: parcel-fly 3.2s cubic-bezier(0.4, 0.0, 0.2, 1) infinite;
  z-index: 3;
}
.flight-parcel .parcel-body {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
}
.wing {
  position: absolute;
  top: 42%;
  width: 16px;
  height: 10px;
  background: linear-gradient(180deg, #e0f2fe 0%, #7dd3fc 100%);
  border: 1px solid rgba(10, 37, 64, 0.2);
  z-index: 1;
  opacity: 0.95;
}
.wing-l {
  left: 2px;
  border-radius: 70% 10% 60% 40%;
  transform-origin: right center;
  animation: wing-flap-l 0.28s ease-in-out infinite;
}
.wing-r {
  right: 2px;
  border-radius: 10% 70% 40% 60%;
  transform-origin: left center;
  animation: wing-flap-r 0.28s ease-in-out infinite;
}
.flight-parcel-b .wing { width: 13px; height: 8px; }
.flight-parcel-c .wing { width: 11px; height: 7px; }
.flight-wake {
  position: absolute;
  right: 78%;
  top: 50%;
  width: 28px;
  height: 6px;
  margin-top: -3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(125, 211, 252, 0.55));
  filter: blur(2px);
  opacity: 0.8;
}
.flight-parcel-b {
  animation-duration: 4s;
  animation-delay: -1.3s;
}
.flight-parcel-c {
  animation-duration: 4.8s;
  animation-delay: -2.6s;
}

.flight-card.is-idle .flight-rail {
  animation-duration: 1.6s;
  opacity: 0.55;
}
.flight-card.is-idle .flight-parcel-b,
.flight-card.is-idle .flight-parcel-c,
.flight-card.is-idle .flight-spark-2,
.flight-card.is-idle .flight-spark-3 {
  display: none;
}
.flight-card.is-idle .flight-parcel-a {
  animation-duration: 5.5s;
  opacity: 0.55;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.25));
}
.flight-card.is-idle .flight-glow {
  animation-duration: 3.4s;
  opacity: 0.55;
}

@keyframes rail-drift {
  from { background-position: 0 0; }
  to { background-position: 28px 0; }
}
@keyframes glow-sweep {
  0%   { left: -10%; opacity: 0; }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { left: 85%; opacity: 0; }
}
@keyframes spark-fly {
  0%   { left: 0%; opacity: 0; transform: translateY(0); }
  10%  { opacity: 1; }
  50%  { transform: translateY(-7px); }
  90%  { opacity: 1; }
  100% { left: 100%; opacity: 0; transform: translateY(2px); }
}
@keyframes parcel-fly {
  0%   { left: 0%;   opacity: 0; transform: translate(-50%, -50%) scale(0.8) rotate(-6deg); }
  8%   { opacity: 1; }
  25%  { transform: translate(-50%, calc(-50% - 10px)) scale(1.05) rotate(2deg); }
  50%  { transform: translate(-50%, calc(-50% + 4px)) scale(1) rotate(-2deg); }
  75%  { transform: translate(-50%, calc(-50% - 8px)) scale(1.04) rotate(3deg); }
  92%  { opacity: 1; }
  100% { left: 100%; opacity: 0; transform: translate(-50%, -50%) scale(0.88) rotate(6deg); }
}
@keyframes endpoint-throb {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 4px rgba(125, 211, 252, 0.2); }
  50% { transform: scale(1.15); box-shadow: 0 0 0 7px rgba(125, 211, 252, 0.35); }
}
@keyframes endpoint-ring {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(3.2); opacity: 0; }
}
@keyframes number-pulse {
  0%, 100% { transform: scale(1); text-shadow: none; }
  50% { transform: scale(1.04); text-shadow: 0 0 18px rgba(125, 211, 252, 0.45); }
}
@keyframes wing-flap-l {
  0%, 100% { transform: rotate(18deg) scaleY(1); }
  50% { transform: rotate(-28deg) scaleY(0.85); }
}
@keyframes wing-flap-r {
  0%, 100% { transform: rotate(-18deg) scaleY(1); }
  50% { transform: rotate(28deg) scaleY(0.85); }
}
@media (max-width: 900px) {
  .flight-card { flex-direction: column; align-items: stretch; }
  .flight-track { max-width: none; margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .flight-rail, .flight-parcel, .flight-glow, .flight-spark,
  .flight-dot, .flight-pulse, .flight-number, .wing { animation: none !important; }
  .flight-parcel { left: 50%; opacity: 1; }
  .flight-parcel-b, .flight-parcel-c { display: none; }
}

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  border-left: 4px solid var(--line);
}
.stat-card.accent-blue { border-left-color: #2563eb; }
.stat-card.accent-yellow { border-left-color: #ca8a04; }
.stat-card.accent-green { border-left-color: #16a34a; }
.stat-card.accent-black { border-left-color: #0a0a0a; }
.stat-label { color: var(--muted); font-size: 13px; }
.stat-value { font-size: 30px; font-weight: 700; margin-top: 4px; color: var(--ink); }
.stat-value.blue { color: #2563eb !important; }
.stat-value.yellow { color: #ca8a04 !important; }
.stat-value.green { color: #16a34a !important; }
.stat-value.black { color: #0a0a0a !important; }

/* ---------- app promo (QR) ---------- */

.app-promo {
  display: flex;
  gap: 18px;
  align-items: center;
  border: 2px solid var(--accent);
  background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 55%);
  padding: 18px 20px;
}
.app-promo-qr {
  width: 140px;
  height: 140px;
  border-radius: 10px;
  flex-shrink: 0;
  background: #fff;
  box-shadow: 0 4px 14px rgba(10, 37, 64, 0.1);
}
.app-promo-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-dark, #0284c7);
  margin-bottom: 4px;
}
.app-promo-copy h2 {
  margin: 0 0 6px;
  font-size: 18px;
  line-height: 1.2;
}
.app-promo-copy p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
  max-width: 42rem;
}
.app-promo-cta {
  color: var(--brand) !important;
  font-weight: 700 !important;
  font-size: 14px !important;
}
.app-promo-note {
  font-size: 13px !important;
  margin-bottom: 0 !important;
}
.app-promo-compact {
  padding: 12px 16px;
  gap: 14px;
  margin-bottom: 18px;
}
.app-promo-compact .app-promo-qr {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  box-shadow: none;
}
.app-promo-compact .app-promo-copy h2 {
  font-size: 15px;
  margin-bottom: 2px;
}
.app-promo-compact .app-promo-cta {
  margin: 0 !important;
  font-size: 13px !important;
}
@media (max-width: 720px) {
  .app-promo {
    flex-direction: column;
    text-align: center;
    padding: 16px;
  }
  .app-promo-qr { width: 132px; height: 132px; }
  .app-promo-compact {
    flex-direction: row;
    text-align: left;
  }
  .app-promo-compact .app-promo-qr { width: 64px; height: 64px; }
  .app-promo-copy p { max-width: none; }
}

/* ---------- tables ---------- */

.case-table { width: 100%; border-collapse: collapse; }
.case-table th {
  text-align: left; font-size: 12px; letter-spacing: 0.6px; text-transform: uppercase;
  color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line);
}
.case-table td { padding: 12px 10px; border-bottom: 1px solid var(--line); }
.case-table tbody tr { cursor: pointer; }
.case-table tbody tr:hover { background: var(--bg); }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; background: #eef2f7; color: var(--muted);
}
.badge-received { background: #e0f2fe; color: #0369a1; }
.badge-in-production { background: #fef9c3; color: #a16207; }
.badge-shipped { background: #ffedd5; color: var(--orange); }
.badge-delivered { background: var(--ok-soft); color: var(--ok); }
.badge-lg { font-size: 14px; padding: 6px 16px; }

.empty-state { text-align: center; padding: 46px 20px; }
.empty-title { font-weight: 700; font-size: 17px; }
.empty-sub { color: var(--muted); margin: 6px 0 18px; }

/* ---------- tabs + search ---------- */

.tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs a { padding: 8px 2px 10px; color: var(--muted); text-decoration: none; font-weight: 600; border-bottom: 2px solid transparent; }
.tabs a.active { color: var(--green-dark); border-bottom-color: var(--green-dark); }

.search-row { display: flex; gap: 10px; }
.search-row input[type="search"] { flex: 1; }

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

label { display: block; font-size: 13px; font-weight: 600; margin: 0 0 5px; color: var(--ink); }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 15px; font-family: inherit; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--green); outline-offset: -1px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.narrow-form { max-width: 380px; display: flex; flex-direction: column; gap: 10px; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; }
.inline-form input, .inline-form select { width: auto; flex: 1; min-width: 180px; }

.readonly { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }

.check-row { display: flex; flex-wrap: wrap; gap: 8px; }
.check-pill {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1.5px solid var(--line); border-radius: 999px; padding: 7px 14px;
  font-weight: 500; cursor: pointer;
}
.check-pill:has(input:checked) { border-color: var(--green); background: var(--green-soft); color: var(--green-dark); }

.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  border: 2px dashed var(--line); border-radius: 12px; padding: 34px 20px;
  text-align: center; cursor: pointer;
}
.dropzone:hover { border-color: var(--green); }
.dropzone-accent {
  border: 2px solid #38bdf8;
  background: linear-gradient(180deg, #f0f9ff 0%, #ffffff 70%);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.15);
}
.dropzone-accent:hover {
  border-color: #0ea5e9;
  background: #e0f2fe;
}
.dropzone input[type="file"] { width: auto; }
.drop-title { font-weight: 700; }
.drop-sub { color: var(--muted); font-size: 13px; max-width: 440px; }

.cases-filters { display: flex; flex-direction: column; gap: 12px; }
.date-row {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
}
.date-field {
  display: flex; flex-direction: column; gap: 4px; font-size: 12px;
  color: var(--muted); font-weight: 600;
}
.date-field input[type="date"] {
  min-width: 160px; padding: 8px 10px; border: 1.5px solid var(--line);
  border-radius: 9px; font-size: 14px; color: var(--ink); background: #fff;
}
.cases-count-line {
  margin: 0 0 10px;
  font-weight: 700;
  font-size: 15px;
  color: var(--brand);
}

.btn {
  display: inline-block; border: none; border-radius: 9px; padding: 10px 20px;
  font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn-primary { background: var(--accent); color: var(--brand); font-weight: 700; }
.btn-primary:hover { background: var(--accent-dark); color: var(--brand); }
.btn-ghost { background: #fff; border: 1.5px solid var(--line); color: var(--ink); }
.btn-ghost.active { border-color: var(--green); color: var(--green-dark); background: var(--green-soft); }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 28px; font-size: 17px; }

.alert { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; }
.alert-success { background: var(--ok-soft); color: var(--ok); border-color: #bbf7d0; }

/* ---------- case detail ---------- */

.case-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 8px; }

.timeline { display: flex; }
.timeline .step { flex: 1; text-align: center; position: relative; }
.timeline .step::before {
  content: ""; position: absolute; top: 9px; left: -50%; width: 100%; height: 3px; background: var(--line);
}
.timeline .step:first-child::before { display: none; }
.timeline .step.done::before { background: var(--green); }
.timeline .dot {
  width: 20px; height: 20px; border-radius: 50%; background: var(--line);
  margin: 0 auto 6px; position: relative; z-index: 1; border: 3px solid #fff;
}
.timeline .step.done .dot { background: var(--green); }
.step-label { font-size: 12.5px; color: var(--muted); }
.step.done .step-label { color: var(--ink); font-weight: 600; }
.tracking { margin: 14px 0 0; color: var(--muted); }

.rx-table { width: 100%; border-collapse: collapse; }
.rx-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); }
.rx-label { width: 220px; color: var(--muted); font-weight: 600; font-size: 13.5px; }

.file-list { margin: 0; padding-left: 18px; }
.file-list a { color: var(--green-dark); }

.viewer { width: 100%; height: 420px; border: 1px solid var(--line); border-radius: 10px; background: #fafcff; }
.viewer-controls { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.hint { color: var(--muted); font-size: 13px; margin: 8px 0 0; }

/* ---------- login (premium, brand-matched) ---------- */

.login-page {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(ellipse 80% 60% at 15% 20%, rgba(125, 211, 252, 0.18), transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 80%, rgba(10, 37, 64, 0.55), transparent 50%),
    linear-gradient(160deg, #061828 0%, #0A2540 45%, #0f3358 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
}

.login-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 36px;
}

.login-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: #fff;
}

.login-logo-img {
  height: 36px;
  width: auto;
  display: block;
}

.sidebar-logo {
  height: 32px;
  width: auto;
  display: block;
  margin-bottom: 6px;
}

.login-logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--brand);
  font-weight: 800;
  font-size: 18px;
  display: none;
}

.login-logo-word {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 2.5px;
  display: none;
}

.login-top-link {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}
.login-top-link:hover { color: #fff; }

.login-main {
  flex: 1;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
  max-width: 1040px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 36px 48px;
}

.login-main-single {
  grid-template-columns: 1fr;
  justify-items: center;
  max-width: 480px;
}

.login-kicker {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 14px;
}

.login-headline {
  font-size: 42px;
  line-height: 1.12;
  font-weight: 800;
  margin: 0 0 16px;
  letter-spacing: -0.5px;
}

.login-lede {
  margin: 0;
  font-size: 17px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.78);
  max-width: 420px;
}

.login-panel {
  background: #fff;
  color: var(--ink);
  border-radius: 18px;
  padding: 36px 34px 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  width: 100%;
  max-width: 420px;
  justify-self: end;
}

.login-main-single .login-panel { justify-self: center; }

.login-panel h2 {
  margin: 0 0 6px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.login-panel-sub {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 15px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-form label {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 700;
}

.login-form input {
  border: 1.5px solid #d7dee8;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 15px;
}
.login-form input:focus {
  outline: none;
  border-color: #7DD3FC;
  box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.35);
}

.password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.password-wrap input { width: 100%; padding-right: 64px; }
.pw-toggle {
  position: absolute;
  right: 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 8px;
}
.pw-toggle:hover { color: var(--brand); }

.login-row {
  display: flex;
  justify-content: flex-end;
  margin: 2px 0 8px;
}

.forgot-link {
  color: #0369a1;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.forgot-link:hover { text-decoration: underline; }

.login-submit {
  margin-top: 8px;
  height: 48px;
  border-radius: 10px;
  font-size: 16px;
}

.login-foot-note {
  margin: 18px 0 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}
.login-foot-note a { color: var(--brand); font-weight: 600; }

.login-footer {
  padding: 16px 36px 22px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
}

@media (max-width: 860px) {
  .login-main {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 12px 20px 36px;
  }
  .login-intro { order: 0; }
  .login-panel { justify-self: stretch; max-width: none; padding: 28px 22px 22px; }
  .login-headline { font-size: 30px; }
  .login-top { padding: 18px 20px; }
  .login-footer { padding: 12px 20px 20px; }
}

/* legacy class kept so old markup never breaks */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 34px 32px; width: 360px; max-width: calc(100vw - 32px);
}
.login-card h1 { text-align: center; font-size: 20px; margin: 18px 0 16px; }
.login-card form { display: flex; flex-direction: column; gap: 10px; }

/* ---------- responsive (iPhone / iPad) ---------- */

@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: static; flex-direction: column; padding: 14px 0 0;
  }
  .sidebar nav { flex-direction: row; overflow-x: auto; padding: 8px 12px 12px; }
  .sidebar nav a { white-space: nowrap; font-size: 14px; }
  .sidebar-footer { display: none; }
  .brand { padding: 0 18px 4px; }
  .content { padding: 22px 16px 50px; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .hero-number { font-size: 40px; }
}

/* ---------- billing admin ---------- */

.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 12px; letter-spacing: 0.5px; color: var(--muted);
  padding: 8px 10px; border-bottom: 1.5px solid var(--line);
}
.table td { padding: 10px; border-bottom: 1px solid var(--line); }

.mode-pill {
  display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: 1px;
  padding: 3px 10px; border-radius: 999px; margin-left: 8px; vertical-align: middle;
}
.mode-simulated { background: #fef9c3; color: #a16207; }
.mode-test { background: #e0f2fe; color: #0369a1; }
.mode-live { background: var(--green-soft); color: var(--green-dark); }

.magic-form { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.magic-form > div { flex: 1; min-width: 200px; }
.magic-form input, .magic-form select { width: 100%; }
.magic-send { display: flex; gap: 14px; align-items: center; flex: 0 0 auto !important; min-width: 0 !important; }

.link-box {
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 12px; margin: 10px 0; font-size: 13px; word-break: break-all;
}
.btn-small { padding: 6px 12px; font-size: 13px; background: #fff; border: 1.5px solid var(--line); }
.btn-small:hover { border-color: var(--green); color: var(--green-dark); }

.badge-green { background: var(--green-soft); color: var(--green-dark); }
.badge-green-outline { background: #fff; color: var(--green-dark); border: 1.5px solid var(--green); }
.badge-orange { background: #ffedd5; color: var(--orange); }

.check-label { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 14px; margin: 0; }
.check-label input { width: auto; }
.inline-form { display: inline; }

/* ---------- clinic setup flow (magic link) ---------- */

.setup-body { background: var(--bg); margin: 0; }
.setup-wrap { max-width: 640px; margin: 0 auto; padding: 44px 20px 60px; }
.setup-head { text-align: center; margin-bottom: 24px; }
.setup-sub { color: var(--muted); margin-top: 4px; }

.stepper { display: flex; gap: 10px; margin-bottom: 18px; }
.stepper .step {
  flex: 1; text-align: center; padding: 10px; border-radius: 10px;
  border: 1.5px solid var(--line); background: #fff; color: var(--muted);
  font-weight: 600; font-size: 14px;
}
.stepper .step.active { border-color: var(--green); color: var(--green-dark); background: var(--green-soft); }
.stepper .step.done { border-color: var(--green); color: var(--green-dark); }

.setup-card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 26px 28px;
}
.setup-card input, .setup-card select {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--line);
  border-radius: 8px; font-size: 15px; margin-bottom: 14px; font-family: inherit;
}
.setup-card input:focus, .setup-card select:focus { outline: 2px solid var(--green); outline-offset: -1px; }
.setup-note { color: var(--muted); font-size: 14px; margin: 4px 0 18px; }

.method-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }
@media (max-width: 560px) { .method-grid { grid-template-columns: 1fr; } }
.method-card {
  border: 2px solid var(--line); border-radius: 12px; padding: 18px;
  cursor: pointer; text-align: center; position: relative;
}
.method-card.selected { border-color: var(--brand); background: var(--brand-soft); }
.method-badges { display: flex; gap: 6px; justify-content: center; margin-bottom: 10px; min-height: 22px; }
.method-icon { font-size: 26px; font-weight: 800; color: var(--green-dark); margin-bottom: 8px; }
.method-title { font-weight: 700; margin-bottom: 6px; }
.method-desc { font-size: 13.5px; color: var(--muted); margin-bottom: 10px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .two-col { grid-template-columns: 1fr; } }

.tos-box {
  align-items: flex-start; background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 14px; margin: 4px 0 18px; line-height: 1.45;
}
.tos-box input { width: auto; margin: 3px 0 0; }
.tos-box a { color: var(--green-dark); }

.setup-back { display: block; text-align: center; margin-top: 14px; color: var(--muted); font-size: 14px; }
.setup-foot { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 22px; }

.done-check {
  width: 56px; height: 56px; border-radius: 50%; background: var(--green-soft);
  color: var(--green-dark); font-size: 30px; line-height: 56px; margin: 0 auto 14px;
}
.terms-body h2 { margin-top: 18px; }
.terms-body p { color: var(--ink); font-size: 14.5px; line-height: 1.55; }

/* ---------- analytics ---------- */

.analytics-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.analytics-stat-row { grid-template-columns: repeat(3, 1fr); }
@media (min-width: 1100px) {
  .analytics-stat-row { grid-template-columns: repeat(6, 1fr); }
}
.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 900px) {
  .analytics-grid { grid-template-columns: 1fr; }
}
.bar-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.bar-row {
  display: grid;
  grid-template-columns: 88px 1fr 42px;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}
.bar-key { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track {
  height: 10px;
  background: #eef2f7;
  border-radius: 999px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: var(--brand);
  border-radius: 999px;
  min-width: 0;
}
.bar-fill.blue { background: #2563eb; }
.bar-fill.green { background: #16a34a; }
.bar-fill.yellow { background: #ca8a04; }
.bar-count { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
