:root {
  --ink: #273142;
  --ink-strong: #101828;
  --muted: #667085;
  --line: #e3e8ef;
  --line-soft: #eef1f5;
  --surface: #ffffff;
  --surface-raised: #f8fafc;
  --band: #f4f6f9;
  --sidebar: #0f2d52;
  --sidebar-2: #09213f;
  --teal: #12a594;
  --teal-bright: #20b8a7;
  --blue: #3766e8;
  --amber: #e6a23c;
  --green: #12a594;
  --red: #e05a5a;
  --gray: #667085;
  --violet: #7c5ce7;
  --shadow: 0 6px 20px rgba(16, 24, 40, .045);
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  font-size: 16px;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--band);
  font-family: "Segoe UI Variable Text", "Segoe UI", Inter, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

a {
  color: var(--blue);
  text-decoration-color: rgba(55, 102, 232, .3);
}

.btn {
  border-radius: 8px;
  font-weight: 600;
  font-size: .875rem;
}

.btn-primary {
  --bs-btn-bg: var(--blue);
  --bs-btn-border-color: var(--blue);
  --bs-btn-hover-bg: #2b56d0;
  --bs-btn-hover-border-color: #2b56d0;
  --bs-btn-active-bg: #2348b3;
  --bs-btn-active-border-color: #2348b3;
  background-color: var(--blue) !important;
  border-color: var(--blue) !important;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: #2b56d0 !important;
  border-color: #2b56d0 !important;
}

.form-control,
.form-select {
  border-color: #d7e1ea;
  border-radius: 7px;
  color: var(--ink);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 .18rem rgba(55, 102, 232, .12);
}

.admin-body {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 22px 16px 18px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: #fff;
  text-decoration: none;
  margin-bottom: 24px;
  padding: 0 4px;
}

.brand strong,
.login-brand strong {
  display: block;
  font-size: .96rem;
  letter-spacing: -.01em;
}

.brand small,
.login-brand small {
  display: block;
  color: rgba(255,255,255,.68);
  font-size: .76rem;
  margin-top: 2px;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: rgba(255,255,255,.1);
  color: #fff;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}

.brand-mark svg {
  width: 23px;
  height: 23px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-mark-lg {
  width: 52px;
  height: 52px;
  font-size: 1.1rem;
}

.sidebar-nav {
  display: grid;
  gap: 5px;
}

.sidebar-nav a {
  color: #dce7ee;
  text-decoration: none;
  padding: 10px 11px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 580;
  font-size: .91rem;
  transition: background-color .18s ease, color .18s ease;
}

.sidebar-nav a:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
}

.sidebar-nav a.active {
  color: #fff;
  background: #245edb;
  box-shadow: 0 6px 16px rgba(0, 47, 138, .28);
}

.nav-icon {
  width: 26px;
  height: 26px;
  border-radius: 0;
  display: inline-grid;
  place-items: center;
  background: transparent;
  color: #c7d8ee;
}

.nav-icon svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-nav a.active .nav-icon { color: #fff; }

.sidebar-profile {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.13);
  background: rgba(255,255,255,.08);
  border-radius: 10px;
}

.sidebar-profile strong,
.sidebar-profile small {
  display: block;
}

.sidebar-profile small {
  color: rgba(255,255,255,.7);
}

.sidebar-footer {
  margin-top: 12px;
}

.admin-main { min-width: 0; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--line);
  padding: 15px 24px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  backdrop-filter: blur(12px);
}

.topbar h1 {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 720;
  letter-spacing: -.025em;
  color: var(--ink-strong);
}

.eyebrow {
  color: var(--teal);
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: 0;
  font-weight: 800;
}

.topbar-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.profile-chip {
  display: flex;
  gap: 9px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  padding: 4px 0 4px 16px;
}

.profile-chip strong,
.profile-chip small {
  display: block;
  line-height: 1.1;
}

.profile-chip small {
  color: var(--muted);
  margin-top: 2px;
}

.content-wrap {
  padding: 18px 24px 36px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 17px;
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.panel-head h2 {
  margin: 0;
  font-size: .98rem;
  font-weight: 700;
  color: var(--ink-strong);
}

.panel-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: .8rem;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  padding: 26px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #0d3042, #105e62);
  color: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.dashboard-hero p {
  margin: 0 0 8px;
  color: #a8e8e4;
  text-transform: uppercase;
  font-size: .75rem;
  font-weight: 800;
}

.dashboard-hero h2 {
  max-width: 700px;
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2.25rem);
  line-height: 1.14;
}

.dashboard-hero span {
  display: block;
  margin-top: 10px;
  color: rgba(255,255,255,.76);
}

