:root {
  --doctor-navy: #0f3f46;
  --doctor-navy-2: #155e63;
  --doctor-purple: #db2777;
  --doctor-cyan: #14b8a6;
  --doctor-bg: #f7fbfb;
  --doctor-ink: #555762;
  --doctor-line: #e5e5e8;
  --doctor-muted: #8b8d98;
  --doctor-shadow: 0 15px 36px rgba(16, 21, 58, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--doctor-ink);
  background: var(--doctor-bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

input,
textarea,
select,
.search-input,
.dataTables_filter input {
  direction: ltr;
  text-align: left;
  unicode-bidi: plaintext;
}

button {
  cursor: pointer;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

/* ── Login page ─────────────────────────────────────────────────────────────── */
.lp-root {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

/* Left brand panel */
.lp-brand {
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: linear-gradient(145deg, #0a2f35 0%, #0f3f46 45%, #155e63 100%);
}

.lp-brand-inner {
  position: relative;
  z-index: 2;
  padding: 56px 52px;
  display: flex;
  flex-direction: column;
  gap: 40px;
  width: 100%;
}

.lp-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.lp-logo svg {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.lp-hero-text h1 {
  margin: 0 0 12px;
  color: #fff;
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.lp-hero-text p {
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 1.08rem;
  line-height: 1.65;
  max-width: 360px;
}

.lp-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lp-feature {
  display: flex;
  align-items: center;
  gap: 14px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.97rem;
}

.lp-feature-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--doctor-cyan);
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.25);
}

.lp-feature-dot.pink {
  background: var(--doctor-purple);
  box-shadow: 0 0 0 3px rgba(219, 39, 119, 0.25);
}

/* Decorative rings */
.lp-brand-art {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.lp-art-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.lp-art-ring-1 { width: 420px; height: 420px; bottom: -120px; right: -140px; }
.lp-art-ring-2 { width: 280px; height: 280px; bottom: -40px; right: -60px; border-color: rgba(255,255,255,0.12); }
.lp-art-ring-3 { width: 160px; height: 160px; bottom: 40px; right: 20px; border-color: rgba(219, 39, 119, 0.35); }

/* Right form panel */
.lp-form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
  background: #f7fbfb;
}

.lp-card {
  width: min(440px, 100%);
  background: #fff;
  border-radius: 20px;
  padding: 44px 40px;
  box-shadow: 0 4px 6px rgba(15, 63, 70, 0.04), 0 20px 48px rgba(15, 63, 70, 0.10);
}

.lp-card-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 36px;
}

.lp-card-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--doctor-navy), #db2777);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
}

.lp-card-icon svg {
  width: 24px;
  height: 24px;
}

.lp-card-header h2 {
  margin: 0 0 4px;
  font-size: 1.5rem;
  font-weight: 700;
  color: #0d1f22;
  letter-spacing: -0.02em;
}

.lp-card-header p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--doctor-muted);
}

.lp-field {
  margin-bottom: 20px;
}

.lp-label {
  display: block;
  margin-bottom: 7px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #374151;
  letter-spacing: 0.01em;
}

.lp-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.lp-input-icon {
  position: absolute;
  left: 14px;
  width: 17px;
  height: 17px;
  color: var(--doctor-muted);
  pointer-events: none;
  flex-shrink: 0;
}

.lp-input-wrap input {
  width: 100%;
  padding: 13px 44px 13px 42px;
  border: 1.5px solid #e0e7ea;
  border-radius: 10px;
  background: #f9fbfb;
  color: #111827;
  font-size: 0.97rem;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
  outline: none;
}

.lp-input-wrap input:focus {
  border-color: var(--doctor-cyan);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}

.lp-input-wrap input::placeholder {
  color: #b0bac0;
}

.lp-toggle-pw {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--doctor-muted);
  padding: 4px;
  line-height: 1;
  cursor: pointer;
}

.lp-toggle-pw svg {
  width: 17px;
  height: 17px;
}

.lp-toggle-pw:hover {
  color: var(--doctor-cyan);
}

.lp-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.lp-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: #4b5563;
  cursor: pointer;
}

.lp-remember input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--doctor-cyan);
}

.lp-forgot {
  background: none;
  border: none;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--doctor-navy-2);
  cursor: pointer;
  padding: 0;
}

.lp-forgot:hover {
  color: var(--doctor-cyan);
  text-decoration: underline;
}

.lp-submit {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--doctor-navy) 0%, #1a6b74 50%, #db2777 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  box-shadow: 0 4px 16px rgba(219, 39, 119, 0.28);
}

.lp-submit svg {
  width: 18px;
  height: 18px;
  transition: transform 0.2s;
}

.lp-submit:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(219, 39, 119, 0.38);
}

.lp-submit:hover svg {
  transform: translateX(3px);
}

.lp-submit:active {
  transform: translateY(0);
}

.lp-hint {
  margin: 20px 0 0;
  font-size: 0.82rem;
  color: var(--doctor-muted);
  text-align: center;
  line-height: 1.5;
}

@media (max-width: 768px) {
  .lp-root {
    grid-template-columns: 1fr;
  }
  .lp-brand {
    min-height: 200px;
    padding: 0;
  }
  .lp-brand-inner {
    padding: 32px 28px;
    gap: 20px;
  }
  .lp-hero-text h1 { font-size: 1.8rem; }
  .lp-features { display: none; }
  .lp-form-side { padding: 32px 20px; }
  .lp-card { padding: 32px 24px; }
}

.doctor-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 100vh;
}

.doctor-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 10px;
  overflow-y: auto;
  color: #d9d9e8;
  background: var(--doctor-navy);
}

.doctor-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 34px;
  color: #f9a8d4;
  text-decoration: none;
}

