:root {
  color-scheme: light;
  --navy: #111827;
  --navy-2: #182235;
  --ink: #111827;
  --muted: #687386;
  --line: #edf0f6;
  --surface: #ffffff;
  --bg: #f7f8fb;
  --purple: #6541d8;
  --purple-2: #5b35d7;
  --green: #18b978;
  --teal: #18a7a2;
  --blue: #2f9cf4;
  --amber: #f4a62a;
  --red: #e45d5d;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.login-screen {
  display: none;
}

.auth-locked {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(17, 24, 39, 0.96), rgba(24, 34, 53, 0.92)),
    linear-gradient(120deg, rgba(101, 65, 216, 0.24), rgba(24, 185, 120, 0.16)),
    #111827;
}

.auth-locked .app-shell {
  display: none;
}

.auth-locked .login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(920px, 100%);
  min-height: 520px;
  display: grid;
  grid-template-columns: minmax(270px, 0.86fr) minmax(330px, 1fr);
  overflow: hidden;
  border: 1px solid rgba(199, 210, 254, 0.18);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 28px 90px rgba(17, 24, 39, 0.34);
}

.login-brand {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 34px;
  background:
    linear-gradient(180deg, rgba(101, 65, 216, 0.34), rgba(24, 167, 162, 0.16)),
    var(--navy);
  color: #ffffff;
}

.login-brand .brand-mark {
  flex: 0 0 auto;
}

.login-brand strong,
.login-brand span {
  display: block;
}

.login-brand strong {
  font-size: 23px;
}

.login-brand span {
  margin-top: 5px;
  color: #aeb8cc;
  font-size: 13px;
  font-weight: 700;
}

.login-form {
  display: grid;
  align-content: center;
  gap: 18px;
  padding: 44px;
  background:
    linear-gradient(180deg, rgba(240, 237, 255, 0.56), transparent 34%),
    #ffffff;
}

.login-form h1 {
  margin-top: 6px;
  font-size: 30px;
}

.login-error {
  min-height: 18px;
  margin: -4px 0 0;
  color: var(--red);
  font-size: 12px;
  font-weight: 850;
}

.account-access {
  display: grid;
  gap: 8px;
  padding-top: 4px;
}

.account-access span {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid #edf0f6;
  background: #fbfcff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.account-access b {
  color: var(--ink);
}

.app-shell {
  display: grid;
  grid-template-columns: 185px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 16px 12px;
  background: var(--navy);
  color: #f8fbff;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand,
.doctor-chip,
.sidebar-card,
.panel-header,
.topbar,
.top-actions,
.chat-head,
.profile-layout,
.reschedule-card {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  padding: 0 2px 12px;
}

.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1.5px solid #9ca3ff;
  border-radius: 8px;
  color: #c7d2fe;
  font-size: 19px;
  font-weight: 800;
}

.brand strong {
  font-size: 15px;
}

.brand strong,
.doctor-chip strong {
  display: block;
}

.brand span,
.doctor-chip small,
.sidebar-card small {
  display: block;
  margin-top: 2px;
  color: #9aa5b8;
  font-size: 11px;
}

.nav-list {
  display: grid;
  gap: 4px;
}

.nav-group {
  margin: 14px 4px 6px;
  color: #7f8ba5;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.nav-item {
  width: 100%;
  min-height: 34px;
  padding: 0 9px;
  background: transparent;
  color: #d3d9e6;
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: left;
  font-size: 12px;
  font-weight: 750;
}

.nav-item span {
  width: 18px;
  text-align: center;
  opacity: 0.92;
}

.nav-item b {
  margin-left: auto;
  padding: 1px 7px;
  border-radius: 999px;
  background: #18b978;
  color: #ffffff;
  font-size: 10px;
}

.nav-item:hover,
.nav-item.active {
  background: var(--purple);
  color: #ffffff;
}

.logout {
  margin-top: auto;
  min-height: 38px;
}

.settings-link {
  margin-top: 4px;
}

.owner-only {
  display: none;
}

.owner-session .owner-only {
  display: flex;
}

.owner-session article.owner-only {
  display: block;
}

.owner-layout {
  display: grid;
  gap: 14px;
}

.owner-hero {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(101, 65, 216, 0.12), rgba(24, 185, 120, 0.1)),
    #ffffff;
}

.owner-hero h2 {
  margin-top: 4px;
  font-size: 22px;
}

.owner-work {
  grid-template-columns: minmax(0, 1.2fr) minmax(290px, 0.8fr);
}

.clinic-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.clinic-form .wide,
.clinic-form button {
  grid-column: 1 / -1;
}

.clinic-list {
  display: grid;
  gap: 10px;
}