.hero-kpis {
  display: grid;
  grid-template-columns: repeat(3, 110px);
  gap: 10px;
}

.hero-kpis div {
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.08);
  border-radius: 8px;
  padding: 14px;
}

.hero-kpis strong {
  display: block;
  font-size: 1.65rem;
}

.hero-kpis span {
  margin: 0;
  font-size: .78rem;
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
}

.metrics-row {
  margin-bottom: 18px;
  grid-template-columns: repeat(6, minmax(138px, 1fr));
}

.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--teal);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 12px 30px rgba(15, 38, 56, .06);
  min-height: 126px;
}

.metric-blue { border-top-color: var(--blue); }
.metric-amber { border-top-color: var(--amber); }
.metric-green { border-top-color: var(--green); }
.metric-red { border-top-color: var(--red); }
.metric-gray { border-top-color: var(--gray); }

.metric .label {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
}

.metric .value {
  margin-top: 8px;
  color: var(--ink-strong);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}

.metric .text-value {
  font-size: 1.1rem;
  line-height: 1.2;
}

.metric small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(310px, .65fr);
  gap: 16px;
  margin-bottom: 16px;
}

.panel-xl {
  grid-row: span 2;
}

.line-chart {
  width: 100%;
  min-height: 260px;
}

.line-chart line {
  stroke: #d8e2ea;
  stroke-width: 1;
}

.line-chart polyline {
  fill: none;
  stroke: var(--teal);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.line-chart circle {
  fill: #fff;
  stroke: var(--teal);
  stroke-width: 3;
}

.line-chart text {
  fill: var(--muted);
  font-size: 12px;
  text-anchor: middle;
}

.chart-labels {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: .78rem;
}

.donut-wrap {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.donut {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
}

.donut::after {
  content: "";
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: #fff;
  position: absolute;
}

.donut span {
  position: relative;
  z-index: 1;
  font-weight: 800;
  font-size: 1.55rem;
}

.legend {
  display: grid;
  gap: 10px;
}

.legend div {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-green { background: var(--green); }
.dot-amber { background: var(--amber); }
.dot-red { background: var(--red); }

.bar-list {
  display: grid;
  gap: 13px;
}

.bar-row div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  font-size: .88rem;
}

.bar-row i {
  display: block;
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--teal-bright));
}

.split-meter {
  height: 14px;
  background: #edf2f7;
  border-radius: 999px;
  overflow: hidden;
}

.split-meter span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--teal-bright));
}

.split-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}

.split-stats div {
  border: 1px solid var(--line-soft);
  background: var(--surface-raised);
  border-radius: 8px;
  padding: 13px;
}

.split-stats strong,
.split-stats span {
  display: block;
}

.split-stats strong {
  font-size: 1.6rem;
}

.split-stats span {
  color: var(--muted);
  font-size: .82rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

.table { margin-bottom: 0; }

.table th {
  color: var(--muted);
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: 0;
  border-bottom-color: var(--line);
}

.professional-table td {
  border-bottom-color: var(--line-soft);
}

.professional-table td span {
  color: var(--muted);
  font-size: .84rem;
}

.badge-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 750;
  white-space: nowrap;
}