.doctor-mark {
  width: 33px;
  height: 27px;
  display: inline-block;
  clip-path: polygon(0 0, 42% 0, 50% 30%, 62% 0, 100% 0, 54% 100%);
  background: linear-gradient(135deg, #14b8a6, #db2777);
}

.doctor-target {
  width: 22px;
  height: 22px;
  margin-left: auto;
  border: 3px solid #14b8a6;
  border-radius: 50%;
}

.doctor-nav,
.doctor-subnav {
  display: grid;
  gap: 6px;
}

.doctor-nav-item,
.doctor-subnav button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 10px;
  color: inherit;
  border: 0;
  border-radius: 5px;
  background: transparent;
  text-align: left;
  white-space: normal;
}

.doctor-nav-item b {
  margin-left: auto;
  transition: transform 0.2s ease;
}

.doctor-nav-item.is-active,
.doctor-subnav button.is-active {
  color: #fff;
  background: var(--doctor-purple);
  box-shadow: 0 7px 18px rgba(219, 39, 119, 0.32);
}

.doctor-nav-group.is-open .doctor-nav-item b {
  transform: rotate(90deg);
}

.doctor-subnav {
  display: none;
  padding: 2px 0 4px 36px;
}

.doctor-nav-group.is-open .doctor-subnav {
  display: grid;
}

.doctor-subnav button {
  min-height: 32px;
  padding: 8px 10px;
  line-height: 1.25;
}

.doctor-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--doctor-bg);
}

.doctor-page {
  flex: 1;
  padding: 28px 30px 72px;
}

.doctor-side-link {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin: 0 0 6px;
  padding: 10px 12px;
  color: #dfe1f2;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 0.88rem;
  font-weight: 750;
  line-height: 1.2;
  text-align: left;
}

.doctor-side-link span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.doctor-side-link b {
  transition: transform 0.2s ease;
}

.doctor-side-link:hover,
.doctor-side-link.active {
  color: #fff;
  background: rgba(219, 39, 119, 0.88);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.doctor-side-link.active b {
  transform: rotate(90deg);
}

.doctor-submenu {
  display: none;
  gap: 5px;
  margin: 2px 0 12px;
  padding-left: 34px;
}

.doctor-submenu.open {
  display: grid;
}

.doctor-submenu .doctor-side-link {
  min-height: 34px;
  display: flex;
  margin-bottom: 0;
  padding: 8px 10px;
  color: #cfd3ee;
  font-size: 0.8rem;
  font-weight: 650;
}

.doctor-submenu .doctor-side-link span {
  overflow-wrap: normal;
  word-break: normal;
}

.doctor-topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
}

.doctor-top-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Refresh (2026-09-02): one-click latest build + fresh server data. */
.doctor-refresh-button {
  border: 1px solid var(--doctor-navy, #16405b);
  background: #fff;
  color: var(--doctor-navy, #16405b);
  border-radius: 6px;
  padding: 6px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.doctor-refresh-button:hover { background: var(--doctor-navy, #16405b); color: #fff; }
.doctor-refresh-button:disabled { opacity: 0.6; cursor: wait; }

/* Responsive portal (2026-08-21): hamburger + drawer backdrop exist only on
   small screens — hidden on desktop so the current layout is unchanged. */
.doctor-icon-button.doctor-menu-toggle {
  display: none;
  color: var(--doctor-navy);
}

.doctor-nav-backdrop {
  display: none;
}

.doctor-portal-links {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--doctor-line);
  border-radius: 6px;
  background: #fff;
}

.doctor-portal-links a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  color: var(--doctor-muted);
  border-radius: 5px;
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.doctor-portal-links a.active,
.doctor-portal-links a:hover {
  color: #fff;
  background: var(--doctor-purple);
}

.doctor-language {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
}

.doctor-flag {
  font-size: 1.25rem;
}

.doctor-icon-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--doctor-ink);
  border: 0;
  background: transparent;
}

.doctor-bell span {
  position: absolute;
  top: -2px;
  right: -1px;
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 50%;
  background: var(--doctor-purple);
  font-size: 0.9rem;
}

.doctor-profile-trigger {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--doctor-ink);
  border: 0;
  background: transparent;
  text-align: right;
}

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

.doctor-profile-trigger strong {
  font-size: 1.05rem;
}

.doctor-profile-trigger small {
  color: #777;
}

.doctor-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 50%;
  background: #c64ea1;
  font-size: 0.55rem;
  line-height: 1;
  text-align: center;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.doctor-profile-menu {
  position: absolute;
  top: 56px;
  right: 0;
  width: 180px;
  padding: 8px;
  border: 1px solid var(--doctor-line);
  border-radius: 4px;
  background: #fff;
  box-shadow: var(--doctor-shadow);
}

.doctor-profile-menu button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 10px;
  color: var(--doctor-ink);
  border: 0;
  border-bottom: 1px solid var(--doctor-line);
  background: transparent;
  text-align: left;
}

.doctor-profile-menu button:last-child {
  border-bottom: 0;
}

/* 2026-09-02: visible sidebar Logout for the procedure portal. */
.doctor-side-logout {
  margin-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 18px;
  border-radius: 0;
}

.doctor-content {
  flex: 1;
  padding: 30px 26px 64px;
}

.doctor-section-label {
  margin: 0 0 20px;
  color: #777;
  font-weight: 700;
}

.doctor-stats-card,
.doctor-card {
  border-radius: 5px;
  background: #fff;
  box-shadow: var(--doctor-shadow);
}

.doctor-stats-card {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 34px;
  padding: 58px 56px;
}

.doctor-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.doctor-stat strong {
  display: block;
  color: #2d2e35;
  font-size: 2rem;
}