.clinic-item {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.clinic-item.paused {
  background: #f8f9fc;
  border-color: #dde3ef;
  opacity: 0.82;
}

.clinic-item div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.clinic-item strong,
.clinic-item span,
.clinic-item small {
  display: block;
}

.clinic-item span {
  padding: 3px 8px;
  border-radius: 999px;
  background: #f0edff;
  color: var(--purple);
  font-size: 10px;
  font-weight: 900;
}

.clinic-item p,
.clinic-item small {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.clinic-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 4px;
}

.clinic-actions button {
  min-height: 30px;
  padding: 0 10px;
  border-color: var(--line);
  background: #ffffff;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
}

.clinic-actions .danger-action {
  border-color: #ffd7d7;
  color: #b3261e;
  background: #fff8f8;
}

.service-list {
  display: grid;
  gap: 9px;
}

.service-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.service-item strong,
.service-item span {
  display: block;
}

.service-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.service-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.service-actions button {
  min-height: 30px;
  padding: 0 10px;
  border-color: var(--line);
  background: #ffffff;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
}

.service-actions .danger-action {
  border-color: #ffd7d7;
  color: #b3261e;
  background: #fff8f8;
}

.sidebar-card {
  margin-top: auto;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(24, 185, 120, 0.16);
}

.main-panel {
  min-width: 0;
  padding: 0 14px 20px;
  overflow: auto;
}

.topbar {
  justify-content: space-between;
  gap: 18px;
  min-height: 62px;
  margin: 0 -14px 14px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.title-row {
  display: flex;
  align-items: center;
  gap: 18px;
}

.menu-button,
.chevron-button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: transparent;
  color: #111827;
  font-weight: 900;
}

.eyebrow {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 15px;
  line-height: 1.1;
}

h2 {
  margin-bottom: 0;
  font-size: 14px;
}

h3 {
  margin-bottom: 4px;
  font-size: 16px;
}

.top-actions {
  gap: 10px;
}

.sync-pill,
.intent-pill {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: #ecfbf4;
  color: #0a8154;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.sync-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 999px;
  background: var(--green);
}

.icon-button {
  position: relative;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: #ffffff;
  color: var(--purple);
  border: 1px solid var(--line);
  font-weight: 900;
}

.notification-center {
  position: relative;
}

.notification-button {
  position: relative;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--navy);
  font-weight: 800;
}

.notification-button:hover,
.notification-button[aria-expanded="true"] {
  border-color: #b9a9ff;
  background: #f6f3ff;
  color: var(--purple);
}

.notification-button em {
  font-size: 11px;
  font-style: normal;
}

.notification-button b {
  position: absolute;
  top: -5px;
  right: -4px;
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #ef4059;
  color: #ffffff;
  font-size: 10px;
  line-height: 1;
}

.notification-panel {
  position: absolute;
  z-index: 120;
  top: calc(100% + 10px);
  right: 0;
  width: min(360px, calc(100vw - 28px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 20px 55px rgba(17, 24, 39, .18);
}

.notification-panel-head {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--line);
}

.notification-items {
  max-height: 390px;
  overflow: auto;
}

.notification-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
}

.notification-item:last-child {
  border-bottom: 0;
}