.status-pending { background: #fff4e2; color: var(--amber); }
.status-sent, .status-active, .status-viewed, .status-downloaded { background: #e6f6ef; color: var(--green); }
.status-failed, .status-disabled { background: #fdeaea; color: var(--red); }
.status-notrequired, .status-notviewed { background: #eef2f6; color: var(--gray); }
.status-expired { background: #344054; color: #fff; }

.rank-list {
  display: grid;
  gap: 11px;
}

.rank-list div {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
}

.timeline {
  display: grid;
  gap: 14px;
}

.timeline-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--teal);
  margin-top: 6px;
  box-shadow: 0 0 0 5px rgba(17, 125, 124, .1);
}

.timeline-row strong,
.timeline-row p,
.timeline-row small {
  display: block;
}

.timeline-row p {
  margin: 2px 0;
  color: var(--ink);
}

.timeline-row small {
  color: var(--muted);
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.kv {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
}

.kv span:first-child { color: var(--muted); }

.avatar {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #d9f4f0;
  color: var(--teal);
  font-weight: 800;
}

.avatar-sm {
  width: 30px;
  height: 30px;
  font-size: .78rem;
}

.avatar-xl {
  width: 78px;
  height: 78px;
  font-size: 1.35rem;
}

.profile-hero {
  display: flex;
  gap: 16px;
  align-items: center;
}

.profile-hero h2 {
  margin: 0;
  font-size: 1.35rem;
}

.profile-hero p {
  margin: 4px 0 0;
  color: var(--muted);
}

.profile-hero .badge-status {
  margin-left: auto;
}

.tester-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
  padding: 24px;
  color: #fff;
  background: linear-gradient(135deg, #0d3042, #117d7c);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.tester-hero h2 {
  margin: 4px 0 0;
  font-size: 1.65rem;
  font-weight: 800;
}

.tester-hero span {
  display: block;
  margin-top: 7px;
  color: rgba(255,255,255,.78);
}

.endpoint-card {
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.1);
  border-radius: 8px;
  padding: 15px;
}

.endpoint-card small,
.endpoint-card code {
  display: block;
}

.endpoint-card small {
  color: #a8e8e4;
  font-weight: 800;
  text-transform: uppercase;
  font-size: .72rem;
}

.endpoint-card code {
  margin-top: 6px;
  color: #fff;
  white-space: normal;
  word-break: break-word;
}

.tester-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .42fr);
  gap: 16px;
  align-items: start;
}

.tester-form,
.tester-side,
.tester-side .panel {
  min-width: 0;
}

.tester-form .form-label {
  color: var(--ink-strong);
  font-size: .84rem;
  font-weight: 750;
}

.field-note {
  margin-top: 6px;
  color: var(--muted);
  font-size: .82rem;
}

.tester-actions,
.link-actions,
.sms-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tester-actions {
  margin-top: 18px;
}

.tester-side {
  display: grid;
  gap: 16px;
}

.result-summary,
.muted-box {
  border: 1px solid var(--line-soft);
  background: var(--surface-raised);
  border-radius: 8px;
  padding: 14px;
}

.result-summary {
  display: grid;
  gap: 4px;
  color: var(--muted);
  min-height: 78px;
}

.result-summary strong {
  color: var(--ink-strong);
  font-size: 1.05rem;
}

.result-summary span {
  display: block;
}

.link-actions {
  margin-top: 12px;
}

.json-box {
  margin: 14px 0 0;
  max-height: 300px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid #d9e4ec;
  border-radius: 8px;
  background: #071626;
  color: #e7f8f5;
  padding: 14px;
  font-size: .8rem;
}

.sms-preview {
  min-height: 132px;
  resize: vertical;
  background: var(--surface-raised);
  overflow-wrap: anywhere;
}

.public-main {
  min-height: 100vh;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 440px;
  gap: 40px;
  align-items: center;
  padding: clamp(24px, 5vw, 72px);
  background:
    radial-gradient(circle at top left, rgba(26, 166, 163, .16), transparent 32%),
    linear-gradient(135deg, #f8fbfd, #eaf2f6);
}

.login-story {
  max-width: 700px;
}

.login-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--ink);
  margin-bottom: 42px;
}

.login-brand small {
  color: var(--muted);
}

.login-story h1 {
  max-width: 760px;
  margin: 0;
  color: var(--ink-strong);
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.04;
  font-weight: 800;
}

.login-story p {
  max-width: 560px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
}

.login-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.login-proof span {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.7);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--ink);
  font-weight: 700;
  font-size: .86rem;
}

.login-card {
  background: rgba(255,255,255,.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 30px;
  box-shadow: 0 25px 70px rgba(15, 38, 56, .14);
}

.login-card-head {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 24px;
}

.login-card-head h2 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 1.35rem;
}

.login-card-head p {
  margin: 3px 0 0;
  color: var(--muted);
}

.clinic-logo {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--teal);
  color: #fff;
  font-weight: 800;
}

.login-note {
  margin-top: 18px;
  color: var(--muted);
  text-align: center;
  font-size: .84rem;
}

.patient-panel {
  width: min(560px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.confidential {
  color: var(--muted);
  font-size: .9rem;
}

@media (max-width: 1180px) {
  .metrics-row {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .panel-xl {
    grid-row: auto;
  }
}

@media (max-width: 920px) {
  .admin-body { display: block; }
  .sidebar {
    position: static;
    height: auto;
  }
  .sidebar-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar-profile { margin-top: 18px; }
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .content-wrap,
  .topbar {
    padding-left: 16px;
    padding-right: 16px;
  }
  .dashboard-hero {
    grid-template-columns: 1fr;
  }
  .tester-hero,
  .tester-grid {
    grid-template-columns: 1fr;
  }
  .hero-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .login-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .sidebar-nav { grid-template-columns: 1fr; }
  .hero-kpis,
  .split-stats,
  .donut-wrap {
    grid-template-columns: 1fr;
  }
  .topbar-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }
  .profile-chip {
    justify-content: flex-start;
  }
  .kv {
    grid-template-columns: 1fr;
  }
  .login-card {
    padding: 22px;
  }
}

/* Professional light dashboard */
.admin-main {
  min-width: 0;
  background: var(--band);
}

.topbar-search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 7px 13px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .03);
}