.doctor-stat span {
  display: block;
  margin-top: 4px;
  color: #777;
  font-size: 1.1rem;
}

.doctor-stat i {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-style: normal;
}

.doctor-stat i.purple {
  color: var(--doctor-purple);
  background: #eeeaff;
}

.doctor-stat i.green {
  color: #55c784;
  background: #e8f8ec;
}

.doctor-stat i.red {
  color: #f16968;
  background: #fde8e8;
}

.doctor-stat i.orange {
  color: #ff9b43;
  background: #fff0e3;
}

.doctor-card {
  padding: 34px 36px;
  overflow-x: auto;
}

.doctor-card h2 {
  margin: 0 0 26px;
  color: #3f4149;
  font-size: 1.08rem;
  letter-spacing: 0;
}

.doctor-filter-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) 120px;
  align-items: end;
  gap: 20px;
  margin-bottom: 70px;
}

.doctor-discount-filter-row {
  grid-template-columns: repeat(3, minmax(180px, 1fr)) auto;
  margin-bottom: 56px;
}

.doctor-filter-actions {
  display: flex;
  align-items: end;
  gap: 10px;
}

.doctor-filter-row.two {
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) 92px;
  margin-bottom: 28px;
}

.doctor-field {
  display: grid;
  gap: 6px;
  color: #686a75;
  font-size: 0.9rem;
}

.doctor-field input,
.doctor-field select,
.doctor-field textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  color: #666;
  border: 1px solid #d9d9dd;
  border-radius: 4px;
  outline-color: var(--doctor-purple);
  background: #fff;
}

.doctor-field textarea {
  min-height: 96px;
  resize: vertical;
}

.doctor-field small {
  color: #777;
}

.doctor-wide {
  grid-column: 1 / -1;
}

.doctor-cyan-button,
.doctor-reset-button,
.doctor-view-button,
.doctor-download-button {
  min-height: 38px;
  padding: 9px 20px;
  color: #fff;
  border: 0;
  border-radius: 5px;
  font-weight: 700;
}

.doctor-cyan-button,
.doctor-view-button {
  background: var(--doctor-cyan);
}

.doctor-reset-button {
  background: #df5757;
}

/* 2026-09-05: a pressed Save/Submit button shows it was pressed while the
   PDF upload and server confirm run (the press used to look ignored). */
.procedure-template-actions .doctor-cyan-button:disabled,
.procedure-template-actions .doctor-reset-button:disabled {
  opacity: 0.6;
  cursor: progress;
}

.doctor-download-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--doctor-purple);
}

.doctor-view-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 6px 15px;
  font-weight: 500;
  white-space: nowrap;
}

.doctor-report-heading {
  margin-bottom: 22px;
  text-align: center;
}

.doctor-report-heading h3,
.doctor-report-heading p {
  margin: 0;
}

.doctor-report-heading h3 {
  color: #5e5f65;
}

.doctor-report-meta {
  max-width: 700px;
  margin: 0 0 18px 60px;
}

.doctor-report-title {
  margin: 0 0 28px;
  color: #555;
  text-align: center;
  font-size: 0.95rem;
}

.doctor-bordered-table,
.doctor-list-table {
  width: 100%;
  border-collapse: collapse;
  color: #63656c;
  font-size: 0.88rem;
}

.doctor-bordered-table {
  max-width: 1160px;
  border: 2px solid #1d1d1d;
}

.doctor-bordered-table th,
.doctor-bordered-table td {
  padding: 11px 12px;
  border: 2px solid #1d1d1d;
  text-align: center;
}

.doctor-bordered-table th {
  color: #555;
}

.doctor-bordered-table tfoot td {
  font-weight: 800;
  text-align: right;
  background: #f7f7f8;
}

.doctor-bordered-table tfoot td:last-child {
  text-align: center;
}

.doctor-list-table th,
.doctor-list-table td {
  padding: 12px 14px;
  border: 0;
  text-align: left;
  vertical-align: middle;
}

.doctor-list-table th {
  color: #5e6068;
  background: #fff;
}

.doctor-list-table tbody tr:nth-child(odd) {
  background: #f0f0f1;
}

.doctor-list-table tbody tr:nth-child(even) {
  background: #fff;
}

.doctor-list-table td {
  overflow-wrap: anywhere;
}

.procedure-template-card {
  overflow: visible;
}

.procedure-template-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.procedure-template-heading h2 {
  margin-bottom: 6px;
}

.procedure-template-heading p {
  margin: 0;
  color: var(--doctor-muted);
}

.procedure-template-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(420px, 1.05fr);
  gap: 24px;
  align-items: start;
}

.procedure-template-list,
.procedure-template-editor {
  min-width: 0;
}

.procedure-template-controls,
.procedure-template-form-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(150px, 0.65fr);
  gap: 14px;
  margin-bottom: 16px;
}

.procedure-template-table {
  border: 1px solid var(--doctor-line);
}

.procedure-template-table tbody tr.selected {
  background: #eeecff;
  box-shadow: inset 4px 0 0 var(--doctor-purple);
}

.procedure-template-table td b {
  color: #3f4149;
}

.procedure-template-editor {
  padding: 22px;
  border: 1px solid var(--doctor-line);
  border-radius: 5px;
  background: #fbfbfd;
}

.procedure-editor-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.procedure-editor-title span:first-child {
  color: var(--doctor-cyan);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.procedure-editor-title h3 {
  margin: 4px 0;
  color: #30323b;
  font-size: 1rem;
  letter-spacing: 0;
}

.procedure-editor-title small,
.procedure-saved-templates small {
  color: var(--doctor-muted);
}

.procedure-status-pill {
  flex: 0 0 auto;
  min-width: 88px;
  padding: 6px 10px;
  border-radius: 999px;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  text-align: center;
}

.procedure-status-pill.active {
  background: #55c784;
}

.procedure-status-pill.inactive {
  background: #8b8d98;
}

.procedure-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--doctor-line);
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
  background: #fff;
}