.notification-type {
  padding: 4px 7px;
  border-radius: 999px;
  background: #eee9ff;
  color: var(--purple);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.notification-type.reminder {
  background: #e7f8f0;
  color: #087c50;
}

.notification-copy {
  min-width: 0;
}

.notification-copy strong,
.notification-copy small {
  display: block;
}

.notification-copy strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.notification-actions {
  display: grid;
  gap: 5px;
}

.notification-actions button {
  min-height: 26px;
  padding: 0 8px;
  font-size: 9px;
}

.confirmation-actions {
  justify-content: flex-end;
  margin-top: 8px;
}

.confirmation-actions button {
  min-width: 130px;
}

.doctor-notification-peek {
  position: fixed;
  z-index: 250;
  top: 18px;
  right: 18px;
  width: min(330px, calc(100vw - 36px));
  padding: 14px 16px;
  border: 1px solid #c7bbff;
  border-left: 5px solid var(--purple);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 20px 55px rgba(17, 24, 39, .22);
}

.doctor-notification-peek strong,
.doctor-notification-peek span,
.doctor-notification-peek small {
  display: block;
}

.doctor-notification-peek strong {
  color: var(--purple);
  font-size: 11px;
  text-transform: uppercase;
}

.doctor-notification-peek span {
  margin-top: 4px;
  color: var(--navy);
  font-size: 13px;
  font-weight: 800;
}

.doctor-notification-peek small {
  margin-top: 5px;
  color: var(--muted);
}

.doctor-chip {
  gap: 8px;
}

.doctor-chip > span,
.avatar,
.patient-avatar,
.conversation span,
.chat-head > span {
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #e8f2ff;
  color: #2367b1;
  font-weight: 900;
}

.doctor-chip > span {
  width: 36px;
  height: 36px;
  background:
    radial-gradient(circle at 50% 35%, #2b1d18 0 12%, transparent 13%),
    radial-gradient(circle at 50% 48%, #e0aa86 0 20%, transparent 21%),
    linear-gradient(135deg, #172033, #eef2ff);
  color: transparent;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.kpi-grid,
.dashboard-grid,
.work-grid,
.settings-grid {
  display: grid;
  gap: 14px;
}

.kpi-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 14px;
}

.kpi-card,
.panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(30, 42, 68, 0.035);
}

.kpi-card {
  position: relative;
  min-height: 104px;
  padding: 20px 12px 14px 66px;
}

.kpi-card i {
  position: absolute;
  left: 18px;
  top: 24px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-style: normal;
  font-weight: 900;
}

.icon-purple i {
  background: #f0edff;
  color: var(--purple);
}

.icon-green i {
  background: #e8fbf2;
  color: var(--green);
}

.icon-blue i {
  background: #eaf5ff;
  color: var(--blue);
}

.icon-amber i {
  background: #fff4df;
  color: var(--amber);
}

.kpi-card span,
.muted,
dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.kpi-card span,
.kpi-card small {
  white-space: nowrap;
}

.kpi-card strong {
  display: block;
  margin: 6px 0 5px;
  font-size: 25px;
  line-height: 1;
}

.kpi-card small {
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
}

#dashboard.screen.active {
  display: grid;
  grid-template-columns: minmax(460px, 1.33fr) minmax(315px, 0.98fr) minmax(230px, 0.67fr);
  align-items: start;
  gap: 14px;
}

#dashboard .kpi-grid {
  grid-column: 1 / 3;
  grid-row: 1;
  margin-bottom: 0;
}

.reference-grid {
  display: contents;
}

.appointments-panel {
  grid-column: 1;
  grid-row: 2;
  overflow: hidden;
}

.chart-panel {
  grid-column: 2;
  grid-row: 2;
}

.featured-patient {
  grid-column: 3;
  grid-row: 1 / span 2;
}

.whatsapp-panel {
  grid-column: 1 / 3;
  grid-row: 3;
}

.recent-panel {
  grid-column: 3;
  grid-row: 3;
}

.appointments-panel {
  min-height: 286px;
}

.panel {
  padding: 16px;
}

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

.panel-header {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.link-action,
.kebab {
  background: transparent;
  color: var(--purple);
  font-weight: 800;
}

.soft-select {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
  font-weight: 800;
}

.metric-flash {
  animation: metricPulse 560ms ease;
}

@keyframes metricPulse {
  0% {
    color: var(--green);
    transform: translateY(-1px);
  }

  100% {
    color: inherit;
    transform: translateY(0);
  }
}

.primary-action {
  min-height: 38px;
  padding: 0 14px;
  background: linear-gradient(135deg, var(--purple), var(--purple-2));
  color: #ffffff;
  font-weight: 800;
}

.secondary-action {
  justify-self: start;
  min-height: 34px;
  padding: 0 12px;
  border-color: #d8ddff;
  background: #f6f4ff;
  color: var(--purple);
  font-weight: 850;
}

.full {
  width: 100%;
}

.appointments-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.appointments-table th,
.appointments-table td {
  overflow: hidden;
  padding: 10px 3px;
  border-bottom: 1px solid #edf1f7;
  text-align: left;
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.appointments-table th:nth-child(1),
.appointments-table td:nth-child(1) {
  width: 62px;
}

.appointments-table th:nth-child(2),
.appointments-table td:nth-child(2) {
  width: 88px;
}

.appointments-table th:nth-child(3),
.appointments-table td:nth-child(3) {
  width: 96px;
}

.appointments-table th:nth-child(4),
.appointments-table td:nth-child(4) {
  width: 86px;
}

.appointments-table th:nth-child(5),
.appointments-table td:nth-child(5) {
  width: 82px;
}

.appointments-table th {
  color: var(--muted);
  font-weight: 800;
}

.appointments-table td {
  font-weight: 700;
}

.tag {
  display: inline-flex;
  min-height: 19px;
  align-items: center;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 800;
}

.tag.ok {
  background: #e7f9f0;
  color: #148653;
}

.tag.wait {
  background: #fff4d7;
  color: #b06d08;
}

.chart-wrap {
  display: grid;
  gap: 6px;
  min-height: 178px;
}

.chart-wrap svg {
  width: 100%;
  height: 146px;
}

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

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

.chart-days,
.mini-stats {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.mini-stats {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 8px;
}

.mini-stats span {
  min-height: 56px;
  padding: 10px;
  border-radius: 8px;
  background: #f8fafc;
}

.mini-stats strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 20px;
}

.mini-stats b {
  color: var(--green);
  font-size: 12px;
}

.mini-stats .bad {
  color: var(--red);
}

.featured-patient {
  min-height: 286px;
}

.patient-avatar {
  width: 66px;
  height: 66px;
  margin: 16px auto 12px;
  background:
    radial-gradient(circle at 50% 32%, #2b1b16 0 17%, transparent 18%),
    radial-gradient(circle at 50% 47%, #dca17b 0 25%, transparent 26%),
    linear-gradient(135deg, #f6d1bd, #d7e6f8);
  color: transparent;
}

.featured-patient h3,
.featured-patient p,
.featured-patient > small {
  display: block;
  text-align: center;
}

.featured-patient p,
.featured-patient small {
  color: var(--muted);
}

.patient-facts {
  display: grid;
  gap: 13px;
  margin: 18px 0;
}

.patient-facts span {
  display: grid;
  gap: 3px;
  position: relative;
  padding-left: 38px;
  color: var(--ink);
  font-size: 11px;
}

.patient-facts span::before {
  content: "▣";
  position: absolute;
  left: 0;
  top: 0;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #f1edff;
  color: var(--purple);
  font-size: 12px;
}

.patient-facts b {
  color: var(--muted);
  font-size: 11px;
}

.patient-facts em {
  width: max-content;
  padding: 3px 9px;
  border-radius: 999px;
  background: #e7f9f0;
  color: #148653;
  font-style: normal;
  font-weight: 800;
}

.whatsapp-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 278px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.whatsapp-workspace {
  min-height: calc(100vh - 128px);
}

.whatsapp-workspace .panel-header {
  padding: 18px 18px 14px;
}

.whatsapp-full-layout {
  grid-template-columns: 290px minmax(0, 1fr);
  min-height: 610px;
  margin: 0 18px 18px;
  background: #f8fafc;
}

.conversation-list {
  border-right: 1px solid var(--line);
  background: #fbfcff;
  overflow-y: auto;
}

.conversation {
  position: relative;
  width: 100%;
  min-height: 54px;
  padding: 8px 38px 8px 54px;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.conversation.active {
  background: #ffffff;
}

.whatsapp-full-layout .conversation {
  min-height: 68px;
  padding: 11px 44px 11px 62px;
}

.whatsapp-full-layout .conversation.active {
  background: #f5f8ff;
}

.conversation span {
  position: absolute;
  left: 12px;
  top: 10px;
  width: 32px;
  height: 32px;
  background:
    radial-gradient(circle at 50% 34%, #2a1a16 0 17%, transparent 18%),
    radial-gradient(circle at 50% 48%, #e2aa82 0 23%, transparent 24%),
    linear-gradient(135deg, #f8d7c8, #eef2ff);
  color: transparent;
}

.whatsapp-full-layout .conversation span {
  top: 14px;
  width: 38px;
  height: 38px;
}

.conversation strong,
.conversation small {
  display: block;
}

.conversation small {
  margin-top: 3px;
  color: var(--muted);
  max-width: 145px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
}

.whatsapp-full-layout .conversation small {
  max-width: 172px;
  font-size: 11px;
}

.conversation strong {
  font-size: 11px;
}

.whatsapp-full-layout .conversation strong {
  font-size: 12px;
}

.conversation time {
  position: absolute;
  top: 10px;
  right: 10px;
  color: var(--muted);
  font-size: 9px;
}

.conversation b,
.count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #18b978;
  color: #ffffff;
  font-size: 11px;
}

.conversation b {
  position: absolute;
  right: 12px;
  top: 29px;
}

.count {
  margin-left: 6px;
  background: #e84555;
}

.chat-preview {
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  gap: 10px;
  padding: 12px 14px 10px;
  background: #fafbfe;
}

.inbox-chat-window {
  grid-template-rows: auto 1fr auto;
  gap: 0;
  padding: 0;
  background: linear-gradient(180deg, #f8fafc 0%, #f3f6fb 100%);
}

.chat-head {
  gap: 10px;
}

.inbox-chat-window .chat-head {
  min-height: 74px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
}

.chat-head > span {
  width: 34px;
  height: 34px;
  background:
    radial-gradient(circle at 50% 34%, #2a1a16 0 17%, transparent 18%),
    radial-gradient(circle at 50% 48%, #e2aa82 0 23%, transparent 24%),
    linear-gradient(135deg, #f8d7c8, #eef2ff);
  color: transparent;
}

.inbox-chat-window .chat-head > span {
  width: 42px;
  height: 42px;
}

.chat-head strong,
.chat-head small {
  display: block;
}

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

.chat-head .sync-pill {
  margin-left: auto;
}

.chat-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.chat-head-actions .sync-pill {
  margin-left: 0;
}

.danger-action.delete-conversation-action {
  background: #c9363e;
  color: #ffffff;
  border: 1px solid #ae2931;
  font-weight: 800;
  white-space: nowrap;
}

.danger-action.delete-conversation-action:hover:not(:disabled) {
  background: #ae2931;
}

.danger-action.delete-conversation-action:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.chat-head-empty {
  justify-content: space-between;
}

.chat-body {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 28px 22px;
  overflow-y: auto;
}

.message-bubble {
  max-width: 70%;
  padding: 11px 13px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(30, 42, 68, 0.05);
  font-size: 11px;
  font-weight: 700;
}

.inbox-chat-window .message-bubble {
  max-width: 58%;
  min-width: 180px;
  padding: 13px 15px;
  font-size: 12px;
  line-height: 1.45;
}

.message-bubble.right {
  justify-self: end;
  background: linear-gradient(135deg, #e9fbef, #d8f5e4);
}

.message-bubble.compact {
  max-width: 220px;
}

.message-bubble time {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 9px;
  text-align: right;
}

.message-input {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 8px 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
}

.inbox-chat-window .message-input {
  min-height: 56px;
  margin: 0 18px 18px;
  box-shadow: 0 12px 26px rgba(30, 42, 68, 0.06);
}

.message-input span {
  flex: 1;
  font-size: 11px;
}

.message-input input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}

.message-input input::placeholder {
  color: var(--muted);
}

.inbox-chat-window .message-input span {
  font-size: 12px;
}

.message-input i {
  color: var(--muted);
  font-style: normal;
}

.message-input button {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--purple);
  color: #ffffff;
}

.chat-contact-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.chat-contact-strip span {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.workflow-state {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.workflow-state span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  background: #eef6ff;
  color: #245b9d;
  font-size: 10px;
  font-weight: 850;
}

.activity-feed,
.file-list,
.settings-list,
.timeline,
.appointment-list,
.task-list {
  display: grid;
  gap: 9px;
}

.activity-feed span,
.file-list span,
.settings-list span,
.file-grid div {
  padding: 10px 12px 10px 36px;
  border-radius: 8px;
  background: #f8fafc;
}

.activity-feed span {
  position: relative;
  font-size: 11px;
}

.activity-feed span::before {
  content: "□";
  position: absolute;
  left: 10px;
  top: 13px;
  color: var(--purple);
}

.activity-feed b,
.activity-feed small {
  display: block;
}

.activity-feed small {
  margin-top: 3px;
  color: var(--muted);
}

.conversation-panel {
  min-height: 560px;
}

.chat-thread {
  display: grid;
  gap: 12px;
}

.bubble {
  max-width: 76%;
  padding: 14px;
  border-radius: 8px;
}

.bubble.patient {
  background: #eef3fb;
}

.bubble.ai {
  justify-self: end;
  background: #eafaf8;
}

.approval-box {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border: 1px solid #d8ddff;
  border-radius: 8px;
  background: #f6f5ff;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.appointment button,
.button-row button,
.calendar-grid button {
  min-height: 36px;
  padding: 0 12px;
  background: #edf2fb;
  color: #263655;
  font-weight: 700;
}

.patient-card dl {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}

.patient-card dl div {
  display: grid;
  gap: 4px;
}

dd {
  margin: 0;
  font-weight: 800;
}

.profile-layout {
  align-items: stretch;
  gap: 16px;
}

.patient-workspace {
  display: grid;
  grid-template-columns: minmax(190px, 240px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.patient-sidebar {
  position: sticky;
  top: 92px;
}

.patient-directory {
  display: grid;
  gap: 8px;
}

.patient-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 4px 10px;
  align-items: center;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  background: #fbfcff;
  text-align: left;
}

.patient-row.active {
  border-color: var(--purple);
  background: #f6f4ff;
}

.patient-row span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #e9f6f2;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
}

.patient-row strong,
.patient-row small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.patient-file-panel {
  min-height: 520px;
}

.patient-file-layout,
.patient-record-body {
  display: grid;
  gap: 14px;
}

.patient-file-summary {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: 14px;
}

.patient-details {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.patient-details dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.patient-details div {
  min-width: 0;
}

.patient-details dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.patient-details dd {
  margin: 3px 0 0;
  font-weight: 850;
}

.patient-record-body {
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.7fr);
}

.profile-card {
  min-width: 210px;
  padding: 18px;
  border-radius: 8px;
  background: #f5f8fc;
}

.profile-card .avatar {
  width: 56px;
  height: 56px;
  margin-bottom: 16px;
}

.timeline {
  flex: 1;
}

.timeline div {
  padding: 14px;
  border-left: 3px solid var(--teal);
  background: #f8fafc;
  border-radius: 8px;
}

.timeline span,
.file-list span,
.settings-list span {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.calendar-grid,
.file-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.logic-stack {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.architecture-flow {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  align-items: stretch;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.logic-node {
  width: 132px;
  min-width: 0;
  padding: 14px 10px;
  border: 1px solid #dfe6f2;
  border-radius: 8px;
  background: #fbfcff;
  text-align: center;
}

.logic-node.highlight {
  border-color: #cfc8ff;
  background: #f6f4ff;
}

.logic-node i {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin: 0 auto 10px;
  border-radius: 8px;
  background: #edf7ff;
  color: var(--purple);
  font-style: normal;
  font-weight: 900;
}

.logic-node strong,
.logic-node span {
  display: block;
}

.logic-node strong {
  margin-bottom: 6px;
  font-size: 12px;
}

.logic-node span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
}

.flow-arrow {
  display: grid;
  place-items: center;
  width: 18px;
  min-width: 18px;
  color: var(--green);
  font-size: 20px;
  font-weight: 900;
}

.logic-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(290px, 0.8fr);
  gap: 14px;
  min-width: 0;
}

.logic-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.conversation-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
  padding-bottom: 4px;
}

.conversation-flow div,
.schema-map span {
  min-height: 118px;
  padding: 13px;
  border: 1px solid #dfe6f2;
  border-radius: 8px;
  background: #fbfcff;
}

.conversation-flow strong,
.conversation-flow span,
.conversation-flow small,
.schema-map b {
  display: block;
}

.conversation-flow strong {
  margin-bottom: 10px;
  color: var(--purple);
  font-size: 12px;
}

.conversation-flow span {
  margin-bottom: 8px;
  font-weight: 800;
  line-height: 1.35;
}

.conversation-flow small {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.35;
}

.logic-list {
  display: grid;
  gap: 10px;
  padding-left: 18px;
  margin: 14px 0 0;
  color: #25314c;
  font-weight: 700;
}

.logic-list li::marker {
  color: var(--green);
}

.schema-map {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.schema-map span {
  min-height: 82px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.schema-map b {
  margin-bottom: 5px;
  color: var(--ink);
}

.api-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.api-table td {
  padding: 9px 6px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.api-table td:first-child {
  width: 54px;
  color: var(--purple);
  font-weight: 900;
}

.api-table td:nth-child(2) {
  width: 150px;
  color: var(--ink);
}

.code-card {
  overflow-x: auto;
  min-height: 154px;
  margin: 14px 0 0;
  padding: 14px;
  border-radius: 8px;
  background: #111827;
  color: #d8f8eb;
  font-size: 12px;
  line-height: 1.5;
}

.code-card code {
  white-space: pre-wrap;
  word-break: break-word;
}

.calendar-grid button {
  min-height: 68px;
}

.calendar-grid .selected {
  background: var(--teal);
  color: #ffffff;
}

.reschedule-card {
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border-radius: 8px;
  background: #f6f5ff;
}

.technical {
  border-color: #d8ddff;
}

.focused-card {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(91, 64, 231, 0.12);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 36px));
  padding: 13px 15px;
  border: 1px solid #cde7e2;
  border-radius: 8px;
  background: #f0fffb;
  color: #086c63;
  box-shadow: 0 16px 44px rgba(20, 31, 56, 0.18);
  font-weight: 800;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.app-modal {
  width: min(460px, calc(100vw - 28px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(17, 26, 51, 0.28);
}

.app-modal::backdrop {
  background: rgba(17, 26, 51, 0.34);
}

.modal-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  background: var(--surface);
}

@media (max-width: 1180px) {
  .reference-grid {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.8fr);
  }

  .featured-patient,
  .recent-panel {
    grid-column: span 1;
  }

  .whatsapp-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .nav-group {
    grid-column: 1 / -1;
  }

  .patient-workspace,
  .patient-file-summary,
  .patient-record-body {
    grid-template-columns: 1fr;
  }

  .patient-sidebar {
    position: static;
  }

  .patient-directory {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar,
  .top-actions,
  .profile-layout,
  .reschedule-card {
    align-items: stretch;
    flex-direction: column;
  }

  .kpi-grid,
  .work-grid,
  .owner-work,
  .settings-grid,
  .logic-grid,
  .logic-grid.compact,
  .calendar-grid,
  .file-grid,
  .whatsapp-layout {
    grid-template-columns: 1fr;
  }

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

  #dashboard .kpi-grid,
  .appointments-panel,
  .chart-panel,
  .featured-patient,
  .whatsapp-panel,
  .recent-panel {
    grid-column: 1;
    grid-row: auto;
  }

  .conversation-list {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .schema-map {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .clinic-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .auth-locked .login-screen {
    align-items: stretch;
    padding: 12px;
  }

  .login-card {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .login-brand {
    padding: 22px;
  }

  .login-form {
    padding: 24px;
  }

  .login-form h1 {
    font-size: 24px;
  }

  .account-access span {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .main-panel {
    padding: 0 14px 14px;
  }

  .sidebar {
    padding: 16px;
  }

  .topbar {
    align-items: stretch;
    gap: 10px;
    min-height: auto;
    margin: 0 -14px 14px;
    padding: 10px 14px;
  }

  .title-row {
    justify-content: flex-start;
  }

  .top-actions {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav-item {
    min-width: 0;
    padding: 0 8px;
    font-size: 11px;
  }

  .doctor-chip {
    flex: 1;
    min-width: 170px;
  }

  .notification-center {
    margin-left: auto;
  }

  .notification-button em {
    display: none;
  }

  .owner-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .patient-directory,
  .patient-details dl {
    grid-template-columns: 1fr;
  }

  .service-item {
    align-items: stretch;
    flex-direction: column;
  }

  .service-actions {
    justify-content: flex-end;
  }

  .architecture-flow {
    grid-auto-flow: row;
    grid-auto-columns: unset;
    grid-template-columns: 1fr;
  }

  .logic-node {
    width: auto;
  }

  .flow-arrow {
    width: auto;
    min-width: 0;
    min-height: 18px;
    transform: rotate(90deg);
  }

  .schema-map {
    grid-template-columns: 1fr;
  }

  .api-table td {
    font-size: 10px;
  }

  .chevron-button {
    display: none;
  }

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .appointments-panel {
    overflow-x: auto;
  }

  .appointments-table {
    min-width: 680px;
  }

  .message-bubble,
  .bubble {
    max-width: 100%;
  }

  .mini-stats {
    grid-template-columns: 1fr;
  }
}

/* Local clinic runtime additions */
.tooth-logo { width: 38px; height: 38px; border-radius: 12px; object-fit: cover; box-shadow: 0 10px 24px rgba(0,0,0,.2); }
.tooth-logo.large { width: 54px; height: 54px; border-radius: 16px; }
.login-mode { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.login-mode button { display:grid; gap:3px; padding:12px; border:1px solid var(--line); border-radius:12px; background:#f8f9fd; color:var(--muted); text-align:left; cursor:pointer; }
.login-mode button.active { border-color:var(--purple); background:#f1efff; color:var(--ink); box-shadow:inset 0 0 0 1px var(--purple); }
.login-mode b,.login-mode span { display:block; }
.login-mode span { font-size:11px; }
.login-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; }
.language-select { width:auto; min-width:104px; padding:8px 10px; border:1px solid var(--line); border-radius:10px; background:#fff; color:var(--ink); font:inherit; }
.login-help,.login-trademark { margin:0; text-align:center; color:var(--muted); font-size:12px; }
.login-trademark { margin-top:2px; font-weight:800; letter-spacing:.04em; }
.sidebar-trademark { margin-top:auto; padding:0 10px; color:#7d8da5; font-size:10px; font-weight:900; letter-spacing:.08em; text-align:center; }
.primary-action.compact { padding: 8px 13px; min-width: 0; }
.form-result { display:block; min-height:20px; color:var(--muted); font-size:13px; text-align:center; }
.patient-files { display:grid; gap:8px; }
.patient-file-row { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:12px 14px; border:1px solid var(--line); border-radius:12px; background:#fff; }
.patient-file-row strong,.patient-file-row small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.patient-file-row small { color:var(--muted); }
.empty-state { padding: 32px 20px; color: var(--muted); text-align: center; border: 1px dashed var(--line); border-radius: 16px; }
.empty-chart { display: grid; place-items: center; min-height: 190px; color: var(--muted); text-align: center; }
.appointment-cards { display: grid; gap: 10px; }
.clinic-calendar { margin-bottom:22px; border:1px solid var(--line); border-radius:16px; overflow:hidden; background:#fff; }
.calendar-weekdays,.calendar-month-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); }
.calendar-weekdays { background:#f6f7fb; border-bottom:1px solid var(--line); }
.calendar-weekdays span { padding:10px; text-align:center; color:var(--muted); font-size:11px; font-weight:900; text-transform:uppercase; }
.calendar-day { min-height:104px; padding:9px; border:0; border-right:1px solid var(--line); border-bottom:1px solid var(--line); background:#fff; text-align:left; cursor:pointer; color:var(--ink); }
.calendar-day:nth-child(7n) { border-right:0; }
.calendar-day.outside { background:#fafbfe; color:#a8afbf; }
.calendar-day.selected { background:#f1efff; box-shadow:inset 0 0 0 2px var(--purple); }
.calendar-day.today > span { display:grid; place-items:center; width:27px; height:27px; border-radius:50%; background:var(--purple); color:#fff; }
.calendar-day .calendar-event { display:block; margin-top:6px; padding:5px 7px; overflow:hidden; border-left:4px solid #8b5cf6; border-radius:6px; background:#f0ebff; color:#39236f; font-size:10px; line-height:1.25; }
.calendar-day .calendar-event strong,.calendar-day .calendar-event span,.calendar-day .calendar-event em { display:block; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.calendar-day .calendar-event strong { color:#6d3bd1; font-weight:900; }
.calendar-day .calendar-event span { font-weight:800; }
.calendar-day .calendar-event em { color:#766a91; font-style:normal; }
.calendar-day b { display:block; margin-top:5px; color:var(--purple); font-size:10px; }
.day-agenda-head { display:flex; align-items:end; justify-content:space-between; gap:12px; margin:12px 0; }
.day-agenda-head h3 { margin:0; }
.day-agenda-head small { color:var(--muted); }
.appointment-card { display: grid; grid-template-columns: 88px minmax(180px,1fr) minmax(150px,.8fr) auto; gap: 16px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.appointment-card time { font-weight: 800; color: var(--purple); }
.appointment-card strong,.appointment-card small { display:block; }
.appointment-card small { color: var(--muted); margin-top:4px; }
.appointment-card-actions { display:flex; gap:8px; }
.appointment-card-actions { flex-wrap:wrap; justify-content:flex-end; }
.appointment-card.appointment-overdue { border-color:#efc36b; background:#fffaf0; }
.complete-action { color:#087a52; background:#e9f8f1; }
.danger-action { color:#b54747; border:0; background:#fff1f1; border-radius:10px; padding:8px 10px; cursor:pointer; }
.message-input { gap:10px; }
.message-input input { flex:1; border:0; background:transparent; padding:10px; outline:none; font:inherit; }
.message-input button { cursor:pointer; }
.inbox-chat-window .chat-body { min-height: 420px; max-height: 55vh; overflow:auto; }
.service-row { display:grid; grid-template-columns:minmax(180px,1fr) 150px 150px auto; align-items:center; gap:18px; padding:16px; border-bottom:1px solid var(--line); }
.service-row strong,.service-row small { display:block; }
.service-row small { color:var(--muted); margin-top:3px; }
.record-directory { display:grid; gap:12px; margin-top:18px; }
.record-row { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:16px; border:1px solid var(--line); border-radius:14px; background:#fff; }
.record-row strong,.record-row small { display:block; }
.record-row small { margin-top:5px; color:var(--muted); }
.modal-card textarea { min-height:90px; resize:vertical; }
.modal-card select { width:100%; border:1px solid var(--line); border-radius:12px; padding:12px; background:#fff; }
.admin-only[hidden] { display:none !important; }
body:not(.auth-locked) .app-shell { transition:grid-template-columns 180ms ease; }
body:not(.auth-locked) .sidebar { min-width:0; overflow:hidden; transition:opacity 150ms ease, transform 180ms ease, padding 180ms ease; }
body.sidebar-collapsed:not(.auth-locked) .app-shell { grid-template-columns:0 minmax(0,1fr); }
body.sidebar-collapsed:not(.auth-locked) .sidebar { opacity:0; transform:translateX(-100%); padding-left:0; padding-right:0; pointer-events:none; }
.reminder-page-head { margin-bottom: 16px; }
.reminder-list { display:grid; gap:10px; margin-top:16px; }
.reminder-row { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:14px; border:1px solid var(--line); border-radius:14px; background:#fff; }
.reminder-row strong,.reminder-row small { display:block; }
.reminder-row small { margin-top:5px; color:var(--muted); }
@media (max-width: 760px) { .appointment-card,.service-row { grid-template-columns:1fr; } .record-row { align-items:stretch; flex-direction:column; } .clinic-calendar { overflow-x:auto; } .calendar-weekdays,.calendar-month-grid { min-width:700px; } }

.auth-tabs { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.auth-tabs button { width:100%; }
.hp-field { position:absolute; left:-10000px; width:1px; height:1px; overflow:hidden; }
.terms-check { display:flex; align-items:flex-start; gap:10px; font-weight:600; }
.terms-check input { width:auto; margin-top:3px; }
.login-form[hidden] { display:none !important; }