.topbar-search:hover,
.topbar-search:focus {
  color: var(--blue);
  background: #f8faff;
  border-color: #cdd7ed;
}

.topbar-search svg,
.text-link svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dashboard-shell {
  display: grid;
  gap: 14px;
  width: 100%;
  max-width: 1720px;
  margin: 0 auto;
}

.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.kpi-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
  min-height: 132px;
  padding: 17px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: var(--shadow);
}

.kpi-card-featured {
  border-color: #9fb8ff;
  box-shadow: 0 0 0 1px rgba(55, 102, 232, .08), 0 8px 22px rgba(55, 102, 232, .08);
}

.kpi-icon {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 10px;
}

.kpi-icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.kpi-icon-blue { color: var(--blue); background: #edf2ff; }
.kpi-icon-teal { color: var(--teal); background: #e9f8f5; }
.kpi-icon-cyan { color: #1596af; background: #e9f7fa; }
.kpi-icon-violet { color: var(--violet); background: #f2edff; }

.kpi-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.kpi-label {
  margin-top: 1px;
  color: var(--ink);
  font-size: .87rem;
  font-weight: 620;
}

.kpi-content > strong {
  display: block;
  margin-top: 6px;
  color: var(--ink-strong);
  font-size: clamp(1.6rem, 2.2vw, 2rem);
  line-height: 1;
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
}

.kpi-content > strong em {
  margin-left: 2px;
  font-size: .65em;
  font-style: normal;
  letter-spacing: 0;
}

.kpi-content > small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.35;
}

.kpi-substats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 8px;
  color: var(--muted);
  font-size: .75rem;
}

.kpi-substats b {
  color: var(--ink);
  font-weight: 700;
}

.dashboard-primary-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(310px, .92fr);
  gap: 12px;
}

.analytics-panel,
.mini-analytics-panel,
.operations-panel {
  min-width: 0;
  box-shadow: var(--shadow);
}

.analytics-panel {
  min-height: 358px;
}

.analytics-panel .panel-head,
.mini-analytics-panel .panel-head,
.operations-panel .panel-head {
  align-items: center;
  margin-bottom: 12px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--blue);
  font-size: .79rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.text-link:hover { color: #244fc4; }

.line-chart-wrap {
  min-width: 0;
  overflow: hidden;
}

.upload-chart {
  display: block;
  width: 100%;
  height: 226px;
  overflow: visible;
}

.upload-x-axis {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px 8px 48px;
  color: #7c8799;
  font-size: .7rem;
  white-space: nowrap;
}

.chart-gridline {
  stroke: #e8ecf2;
  stroke-width: 1;
  stroke-dasharray: 3 4;
}

.chart-axis-label,
.chart-x-label {
  fill: #7c8799;
  font-family: inherit;
  font-size: 12px;
}

.chart-area { fill: url(#uploadArea); }

.chart-line {
  fill: none;
  stroke: var(--blue);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-point {
  fill: #fff;
  stroke: var(--blue);
  stroke-width: 2.5;
}

.chart-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: .76rem;
}

.chart-footer span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.chart-footer strong {
  color: var(--ink);
  font-weight: 620;
}

.legend-swatch {
  display: inline-block;
  width: 17px;
  height: 3px;
  border-radius: 3px;
}

.legend-swatch-blue { background: var(--blue); }

.donut-layout {
  display: grid;
  gap: 22px;
  justify-items: center;
  align-content: center;
  min-height: 275px;
}

.chart-donut,
.chart-pie {
  flex: 0 0 auto;
  width: 118px;
  height: 118px;
  border-radius: 50%;
}

.chart-donut {
  position: relative;
  display: grid;
  place-items: center;
}

.chart-donut::after {
  content: "";
  position: absolute;
  width: 68%;
  height: 68%;
  border-radius: 50%;
  background: #fff;
}

.chart-donut-lg {
  width: 156px;
  height: 156px;
}

.chart-donut span {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  line-height: 1.1;
}

.chart-donut span strong {
  color: var(--ink-strong);
  font-size: 1.3rem;
  letter-spacing: -.035em;
  font-variant-numeric: tabular-nums;
}

.chart-donut span small {
  margin-top: 4px;
  color: var(--muted);
  font-size: .72rem;
}

.chart-legend {
  display: grid;
  gap: 12px;
  width: 100%;
}

.chart-legend > div {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.chart-legend i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.chart-legend span,
.chart-legend strong {
  color: var(--ink);
  font-size: .79rem;
}

.chart-legend strong {
  font-weight: 680;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.chart-legend strong small {
  color: var(--muted);
  font-weight: 500;
}

.dashboard-analytics-grid {
  display: grid;
  grid-template-columns: 1.12fr .95fr .98fr 1fr;
  gap: 12px;
}

.mini-analytics-panel {
  min-height: 272px;
}

.horizontal-bars {
  display: grid;
  gap: 12px;
  padding-top: 4px;
}

.horizontal-bar-row > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
  font-size: .76rem;
}

.horizontal-bar-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.horizontal-bar-row strong {
  color: var(--ink-strong);
  font-weight: 680;
  font-variant-numeric: tabular-nums;
}

.bar-track {
  height: 7px;
  overflow: hidden;
  background: #edf1f6;
  border-radius: 5px;
}

.bar-track i {
  display: block;
  height: 100%;
  min-width: 3px;
  background: var(--blue);
  border-radius: inherit;
}

.compact-pie-layout {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 176px;
}

.compact-pie-layout .chart-pie,
.compact-pie-layout .chart-donut {
  width: 108px;
  height: 108px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.75);
}

.chart-legend-compact { gap: 11px; }

.chart-legend-compact > div {
  grid-template-columns: 9px minmax(0, 1fr) auto;
  gap: 7px;
}

.chart-legend-compact span {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vertical-bars {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  height: 182px;
  padding: 9px 4px 0;
  border-bottom: 1px solid var(--line);
}

.vertical-bar-column {
  flex: 1 1 0;
  display: grid;
  grid-template-rows: 18px 126px 25px;
  justify-items: center;
  align-items: end;
  min-width: 0;
}

.vertical-bar-column strong {
  align-self: start;
  color: var(--ink-strong);
  font-size: .69rem;
  font-weight: 670;
  font-variant-numeric: tabular-nums;
}

.vertical-track {
  position: relative;
  width: min(27px, 72%);
  height: 100%;
  overflow: hidden;
  background: #f0f3f8;
  border-radius: 4px 4px 0 0;
}

.vertical-track i {
  position: absolute;
  inset: auto 0 0;
  display: block;
  background: var(--blue);
  border-radius: 4px 4px 0 0;
}

.vertical-bar-column span {
  align-self: start;
  max-width: 100%;
  padding-top: 6px;
  overflow: hidden;
  color: var(--muted);
  font-size: .68rem;
  line-height: 1.15;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-operations-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(320px, .9fr);
  gap: 12px;
}

.operations-panel { min-height: 330px; }

.dashboard-table {
  min-width: 760px;
  font-size: .78rem;
}

.dashboard-table th {
  padding: 9px 10px;
  color: #7a8494;
  background: #f8fafc;
  border-top: 1px solid var(--line-soft);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .03em;
}

.dashboard-table td {
  padding: 9px 10px;
  color: var(--ink);
  vertical-align: middle;
}

.dashboard-table tbody tr:hover { background: #fafbfe; }

.dashboard-table td strong,
.dashboard-table td span {
  display: block;
}

.dashboard-table td strong { font-weight: 650; }

.dashboard-table td span:not(.badge-status) {
  margin-top: 2px;
  color: var(--muted);
  font-size: .7rem;
}

.report-id {
  color: var(--blue);
  font-weight: 680;
  text-decoration: none;
}

.dashboard-table time {
  color: var(--muted);
  white-space: nowrap;
}

.badge-status {
  min-height: 22px;
  padding: 3px 7px;
  border-radius: 5px;
  font-size: .68rem;
  font-weight: 650;
}

.activity-timeline {
  display: grid;
  gap: 0;
  padding-top: 2px;
}

.activity-row {
  display: grid;
  grid-template-columns: 38px 12px minmax(0, 1fr);
  gap: 8px;
  min-height: 46px;
}

.activity-row > time {
  padding-top: 2px;
  color: #8a94a4;
  font-size: .68rem;
  font-variant-numeric: tabular-nums;
}

.activity-dot {
  position: relative;
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 1px var(--blue);
}

.activity-dot::after {
  content: "";
  position: absolute;
  top: 8px;
  bottom: -39px;
  left: 2px;
  width: 1px;
  background: #dfe5ed;
}

.activity-row:last-child .activity-dot::after { display: none; }

.activity-row strong {
  display: block;
  overflow: hidden;
  color: var(--ink-strong);
  font-size: .76rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-row p,
.activity-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-row p {
  margin: 1px 0;
  color: var(--muted);
  font-size: .7rem;
}

.activity-row small {
  color: #98a2b3;
  font-size: .65rem;
}

@media (min-width: 1450px) {
  .donut-layout {
    grid-template-columns: 156px minmax(0, 1fr);
    justify-items: stretch;
  }
}

@media (max-width: 1400px) {
  .dashboard-analytics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .dashboard-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-primary-grid,
  .dashboard-operations-grid {
    grid-template-columns: 1fr;
  }

  .sms-panel { min-height: auto; }

  .donut-layout {
    grid-template-columns: 156px minmax(0, 1fr);
    justify-items: stretch;
    min-height: 210px;
    padding: 0 5%;
  }
}

@media (max-width: 920px) {
  .sidebar {
    position: relative;
    height: auto;
    padding: 15px 16px;
  }

  .brand { margin-bottom: 14px; }

  .sidebar-nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .sidebar-nav::-webkit-scrollbar { display: none; }

  .sidebar-nav a {
    flex: 0 0 auto;
    padding: 8px 10px;
  }

  .sidebar-profile,
  .sidebar-footer { display: none; }

  .topbar {
    flex-direction: row;
    align-items: center;
    padding: 13px 16px;
  }

  .content-wrap { padding: 14px 16px 28px; }
}

@media (max-width: 700px) {
  .dashboard-kpis,
  .dashboard-analytics-grid {
    grid-template-columns: 1fr;
  }

  .compact-pie-layout {
    grid-template-columns: 118px minmax(0, 1fr);
  }

  .donut-layout {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 0;
  }

  .chart-legend { max-width: 360px; }
}

@media (max-width: 560px) {
  .topbar-actions {
    width: auto;
    flex-direction: row;
    align-items: center;
  }

  .profile-chip > span:last-child { display: none; }
  .profile-chip { padding-left: 12px; }

  .topbar h1 { font-size: 1.4rem; }

  .topbar-search {
    display: none;
  }

  .profile-chip { border-left: 0; }

  .kpi-card { min-height: 118px; }

  .panel { padding: 15px; }

  .upload-chart {
    width: 720px;
    max-width: none;
  }

  .line-chart-wrap { overflow-x: auto; }

  .chart-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .compact-pie-layout { grid-template-columns: 102px minmax(0, 1fr); }

  .compact-pie-layout .chart-pie,
  .compact-pie-layout .chart-donut {
    width: 96px;
    height: 96px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Application-wide light theme */
::selection {
  color: var(--ink-strong);
  background: #dce6ff;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(55, 102, 232, .2);
  outline-offset: 2px;
}

.form-label,
.form-check-label {
  margin-bottom: 6px;
  color: #344054;
  font-size: .82rem;
  font-weight: 620;
}

.form-control,
.form-select {
  min-height: 40px;
  padding: 8px 11px;
  color: var(--ink-strong);
  background-color: #fff;
  border-color: #d7dde7;
  border-radius: 8px;
  font-size: .87rem;
  line-height: 1.4;
}

textarea.form-control { min-height: auto; }

.form-control::placeholder { color: #98a2b3; }

.form-control[readonly],
.form-control:disabled,
.form-select:disabled {
  color: #475467;
  background-color: #f7f9fc;
}

.form-check-input:checked {
  background-color: var(--blue);
  border-color: var(--blue);
}

.btn {
  min-height: 38px;
  padding: 7px 13px;
  line-height: 1.35;
  box-shadow: none;
}

.btn-sm {
  min-height: 32px;
  padding: 5px 10px;
  font-size: .78rem;
}

.btn-lg {
  min-height: 48px;
  padding: 11px 16px;
  font-size: .94rem;
}

.btn-outline-secondary {
  color: #475467;
  background: #fff;
  border-color: #d0d7e2;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-secondary.active {
  color: #244fc4;
  background: #eef3ff;
  border-color: #b9c9f4;
}

.btn-outline-primary {
  color: var(--blue);
  background: #fff;
  border-color: #b9c9f4;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

.btn-outline-danger,
.btn-outline-success { background: #fff; }

.btn-group > .btn {
  min-width: 42px;
  font-weight: 600;
}

.panel {
  border-color: var(--line);
  border-radius: 11px;
  box-shadow: var(--shadow);
}

.panel > h2.h6,
.panel > .h6 {
  margin: 0 0 15px;
  color: var(--ink-strong);
  font-size: .96rem;
  font-weight: 700;
}

.toolbar {
  gap: 12px;
  align-items: flex-end;
}

.toolbar > div {
  flex: 1 1 150px;
  min-width: 135px;
  max-width: 220px;
}

.toolbar .form-label { display: block; }

.table-responsive {
  border: 1px solid var(--line-soft);
  border-radius: 9px;
}

.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--ink);
  font-size: .82rem;
}

.table thead th {
  padding: 10px 12px;
  color: #667085;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  font-size: .69rem;
  font-weight: 700;
  letter-spacing: .025em;
  white-space: nowrap;
}

.table tbody td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafbfe; }

.table td > a:not(.btn) {
  color: var(--blue);
  font-weight: 650;
  text-decoration: none;
}

.alert {
  border-width: 1px;
  border-radius: 9px;
  font-size: .86rem;
}

.alert-success {
  color: #0d6659;
  background: #ebf8f5;
  border-color: #bce7dd;
}

.alert-warning {
  color: #8a5708;
  background: #fff8e8;
  border-color: #f1dcac;
}

.metric {
  min-height: 118px;
  padding: 17px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: var(--shadow);
}

.metric .label {
  color: var(--muted);
  font-size: .79rem;
  font-weight: 620;
}

.metric .value {
  margin-top: 10px;
  font-size: 1.8rem;
  font-weight: 720;
  letter-spacing: -.035em;
}

.metric .text-value {
  font-size: 1.05rem;
  letter-spacing: -.015em;
}

.details-grid { gap: 12px; }

.details-grid .panel { min-width: 0; }

.kv {
  grid-template-columns: minmax(112px, 145px) minmax(0, 1fr);
  gap: 14px;
  padding: 10px 0;
  font-size: .85rem;
}

.kv:last-child { border-bottom: 0; }
.kv span:last-child { overflow-wrap: anywhere; }

.profile-hero {
  padding: 20px;
  background: #fff;
}

.profile-hero h2 {
  color: var(--ink-strong);
  font-size: 1.25rem;
  font-weight: 700;
}

.avatar {
  color: #0b7f73;
  background: #def4ef;
  font-weight: 720;
}

.avatar-xl {
  width: 68px;
  height: 68px;
  font-size: 1.15rem;
}

.timeline { gap: 0; }

.timeline-row {
  position: relative;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 10px;
  padding-bottom: 15px;
}

.timeline-row::before {
  content: "";
  position: absolute;
  top: 14px;
  bottom: 0;
  left: 5px;
  width: 1px;
  background: #dfe5ed;
}

.timeline-row:last-child::before { display: none; }

.timeline-dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  background: var(--blue);
  box-shadow: 0 0 0 3px #e8efff;
}

.timeline-row strong {
  color: var(--ink-strong);
  font-size: .82rem;
  font-weight: 650;
}

.timeline-row p {
  margin: 2px 0;
  color: var(--muted);
  font-size: .79rem;
}

.timeline-row small { font-size: .72rem; }

.tester-hero {
  margin-bottom: 14px;
  padding: 20px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: var(--shadow);
}

.tester-hero h2 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -.015em;
}

.tester-hero span {
  margin-top: 6px;
  color: var(--muted);
  font-size: .86rem;
}

.endpoint-card {
  padding: 13px 15px;
  background: #f7f9fc;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.endpoint-card small {
  color: var(--blue);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
}

.endpoint-card code {
  margin-top: 4px;
  color: #344054;
  font-size: .78rem;
}

.tester-grid { gap: 12px; }
.tester-side { gap: 12px; }

.tester-form .form-label {
  color: #344054;
  font-size: .8rem;
  font-weight: 620;
}

.result-summary,
.muted-box {
  background: #f8fafc;
  border-color: var(--line);
  border-radius: 9px;
}

.json-box {
  color: #344054;
  background: #f7f9fc;
  border-color: var(--line);
  border-radius: 9px;
  font-family: "Cascadia Code", Consolas, monospace;
}

.sms-preview { background: #f8fafc; }

.public-body {
  color: var(--ink);
  background: #f4f6f9;
}

.public-main {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: #f4f6f9;
}

.login-shell {
  width: 100%;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
  gap: clamp(36px, 6vw, 96px);
  padding: clamp(28px, 6vw, 84px);
  background: #f4f6f9;
}

.login-story { max-width: 680px; }

.login-brand {
  margin-bottom: 46px;
  color: var(--ink-strong);
}

.login-brand .brand-mark {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 7px 18px rgba(55, 102, 232, .18);
}

.login-brand small { color: var(--muted); }

.login-story h1 {
  max-width: 650px;
  font-size: clamp(2.15rem, 4.4vw, 3.7rem);
  font-weight: 720;
  letter-spacing: -.05em;
}

.login-story p {
  margin-top: 18px;
  color: #5f6c80;
  font-size: 1.02rem;
  line-height: 1.7;
}

.login-proof {
  gap: 18px;
  margin-top: 30px;
}

.login-proof span {
  position: relative;
  padding: 0 0 0 20px;
  color: #475467;
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: .83rem;
  font-weight: 620;
}

.login-proof span::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 0;
  width: 11px;
  height: 7px;
  border-bottom: 2px solid var(--teal);
  border-left: 2px solid var(--teal);
  transform: rotate(-45deg);
}

.login-card {
  padding: 30px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(16, 24, 40, .08);
}

.login-card-head { margin-bottom: 26px; }

.login-card-head h2 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -.02em;
}

.login-card-head p { font-size: .86rem; }

.clinic-logo {
  width: 46px;
  height: 46px;
  color: #fff;
  background: var(--blue);
  border-radius: 10px;
  box-shadow: 0 7px 18px rgba(55, 102, 232, .16);
}

.clinic-logo svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-note {
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  font-size: .78rem;
}

.patient-panel {
  width: min(520px, 100%);
  padding: 30px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(16, 24, 40, .08);
}

.patient-panel .clinic-logo { margin-bottom: 22px; }

.patient-panel h1 {
  color: var(--ink-strong);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -.02em;
}

.confidential {
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  font-size: .8rem;
  line-height: 1.55;
}

@media (max-width: 920px) {
  .login-shell {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .login-story { max-width: 760px; }
  .login-brand { margin-bottom: 28px; }
  .login-story h1 { max-width: 760px; }
  .login-card { width: min(520px, 100%); }
}

@media (max-width: 560px) {
  .toolbar > div {
    flex-basis: 100%;
    max-width: none;
  }

  .toolbar > .btn { flex: 1 1 auto; }

  .profile-hero {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .profile-hero .badge-status { margin-left: 84px; }

  .tester-hero { padding: 16px; }

  .login-shell { padding: 22px; }
  .login-story h1 { font-size: 2.15rem; }
  .login-proof { display: grid; gap: 11px; }
  .login-card { padding: 23px; }
  .public-main { padding: 14px; }
  .patient-panel { padding: 23px; }
}

/* ---------------------------------------------------------------
   Client branding, enhanced sign-in, settings form
   --------------------------------------------------------------- */

/* Uploaded clinic logo, used wherever the default flask mark would sit */
.brand-logo {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  flex: 0 0 auto;
}

.brand-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.brand-logo-lg {
  width: 52px;
  height: 52px;
  border-radius: 14px;
}

.clinic-logo-img {
  background: #fff;
  padding: 6px;
  overflow: hidden;
}

.clinic-logo-img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Feature list on the sign-in page */
.login-features {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  max-width: 30rem;
}

.login-features li {
  display: flex;
  gap: .85rem;
  align-items: flex-start;
}

.login-features span:last-child {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  font-size: .9rem;
  color: var(--muted);
  line-height: 1.5;
}

.login-features strong {
  color: var(--ink-strong);
  font-size: .95rem;
  font-weight: 600;
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 9px;
  background: rgba(18, 165, 148, .1);
}

.feature-icon svg {
  width: 17px;
  height: 17px;
  stroke: var(--teal);
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Show/hide password */
.password-field {
  position: relative;
}

.password-field .form-control {
  padding-right: 4.25rem;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: .6rem;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  padding: .25rem .4rem;
  border-radius: 6px;
}

.password-toggle:hover {
  color: var(--blue);
  background: var(--surface-raised);
}

.password-toggle:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

.login-error:empty {
  display: none;
}

.login-error {
  background: rgba(224, 90, 90, .08);
  border: 1px solid rgba(224, 90, 90, .3);
  color: #b23c3c;
  border-radius: 8px;
  padding: .6rem .8rem;
  font-size: .85rem;
  margin-bottom: 1rem;
}

.login-note {
  display: flex;
  align-items: center;
  gap: .5rem;
  justify-content: center;
}

.lock-mark svg {
  width: 14px;
  height: 14px;
  stroke: var(--muted);
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}

.login-footer {
  text-align: center;
  padding: 1.5rem 1rem 2.5rem;
  font-size: .8rem;
  color: var(--muted);
}

/* Logo preview in Settings */
.logo-preview {
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--surface-raised);
  padding: .75rem;
  display: grid;
  place-items: center;
  min-height: 84px;
}

.logo-preview img {
  max-width: 100%;
  max-height: 64px;
  object-fit: contain;
}

@media (max-width: 900px) {
  .login-features {
    display: none;
  }
}

/* SMS wording preview on the settings page */
.sms-preview-box {
    margin: 0;
    padding: .75rem .9rem;
    background: #f6f8fb;
    border: 1px solid #dfe5ec;
    border-radius: 8px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .82rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
    color: #2c3542;
}