.procedure-editor-toolbar button {
  min-width: 34px;
  min-height: 32px;
  padding: 5px 10px;
  color: #4c4f59;
  border: 1px solid #dcdde2;
  border-radius: 4px;
  background: #f7f7f9;
  font-weight: 700;
}

.procedure-rich-editor {
  min-height: 250px;
  max-height: 420px;
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--doctor-line);
  border-radius: 0 0 5px 5px;
  background: #fff;
  color: #383a42;
  line-height: 1.6;
  outline-color: var(--doctor-purple);
}

.procedure-rich-editor p {
  margin: 0 0 12px;
}

.procedure-template-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 16px;
}

.procedure-wide-filter {
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) 120px;
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--doctor-line);
  border-radius: 6px;
  background: #fafbff;
}

.procedure-table-controls {
  display: grid;
  grid-template-columns: minmax(130px, 180px) minmax(240px, 1fr);
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
}

.procedure-table-controls .doctor-field {
  gap: 5px;
}

.procedure-action-table {
  min-width: 1120px;
}

.procedure-icon-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
  min-width: 218px;
}

.procedure-icon-button {
  flex: 0 0 36px;
  width: 36px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  color: #fff;
  border: 0;
  border-radius: 6px;
  background: var(--doctor-cyan);
  font-size: 0.75rem;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.procedure-icon-button:nth-child(1) {
  background: var(--doctor-purple);
}

.procedure-icon-button:nth-child(2) {
  background: #34a7c2;
}

.procedure-icon-button:disabled {
  color: #8e93a3;
  background: #e5e8ef;
  cursor: not-allowed;
}

/* v388 (2026-09-05): Claim button + claim-state chips beside Use Results
   Template / Upload Results. Explicit colours so the nth-child rules above do
   not recolour T/U when the Claim control is inserted before them. */
.procedure-icon-button.procedure-claim-button {
  background: #2e7d32;
}

.procedure-icon-button.procedure-claim-button:disabled {
  color: #8e93a3;
  background: #e5e8ef;
}

.procedure-claim-state {
  min-height: 34px;
  padding: 0 10px;
  color: #fff;
  white-space: nowrap;
}

.doctor-chip.resolved.procedure-claim-state {
  background: #2e7d32;
}

.procedure-claim-note {
  display: block;
  margin-top: 4px;
  color: #a14d00;
  font-size: 0.72rem;
  font-weight: 700;
}

.procedure-icon-button span {
  display: block;
}

.procedure-text-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  min-width: 112px;
  padding: 6px 10px;
}

.procedure-text-action small {
  color: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.1;
  white-space: normal;
}

.procedure-file-meta {
  flex-basis: 100%;
  color: #626879;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.3;
}

.procedure-hidden-upload {
  display: none;
}

.procedure-pdf-label {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  color: #4f5260;
  border: 1px solid var(--doctor-line);
  border-radius: 5px;
  background: #f7f8fc;
  font-size: 0.78rem;
  font-weight: 800;
}

.procedure-pendingResults-table {
  min-width: 1120px;
}

.procedure-pendingResults-table th:first-child,
.procedure-pendingResults-table td:first-child {
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  padding-left: 8px;
  padding-right: 8px;
  text-align: center;
}

.procedure-pendingResults-table th:nth-child(2),
.procedure-pendingResults-table td:nth-child(2) {
  width: 112px;
}

.procedure-pendingResults-table th:nth-child(3),
.procedure-pendingResults-table td:nth-child(3) {
  width: 170px;
}

.procedure-pendingResults-table th:nth-child(4),
.procedure-pendingResults-table td:nth-child(4) {
  width: 138px;
}

.procedure-pendingResults-table th:nth-child(5),
.procedure-pendingResults-table td:nth-child(5) {
  width: 240px;
}

.procedure-pendingResults-table th:nth-child(6),
.procedure-pendingResults-table td:nth-child(6) {
  width: 130px;
}

.procedure-pendingResults-table th:nth-child(7),
.procedure-pendingResults-table td:nth-child(7) {
  width: 142px;
}

.procedure-pendingResults-table th:nth-child(8),
.procedure-pendingResults-table td:nth-child(8) {
  width: 248px;
}

.procedure-template-button,
.procedure-confirm-button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  color: #fff;
  border: 0;
  border-radius: 5px;
  background: var(--doctor-purple);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
}

.procedure-confirm-button {
  background: var(--doctor-cyan);
}

.procedure-print {
  margin-top: 18px;
}

.procedure-claim-print-area {
  max-width: 980px;
  margin: 0 auto;
}

.procedure-claim-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}

.procedure-claim-meta div {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid #d7dde8;
  border-radius: 6px;
  background: #f8fbff;
}

.procedure-claim-meta span {
  color: #777b86;
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.procedure-claim-meta strong {
  color: #4e5159;
  font-size: 0.9rem;
}

.procedure-claim-table td:first-child,
.procedure-claim-table th:first-child {
  text-align: left;
}

.procedure-claim-table tfoot td {
  font-weight: 900;
}

.procedure-claim-empty {
  padding: 22px 12px !important;
  color: #6f7480;
  font-weight: 800;
  text-align: center !important;
}

.procedure-commission-print-area {
  max-width: 980px;
  margin: 0 auto;
}

.procedure-commission-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}

.procedure-commission-meta div {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid #d7dde8;
  border-radius: 6px;
  background: #f8fbff;
}

.procedure-commission-meta span {
  color: #777b86;
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.procedure-commission-meta strong {
  color: #4e5159;
  font-size: 0.9rem;
}

.procedure-commission-table {
  table-layout: fixed;
}

.procedure-commission-table th,
.procedure-commission-table td {
  padding: 9px 8px;
  overflow-wrap: anywhere;
  word-break: normal;
}

.procedure-commission-table th:nth-child(1),
.procedure-commission-table td:nth-child(1) {
  width: 42px;
}

.procedure-commission-table th:nth-child(2),
.procedure-commission-table td:nth-child(2) {
  width: 112px;
}

.procedure-commission-table th:nth-child(3),
.procedure-commission-table td:nth-child(3) {
  text-align: left;
}

.procedure-commission-table th:nth-child(4),
.procedure-commission-table td:nth-child(4),
.procedure-commission-table th:nth-child(5),
.procedure-commission-table td:nth-child(5),
.procedure-commission-table th:nth-child(6),
.procedure-commission-table td:nth-child(6) {
  width: 116px;
}

.procedure-commission-table tfoot td {
  font-weight: 900;
}

.procedure-commission-empty {
  padding: 22px 12px !important;
  color: #6f7480;
  font-weight: 800;
  text-align: center !important;
}

.procedure-report-page {
  max-width: 920px;
  margin: 0 auto;
  padding: 42px 64px;
  color: #24262b;
  background: #fff;
  box-shadow: var(--doctor-shadow);
}

.procedure-report-file-frame {
  display: block;
  width: 100%;
  min-height: 78vh;
  border: 1px solid var(--doctor-line);
  border-radius: 6px;
  background: #fff;
}

/* Safari fallback (2026-09-02): uploaded PDF drawn onto canvases with pdf.js */
.procedure-report-canvas-view {
  max-height: 78vh;
  overflow: auto;
  padding: 16px;
  box-sizing: border-box;
  background: #e9edf1;
  display: grid;
  gap: 16px;
  justify-items: center;
  align-content: start;
}

.procedure-report-canvas-page {
  display: block;
  max-width: 100%;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

.procedure-report-file-image {
  display: grid;
  place-items: center;
  padding: 18px;
  border: 1px solid var(--doctor-line);
  border-radius: 6px;
  background: #fff;
}

.procedure-report-file-image img {
  max-width: 100%;
  height: auto;
}

.procedure-report-file-download {
  display: grid;
  gap: 14px;
  max-width: 720px;
  margin: 0 auto;
  padding: 28px;
  border: 1px solid var(--doctor-line);
  border-radius: 6px;
  background: #fff;
}

.procedure-report-letterhead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 2px solid #37b7c3;
  color: #1c5761;
}

.procedure-report-letterhead strong {
  font-size: 1.35rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.procedure-report-letterhead span {
  color: #6f7480;
  font-size: 0.9rem;
  font-weight: 800;
}

.procedure-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(22, 28, 36, 0.42);
}

.procedure-modal {
  width: min(560px, 100%);
  padding: 22px;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 20px 55px rgba(25, 32, 44, 0.22);
}

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

.procedure-modal-heading h2 {
  margin: 0 0 8px;
  color: #3f4149;
  font-size: 1.05rem;
}

.procedure-modal-heading p {
  margin: 0;
  color: #6f7480;
  font-weight: 800;
  line-height: 1.4;
}

.procedure-modal-close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--doctor-line);
  border-radius: 5px;
  background: #fff;
  color: #3f4149;
  font-size: 1.2rem;
  font-weight: 800;
}

.procedure-modal-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid var(--doctor-line);
  border-radius: 6px;
  background: #f8fbff;
}

.procedure-modal-summary span {
  display: grid;
  gap: 3px;
  color: #4f5664;
  font-size: 0.82rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.procedure-modal-summary b {
  color: #7a7f8c;
  font-size: 0.7rem;
  text-transform: uppercase;
}

.procedure-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.procedure-report-page h2,
.procedure-report-page h3 {
  overflow-wrap: anywhere;
}

.procedure-saved-templates {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--doctor-line);
}

.procedure-saved-templates h3 {
  margin: 0 0 12px;
  color: #3f4149;
  font-size: 0.92rem;
}

.procedure-saved-templates p {
  margin: 0;
  color: var(--doctor-muted);
}

.procedure-template-saved-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  padding: 12px;
  color: var(--doctor-ink);
  border: 1px solid var(--doctor-line);
  border-radius: 5px;
  background: #fff;
  text-align: left;
}

.procedure-template-saved-item.active {
  border-color: rgba(219, 39, 119, 0.55);
  background: #fdf2f8;
}

.procedure-template-saved-item b,
.procedure-template-saved-item small {
  display: block;
}

.procedure-workflow-card {
  overflow: visible;
}

.procedure-submission-card {
  max-width: 1180px;
}

.procedure-submission-form {
  display: grid;
  gap: 22px;
}

.procedure-form-section {
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--doctor-line);
  border-radius: 7px;
  background: #fbfbfd;
}

.procedure-form-section h3 {
  margin: 0;
  color: #3f4149;
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 0;
}

.procedure-hidden-section {
  display: none;
}

.procedure-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
}

.procedure-info-grid input[readonly] {
  color: #4b4e58;
  background: #f4f6fb;
}

.procedure-submission-editor {
  min-height: 320px;
}

.doctor-page > .doctor-section-label {
  margin-bottom: 22px;
  color: #6b6d77;
  font-size: 1.05rem;
  letter-spacing: 0;
}

.doctor-page .doctor-card {
  margin-bottom: 22px;
}

.doctor-page .doctor-card > h2 {
  font-size: 1.15rem;
  font-weight: 850;
}

.procedure-workflow-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.procedure-workflow-heading h2 {
  margin-bottom: 6px;
}

.procedure-workflow-heading p {
  margin: 0;
  color: var(--doctor-muted);
}

.procedure-workflow-layout {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(430px, 0.9fr);
  gap: 22px;
  align-items: start;
}

.procedure-workflow-list,
.procedure-workflow-editor {
  min-width: 0;
}

.procedure-workflow-table {
  border: 1px solid var(--doctor-line);
}

.doctor-page .doctor-list-table {
  table-layout: fixed;
}

.doctor-page .doctor-list-table th,
.doctor-page .doctor-list-table td {
  padding: 11px 12px;
}

.procedure-workflow-table tbody tr.selected {
  background: #fce7f3;
  box-shadow: inset 4px 0 0 var(--doctor-purple);
}

.procedure-workflow-table td small {
  display: block;
  margin-top: 4px;
  color: var(--doctor-muted);
  font-size: 0.74rem;
}

.procedure-worklist-cards {
  display: grid;
  gap: 12px;
  max-height: 640px;
  overflow-y: auto;
  padding-right: 4px;
}

.procedure-worklist-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--doctor-line);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(16, 21, 58, 0.06);
}

.procedure-worklist-card.selected {
  border-color: rgba(219, 39, 119, 0.65);
  background: #fdf2f8;
  box-shadow: inset 4px 0 0 var(--doctor-purple), 0 10px 22px rgba(219, 39, 119, 0.12);
}

.procedure-worklist-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--doctor-purple), var(--doctor-cyan));
  font-weight: 900;
}

.procedure-worklist-main {
  min-width: 0;
}

.procedure-worklist-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.procedure-worklist-top strong {
  color: #30323a;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.procedure-worklist-top span {
  flex: 0 0 auto;
  color: var(--doctor-cyan);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.procedure-worklist-main p {
  margin: 5px 0 8px;
  color: #696b75;
  font-size: 0.82rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.procedure-worklist-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.procedure-worklist-meta span {
  padding: 3px 7px;
  border-radius: 999px;
  background: #eef1f7;
  color: #6a6d78;
  font-size: 0.7rem;
  font-weight: 800;
}

.procedure-worklist-status {
  display: grid;
  justify-items: end;
  gap: 7px;
}

.procedure-worklist-status .doctor-view-button {
  min-width: 72px;
}

.procedure-empty-state {
  padding: 22px;
  border: 1px dashed var(--doctor-line);
  border-radius: 7px;
  color: var(--doctor-muted);
  background: #fff;
  font-weight: 800;
  text-align: center;
}

.procedure-workflow-editor {
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--doctor-line);
  border-radius: 5px;
  background: #fbfbfd;
}

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

.procedure-existing-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 36px;
}

.procedure-existing-files span,
.procedure-existing-files p {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--doctor-line);
  border-radius: 5px;
  background: #fff;
  color: #4b4e58;
  font-size: 0.78rem;
  font-weight: 700;
}

.procedure-existing-files span {
  display: grid;
  gap: 5px;
  min-width: 190px;
}

.procedure-existing-files small {
  display: block;
  color: var(--doctor-muted);
  font-weight: 600;
}

.procedure-upload-progress {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--doctor-line);
  border-radius: 5px;
  background: #fff;
  color: #4b4e58;
  font-size: 0.8rem;
  font-weight: 700;
}

.procedure-upload-progress div {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8ecf4;
}

.procedure-upload-progress b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--doctor-purple), var(--doctor-cyan));
  transition: width 0.18s ease;
}

.procedure-upload-remove {
  width: fit-content;
  border: 0;
  background: transparent;
  color: #c0392b;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}

.procedure-upload-status {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #d8e1ed;
  border-radius: 6px;
  background: #f8fbff;
  color: #4f5664;
  font-size: 0.86rem;
  font-weight: 700;
}

.procedure-audit-panel {
  display: grid;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--doctor-line);
}

.procedure-audit-panel h3 {
  margin: 0 0 4px;
  color: #3f4149;
  font-size: 0.92rem;
}

.procedure-audit-panel p {
  margin: 0;
  padding: 9px 10px;
  border-radius: 5px;
  background: #fff;
  color: #3f4149;
  font-size: 0.8rem;
}

.procedure-audit-panel span {
  display: block;
  margin-top: 3px;
  color: var(--doctor-muted);
  font-size: 0.72rem;
}

.doctor-compact-card {
  max-width: none;
}

.doctor-compact-card .doctor-list-table {
  max-width: 700px;
}

.doctor-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  color: #fff;
  border-radius: 4px;
  font-weight: 700;
}

.doctor-chip.pending {
  background: var(--doctor-cyan);
}

.doctor-chip.warning {
  background: #ff9b43;
}

.doctor-chip.resolved {
  background: #55c784;
}

.doctor-request-form,
.doctor-complaint-form {
  max-width: 1320px;
}

.doctor-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 28px 110px;
}

.doctor-upload-row {
  display: flex;
  align-items: end;
  gap: 180px;
  margin: 46px 0 26px;
}

.doctor-file-field {
  display: grid;
  gap: 8px;
}

.doctor-upload-row p {
  margin: 0;
  color: #777;
}

.doctor-form-actions {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.doctor-complaint-form {
  margin-bottom: 60px;
}

.doctor-complaint-form .doctor-form-grid {
  grid-template-columns: minmax(240px, 1fr) minmax(240px, 1fr) auto;
  align-items: end;
  gap: 20px;
}

.doctor-complaints-table {
  max-width: 720px;
}

.doctor-preview-card {
  padding: 22px 0 24px;
  overflow-x: auto;
}

.doctor-preview-card h2 {
  margin-left: 22px;
}

.doctor-report-paper {
  width: min(980px, calc(100vw - 394px));
  min-height: auto;
  margin: 0 auto;
  padding: 32px 72px 72px;
  color: #24262b;
  background: #fff;
  box-shadow: -22px 0 24px -26px rgba(0, 0, 0, 0.8), 22px 0 24px -26px rgba(0, 0, 0, 0.8);
  overflow: visible;
  word-break: break-word;
}

.doctor-report-paper h3 {
  margin: 0 0 22px;
  font-size: 1.45rem;
}

.doctor-report-paper hr {
  margin: 34px 0 18px;
  border: 0;
  border-top: 4px double #222;
}

.doctor-report-paper h4 {
  margin: 0 0 20px;
  font-size: 1.45rem;
  text-decoration: underline;
}

.doctor-report-paper p,
.doctor-report-body {
  font-size: 1.35rem;
  line-height: 1.35;
}

.doctor-report-body {
  display: block;
  max-width: 100%;
  white-space: normal;
}

.doctor-report-body p,
.doctor-report-body div,
.doctor-report-body li {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.doctor-report-body table {
  width: 100%;
  border-collapse: collapse;
}

.doctor-report-body img {
  max-width: 100%;
  height: auto;
}

.doctor-documentation p {
  max-width: 780px;
  line-height: 1.7;
}

.doctor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 26px 24px;
  color: #777;
}

.doctor-footer strong,
.doctor-footer b {
  color: var(--doctor-purple);
}

@media (max-width: 1100px) {
  .doctor-login-card,
  .doctor-form-grid,
  .doctor-complaint-form .doctor-form-grid {
    grid-template-columns: 1fr;
  }

  /* ── Mobile / tablet shell (2026-08-21) ────────────────────────────────
     Same portal, responsive: the sidebar becomes a slide-in drawer opened
     by the topbar hamburger; content takes the full width. */
  .doctor-shell {
    display: block;
  }

  .doctor-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 90;
    width: min(300px, 84vw);
    height: 100vh;
    height: 100dvh;
    transform: translateX(-105%);
    visibility: hidden;
    transition: transform 0.22s ease, visibility 0.22s;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }

  .doctor-sidebar.is-open {
    transform: translateX(0);
    visibility: visible;
    box-shadow: 24px 0 60px rgba(0, 0, 0, 0.35);
  }

  .doctor-nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(10, 20, 22, 0.5);
  }

  .doctor-icon-button.doctor-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
  }

  .doctor-topbar {
    flex-wrap: wrap;
    gap: 8px;
    height: auto;
    min-height: 64px;
    padding: 8px 14px;
  }

  /* Touch-friendly navigation */
  .doctor-nav-item {
    min-height: 46px;
  }

  .doctor-subnav button {
    min-height: 42px;
  }

  .doctor-portal-links {
    flex-wrap: wrap;
    min-width: 0;
    max-width: 100%;
  }

  .doctor-portal-links a {
    min-height: 40px;
    padding: 7px 8px;
  }

  /* Dashboard summary cards: 2 per row on tablets/phones, same content */
  .doctor-stats-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    padding: 26px 22px;
  }

  .doctor-stat strong {
    font-size: 1.6rem;
  }

  .doctor-stat i {
    width: 48px;
    height: 48px;
  }

  .doctor-filter-row,
  .doctor-filter-row.two,
  .procedure-wide-filter,
  .procedure-table-controls {
    grid-template-columns: 1fr;
  }

  .procedure-template-layout,
  .procedure-workflow-layout,
  .procedure-info-grid,
  .procedure-template-controls,
  .procedure-template-form-grid,
  .procedure-workflow-form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .doctor-login-page,
  .doctor-content {
    padding: 16px;
  }

  .doctor-login-form,
  .doctor-login-visual,
  .doctor-card,
  .doctor-stats-card {
    padding: 24px;
  }

  .doctor-topbar,
  .doctor-footer {
    flex-wrap: wrap;
  }

  .procedure-template-heading,
  .procedure-editor-title,
  .procedure-template-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .doctor-upload-row,
  .doctor-form-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
  }

  .doctor-report-paper {
    width: 100%;
    padding: 24px;
  }

  .doctor-page {
    padding: 16px;
  }

  .doctor-side-link {
    grid-template-columns: 22px minmax(0, 1fr) auto;
  }

  .procedure-worklist-card {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .procedure-worklist-status {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    justify-items: start;
  }

  .procedure-report-page {
    padding: 24px;
  }

  /* Keep report notifications and tables readable without pushing the page
     wider than the screen — they scroll inside their own card instead. */
  .doctor-card {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  body {
    overflow-x: hidden;
  }
}

/* Very narrow phones (2026-08-21): summary cards stack one per row —
   same cards, same information, just stacked. */
@media (max-width: 480px) {
  .doctor-stats-card {
    grid-template-columns: 1fr;
  }

  .doctor-topbar .doctor-language {
    display: none;
  }

  .doctor-profile-trigger span:first-child {
    max-width: 34vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .doctor-content {
    padding: 12px;
  }
}

@media print {
  @page {
    size: A4;
    margin: 0;
  }

  body[data-print-target="claim-summary"] * {
    visibility: hidden !important;
  }

  body[data-print-target="claim-summary"] .procedure-claim-print-area,
  body[data-print-target="claim-summary"] .procedure-claim-print-area * {
    visibility: visible !important;
  }

  body[data-print-target="claim-summary"] .procedure-claim-print-area {
    position: absolute;
    inset: 0 auto auto 0;
    width: 210mm;
    min-height: 297mm;
    box-sizing: border-box;
    padding: 14mm;
    color: #1f2530;
    background: #fff;
  }

  body[data-print-target="claim-summary"],
  body[data-print-target="claim-summary"] .doctor-shell,
  body[data-print-target="claim-summary"] .doctor-main,
  body[data-print-target="claim-summary"] .doctor-page,
  body[data-print-target="claim-summary"] .doctor-card {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }

  body[data-print-target="claim-summary"] .doctor-report-meta {
    margin-left: 0;
  }

  body[data-print-target="claim-summary"] .procedure-claim-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-print-target="claim-summary"] .procedure-claim-table {
    width: 100%;
    page-break-inside: avoid;
  }

  body[data-print-target="claim-summary"] .procedure-signature {
    page-break-inside: avoid;
  }

  body[data-print-target="commission"] * {
    visibility: hidden !important;
  }

  body[data-print-target="commission"] .procedure-commission-print-area,
  body[data-print-target="commission"] .procedure-commission-print-area * {
    visibility: visible !important;
  }

  body[data-print-target="commission"] .procedure-commission-print-area {
    position: absolute;
    inset: 0 auto auto 0;
    width: 210mm;
    min-height: 297mm;
    box-sizing: border-box;
    padding: 12mm;
    color: #1f2530;
    background: #fff;
  }

  body[data-print-target="commission"],
  body[data-print-target="commission"] .doctor-shell,
  body[data-print-target="commission"] .doctor-main,
  body[data-print-target="commission"] .doctor-page,
  body[data-print-target="commission"] .doctor-card {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }

  body[data-print-target="commission"] .doctor-report-heading {
    margin-bottom: 14px;
  }

  body[data-print-target="commission"] .doctor-report-meta {
    margin: 0 0 12px;
    font-size: 11px;
  }

  body[data-print-target="commission"] .doctor-report-title {
    margin-bottom: 16px;
    font-size: 12px;
  }

  body[data-print-target="commission"] .procedure-commission-meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 14px;
  }

  body[data-print-target="commission"] .procedure-commission-meta div {
    padding: 7px 9px;
  }

  body[data-print-target="commission"] .procedure-commission-meta span {
    font-size: 9px;
  }

  body[data-print-target="commission"] .procedure-commission-meta strong {
    font-size: 11px;
  }

  body[data-print-target="commission"] .procedure-commission-table {
    width: 100%;
    table-layout: fixed;
    page-break-inside: avoid;
    font-size: 10.5px;
  }

  body[data-print-target="commission"] .procedure-commission-table th,
  body[data-print-target="commission"] .procedure-commission-table td {
    padding: 6px 5px;
  }

  body[data-print-target="commission"] .procedure-commission-signature {
    page-break-inside: avoid;
    margin-top: 22px;
    font-size: 11px;
  }
}

/* 2026-09-02: visible template search results under the Results Template search box. */
.procedure-template-search-results {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 260px;
  overflow-y: auto;
  margin: -.2rem 0 .6rem;
  padding: 6px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
}
.procedure-template-search-results button {
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: #f4f6f9;
  color: var(--doctor-ink);
  text-align: left;
  font-size: .9rem;
  cursor: pointer;
}
.procedure-template-search-results button:hover,
.procedure-template-search-results button.active {
  background: var(--doctor-purple);
  color: #fff;
}
.procedure-template-search-results small {
  padding: 6px 10px;
  color: #777;
}

/* 2026-09-02 claim summary: cases counted without a commission rate */
.procedure-claim-note { color: #b45309; font-weight: 600; white-space: nowrap; }

/* 2026-09-04 WhatsApp support: the floating "Chat with us" button on the
   referral portal (both the signed-in shell and the login screen). Fixed
   bottom-right, z-index BELOW the modal overlays (9999) so it can never cover
   a dialog; the label collapses to the icon on phones, and it is never printed. */
.doctor-whatsapp-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 900;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  background: #25d366;
  color: #fff;
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .25);
  transition: transform .15s ease, box-shadow .15s ease;
}
.doctor-whatsapp-fab:hover,
.doctor-whatsapp-fab:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .3);
  color: #fff;
}
.doctor-whatsapp-fab svg { flex: none; }
@media (max-width: 480px) {
  .doctor-whatsapp-fab { right: 14px; bottom: 14px; padding: 12px; }
  .doctor-whatsapp-fab span { display: none; }
}
@media print {
  .doctor-whatsapp-fab { display: none !important; }
}

/* 2026-09-05 THE PHONE ZOOM TRAP (marker: doctor-mobile-16px).
   iOS Safari zooms the WHOLE PAGE IN when a field whose computed font-size is
   under 16px receives focus, and it does NOT zoom back out when the field
   blurs. The login field is 0.97rem (15.52px measured live) and the register /
   password-change modal fields are inline .95rem (15.2px), so a doctor who
   signs in on an iPhone is left on a permanently zoomed page: the dashboard
   clipped on BOTH edges with oversized text, which is exactly what the owner's
   phone showed.
   MEASURED FIRST, so this is not a guess about a layout bug: at 320, 360 and
   375 CSS px the deployed portal has NO horizontal overflow at all --
   documentElement.scrollWidth equals window.innerWidth at every width -- so
   there was nothing to un-break in the layout. The clipping was zoom.
   !important is necessary, not lazy: several of these fields carry their
   font-size in an inline style attribute written by doctor-app.js, and a
   stylesheet rule cannot outrank an inline style without it.
   Coarse pointers and narrow screens only; the desktop type scale is
   untouched. */
@media (pointer: coarse), (max-width: 768px) {
  #doctorPortal input:not([type="checkbox"]):not([type="radio"]),
  #doctorPortal select,
  #doctorPortal textarea {
    font-size: 16px !important;
  }
}
