:root {
  /* Brand accent (logo option A: charcoal & gold). The --teal-* names are
     kept so every existing rule picks the gold up without renaming. */
  --teal-50: #fbf7ea;
  --teal-100: #f3e6c3;
  --teal-500: #c9a227;
  --teal-600: #8c6b14;
  --teal-700: #6e520c;
  --ink-900: #0f172a;
  --ink-700: #334155;
  --ink-500: #64748b;
  --ink-300: #cbd5e1;
  --ink-100: #f1f5f9;
  --ink-50: #f8fafc;
  --amber-500: #f59e0b;
  --amber-100: #fef3c7;
  --red-500: #ef4444;
  --red-100: #fee2e2;
  --green-600: #16a34a;
  --green-100: #dcfce7;
  --indigo-500: #6366f1;
  --violet-500: #a855f7;
  --sky-500: #0ea5e9;
  --sky-100: #e0f2fe;
  --rose-500: #f43f5e;
  --rose-100: #ffe4e6;
  --white: #ffffff;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.10);
  /* Colorful gradient tiles used by the file viewer to tell photos, 3D
     scans and documents apart at a glance. */
  --grad-image: linear-gradient(135deg, #14b8a6 0%, #0ea5e9 100%);
  --grad-model: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  --grad-doc: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
  --grad-other: linear-gradient(135deg, #64748b 0%, #475569 100%);
  /* Brand gradient — the topbar accent strip, primary buttons, gradient
     text, and the login/register backdrop all pull from this one so the
     "colorful" pass reads as one consistent identity rather than random
     accent colors scattered around. */
  --grad-brand: linear-gradient(90deg, #a8801a, #e2c25a 50%, #a8801a);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #f0fdfa 0%, #eff6ff 35%, #f5f3ff 70%, #fff1f2 100%);
  background-attachment: fixed;
  color: var(--ink-900);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.5;
}

a { color: var(--teal-700); }

.hidden { display: none !important; }

/* ---- Layout shells ---- */

.centered-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

/* Soft blurred color blobs behind the login/register card — purely
   decorative, sits below the card (z-index) and never intercepts clicks. */
.centered-shell::before {
  content: '';
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle at 15% 20%, rgba(20, 184, 166, 0.25), transparent 40%),
    radial-gradient(circle at 85% 15%, rgba(99, 102, 241, 0.22), transparent 40%),
    radial-gradient(circle at 50% 90%, rgba(244, 63, 94, 0.18), transparent 45%);
  filter: blur(40px);
  z-index: 0;
  pointer-events: none;
}
.centered-shell > * { position: relative; z-index: 1; }

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--white);
  border-bottom: 3px solid transparent;
  border-image: var(--grad-brand) 1;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand {
  font-weight: 700;
  font-size: 19.5px;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, var(--teal-700), var(--sky-500));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-badge {
  font-size: 12.5px;
  font-weight: 600;
  background: var(--teal-100);
  color: var(--teal-700);
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Each portal gets its own accent color so the role is identifiable at a
   glance — set via a second class on the badge in each page's topbar. */
.brand-badge-technician { background: var(--sky-100); color: #0369a1; }
.brand-badge-qa { background: #eef2ff; color: #3730a3; }
.brand-badge-doctor { background: var(--rose-100); color: #be185d; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 15px;
  color: var(--ink-500);
}

/* ---- Topbar identity (avatar + name + Account button) ---- */

.topbar-identity { display: flex; align-items: center; gap: 8px; }
.topbar-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--ink-100);
  box-shadow: 0 0 0 2px var(--teal-100);
}
.topbar-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--grad-image);
  color: var(--white);
  font-weight: 700;
  font-size: 14px;
}
.topbar-identity-name { color: var(--ink-900); }
.topbar-identity-sub { color: var(--ink-500); font-weight: 400; }

/* ---- Account settings modal ---- */

.account-avatar-row { display: flex; align-items: center; gap: 16px; margin-bottom: 4px; }
.account-avatar-preview {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--ink-100);
  box-shadow: 0 0 0 3px var(--teal-100);
}
.account-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--grad-image);
  color: var(--white);
  font-weight: 700;
  font-size: 27.5px;
}

.main {
  flex: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
}

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--ink-100);
  margin-bottom: 20px;
}

.tab-btn {
  border: none;
  background: transparent;
  padding: 10px 14px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.tab-btn.active {
  color: var(--teal-700);
  border-bottom: 2px solid;
  border-image: linear-gradient(90deg, var(--teal-500), var(--sky-500)) 1;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---- Cards ---- */

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 18px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.card-header h2 {
  margin: 0;
  font-size: 18.5px;
}

.card-header p.subtitle {
  margin: 2px 0 0;
  font-size: 15px;
  color: var(--ink-500);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

@media (max-width: 860px) {
  .grid-2 { grid-template-columns: 1fr; }
}

/* ---- Auth ---- */

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--white);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  padding: 32px;
}

.auth-logo {
  text-align: center;
  margin-bottom: 8px;
  font-size: 23px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--teal-600), var(--sky-500), var(--indigo-500));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-sub {
  text-align: center;
  color: var(--ink-500);
  font-size: 15px;
  margin-bottom: 24px;
}

/* ---- Forms ---- */

label {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-700);
  margin-bottom: 5px;
}

input[type="text"], input[type="password"], input[type="email"], input[type="number"], select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--ink-300);
  border-radius: 8px;
  font-size: 16px;
  background: var(--white);
  color: var(--ink-900);
  font-family: inherit;
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--teal-500);
  outline-offset: 0;
  border-color: var(--teal-500);
}

.field { margin-bottom: 16px; }

/* Password show/hide toggle — wraps any input[type=password] at runtime
   (see enablePasswordTogglesIn() in api.js). */
.password-field { position: relative; }
.password-field input { padding-right: 40px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--ink-500);
  cursor: pointer;
  padding: 0;
}
.password-toggle:hover { background: var(--ink-100); color: var(--ink-700); }
.password-toggle svg { width: 18px; height: 18px; }

.field-row {
  display: flex;
  gap: 12px;
}
.field-row > .field { flex: 1; }

.error-text {
  color: var(--red-500);
  font-size: 15px;
  margin-top: 10px;
  min-height: 0;
}

.help-text {
  color: var(--ink-500);
  font-size: 14.5px;
  margin-top: 4px;
}

/* ---- Buttons ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.1s ease;
}
.btn:hover { filter: brightness(0.96); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--teal-600), var(--sky-500));
  color: var(--white);
  width: 100%;
  box-shadow: 0 2px 6px rgba(14, 165, 233, 0.25);
  transition: filter 0.1s ease, transform 0.1s ease, box-shadow 0.1s ease;
}
.btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 4px 10px rgba(14, 165, 233, 0.32); }
.btn-secondary { background: var(--ink-100); color: var(--ink-700); }
.btn-outline { background: var(--white); color: var(--teal-700); border: 1px solid var(--teal-600); }
.btn-danger { background: var(--red-100); color: var(--red-500); }
.btn-sm { padding: 6px 12px; font-size: 15px; }
.btn-block { width: 100%; }

/* Shown in place of a Download control for patient photos a technician can
   view but not save — a quiet, clearly-inert badge rather than a button. */
.btn-disabled {
  background: var(--ink-100);
  color: var(--ink-500);
  border: 1px dashed var(--ink-300);
  cursor: not-allowed;
  user-select: none;
}
.btn-disabled:hover { filter: none; }

/* ---- Badges / status pills ---- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
}
.pill-pending { background: var(--amber-100); color: #92400e; }
.pill-in_progress { background: #dbeafe; color: #1d4ed8; }
.pill-completed { background: var(--green-100); color: var(--green-600); }
.pill-role-management { background: var(--teal-100); color: var(--teal-700); }
.pill-role-technician { background: var(--ink-100); color: var(--ink-700); }
.pill-role-doctor { background: #ede9fe; color: #6d28d9; }
.pill-role-qa { background: #eef2ff; color: #3730a3; }
.pill-role-manager { background: var(--sky-100); color: #0369a1; }
.pill-pending-approval { background: var(--amber-100); color: #92400e; }
.pill-disapproved { background: var(--red-100); color: var(--red-500); }
.pill-neutral { background: var(--ink-100); color: var(--ink-700); }

/* ---- Production stage pipeline ---- */

.stage-pipeline { margin-bottom: 16px; }
.stage-list { display: flex; flex-direction: column; border: 1px solid var(--ink-100); border-radius: var(--radius); overflow: hidden; }
.stage-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--ink-100);
  background: var(--white);
}
.stage-row:last-child { border-bottom: none; }
.stage-row.stage-completed { background: var(--teal-50); }
.stage-num {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--ink-100);
  color: var(--ink-700);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14.5px;
  font-weight: 700;
}
.stage-row.stage-in_progress .stage-num { background: #dbeafe; color: #1d4ed8; }
.stage-row.stage-completed .stage-num { background: var(--teal-600); color: var(--white); }
.stage-info { flex: 1; min-width: 0; }
.stage-label { font-weight: 600; font-size: 15.5px; }
.stage-meta { font-size: 14px; color: var(--ink-500); margin-top: 1px; }

/* ---- Revision banner: a doctor sent a version back for changes ---- */

.revision-banner {
  background: var(--amber-100);
  border: 1px solid #fbbf24;
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 15.5px;
  color: #7c4a03;
}
.revision-banner strong { display: block; margin-bottom: 3px; }
/* Neutral variant for "submitted, waiting on someone else" states (e.g.
   awaiting QA) rather than an actual request for changes. */
.revision-banner-info {
  background: #eef2ff;
  border-color: var(--indigo-500);
  color: #3730a3;
}
.case-revision-banner {
  display:flex; align-items:center; gap:14px; margin:0 0 14px; padding:12px 14px;
  border:2px solid #2581ea; border-radius:12px; background:#eff6ff; color:#0b376f;
}
.case-revision-banner .case-revision-kicker {
  flex:0 0 auto; padding:6px 9px; border-radius:8px; background:#2581ea; color:#fff;
  font-size:12px; font-weight:900; letter-spacing:.05em;
}
.case-revision-banner strong { display:block; font-size:16px; color:#082f63; }
.case-revision-banner div > span { display:block; margin-top:2px; color:#476581; font-size:13px; }
.doc-additional-clinical, .doc-additional-clinical strong { color:#c62828 !important; }
.slog-revision-label { color:#1565c0; font-weight:900; }
.doc-revision-mini {
  display:inline-flex; align-items:center; margin-left:7px; padding:3px 7px; border-radius:999px;
  background:#e8f2ff; color:#0f67c8; border:1px solid #bfdbfe; font-size:11px; font-weight:900; letter-spacing:.04em;
  vertical-align:middle;
}
.doctor-revision-context {
  display:flex; align-items:center; gap:12px; margin:2px 0 16px; padding:12px 14px;
  border:2px solid #2581ea; border-radius:12px; background:#eff6ff; color:#0b376f;
}
.doctor-revision-context-badge {
  flex:0 0 auto; padding:6px 9px; border-radius:8px; background:#2581ea; color:#fff;
  font-size:12px; font-weight:900; letter-spacing:.05em;
}
.doctor-revision-context > div { flex:1; min-width:0; }
.doctor-revision-context strong { display:block; color:#082f63; font-size:15px; }
.doctor-revision-context div > span { display:block; margin-top:2px; color:#476581; font-size:13px; line-height:1.35; }
@media (max-width:700px) { .doctor-revision-context { align-items:flex-start; flex-wrap:wrap; } }

/* ---- Deliverable versions / doctor review ---- */

.version-card {
  background: var(--white);
  border: 1px solid var(--ink-100);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}
.version-card-header { display: flex; align-items: center; gap: 10px; font-size: 17px; }
.reject-note {
  margin-top: 12px;
  background: var(--red-100);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 15px;
  color: #7f1d1d;
}
.reject-note strong { display: block; margin-bottom: 2px; }
.version-review-actions { display: flex; gap: 10px; margin-top: 14px; }
.version-review-actions .btn { flex: 1; }

/* ---- Rejects list (management) ---- */

.reject-list { display: flex; flex-direction: column; gap: 8px; }
.reject-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--ink-100);
  border-radius: 8px;
  font-size: 15px;
}
.reject-row-main { flex: 1; }

/* ---- Raw change-history audit table (management) ---- */

.history-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.history-table th {
  text-align: left;
  color: var(--ink-500);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 7px 8px;
  border-bottom: 1px solid var(--ink-100);
}
.history-table td { padding: 7px 8px; border-bottom: 1px solid var(--ink-100); vertical-align: top; }

/* ---- Case list ---- */

.case-list { display: flex; flex-direction: column; gap: 10px; }

.case-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--ink-100);
  border-radius: 10px;
  background: var(--white);
}

.case-row-main { display: flex; flex-direction: column; gap: 4px; }
.case-row-title { font-weight: 600; font-size: 16.5px; }
.case-row-meta { font-size: 14.5px; color: var(--ink-500); display: flex; gap: 10px; flex-wrap: wrap; }
.case-row-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.empty-state {
  text-align: center;
  color: var(--ink-500);
  padding: 30px 10px;
  font-size: 16px;
}

/* ---- Activity feed ---- */

.feed { display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow-y: auto; }
.feed-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--ink-100); font-size: 15.5px; }
.feed-item:last-child { border-bottom: none; }
.feed-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; background: var(--teal-500); }
.feed-dot.completed { background: var(--green-600); }
.feed-dot.accepted { background: #1d4ed8; }
.feed-dot.created { background: var(--amber-500); }
.feed-time { color: var(--ink-500); font-size: 14px; white-space: nowrap; }
.feed-text { color: var(--ink-900); }

/* ---- Stats ---- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
@media (max-width: 760px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  border-top: 3px solid var(--ink-100);
}
.stat-value { font-size: 27.5px; font-weight: 700; color: var(--ink-900); }
.stat-label { font-size: 14.5px; color: var(--ink-500); margin-top: 2px; }

/* Each card in the overview strip means something different (pending /
   in progress / awaiting QC / completed / turnaround), so the accent color
   carries that meaning instead of being decoration — same palette as the
   status pills elsewhere, so "amber" always means "pending" across the app. */
.stat-card:nth-child(1) { border-top-color: var(--amber-500); }
.stat-card:nth-child(1) .stat-value { color: #b45309; }
.stat-card:nth-child(2) { border-top-color: var(--sky-500); }
.stat-card:nth-child(2) .stat-value { color: #0369a1; }
.stat-card:nth-child(3) { border-top-color: var(--violet-500); }
.stat-card:nth-child(3) .stat-value { color: #7e22ce; }
.stat-card:nth-child(4) { border-top-color: var(--green-600); }
.stat-card:nth-child(4) .stat-value { color: var(--green-600); }
.stat-card:nth-child(5) { border-top-color: var(--teal-500); }
.stat-card:nth-child(5) .stat-value { color: var(--teal-700); }
.stat-card:nth-child(6) { border-top-color: #2563eb; }
.stat-card:nth-child(6) .stat-value { color: #1d4ed8; }
.stat-card-action {
  appearance: none;
  width: 100%;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.stat-card-action:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); background: #f8fbff; }
.stat-card-action:focus-visible { outline: 3px solid rgba(37,99,235,.18); outline-offset: 2px; }
.stat-hint { margin-top: 5px; font-size: 12px; font-weight: 600; color: #64748b; }

/* ---- Drive browser ---- */

.drive-breadcrumbs { display: flex; flex-wrap: wrap; gap: 4px; font-size: 15px; margin-bottom: 10px; color: var(--ink-500); }
.drive-breadcrumbs button { background: none; border: none; color: var(--teal-700); cursor: pointer; font-size: 15px; padding: 0; }
.drive-list { display: flex; flex-direction: column; border: 1px solid var(--ink-100); border-radius: 8px; max-height: 320px; overflow-y: auto; }
.drive-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; border-bottom: 1px solid var(--ink-100); font-size: 15.5px;
}
.drive-item:last-child { border-bottom: none; }
.drive-item-name { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.drive-item-name.folder { font-weight: 600; }

/* ---- Team table ---- */

table.team-table { width: 100%; border-collapse: collapse; font-size: 15.5px; }
table.team-table th { text-align: left; color: var(--ink-500); font-weight: 600; font-size: 14px; text-transform: uppercase; letter-spacing: 0.02em; padding: 8px 10px; border-bottom: 1px solid var(--ink-100); }
table.team-table td { padding: 10px; border-bottom: 1px solid var(--ink-100); vertical-align: middle; }

/* Scrollable wrapper for long account lists (e.g. the Doctors tab) — keeps
   the header row and page layout stable while the rows scroll internally. */
.scroll-table-wrap { max-height: 460px; overflow-y: auto; }
.scroll-table-wrap table.team-table thead th { position: sticky; top: 0; background: var(--white); z-index: 1; }

/* ---- Timer ---- */

.timer-box {
  display: flex; align-items: center; gap: 8px;
  font-variant-numeric: tabular-nums;
  font-weight: 700; color: var(--teal-700);
}

/* ---- Toast ---- */

#toast-stack {
  position: fixed; top: 16px; right: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 100;
}
.toast {
  background: var(--ink-900); color: white; padding: 10px 16px; border-radius: 8px; font-size: 15.5px;
  box-shadow: var(--shadow-md); max-width: 320px;
  animation: toast-in 0.15s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

/* ---- Modal ---- */

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,0.45); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50;
}
.modal {
  background: var(--white); border-radius: 12px; box-shadow: var(--shadow-md); padding: 22px; width: 100%; max-width: 480px; max-height: 88vh; overflow-y: auto;
}
.modal h3 { margin-top: 0; }
.modal-close-btn {
  position: sticky; top: 0; float: right; margin: -4px -4px 0 12px;
  width: 30px; height: 30px; border-radius: 50%; border: none; background: var(--ink-100);
  color: var(--ink-600); font-size: 19.5px; line-height: 1; cursor: pointer; z-index: 5;
  display: flex; align-items: center; justify-content: center;
}
.modal-close-btn:hover { background: var(--ink-200); color: var(--ink-800); }

.file-drop {
  border: 1.5px dashed var(--ink-300); border-radius: 8px; padding: 18px; text-align: center; font-size: 15.5px; color: var(--ink-500); cursor: pointer;
}
.file-drop.dragover { border-color: var(--teal-500); background: var(--teal-50); }
.file-chip-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.file-chip { display: flex; align-items: center; justify-content: space-between; background: var(--ink-100); padding: 6px 10px; border-radius: 6px; font-size: 14.5px; }
.file-chip button { border: none; background: none; color: var(--red-500); cursor: pointer; font-size: 14px; }

.progress-bar { height: 6px; background: var(--ink-100); border-radius: 4px; overflow: hidden; margin-top: 8px; }

/* ---- File grid (thumbnails for case intake/deliverable files) ---- */

.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}
.file-card {
  border: 1px solid var(--ink-100);
  border-radius: 12px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  background: var(--white);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.file-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--teal-100);
}
.file-thumb {
  width: 100%;
  height: 96px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--ink-100);
  cursor: zoom-in;
  display: block;
  transition: transform 0.2s ease;
}
.file-card:hover .file-thumb { transform: scale(1.03); }

.file-thumb-icon {
  position: relative;
  width: 100%;
  height: 96px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  overflow: hidden;
  color: var(--white);
}
.file-thumb-icon svg { width: 28px; height: 28px; position: relative; z-index: 1; flex-shrink: 0; }
.file-thumb-icon.kind-image { background: var(--grad-image); }
.file-thumb-icon.kind-model { background: var(--grad-model); }
.file-thumb-icon.kind-pdf { background: var(--grad-doc); }
.file-thumb-icon.kind-other { background: var(--grad-other); }

/* A faint isometric grid behind 3D-scan tiles hints at a scan viewport
   instead of a flat generic icon. */
.file-thumb-icon.kind-model::before,
.file-viewer-placeholder-icon.kind-model::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.18) 1px, transparent 1px);
  background-size: 13px 13px;
  transform: perspective(110px) rotateX(50deg) scale(1.7);
  transform-origin: bottom;
}

.file-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-700);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-card-meta {
  font-size: 12px;
  color: var(--ink-500);
  display: flex;
  align-items: center;
  gap: 5px;
}
.file-card-meta-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.file-card-meta-dot.kind-image { background: var(--teal-500); }
.file-card-meta-dot.kind-model { background: var(--indigo-500); }
.file-card-meta-dot.kind-pdf,
.file-card-meta-dot.kind-other { background: var(--amber-500); }

.file-card .btn { text-align: center; }
.file-card.active {
  border-color: var(--teal-500);
  box-shadow: 0 0 0 2px var(--teal-100), var(--shadow-md);
}

#case-detail-modal { max-width: 800px; }

/* ---- File viewer (dropdown + large central preview, above the grid) ---- */

.file-viewer-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  background: var(--ink-50);
  border: 1px solid var(--ink-100);
  border-radius: 999px;
  padding: 5px 5px 5px 14px;
}
.file-viewer-select {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-weight: 600;
  color: var(--ink-900);
  padding-left: 0;
}
.file-viewer-select:focus { outline: none; }
.file-viewer-nav-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--white);
  color: var(--teal-700);
  font-size: 20.5px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.file-viewer-nav-btn:hover { background: var(--teal-500); color: var(--white); transform: scale(1.06); }

.file-viewer-stage {
  position: relative;
  background: linear-gradient(180deg, var(--ink-50) 0%, var(--white) 100%);
  border: 1px solid var(--ink-100);
  border-radius: 14px;
  min-height: 260px;
  max-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 14px;
  margin-bottom: 14px;
}
.file-viewer-stage::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--grad-image);
}
.file-viewer-image-wrap {
  position: relative;
  display: inline-flex;
  cursor: zoom-in;
  animation: viewer-fade-in 0.18s ease;
}
.file-viewer-image {
  max-width: 100%;
  max-height: 380px;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  display: block;
}
.file-viewer-maximize-hint {
  position: absolute;
  right: 10px;
  bottom: 10px;
  background: rgba(15, 23, 42, 0.68);
  color: var(--white);
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 10px 5px 8px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 5px;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}
.file-viewer-image-wrap:hover .file-viewer-maximize-hint { opacity: 1; }
.file-viewer-maximize-hint svg { width: 12px; height: 12px; }

.file-viewer-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px;
  color: var(--ink-500);
  animation: viewer-fade-in 0.18s ease;
}
.file-viewer-placeholder-icon {
  width: 84px;
  height: 84px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  color: var(--white);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.file-viewer-placeholder-icon svg { width: 36px; height: 36px; position: relative; z-index: 1; }
.file-viewer-placeholder-icon.kind-image { background: var(--grad-image); }
.file-viewer-placeholder-icon.kind-model { background: var(--grad-model); }
.file-viewer-placeholder-icon.kind-pdf { background: var(--grad-doc); }
.file-viewer-placeholder-icon.kind-other { background: var(--grad-other); }
.file-viewer-placeholder-text { font-weight: 700; color: var(--ink-900); font-size: 16.5px; }
.file-viewer-placeholder-sub { font-size: 14.5px; margin-top: 4px; max-width: 320px; }
.file-viewer-placeholder .btn-primary { width: auto; margin-top: 14px; }

.file-grid-compact { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.file-grid-compact .file-thumb,
.file-grid-compact .file-thumb-icon { height: 68px; }
.file-grid-compact .file-thumb-icon svg { width: 24px; height: 24px; }

@keyframes viewer-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Image preview lightbox (maximize a photo full-screen) ---- */

.image-preview-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8, 15, 30, 0.92);
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}
.image-preview-overlay.open { display: flex; animation: lightbox-fade-in 0.15s ease; }
.image-preview-box {
  background: transparent;
  border-radius: 14px;
  overflow: visible;
  max-width: 94vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}
.image-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 4px 14px;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--white);
}
.image-preview-count {
  font-weight: 600;
  color: var(--white);
  background: rgba(255, 255, 255, 0.16);
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 13px;
  margin-left: 6px;
}
.image-preview-header button {
  border: none;
  background: rgba(255, 255, 255, 0.12);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 17px;
  cursor: pointer;
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.image-preview-header button:hover { background: rgba(255, 255, 255, 0.26); }
.image-preview-header .btn-outline {
  width: auto;
  border-color: rgba(255, 255, 255, 0.4);
  color: var(--white);
  background: rgba(255, 255, 255, 0.1);
}
.image-preview-header .btn-outline:hover { background: rgba(255, 255, 255, 0.2); }
.image-preview-box img {
  max-width: 90vw;
  max-height: 76vh;
  object-fit: contain;
  display: block;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: lightbox-image-in 0.18s ease;
}
.image-preview-body { position: relative; display: flex; align-items: center; justify-content: center; }
.image-preview-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 25.5px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease;
}
.image-preview-nav:hover { background: var(--teal-500); transform: translateY(-50%) scale(1.06); border-color: transparent; }
.image-preview-prev { left: 4px; }
.image-preview-next { right: 4px; }

@keyframes lightbox-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes lightbox-image-in { from { opacity: 0; transform: scale(0.98); } to { opacity: 1; transform: scale(1); } }

.progress-bar-fill { height: 100%; background: var(--teal-500); transition: width 0.2s ease; }

/* ---- File card: uniform tiles, single-line action pinned to the bottom ---- */
.file-card { min-width: 0; }
.file-card .file-card-action {
  margin-top: auto;
  width: 100%;
  padding: 5px 6px;
  font-size: 13px;
  white-space: nowrap;
}
.file-card-tag {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 6px;
  border-radius: 999px;
  background: var(--ink-50);
  color: var(--ink-500);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.file-card-tag svg { width: 12px; height: 12px; flex-shrink: 0; }

/* ---- Technician: overview list + three-page case workspace ---- */
.active-case-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.active-case-title-row h2 { margin: 0; }
.pill-sent-back { background: var(--rose-100); color: var(--rose-500); }

.case-row-clickable { cursor: pointer; transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease; }
.case-row-clickable:hover { border-color: var(--teal-100); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.active-row { border-left: 4px solid var(--sky-500); }
.active-row-qa { border-left-color: var(--ink-300, #cbd5e1); }
.active-row-changes { border-left-color: var(--rose-500); }
.active-row .case-row-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-timer {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 15px;
  color: var(--teal-700);
  background: var(--teal-100);
  padding: 4px 10px;
  border-radius: 999px;
}
.case-row-actions { display: flex; align-items: center; gap: 10px; }

.ws-back {
  background: none;
  border: none;
  color: var(--teal-700);
  font-weight: 600;
  font-size: 15.5px;
  cursor: pointer;
  padding: 4px 0;
  margin-bottom: 10px;
}
.ws-back:hover { text-decoration: underline; }
.ws-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.ws-header .subtitle { margin: 4px 0 0; }

.ws-subtabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 0 14px;
}
.ws-subtab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 10px;
  border-radius: 12px;
  border: 1px solid var(--ink-100);
  background: var(--white);
  font-weight: 600;
  font-size: 16px;
  color: var(--ink-700);
  cursor: pointer;
  transition: all 0.15s ease;
}
.ws-subtab:hover { border-color: var(--teal-100); color: var(--teal-700); }
.ws-subtab.active {
  background: linear-gradient(135deg, #0b5ed7 0%, #1f7ae0 100%);
  color: var(--white);
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(11, 94, 215, 0.22);
}
.ws-subtab-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px;
  background: var(--ink-100);
  color: var(--ink-700);
}
.ws-subtab.active .ws-subtab-num { background: rgba(255, 255, 255, 0.25); color: var(--white); }
.ws-subtab-badge { font-size: 13px; opacity: 0.85; font-weight: 700; }
.ws-subtab-badge:empty { display: none; }

.ws-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.ws-info-item {
  background: var(--ink-50);
  border: 1px solid var(--ink-100);
  border-radius: 10px;
  padding: 10px 12px;
  min-width: 0;
}
.ws-info-label { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-500); font-weight: 700; }
.ws-info-value { font-size: 16px; font-weight: 600; color: var(--ink-900); margin-top: 3px; overflow-wrap: anywhere; }
.ws-files-block + .ws-files-block { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--ink-100); }
.ws-panel .file-viewer-stage { min-height: 220px; max-height: 360px; }
.ws-panel .file-viewer-image { max-height: 320px; }

.ws-deliver {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--ink-50);
  border: 1px solid var(--ink-100);
}
.ws-deliver-title { font-weight: 700; color: var(--ink-900); }
.ws-deliver-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.ws-deliver .btn-primary { width: auto; padding-left: 22px; padding-right: 22px; }

@media (max-width: 640px) {
  .ws-subtabs { grid-template-columns: 1fr; }
  .case-row-actions { flex-wrap: wrap; }
}

/* ---- Technician Patient details: photo gallery + scan list ---- */
.ws-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.ws-section-head h4 { margin: 0; display: flex; align-items: center; gap: 8px; }
.ws-count {
  background: var(--ink-100); color: var(--ink-700);
  border-radius: 999px; padding: 1px 9px; font-size: 14px; font-weight: 700;
}
.ws-section-note { font-size: 14.5px; color: var(--ink-500); }
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.photo-tile {
  position: relative;
  padding: 0;
  border: none;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--ink-100);
  cursor: zoom-in;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.25s ease; }
.photo-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.photo-tile:hover img { transform: scale(1.05); }
.photo-tile:focus-visible { outline: 3px solid var(--sky-500); outline-offset: 2px; }
.photo-tile-zoom {
  position: absolute; right: 8px; bottom: 8px;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(15, 23, 42, 0.6); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.15s ease;
}
.photo-tile-zoom svg { width: 14px; height: 14px; }
.photo-tile:hover .photo-tile-zoom { opacity: 1; }

.scan-list { display: flex; flex-direction: column; gap: 8px; }
.scan-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--ink-100);
  border-radius: 12px;
  background: var(--white);
}
.scan-icon {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: var(--white);
}
.scan-icon svg { width: 20px; height: 20px; }
.scan-icon.kind-model { background: var(--grad-model); }
.scan-icon.kind-pdf { background: var(--grad-doc); }
.scan-icon.kind-other { background: var(--grad-other); }
.scan-main { flex: 1; min-width: 0; }
.scan-name { font-weight: 600; font-size: 15.5px; color: var(--ink-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scan-meta { font-size: 14px; color: var(--ink-500); margin-top: 2px; }
.scan-row .btn { width: auto; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.scan-row .btn svg { width: 14px; height: 14px; }
@media (max-width: 640px) { .photo-gallery { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); } }

/* ---- Patient details: one centered, scrollable box (STL on top, photos below) ---- */
.patient-files-box {
  max-width: 760px;
  margin: 0 auto;
  max-height: 72vh;
  overflow-y: auto;
  padding: 16px 18px;
  border: 1px solid var(--ink-100);
  border-radius: 14px;
  background: var(--ink-50);
  scrollbar-width: thin;
}
.patient-files-box::-webkit-scrollbar { width: 10px; }
.patient-files-box::-webkit-scrollbar-thumb { background: var(--ink-300); border-radius: 999px; border: 2px solid var(--ink-50); }
.patient-files-box #ws-scans { margin-bottom: 22px; }
.photo-stack { display: flex; flex-direction: column; gap: 14px; }
.photo-stack-item {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--ink-100);
  border-radius: 12px;
  overflow: hidden;
  background: var(--white);
  cursor: zoom-in;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.photo-stack-item:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.photo-stack-item:focus-visible { outline: 3px solid var(--sky-500); outline-offset: 2px; }
.photo-stack-item img { display: block; width: 100%; max-height: 480px; object-fit: contain; background: #0f172a; }
.photo-stack-num {
  position: absolute; left: 10px; top: 10px;
  background: rgba(15, 23, 42, 0.65); color: var(--white);
  font-size: 13px; font-weight: 700;
  padding: 3px 9px; border-radius: 999px;
}

/* Count badge on a tab (e.g. "New cases 3") */
.tab-count {
  display: inline-block;
  min-width: 20px;
  padding: 1px 7px;
  margin-left: 4px;
  border-radius: 999px;
  background: var(--rose-500);
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
.tab-count:empty { display: none; }

/* Technician + QA accounts: switch between their two pages */
.role-switch-btn { width: auto; text-decoration: none; margin-right: 6px; white-space: nowrap; }

/* Team table: action buttons stay on one tidy row */
.row-actions { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
input:disabled { background: var(--ink-50); color: var(--ink-500); cursor: not-allowed; }

/* Login: "Keep me signed in" */
.remember-row { display: flex; align-items: flex-start; gap: 8px; margin: 2px 0 14px; font-size: 15px; font-weight: 500; color: var(--ink-700); cursor: pointer; }
.remember-row input { margin-top: 4px; width: 16px; height: 16px; accent-color: var(--teal-600); flex-shrink: 0; }
.remember-hint { color: var(--ink-500); font-size: 13.5px; }

/* ---- Rx: doctor's instructions ---- */
.rx-box {
  border: 1px solid #fcd34d;
  background: #fffbeb;
  border-left: 5px solid var(--amber-500);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 18px;
}
.rx-box-empty { border-color: var(--ink-100); border-left-color: var(--ink-300); background: var(--white); }
.rx-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.rx-badge {
  font-family: Georgia, "Times New Roman", serif; font-style: italic; font-weight: 700;
  font-size: 17px; color: var(--white); background: var(--amber-500);
  border-radius: 8px; padding: 1px 9px;
}
.rx-box-empty .rx-badge { background: var(--ink-300); }
.rx-title { font-weight: 700; color: var(--ink-900); }
.rx-edit-btn { margin-left: auto; width: auto; }
.rx-body { white-space: pre-wrap; font-size: 16px; line-height: 1.55; color: var(--ink-900); overflow-wrap: anywhere; }
.rx-body textarea { width: 100%; box-sizing: border-box; font: inherit; }
.rx-none { color: var(--ink-500); font-size: 15px; }

/* Compact case line (replaces the big name + timer header) */
.ws-crumb { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.ws-crumb .ws-back { margin-bottom: 0; }
.ws-crumb-sep { color: var(--ink-300); }
.ws-crumb-name { font-weight: 700; color: var(--ink-900); font-size: 17px; }

/* ---- Stage buttons + CCM-style notes box ---- */
.stage-btn { width: auto; flex-shrink: 0; white-space: nowrap; }
.stage-row .pill { flex-shrink: 0; }
.stage-note-editor {
  flex-basis: 100%;
  margin: 4px 0 2px 38px;
  padding: 12px 14px;
  background: var(--ink-50);
  border: 1px solid var(--ink-100);
  border-radius: 10px;
}
.stage-note-editor label { display: block; font-weight: 600; font-size: 14.5px; margin-bottom: 6px; color: var(--ink-700); }
.stage-note-optional { font-weight: 400; color: var(--ink-500); }
.stage-note-editor textarea { width: 100%; box-sizing: border-box; resize: vertical; font: inherit; }
.stage-note-actions { display: flex; justify-content: flex-end; margin-top: 8px; }
.stage-note-saved {
  margin-top: 6px; padding: 6px 10px;
  background: var(--white); border: 1px solid var(--ink-100); border-radius: 8px;
  font-size: 14.5px; color: var(--ink-700); white-space: pre-wrap; overflow-wrap: anywhere;
}
.stage-note-saved-label { font-weight: 700; color: var(--ink-900); }
@media (max-width: 640px) { .stage-note-editor { margin-left: 0; } }

/* ---- Setup log (CCM-style label : value sheet) ---- */
.setup-log {
  border: 1px solid #bae6fd;
  background: linear-gradient(180deg, #f0f9ff 0%, #ecfeff 100%);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 18px;
}
.setup-log-title { font-weight: 700; font-size: 17px; color: var(--ink-900); margin-bottom: 8px; }
.slog-section {
  display: grid;
  grid-template-columns: minmax(150px, 220px) 1fr;
  column-gap: 12px;
  row-gap: 4px;
  padding: 8px 0;
  border-top: 1px dashed #bae6fd;
}
.slog-section:first-of-type { border-top: none; }
.slog-label { text-align: right; font-weight: 700; color: var(--ink-700); font-size: 14.5px; }
.slog-value { color: var(--ink-900); font-size: 14.5px; overflow-wrap: anywhere; }
.slog-notes {
  background: var(--white);
  border: 1px solid var(--ink-100);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 14.5px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 2px 0 4px;
}
.slog-notes-label { font-weight: 700; color: var(--ink-700); }
.slog-empty { color: var(--ink-300); }
.slog-ok { color: var(--green-600); font-weight: 700; }
.slog-bad { color: var(--red-500); font-weight: 700; }
.slog-section-active {
  margin: 4px -6px;
  padding: 12px 6px;
  border: 1px solid #93c5fd;
  border-radius: 10px;
  background: rgba(255,255,255,.72);
}
.slog-complete-action { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.slog-complete-action .btn { width:auto; min-width:132px; }
.slog-stage-files .stage-files { margin:0 0 7px; }
.slog-stage-files .stage-upload-btn { margin:2px 8px 4px 0; }
.slog-file-rule { display:inline-block; margin:4px 0; font-size:13px; vertical-align:middle; }
.slog-notes-edit textarea { width:100%; min-height:82px; resize:vertical; }
.slog-inline-actions { display:flex; align-items:center; gap:9px; flex-wrap:wrap; margin-top:9px; }
.slog-inline-actions .btn { width:auto; min-width:96px; }
@media (max-width: 640px) {
  .slog-section { grid-template-columns: 1fr; }
  .slog-label { text-align: left; }
}

/* ---- Management: edit / delete case ---- */
.case-tools { display: flex; gap: 8px; flex-wrap: wrap; margin: -4px 0 12px; }
.case-tools .btn { width: auto; }
.ec-file-list { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }
.ec-file-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--ink-100); border-radius: 10px; background: var(--white); }
.ec-thumb { width: 52px; height: 40px; object-fit: cover; border-radius: 6px; flex-shrink: 0; background: var(--ink-100); }
.danger-zone {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 22px; padding: 12px 14px; border: 1px solid #fecaca; background: #fef2f2; border-radius: 10px;
}

/* Management case window: same patient-files box as the technician page */
.patient-files-box-modal { max-width: none; max-height: 60vh; }
/* Keep photo tiles a sensible size while each photo is still loading */
.photo-stack-item img { min-height: 220px; }

/* ---- Files uploaded for a production step (e.g. Cut) ---- */
.stage-upload { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px dashed var(--ink-100); }
.stage-required { color: var(--red-500); font-weight: 600; }
.stage-upload-btn { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; margin-top: 6px; }
.stage-upload-btn svg { width: 14px; height: 14px; }
.stage-files { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.stage-file {
  display: flex; align-items: center; gap: 8px;
  background: var(--white); border: 1px solid var(--ink-100); border-radius: 8px; padding: 6px 10px;
}
.stage-file-icon { width: 26px; height: 26px; border-radius: 6px; background: var(--grad-model); color: var(--white); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stage-file-icon svg { width: 15px; height: 15px; }
.stage-file-name { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.stage-file-meta { font-size: 13px; color: var(--ink-500); flex-shrink: 0; }
.stage-file-remove { border: none; background: var(--red-100); color: var(--red-500); width: 24px; height: 24px; border-radius: 50%; cursor: pointer; font-size: 16px; line-height: 1; flex-shrink: 0; }
.stage-files-empty { font-size: 14px; color: var(--ink-500); }
.stage-need-file { font-size: 13.5px; color: var(--amber-600, #b45309); margin-right: auto; align-self: center; }
.stage-note-actions { align-items: center; gap: 10px; }
.stage-upload-btn { width: auto !important; }

/* New cases: a case waiting for its next step (e.g. Ready for Stage) */
.case-row-next-step { border-left: 4px solid var(--sky-500); }
.case-row-title .pill { margin-left: 8px; vertical-align: middle; }

/* Stage step: files handed over from the Cut step */
.stage-handover {
  background: #eff6ff; border: 1px solid #bfdbfe; border-left: 4px solid var(--sky-500);
  border-radius: 10px; padding: 10px 12px; margin-bottom: 12px;
}
.stage-handover-title { font-weight: 700; color: #1e3a8a; margin-bottom: 6px; font-size: 14.5px; }
.stage-handover .stage-btn { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.stage-handover .stage-btn svg { width: 14px; height: 14px; }
.stage-handover-note { margin-top: 8px; font-size: 14px; color: var(--ink-700); white-space: pre-wrap; }
.stage-note-editor label.stage-upload-btn { display: inline-flex; width: auto; margin-bottom: 0; }

/* ---- Big upload progress bar with percentage label ---- */
.progress-bar.progress-bar-lg {
  position: relative; height: 30px; border-radius: 8px; margin-top: 12px;
  background: var(--ink-100); border: 1px solid var(--ink-200, #d9dee5);
}
.progress-bar.progress-bar-lg .progress-bar-fill {
  background: linear-gradient(90deg, var(--teal-500), #22c3a6);
  background-size: 40px 40px;
  background-image: linear-gradient(135deg, rgba(255,255,255,.18) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.18) 50%, rgba(255,255,255,.18) 75%, transparent 75%), linear-gradient(90deg, var(--teal-500), #22c3a6);
  animation: progress-stripes 1s linear infinite;
  transition: width 0.3s ease;
}
.progress-bar.progress-bar-lg .progress-bar-fill.done { animation: none; }
.progress-bar-label {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; color: var(--ink-900, #1f2933); white-space: nowrap;
  text-shadow: 0 0 3px rgba(255,255,255,.9); pointer-events: none; padding: 0 8px; overflow: hidden;
}
@keyframes progress-stripes { from { background-position: 40px 0, 0 0; } to { background-position: 0 0, 0 0; } }

/* Doctor details are Management-only (hidden for the Manager role) */
.manager-only-inline { display: none; }
body.is-manager .mgmt-only-inline { display: none; }
body.is-manager .manager-only-inline { display: inline; }
body.is-manager .mgmt-only { display: none !important; }
.stage-note-editor textarea.input-error { border-color: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,.15); }

/* ---- One-by-one completed-file uploads ---- */
.draft-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; max-height: 340px; overflow-y: auto; }
.draft-row { border: 1px solid var(--ink-100); border-radius: 10px; padding: 9px 12px; background: #fff; display: flex; flex-direction: column; gap: 6px; }
.draft-row.done { flex-direction: row; align-items: center; gap: 10px; background: #f0fdf9; border-color: #b7ebdc; }
.draft-row-top { display: flex; align-items: center; gap: 10px; }
.draft-status { width: 24px; height: 24px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; background: var(--ink-100); color: var(--ink-700, #334155); }
.draft-status.ok { background: var(--teal-500); color: #fff; }
.draft-row.error .draft-status { background: #fee2e2; color: #b91c1c; }
.draft-row.uploading .draft-status { background: #dbeafe; color: #1d4ed8; }
.draft-name { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.draft-size { color: var(--ink-500, #64748b); font-size: 14px; white-space: nowrap; }
.draft-remove { background: none; border: none; color: #dc2626; font-weight: 600; cursor: pointer; padding: 4px 6px; font-size: 14px; }
.draft-remove:hover { text-decoration: underline; }
.draft-row .progress-bar { margin-top: 2px; }
.draft-note { font-size: 13px; color: var(--ink-500, #64748b); padding-left: 34px; }
.draft-note.err { color: #b91c1c; }

/* ---- Notification bell ---- */
.notif-wrap { position: relative; display: inline-flex; margin-right: 10px; }
.notif-bell { position: relative; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--ink-100); background: #fff; color: var(--ink-700, #334155); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: background .15s; }
.notif-bell:hover { background: var(--ink-50, #f8fafc); color: var(--teal-500); }
.notif-badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #ef4444; color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; border: 2px solid #fff; }
.notif-badge.hidden { display: none; }
.notif-panel { position: absolute; top: 50px; right: 0; width: 380px; max-width: calc(100vw - 24px); background: #fff; border: 1px solid var(--ink-100); border-radius: 14px; box-shadow: 0 18px 40px rgba(15,23,42,.18); z-index: 1000; overflow: hidden; }
.notif-panel.hidden { display: none; }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--ink-100); font-size: 16px; }
.notif-markall { background: none; border: none; color: var(--teal-500); font-weight: 600; cursor: pointer; font-size: 14px; }
.notif-list { max-height: 440px; overflow-y: auto; }
.notif-empty { padding: 26px 14px; text-align: center; color: var(--ink-500, #64748b); }
.notif-item { width: 100%; display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 12px 14px; border: none; border-bottom: 1px solid var(--ink-100); background: #fff; cursor: pointer; font: inherit; }
.notif-item:hover { background: var(--ink-50, #f8fafc); }
.notif-item.unread { background: #f0fdfa; }
.notif-item.unread:hover { background: #e2faf5; }
.notif-icon { font-size: 18px; line-height: 1.3; flex: none; }
.notif-body { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.notif-msg { font-size: 14.5px; color: var(--ink-900, #1f2933); overflow-wrap: anywhere; }
.notif-item.unread .notif-msg { font-weight: 600; }
.notif-time { font-size: 12.5px; color: var(--ink-500, #64748b); }
.notif-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--teal-500); flex: none; margin-top: 6px; }
@media (max-width: 640px) { .notif-panel { position: fixed; top: 64px; right: 12px; left: 12px; width: auto; } }

/* Doctor: withdraw a pending case */
.withdraw-box { margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 12px 14px; border: 1px solid #fecaca; background: #fef2f2; border-radius: 10px; }
.doc-files-edit .doc-files-head { display: flex; flex-direction: column; gap: 2px; }
.doc-files-edit .draft-name a { color: inherit; text-decoration: underline; }

/* New case tab: single upload card (Drive import retired) */
.new-case-single { max-width: 760px; margin: 0 auto; }

/* ---- Doctor portal ---- */
.doc-stats .doc-stat { text-align: left; cursor: pointer; border: none; font: inherit; transition: transform .12s, box-shadow .12s; }
.doc-stats .doc-stat:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(15,23,42,.10); }
.doc-stats .doc-stat.selected { outline: 2px solid var(--teal-500); }
.doc-stats .doc-stat-review { border-top-color: #f59e0b !important; }
.doc-stats .doc-stat-review .stat-value { color: #b45309 !important; }
.doc-stats .doc-stat-progress { border-top-color: var(--sky-500) !important; }
.doc-stats .doc-stat-progress .stat-value { color: #0369a1 !important; }
.doc-stats .doc-stat-waiting { border-top-color: #a78bfa !important; }
.doc-stats .doc-stat-waiting .stat-value { color: #6d28d9 !important; }
.doc-stats .doc-stat-approved { border-top-color: #22c55e !important; }
.doc-stats .doc-stat-approved .stat-value { color: #15803d !important; }
.doc-filter-note { margin: -4px 0 10px; color: var(--ink-500, #64748b); font-size: 14.5px; }
.doc-case-row { gap: 12px; }
.doc-case-row.needs-review { background: #fffbeb; border-color: #fcd34d; }
.pill-review { background: #fef3c7; color: #92400e; }
.doc-new-card { max-width: 760px; margin: 0 auto; }
textarea.input-error, input.input-error { border-color: #ef4444 !important; box-shadow: 0 0 0 3px rgba(239,68,68,.15); }

/* Stars */
.stars { color: #f59e0b; letter-spacing: 1px; font-size: 17px; white-space: nowrap; }
.stars .stars-off { color: #d6dbe3; }

/* Doctor review form (doctor side) */
.doctor-review-form { margin-top: 14px; padding: 14px; border: 1px solid #fcd34d; background: #fffbeb; border-radius: 12px; }
.doctor-review-title { font-weight: 700; margin-bottom: 8px; }
.star-picker { display: flex; align-items: center; gap: 4px; margin-bottom: 10px; }
.star-btn { background: none; border: none; cursor: pointer; font-size: 32px; line-height: 1; color: #d6dbe3; padding: 0 2px; transition: transform .1s, color .1s; }
.star-btn:hover { transform: scale(1.12); }
.star-btn.on { color: #f59e0b; }
.star-label { margin-left: 8px; color: var(--ink-500, #64748b); font-weight: 600; }
.doctor-review-form textarea { width: 100%; box-sizing: border-box; }

/* Doctor review shown on a version (all sides) */
.doctor-review-note { margin-top: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid; }
.doctor-review-note.ok { background: #f0fdf4; border-color: #bbf7d0; }
.doctor-review-note.bad { background: #fef2f2; border-color: #fecaca; }
.doctor-review-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.doctor-review-comment { margin-top: 6px; font-style: italic; color: var(--ink-700, #334155); }
.nick-chip { display: inline-block; padding: 3px 10px; border-radius: 999px; background: #eef2ff; color: #3730a3; font-weight: 600; font-size: 14px; }
.nick-missing { color: #b45309; font-size: 13.5px; font-style: italic; }
.doc-case-row .btn { flex: 0 0 auto; width: auto; white-space: nowrap; }
.doc-case-row .pill { flex: 0 0 auto; white-space: nowrap; }
.doc-case-row .case-row-main { flex: 1; min-width: 0; }

/* Doctor: case progress tracker */
.doc-progress { display: flex; align-items: center; gap: 6px; margin: 6px 0 16px; padding: 12px 14px; background: var(--ink-50, #f8fafc); border: 1px solid var(--ink-100); border-radius: 12px; overflow-x: auto; }
.doc-step { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 76px; }
.doc-step-dot { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; background: #e5e7eb; color: #6b7280; }
.doc-step.done .doc-step-dot { background: var(--teal-500); color: #fff; }
.doc-step.current .doc-step-dot { background: #f59e0b; color: #fff; box-shadow: 0 0 0 4px rgba(245,158,11,.2); }
.doc-step-label { font-size: 12.5px; color: var(--ink-500, #64748b); text-align: center; white-space: nowrap; }
.doc-step.current .doc-step-label { color: var(--ink-900, #1f2933); font-weight: 700; }
.doc-step-line { flex: 1; height: 2px; background: #e5e7eb; min-width: 14px; margin-bottom: 18px; }
.doc-older-setups { margin-top: 12px; border: 1px solid var(--ink-100); border-radius: 12px; padding: 10px 14px; background: var(--ink-50, #f8fafc); }
.doc-older-setups > summary { cursor: pointer; font-weight: 700; color: var(--ink-700, #334155); }
.doc-older-setups[open] > summary { margin-bottom: 10px; }

/* ---- Doctor ratings (technician History, QA Reviewed, Management) ---- */
.muted { color: var(--ink-500); font-size: 13px; }
.pill-changes { background: var(--rose-100); color: #be123c; }
.row-stars .stars { font-size: 15px; }
.row-waiting { font-size: 13px; color: var(--ink-500); white-space: nowrap; }
.case-row-side { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.stars-avg { position: relative; display: inline-block; font-size: 20px; letter-spacing: 2px; line-height: 1; white-space: nowrap; }
.stars-avg-off { color: #d6dbe3; }
.stars-avg-on { position: absolute; left: 0; top: 0; overflow: hidden; color: #f59e0b; }
.stars-avg.sm { font-size: 14px; letter-spacing: 1px; }
.rating-summary { display: grid; grid-template-columns: 150px minmax(180px, 1fr) minmax(240px, 1.2fr); gap: 20px; align-items: center; }
.rating-score { text-align: center; padding: 8px 0; }
.rating-big { font-size: 44px; font-weight: 700; color: var(--ink-900); line-height: 1.05; margin-bottom: 6px; }
.rating-score .muted { margin-top: 6px; }
.rating-bars { display: flex; flex-direction: column; gap: 6px; }
.rating-bar-row { display: grid; grid-template-columns: 34px 1fr 26px; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-700); }
.rating-bar { height: 8px; background: var(--ink-100); border-radius: 99px; overflow: hidden; }
.rating-bar > span { display: block; height: 100%; background: #f59e0b; border-radius: 99px; }
.rating-bar-count { text-align: right; color: var(--ink-500); }
.rating-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rating-tile { background: var(--ink-50); border: 1px solid var(--ink-100); border-radius: var(--radius); padding: 10px 12px; }
.rating-tile-value { font-size: 20px; font-weight: 700; color: var(--ink-900); }
.rating-tile-label { font-size: 12px; color: var(--ink-500); margin-top: 2px; }
.rating-tile-warn .rating-tile-value { color: #be123c; }
.rating-empty { display: flex; align-items: center; gap: 14px; padding: 6px 2px; }
.rating-empty-star { font-size: 30px; color: #d6dbe3; }
.feedback-title { margin: 20px 0 8px; font-size: 14px; color: var(--ink-700); }
.feedback-list { display: flex; flex-direction: column; border: 1px solid var(--ink-100); border-radius: var(--radius); overflow: hidden; }
.feedback-item { padding: 10px 14px; border-bottom: 1px solid var(--ink-100); background: var(--white); }
.feedback-item:last-child { border-bottom: 0; }
.feedback-clickable { cursor: pointer; }
.feedback-clickable:hover { background: var(--ink-50); }
.feedback-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.feedback-head .stars { font-size: 15px; }
.feedback-meta { font-size: 13px; color: var(--ink-500); }
.feedback-meta strong { color: var(--ink-700); font-weight: 600; }
.feedback-text { margin-top: 4px; color: var(--ink-900); font-size: 14px; }
.rating-cell { white-space: nowrap; }
.rating-cell .rating-num { font-weight: 600; color: var(--ink-900); margin-left: 4px; }
.rating-cell .muted { font-size: 12px; }
.rating-cell .rating-changes { display: block; font-size: 12px; color: #be123c; }
@media (max-width: 860px) {
  .rating-summary { grid-template-columns: 1fr; }
  .rating-score { display: flex; align-items: center; gap: 12px; text-align: left; }
  .rating-big { margin: 0; }
}

/* Phones: the top bar wraps instead of pushing the page sideways. */
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; gap: 8px; padding: 10px 14px; }
  .topbar-right { flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-left: auto; font-size: 14px; }
  .topbar-identity-sub { display: none; }
}

/* =====================================================================
   Brand: charcoal & gold (logo option A)
   ===================================================================== */
:root {
  --charcoal: #16181d;
  --charcoal-2: #2a2c32;
  --gold: #d4a72c;
  --gold-deep: #a8801a;
  --gold-text: #8c6b14;
}
html, body {
  background: linear-gradient(180deg, #f7f5f0 0%, #efece5 100%);
  background-attachment: fixed;
}
.brand-logo { height: 44px; width: auto; display: block; }
@media (max-width: 640px) { .brand-logo { height: 34px; } }
.tab-btn.active { color: var(--charcoal); border-image: linear-gradient(90deg, var(--gold-deep), var(--gold)) 1; }
.btn-primary {
  background: var(--charcoal);
  color: var(--white);
  box-shadow: inset 0 -2px 0 var(--gold), 0 2px 6px rgba(22, 24, 29, 0.18);
}
.btn-primary:hover { filter: none; background: var(--charcoal-2); box-shadow: inset 0 -2px 0 var(--gold), 0 4px 10px rgba(22, 24, 29, 0.24); }
.btn-outline { color: var(--charcoal); border-color: var(--gold-deep); }
.topbar-avatar-fallback, .account-avatar-fallback { background: var(--charcoal); color: var(--gold); }
input:focus, select:focus, textarea:focus { outline-color: var(--gold-deep); border-color: var(--gold-deep); }
.notif-bell:hover { color: var(--gold-text); }
.notif-markall { color: var(--gold-text); }
.notif-item.unread { background: var(--teal-50); }
.draft-status.ok { background: var(--gold-text); }
.file-viewer-nav-btn:hover { background: var(--charcoal); }
.image-preview-nav:hover { background: var(--gold-deep); }
.progress-bar.progress-bar-lg .progress-bar-fill {
  background-image: linear-gradient(135deg, rgba(255,255,255,.18) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.18) 50%, rgba(255,255,255,.18) 75%, transparent 75%), linear-gradient(90deg, var(--gold-deep), var(--gold));
}
.doc-step.done .doc-step-dot { background: var(--gold-text); color: #fff; }
.doc-step.current .doc-step-dot { background: var(--charcoal); color: var(--gold); box-shadow: 0 0 0 4px rgba(212, 167, 44, 0.3); }

/* Sign-in page: warm ivory with the logo above the card */
body.auth-page { background: linear-gradient(180deg, #fbfaf6 0%, #f1ede4 100%); background-attachment: fixed; }
.auth-page .centered-shell { flex-direction: column; gap: 28px; }
.auth-page .centered-shell::before {
  background: radial-gradient(ellipse at 50% 0%, rgba(212, 167, 44, 0.10), transparent 55%);
  filter: none;
}
.auth-page .auth-card { box-shadow: 0 1px 2px rgba(22, 24, 29, 0.06), 0 12px 32px rgba(22, 24, 29, 0.08); }
.auth-brand { width: 320px; max-width: 82vw; height: auto; display: block; }
.auth-page .auth-card { border-top: 3px solid var(--gold); }
.auth-title { text-align: center; font-size: 22px; font-weight: 700; color: var(--charcoal); margin-bottom: 4px; }

/* ---- Doctors tab PIN ---- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.doctors-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.doctors-actions .btn { width: auto; }
.pin-gate { display: flex; justify-content: center; padding: 18px 0 8px; }
.pin-card { width: 100%; max-width: 340px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 26px 24px; border: 1px solid var(--ink-100); border-radius: 14px; background: var(--ink-50); }
.pin-card-wide { max-width: 420px; text-align: left; align-items: stretch; }
.pin-card-wide h3, .pin-card-wide .pin-icon { align-self: center; }
.pin-card h3 { margin: 2px 0 0; }
.pin-card .help-text { margin: 0; }
.pin-icon { width: 54px; height: 54px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--charcoal); color: var(--gold); }
input.pin-input { width: 170px; text-align: center; font-size: 26px; letter-spacing: 0.5em; padding: 10px 0 10px 0.5em; font-variant-numeric: tabular-nums; }
.pin-card-wide input.pin-input { width: 100%; }
.pin-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pin-card .btn-primary { width: 100%; }
.pin-link { font-size: 14px; }
.pin-card .error-text:empty { display: none; }

/* ---- Automatic sign-out ---- */
.idle-warning { position: fixed; inset: 0; background: rgba(17, 18, 20, 0.45); display: none; align-items: center; justify-content: center; z-index: 1000; padding: 16px; }
.idle-warning.open { display: flex; }
.idle-warning-card { background: var(--white); border-radius: 14px; padding: 24px; max-width: 380px; width: 100%; box-shadow: var(--shadow-md); border-top: 3px solid var(--gold); text-align: center; }
.idle-warning-card strong { font-size: 19px; display: block; margin-bottom: 6px; }
.idle-warning-card p { margin: 0 0 16px; color: var(--ink-700); }
.screenlock-banner { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 900; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; justify-content: center; background: var(--white); border: 1px solid var(--ink-100); border-left: 4px solid var(--gold); border-radius: 12px; padding: 12px 16px; box-shadow: var(--shadow-md); max-width: calc(100vw - 32px); font-size: 15px; }
.screenlock-actions { display: flex; gap: 8px; }
.screenlock-actions .btn { width: auto; }
.signed-out-note { background: var(--teal-50); border: 1px solid var(--teal-100); color: var(--ink-700); border-radius: 10px; padding: 10px 12px; font-size: 14px; margin: -8px 0 18px; text-align: center; }
.security-setting-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.security-setting-row label { margin: 0; }
.security-setting-row .btn { width: auto; }

/* ---- Teams ---- */
.team-chip { display: inline-block; vertical-align: middle; padding: 2px 10px; border-radius: 999px; background: #f6efd9; color: var(--gold-text); border: 1px solid #ecdcae; font-weight: 600; font-size: 13px; line-height: 1.5; white-space: nowrap; }
.team-chip-pool { background: var(--ink-50); color: var(--ink-500); border-color: var(--ink-100); font-weight: 500; }
.case-row-title .team-chip { margin-left: 6px; font-size: 12px; }
.help-text .team-chip { margin-right: 6px; }
.team-notice { border-left: 4px solid var(--gold); margin-bottom: 16px; display: flex; flex-direction: column; gap: 4px; }
.team-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; color: var(--ink-700); font-size: 15px; }
.cell-sub { color: var(--ink-500); font-size: 12.5px; margin-top: 2px; }
.row-actions .btn { width: auto; }

/* ---- Performance ---- */
.perf-header { flex-wrap: wrap; gap: 12px; }
.perf-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.perf-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 4px 0 16px; }
.perf-card { border: 1px solid var(--ink-100); border-radius: 12px; padding: 12px 14px; background: var(--ink-50); min-width: 0; }
.perf-card-value { font-size: 20px; font-weight: 700; color: var(--charcoal); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.perf-card-label { font-size: 13px; color: var(--ink-500); margin-top: 2px; }
.perf-table td { vertical-align: top; }
.perf-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0 14px; padding: 4px; background: var(--ink-50); border: 1px solid var(--ink-100); border-radius: 12px; width: fit-content; max-width: 100%; }
.perf-tab { border: 0; background: transparent; color: var(--ink-500); font: inherit; font-size: 14px; font-weight: 600; padding: 8px 16px; border-radius: 9px; cursor: pointer; }
.perf-tab:hover { color: var(--ink-900); }
.perf-tab.active { background: var(--white); color: var(--charcoal); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.perf-tab:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.perf-card-small { font-size: 14px; font-weight: 600; color: var(--ink-500); }
@media (max-width: 640px) { .perf-tabs { width: 100%; display: grid; grid-template-columns: 1fr 1fr; } .perf-tab { padding: 8px 6px; white-space: nowrap; } }
.perf-help { margin-top: 12px; line-height: 1.6; }
.best-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--charcoal); color: var(--gold); font-size: 12px; font-weight: 700; vertical-align: middle; }
.verdict { display: inline-block; margin-top: 4px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.verdict-top { background: #e7f6ec; color: #166534; }
.verdict-good { background: #eef7e6; color: #3f6212; }
.verdict-avg { background: #fdf5e0; color: #8c6b14; }
.verdict-low { background: #fdecec; color: #b42318; }
.verdict-none { background: var(--ink-50); color: var(--ink-500); }
@media (max-width: 640px) {
  .perf-filters { width: 100%; }
  .perf-filters select { flex: 1; }
}

/* ---- Phone widths: tabs and wide tables scroll inside the page, never the page itself ---- */
.scroll-table-wrap { overflow-x: auto; }
.grid-2 > * { min-width: 0; }
@media (max-width: 760px) {
  .tabs { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab-btn { flex: 0 0 auto; white-space: nowrap; }
  .card .team-table, .card .history-table { display: block; overflow-x: auto; }
  .card-header { flex-wrap: wrap; gap: 10px; }
}
.card-header > .btn { width: auto; flex-shrink: 0; white-space: nowrap; }
@media (max-width: 760px) { .perf-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stage-file-locked { color: var(--ink-500); cursor: default; }
.stage-file-locked::after { content: " \1F512"; font-size: 12px; }

/* ---- Email alerts (Admin) ---- */
.ea-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.ea-block { min-width: 0; }
.ea-h { font-size: 15px; margin: 0 0 10px; color: var(--charcoal); }
.ea-list { display: flex; flex-direction: column; gap: 6px; }
.ea-recipient { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--ink-50); border: 1px solid var(--ink-100); border-radius: 8px; padding: 6px 10px; font-size: 15px; overflow-wrap: anywhere; }
.ea-remove { border: none; background: transparent; font-size: 20px; line-height: 1; color: var(--ink-500); cursor: pointer; padding: 0 4px; }
.ea-remove:hover { color: #b42318; }
.ea-add { display: flex; gap: 8px; margin-top: 8px; }
.ea-add input { flex: 1; min-width: 0; }
.ea-add .btn { width: auto; }
.ea-radio { display: flex; align-items: center; gap: 8px; font-weight: 400; margin: 4px 0; cursor: pointer; }
.ea-radio input { width: auto; }
.ea-toggle { display: flex; align-items: center; gap: 10px; margin: 16px 0 6px; cursor: pointer; }
.ea-toggle input { width: auto; }
.ea-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; margin-top: 8px; }
.ea-actions .help-text { flex: 1; min-width: 200px; }
.ea-actions .btn { width: auto; }
.ea-bad { color: #b42318; }
@media (max-width: 760px) { .ea-grid { grid-template-columns: 1fr; } }
.auth-switch { text-align: center; margin: 16px 0 0; font-size: 14.5px; color: var(--ink-500); }
.pullback-box { margin-top: 14px; border: 1px solid var(--ink-100); border-radius: 10px; padding: 10px 14px; background: var(--ink-50); }
.pullback-box summary { cursor: pointer; font-weight: 600; color: #b42318; }
/* A pop-up window always wins over the screen-lock banner (it could cover Save). */
body:has(.modal-backdrop:not(.hidden)) .screenlock-banner { display: none; }
/* Pull back: what to redo */
.pb-scope { display: flex; flex-direction: column; gap: 6px; }
.pb-scope label { display: flex; gap: 8px; align-items: baseline; font-weight: 400; cursor: pointer; margin: 0; }
.redo-box { background: #fff7ed; border: 1px solid #fed7aa; border-left: 4px solid #ea580c; border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; }
.redo-title { color: #9a3412; }
.redo-reason { margin-top: 4px; color: var(--ink-700, #334155); }
.redo-help { margin-top: 4px; font-size: 14px; color: var(--ink-500); }
.redo-inline { color: #9a3412; }
.replaced-files { margin-top: 8px; font-size: 14px; }
.replaced-files summary { cursor: pointer; color: var(--ink-500); }
.replaced-files .stage-file { opacity: .75; }
/* Software */
.sw-pill { display: inline-block; font-size: 12.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #eef2ff; color: #3730a3; border: 1px solid #c7d2fe; vertical-align: middle; }
td .sw-pill { margin-top: 4px; }
.sw-checks { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.sw-check { display: inline-flex; align-items: center; gap: 5px; font-weight: 400; font-size: 14.5px; margin: 0; cursor: pointer; white-space: nowrap; }
.software-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.software-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.software-row input { max-width: 220px; }
.software-add { display: flex; gap: 8px; max-width: 420px; }
/* Clarification questions */
.questions-panel { margin: 14px 0; padding: 16px; border: 1px solid #bfdbfe; border-radius: 14px; background: #f8fbff; }
.q-panel-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; padding:2px 2px 14px; border-bottom:1px dashed #bfdbfe; margin-bottom:14px; }
.q-panel-head h3 { margin:0; font-size:20px; color:#0f2747; }
.q-panel-sub { margin-top:3px; color:var(--ink-500); font-size:13.5px; }
.q-panel-count { white-space:nowrap; font-size:12.5px; font-weight:700; color:#1d4ed8; background:#eff6ff; border:1px solid #bfdbfe; border-radius:999px; padding:5px 10px; }
.q-empty { padding:18px; text-align:center; color:var(--ink-500); background:#fff; border:1px dashed #cbd5e1; border-radius:10px; }
.q-item { background: var(--white); border: 1px solid #dbeafe; border-radius: 12px; padding: 14px; margin-bottom: 12px; box-shadow:0 2px 8px rgba(15,39,71,.04); }
.q-review .q-item, .q-item.q-review { border-left: 4px solid #f59e0b; }
.q-item.q-sent { border-left: 4px solid #2563eb; }
.q-item.q-answered { border-left: 4px solid #16a34a; }
.q-item.q-declined { border-left:4px solid #94a3b8; opacity:.9; }
.q-head { display: flex; gap: 10px; align-items: center; justify-content:space-between; flex-wrap: wrap; }
.q-title { font-weight:800; color:#0f2747; }
.q-meta-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; margin:12px 0; }
.q-meta-grid > div { background:#f8fafc; border:1px solid #eef2f7; border-radius:8px; padding:8px 10px; min-width:0; }
.q-meta-grid span { display:block; font-size:11.5px; text-transform:uppercase; letter-spacing:.035em; color:#64748b; margin-bottom:2px; }
.q-meta-grid strong { display:block; font-size:13px; color:#1e293b; font-weight:650; overflow-wrap:anywhere; }
.q-message-block { border:1px solid #e2e8f0; border-radius:9px; overflow:hidden; }
.q-message-label { background:#f8fafc; border-bottom:1px solid #e2e8f0; padding:7px 10px; font-size:12px; font-weight:700; color:#475569; }
.q-text { padding:10px 12px; white-space:pre-wrap; line-height:1.45; color:#0f172a; }
.q-note { margin-top: 8px; font-size: 14px; color: #475569; background:#f8fafc; border-radius:8px; padding:8px 10px; }
.q-answer { margin-top: 10px; padding: 10px 12px; background: #f0fdf4; border:1px solid #bbf7d0; border-radius: 9px; }
.q-answer-label { font-size: 12.5px; font-weight: 700; color: #166534; margin-bottom: 4px; }
.q-answer-text { white-space:pre-wrap; line-height:1.45; color:#14532d; }
.q-review, .q-record, .q-ask { margin-top: 10px; display: flex; flex-direction: column; gap: 7px; }
.q-review { padding-top:10px; border-top:1px dashed #e2e8f0; }
.q-record summary { cursor: pointer; color: #1d4ed8; font-size: 13.5px; font-weight:600; }
.q-ask { margin-top:16px; padding:14px; background:#fff; border:1px solid #bfdbfe; border-radius:12px; }
.q-ask-title { font-weight:800; color:#0f2747; font-size:15px; }
.q-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.q-actions .help-text { flex: 1; min-width: 200px; }
@media (max-width: 900px) { .q-meta-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width: 560px) { .q-meta-grid { grid-template-columns:1fr; } .q-panel-head { align-items:flex-start; } }
.doc-questions { margin: 12px 0; display: flex; flex-direction: column; gap: 10px; }
.doc-question { border: 1px solid #bfdbfe; border-left: 4px solid #3b82f6; background: #eff6ff; border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.doc-question.answered { border-color: #bbf7d0; border-left-color: #16a34a; background: #f0fdf4; }
.doc-question-head { font-weight: 600; }
.doc-question-text { white-space: pre-wrap; }
.doc-question .btn { align-self: flex-end; }
/* Due times + Exocad */
.due-chip { display: inline-block; font-size: 12.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #f1f5f9; color: #334155; border: 1px solid #e2e8f0; vertical-align: middle; white-space: nowrap; }
.due-chip.due-soon { background: #fff7ed; color: #9a3412; border-color: #fed7aa; }
.due-chip.due-late { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.exo-pill { display: inline-block; font-size: 12.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #ecfeff; color: #0e7490; border: 1px solid #a5f3fc; vertical-align: middle; }
.exo-order { border: 1px solid #a5f3fc; border-left: 4px solid #0891b2; background: #f0fdff; border-radius: 10px; padding: 10px 14px; margin: 12px 0; }
.exo-order-title { font-weight: 700; color: #0e7490; margin-bottom: 6px; }
.exo-row { display: flex; gap: 10px; padding: 2px 0; }
.exo-row span { min-width: 80px; color: var(--ink-500); }
.exo-upload { border: 1px dashed var(--ink-200, #cbd5e1); border-radius: 10px; padding: 12px 14px; margin: 12px 0; }
.exo-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 640px) { .exo-fields { grid-template-columns: 1fr; } }
.type-switch { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.type-switch label { flex: 1; min-width: 180px; display: flex; gap: 8px; align-items: center; border: 1px solid var(--ink-100); border-radius: 10px; padding: 10px 12px; cursor: pointer; margin: 0; font-weight: 600; }
.type-switch label:has(input:checked) { border-color: var(--gold, #d4a72c); background: #fffbeb; }
#case-modal { max-width: 800px; }
.work-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; } @media (max-width: 760px) { .work-grid { grid-template-columns: 1fr; } }
/* Messages ("Ask us") */
.tabs .ask-us-btn { margin-left: auto; align-self: center; }
.msg-thread { border: 1px solid var(--ink-100); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; background: var(--white); }
.msg-thread.msg-unread { border-left: 4px solid #3b82f6; }
.msg-thread-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.msg-post { border-radius: 10px; padding: 8px 12px; margin: 6px 0; max-width: 88%; }
.msg-post.msg-mine { background: #f0fdf4; margin-left: auto; }
.msg-post.msg-theirs { background: #eff6ff; }
.msg-meta { font-size: 13px; color: var(--ink-500); margin-bottom: 2px; }
.msg-body { white-space: pre-wrap; }
.msg-reply { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.msg-reply > .btn { align-self: flex-end; }
.msg-reply .q-actions .btn { width: auto; }
#panel-messages .card-header .ea-toggle { white-space: nowrap; flex-shrink: 0; }

/* Doctor messages — centered, compact workspace */
#panel-messages { max-width: 980px; margin-left: auto; margin-right: auto; }
#panel-messages > .card { width: 100%; }
#panel-messages #ask-card { padding: 24px 26px; }
#panel-messages #ask-send { display: block; width: min(220px, 100%); margin: 18px auto 0; }
@media (max-width: 760px) {
  #panel-messages { max-width: none; }
  #panel-messages #ask-card { padding: 18px; }
  #panel-messages #ask-send { width: 100%; }
}
/* Server storage */
.storage-bar { height: 14px; border-radius: 999px; background: var(--ink-100); overflow: hidden; }
.storage-fill { height: 100%; border-radius: 999px; background: #16a34a; }
.storage-watch .storage-fill { background: #f59e0b; }
.storage-warn .storage-fill, .storage-critical .storage-fill { background: #dc2626; }
.storage-stats { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 14.5px; }
.storage-banner { background: #fef2f2; border: 1px solid #fecaca; border-left: 4px solid #dc2626; color: #991b1b; border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; }
/* Automatic translation */
.tr-note { display: block; margin-top: 4px; font-size: 12.5px; color: var(--ink-500); font-style: normal; }
.tr-note a { color: inherit; text-decoration: underline; }
/* Translator choice (Admin → Automatic translation) */
.tr-providers .ea-toggle { align-items: flex-start; margin: 8px 0; font-weight: 400; }
.tr-providers .ea-toggle input { margin-top: 3px; }
.tr-providers code { font-size: 0.85em; }
/* Edge/IE add their own "show password" eye inside password boxes; we have
   our own toggle, so hide the browser's to avoid two eyes. */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear { display: none; }
/* Exocad: Admin check of a design (outside Exocad team) */
.exo-admin { margin: 10px 0; padding: 12px 14px; border: 1px solid var(--border, #e5e7eb); border-radius: 10px; background: #fafaf7; }
.exo-warn { margin: 6px 0; padding: 8px 12px; border-left: 4px solid #dc2626; background: #fef2f2; color: #7f1d1d; border-radius: 6px; font-size: 13.5px; }
.exo-warn ul { margin: 4px 0 0 18px; padding: 0; }
.exo-ok { margin: 6px 0; padding: 6px 12px; border-left: 4px solid #16a34a; background: #f0fdf4; color: #14532d; border-radius: 6px; font-size: 13px; }
.exo-hidden { margin: 6px 0; font-size: 13px; }
.exo-hidden summary { cursor: pointer; color: var(--ink-500, #6b7280); }
.exo-hidden ul { margin: 4px 0 0 18px; padding: 0; word-break: break-word; }
.exo-file-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--border, #eee); }
.exo-file-name { font-weight: 600; flex: 1; min-width: 160px; word-break: break-word; }
.exo-team-files { margin: 10px 0; padding: 10px 14px; border: 1px solid var(--border, #e5e7eb); border-radius: 10px; font-size: 14px; }
.exo-team-files summary { cursor: pointer; }
/* Admin chat (partners) */
.achat-btn { position: fixed; right: 20px; bottom: 20px; z-index: 950; width: 54px; height: 54px; border-radius: 50%; border: none; background: var(--ink-900, #111827); color: #fff; box-shadow: var(--shadow-md, 0 6px 18px rgba(0,0,0,.18)); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.achat-btn:hover { transform: translateY(-1px); }
.achat-badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #dc2626; color: #fff; font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; }
.achat-live-dot { position: absolute; bottom: 3px; right: 3px; width: 12px; height: 12px; border-radius: 50%; background: #22c55e; border: 2px solid var(--ink-900, #111827); }
.achat-panel { position: fixed; right: 20px; bottom: 86px; z-index: 950; width: 370px; max-width: calc(100vw - 32px); height: 520px; max-height: calc(100vh - 120px); background: var(--white, #fff); border: 1px solid var(--ink-100, #e5e7eb); border-radius: 14px; box-shadow: var(--shadow-md, 0 10px 30px rgba(0,0,0,.18)); display: flex; flex-direction: column; overflow: hidden; }
.achat-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--ink-100, #eee); }
.achat-title { flex: 1; font-weight: 700; font-size: 16px; }
.achat-back, .achat-close { border: none; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--ink-500, #6b7280); padding: 0 4px; }
.achat-body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
.achat-presence { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 10px 14px; border-bottom: 1px solid var(--ink-100, #eee); font-size: 13px; color: var(--ink-500, #6b7280); }
.achat-who { display: inline-flex; align-items: center; gap: 5px; }
.achat-who.is-live { color: #15803d; font-weight: 600; }
.achat-dot { width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; }
.achat-who.is-live .achat-dot { background: #22c55e; }
.achat-room { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 14px; border: none; border-bottom: 1px solid var(--ink-50, #f3f4f6); background: none; cursor: pointer; }
.achat-room:hover { background: var(--ink-50, #f9fafb); }
.achat-room.has-unread .achat-room-name { font-weight: 800; }
.achat-avatar { position: relative; flex: none; width: 38px; height: 38px; border-radius: 50%; background: var(--gold-50, #fdf6e3); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.achat-avatar.is-live::after { content: ''; position: absolute; bottom: 0; right: 0; width: 11px; height: 11px; border-radius: 50%; background: #22c55e; border: 2px solid #fff; }
.achat-room-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.achat-room-name { font-weight: 600; font-size: 15px; }
.achat-room-seen { font-weight: 400; font-size: 12px; color: var(--ink-500, #6b7280); }
.achat-room-seen.is-live { color: #15803d; font-weight: 600; }
.achat-room-last { font-size: 13px; color: var(--ink-500, #6b7280); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.achat-room-unread { background: #dc2626; color: #fff; border-radius: 10px; min-width: 20px; padding: 0 6px; font-size: 12px; font-weight: 700; text-align: center; line-height: 20px; }
.achat-msgs { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 6px; background: #fafaf7; }
.achat-msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 85%; }
.achat-msg.mine { align-self: flex-end; align-items: flex-end; }
.achat-msg-name { font-size: 12px; font-weight: 600; color: var(--ink-500, #6b7280); margin: 4px 0 2px; }
.achat-bubble { background: #fff; border: 1px solid var(--ink-100, #e5e7eb); border-radius: 12px; padding: 7px 11px; font-size: 14.5px; white-space: pre-wrap; word-break: break-word; }
.achat-msg.mine .achat-bubble { background: var(--ink-900, #111827); color: #fff; border-color: transparent; }
.achat-msg-time { font-size: 11px; color: var(--ink-400, #9ca3af); margin-top: 2px; }
.achat-compose { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--ink-100, #eee); align-items: flex-end; }
.achat-compose textarea { flex: 1; resize: none; min-height: 38px; max-height: 110px; font-size: 14.5px; }
.achat-compose .btn { width: auto; }
@media (max-width: 520px) { .achat-panel { right: 8px; left: 8px; width: auto; bottom: 80px; } .achat-btn { right: 14px; bottom: 14px; } }
body:has(.screenlock-banner:not(.hidden)) .achat-btn { bottom: 90px; }
body:has(.achat-panel:not(.hidden)) .screenlock-banner { display: none; }
.exo-approve-card .case-row .btn { width: auto; flex: none; }

/* Notes for the doctor — corrected by QA / Manager / Admin before approval */
.setup-notes-edit { margin: 8px 0 10px; }
.setup-notes-edit textarea { width: 100%; box-sizing: border-box; margin-top: 4px; }

/* On hold (waiting for the doctor) */
.due-chip.due-hold { background: #ede9fe; color: #5b21b6; }
.pill-hold { background: #ede9fe; color: #5b21b6; }
.hold-box { margin: 12px 0; padding: 12px 14px; border: 1px solid #c4b5fd; border-left: 4px solid #7c3aed; border-radius: 10px; background: #f5f3ff; }
.hold-box .hold-reason { margin-top: 4px; white-space: pre-wrap; }
.hold-details { margin: 12px 0; padding: 10px 14px; border: 1px solid var(--ink-100); border-radius: 10px; background: var(--ink-50); }
.hold-details summary { cursor: pointer; font-weight: 600; }
.pb-hold-opt { display: block; margin: 0 0 12px; }
.revision-banner.hold-banner { background: #f5f3ff; border-color: #c4b5fd; }

/* =====================================================================
   Doctor Portal (v81): side menu, dashboard, case table, step-by-step
   new case, languages. Colours come from the brand variables.
   ===================================================================== */
body.doc-app { background: linear-gradient(180deg, #f7f5f0 0%, #efece5 100%); background-attachment: fixed; }
.doc-shell { display: flex; min-height: 100vh; }
.doc-side {
  width: 248px; flex: 0 0 248px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 18px; padding: 22px 16px;
  background: var(--white); border-right: 1px solid rgba(15, 23, 42, 0.07);
}
.doc-side-brand { display: flex; flex-direction: column; gap: 6px; padding: 0 6px 6px; }
.doc-side-brand .brand-logo { height: 40px; width: auto; align-self: flex-start; }
.doc-side-sub { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-500); font-weight: 600; }
.doc-nav { display: flex; flex-direction: column; gap: 4px; }
.doc-nav-btn {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border: 0; border-radius: 10px;
  background: transparent; color: var(--ink-700); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; text-align: left;
}
.doc-nav-btn svg, .doc-lang svg, .doc-search svg, .doc-date svg, .auth-lang svg { width: 20px; height: 20px; flex: 0 0 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.doc-nav-btn:hover { background: var(--ink-50); }
.doc-nav-btn.active { background: var(--charcoal); color: var(--white); box-shadow: inset 3px 0 0 var(--gold); }
.doc-nav-btn.active svg { stroke: var(--gold); }
.doc-nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--red-500); color: #fff; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }
.doc-nav-badge:empty { display: none; }
.doc-side-promo {
  margin-top: auto; padding: 18px 16px; border-radius: 14px; color: #fff;
  background: radial-gradient(circle at 80% 0%, rgba(255,255,255,.12), transparent 50%), var(--charcoal);
  display: flex; flex-direction: column; gap: 6px;
}
.doc-promo-art { width: 100%; height: 56px; fill: none; stroke: var(--gold); stroke-width: 2; stroke-linecap: round; opacity: .9; }
.doc-promo-title { font-weight: 700; font-size: 16px; line-height: 1.3; }
.doc-promo-sub { font-size: 13px; opacity: .8; margin-bottom: 6px; }
.doc-side-promo .btn { width: 100%; background: var(--gold); color: var(--charcoal); box-shadow: none; }
.doc-side-foot { display: flex; flex-direction: column; gap: 8px; }
.doc-lang, .auth-lang { display: flex; align-items: center; gap: 8px; color: var(--ink-500); }
.doc-lang select, .auth-lang select { flex: 1; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--ink-300); background: var(--white); font: inherit; font-size: 14px; color: var(--ink-900); }
.doc-signout { width: 100%; }

.doc-main { flex: 1; min-width: 0; padding: 0 28px 40px; }
.doc-top.topbar { position: sticky; top: 0; z-index: 50; margin: 0 -28px 22px; padding: 12px 28px; background: rgba(255,255,255,.88); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(15,23,42,.06); border-image: none; gap: 16px; }
.doc-search { flex: 1; max-width: 520px; display: flex; align-items: center; gap: 10px; padding: 0 14px; border-radius: 12px; background: var(--ink-50); border: 1px solid var(--ink-100); color: var(--ink-500); }
.doc-search input { flex: 1; border: 0; background: transparent; padding: 11px 0; font: inherit; font-size: 15px; outline: none; color: var(--ink-900); }

.doc-welcome { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.doc-welcome h1 { margin: 0 0 4px; font-size: 30px; letter-spacing: -.02em; color: var(--charcoal); }
.doc-welcome .subtitle { margin: 0; }
.doc-date { display: flex; align-items: center; gap: 10px; color: var(--ink-700); font-weight: 600; font-size: 14px; background: var(--white); border-radius: 12px; padding: 10px 14px; box-shadow: var(--shadow); }
.doc-date svg { color: var(--gold-text); }

.doc-stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.doc-stat-card { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 16px; border: 1px solid rgba(15,23,42,.06); background: var(--white); box-shadow: var(--shadow); cursor: pointer; text-align: left; font: inherit; transition: transform .12s, box-shadow .12s; }
.doc-stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.doc-stat-card.attention { border-color: #fcd34d; box-shadow: 0 0 0 3px rgba(252, 211, 77, .35), var(--shadow); }
.doc-stat-icon { width: 52px; height: 52px; flex: 0 0 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center; }
.doc-stat-icon svg, .doc-cta-icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.doc-ic-amber { background: #fef3c7; color: #b45309; }
.doc-ic-blue { background: #dbeafe; color: #1d4ed8; }
.doc-ic-violet { background: #ede9fe; color: #6d28d9; }
.doc-ic-green { background: #dcfce7; color: #15803d; }
.doc-stat-text { display: flex; flex-direction: column; min-width: 0; }
.doc-stat-num { font-size: 28px; font-weight: 800; line-height: 1.1; color: var(--charcoal); }
.doc-stat-label { font-size: 14px; font-weight: 600; color: var(--ink-700); }
.doc-stat-sub { font-size: 12px; color: var(--ink-500); }

.doc-dash-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
.doc-cta-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.doc-cta { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 16px; background: var(--white); box-shadow: var(--shadow); border: 1px solid rgba(15,23,42,.06); }
.doc-cta-icon { width: 46px; height: 46px; flex: 0 0 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.doc-cta-text { flex: 1 1 160px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.doc-cta { flex-wrap: wrap; }
.doc-cta-text span { font-size: 13px; color: var(--ink-500); }
.doc-cta .btn { width: auto; white-space: nowrap; }

.doc-table-card { padding: 18px 18px 8px; }
.doc-table-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.doc-table-head h2 { margin: 0; font-size: 18px; }
.doc-table-head .subtitle { margin: 4px 0 0; }
.doc-link { font-size: 14px; font-weight: 600; color: var(--gold-text); text-decoration: none; white-space: nowrap; }
.doc-link:hover { text-decoration: underline; }
.doc-table { display: flex; flex-direction: column; }
.doc-tr { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, .9fr) minmax(0, 1.15fr) minmax(0, 1.05fr) 150px; gap: 12px; align-items: center; padding: 12px 10px; border-bottom: 1px solid var(--ink-100); }
.doc-th { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-500); background: var(--ink-50); border-radius: 10px; border-bottom: 0; padding: 10px; }
.doc-tr:not(.doc-th) { cursor: pointer; transition: background .1s; }
.doc-tr:not(.doc-th):hover { background: var(--teal-50); }
.doc-tr.needs-review { box-shadow: inset 3px 0 0 #f59e0b; }
.doc-td-case { display: flex; align-items: center; gap: 12px; min-width: 0; }
.doc-td-case > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.doc-td-case strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-td-case .muted { font-size: 12px; }
.doc-case-thumb { width: 46px; height: 46px; flex: 0 0 46px; border-radius: 12px; background: linear-gradient(135deg, #fdf2f2, #fde7e7); display: flex; align-items: center; justify-content: center; }
.doc-case-thumb svg { width: 34px; height: 24px; fill: none; stroke: #c2410c; stroke-width: 2.2; stroke-linecap: round; }
.doc-case-thumb.exo { background: linear-gradient(135deg, #ecfeff, #e0f2fe); }
.doc-case-thumb.exo svg { stroke: #0369a1; fill: #f0f9ff; }
.doc-type-pill { display: inline-block; padding: 4px 10px; border-radius: 8px; background: #eff6ff; color: #1d4ed8; font-size: 12px; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-type-pill.exo { background: #ecfeff; color: #0e7490; }
.doc-status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 1.25; max-width: 100%; }
.doc-status::before { flex: 0 0 7px; }
.doc-status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.doc-td-date { font-size: 13px; }
.doc-td-act { justify-self: end; }
.doc-td-act .btn { width: auto; min-width: 74px; max-width: 150px; white-space: normal; line-height: 1.25; text-align: center; pointer-events: none; }
.doc-pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 4px 10px; font-size: 14px; }
.doc-pager-btns { display: flex; gap: 6px; }
.doc-pager-btns button { min-width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--ink-100); background: var(--white); font: inherit; cursor: pointer; }
.doc-pager-btns button.active { background: var(--charcoal); color: #fff; border-color: var(--charcoal); }
.doc-pager-btns button:disabled { opacity: .4; cursor: default; }
.doc-filter-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 12px; border-bottom: 1px solid var(--ink-100); }
.doc-filter-tab { border: 0; background: transparent; font: inherit; font-weight: 600; font-size: 14px; color: var(--ink-500); padding: 10px 12px; border-bottom: 3px solid transparent; margin-bottom: -1px; cursor: pointer; }
.doc-filter-tab span { display: inline-block; min-width: 22px; padding: 1px 7px; border-radius: 9px; background: var(--ink-100); color: var(--ink-700); font-size: 12px; margin-left: 4px; }
.doc-filter-tab.active { color: var(--charcoal); border-bottom-color: var(--gold); }

.doc-dash-side { display: flex; flex-direction: column; gap: 18px; }
.doc-side-card { padding: 18px; }
.doc-msg-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 4px; border-bottom: 1px solid var(--ink-100); text-decoration: none; color: inherit; }
.doc-msg-item:last-child { border-bottom: 0; }
.doc-msg-avatar { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%; background: var(--ink-100); color: var(--ink-700); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.doc-msg-avatar.ours { background: var(--charcoal); color: var(--gold); }
.doc-msg-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.doc-msg-top { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.doc-msg-top .muted { font-size: 12px; white-space: nowrap; }
.doc-msg-snip { font-size: 13px; color: var(--ink-500); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-msg-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--sky-500); margin-top: 16px; }
.doc-msg-empty { font-size: 14px; color: var(--ink-500); padding: 6px 0; }
.doc-quality-card { padding: 20px; border-radius: 16px; color: #fff; background: radial-gradient(circle at 90% 100%, rgba(255,255,255,.12), transparent 55%), var(--charcoal); }
.doc-quality-title { font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.doc-quality-card ul { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.doc-quality-card li::before { content: '✓'; color: var(--gold); font-weight: 800; margin-right: 8px; }
.doc-quality-card .btn { width: auto; background: var(--gold); color: var(--charcoal); box-shadow: none; }

/* New case — steps */
.doc-new-card { max-width: 1040px; padding: 24px 26px; }
.doc-steps { display: flex; gap: 8px; margin-bottom: 22px; border-bottom: 1px solid var(--ink-100); }
.doc-wiz-step { display: flex; align-items: center; gap: 10px; padding: 0 14px 14px; color: var(--ink-500); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.doc-wiz-step.current { color: var(--charcoal); border-bottom-color: var(--charcoal); }
.doc-wiz-dot { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--ink-100); color: var(--ink-500); font-size: 14px; }
.doc-wiz-step.current .doc-wiz-dot { background: var(--charcoal); color: var(--white); }
.doc-wiz-step.done .doc-wiz-dot { background: var(--green-600); color: #fff; }
.doc-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-text); margin-bottom: 4px; }
.doc-step-panel h2 { margin: 0 0 6px; font-size: 26px; letter-spacing: -.01em; }
.doc-type-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 18px; }
.doc-type-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 18px 20px; border-radius: 16px; border: 1.5px solid var(--ink-100); background: var(--white); cursor: pointer; font: inherit; text-align: center; transition: border-color .12s, background .12s, transform .12s; }
.doc-type-card:hover { transform: translateY(-2px); border-color: var(--gold); }
.doc-type-card svg { width: 120px; height: 70px; fill: none; stroke: var(--gold-deep); stroke-width: 2.4; stroke-linecap: round; margin-bottom: 8px; }
.doc-type-card strong { font-size: 17px; color: var(--charcoal); }
.doc-type-card span { font-size: 14px; color: var(--ink-500); }
.doc-type-card em { font-style: normal; font-weight: 700; font-size: 14px; color: var(--gold-text); margin-top: 6px; }
.doc-type-card.selected { border-color: var(--green-600); background: #f0fdf4; }
.doc-type-card.selected em { color: var(--green-600); }
.doc-wiz-step.clickable { cursor: pointer; }
.doc-wiz-step.clickable:hover { color: var(--charcoal); background: #f8fbff; border-radius: 10px 10px 0 0; }
.doc-wiz-step.clickable:focus-visible { outline: 2px solid #2684ff; outline-offset: -2px; border-radius: 10px; }
.doc-compact-options-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 16px; margin: 14px 0 16px; }
.doc-compact-options-row.single { grid-template-columns: 1fr; }
.doc-radio-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.doc-radio-field legend { margin-bottom: 8px; padding: 0; font-size: 15px; font-weight: 700; color: var(--ink-700); }
.doc-radio-group { display: flex; gap: 8px; flex-wrap: nowrap; }
.doc-radio-option { flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 7px; margin: 0; padding: 9px 10px; border: 1px solid #d8e4f0; border-radius: 10px; background: #fff; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink-700); transition: border-color .12s ease, background .12s ease, box-shadow .12s ease; }
.doc-radio-option:hover { border-color: #8dbdff; background: #f8fbff; }
.doc-radio-option:has(input:checked) { border-color: #2b7fff; background: #edf5ff; box-shadow: 0 0 0 2px rgba(43,127,255,.08); }
.doc-radio-option input[type="radio"] { width: 16px; height: 16px; margin: 0; flex: 0 0 16px; accent-color: #1976ed; }
.doc-radio-option > span { min-width: 0; display: flex; align-items: baseline; gap: 5px; white-space: nowrap; }
.doc-radio-option strong { font-size: 14px; color: var(--ink-900); }
.doc-radio-option small { display: none; font-size: 11px; font-weight: 500; color: var(--ink-500); }
.doc-radio-option:has(input:checked) > span { align-items: flex-start; flex-direction: column; gap: 1px; }
.doc-radio-option:has(input:checked) small { display: block; }
@media (max-width: 860px) {
  .doc-compact-options-row { grid-template-columns: 1fr; }
  .doc-radio-group { flex-wrap: wrap; }
  .doc-radio-option { min-width: 120px; }
}
@media (max-width: 520px) {
  .doc-radio-group { flex-direction: column; }
  .doc-radio-option { width: 100%; }
}
.doc-step-actions { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin-top: 18px; }
.doc-step-actions .btn { width: auto; min-width: 140px; }
.doc-step-actions #step-back { grid-column: 1; justify-self: start; }
.doc-step-actions #step-next, .doc-step-actions #submit-btn { grid-column: 2; justify-self: center; margin-left: 0; }
.doc-new-card .file-drop { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 34px 18px; }
.doc-new-card .file-drop svg { width: 34px; height: 34px; fill: none; stroke: var(--gold-deep); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.doc-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; padding: 14px 16px; border-radius: 12px; background: var(--ink-50); }
.doc-summary div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.doc-summary strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-summary .muted { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }

/* Case window */
.doc-case-modal { max-width: 920px; }
.doc-case-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin: 4px 36px 12px 0; }
.doc-case-head h3 { margin: 2px 0 4px; font-size: 24px; }
.doc-section-title { margin: 20px 0 8px; font-size: 16px; }
.doc-case-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--ink-100); }
.doc-case-foot .btn { width: auto; }

/* Sign-in page language */
.auth-lang { position: fixed; top: 16px; right: 16px; z-index: 10; background: rgba(255,255,255,.9); padding: 6px 10px; border-radius: 12px; box-shadow: var(--shadow); }
.auth-lang select { border: 0; background: transparent; padding: 4px 2px; flex: none; width: auto; min-width: 9.5em; max-width: none; }
/* Sign-in pages: never let a tall logo slide under the top edge. */
.auth-page .centered-shell { justify-content: safe center; padding-top: 40px; padding-bottom: 32px; }
@media (max-width: 640px) { body.auth-page[data-portal="doctor"] .centered-shell { padding-top: 76px; } }

@media (max-width: 1180px) {
  .doc-dash-grid { grid-template-columns: 1fr; }
  .doc-dash-side { display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 980px) {
  .doc-stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .doc-cta-row { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .doc-shell { flex-direction: column; }
  .doc-side { position: static; width: auto; height: auto; flex: none; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 16px; border-right: 0; border-bottom: 1px solid rgba(15,23,42,.07); }
  .doc-side-brand { flex-direction: row; align-items: center; padding: 0; }
  .doc-side-brand .brand-logo { height: 32px; }
  .doc-side-sub { display: none; }
  .doc-nav { order: 3; flex-direction: row; width: 100%; overflow-x: auto; gap: 4px; }
  .doc-nav-btn { width: auto; flex: 0 0 auto; padding: 9px 12px; font-size: 14px; }
  .doc-side-promo { display: none; }
  .doc-side-foot { flex-direction: row; margin-left: auto; align-items: center; }
  .doc-lang svg { display: none; }
  .doc-signout { width: auto; }
  .doc-main { padding: 0 16px 32px; }
  .doc-top.topbar { margin: 0 -16px 16px; padding: 10px 16px; flex-wrap: wrap; }
  .doc-dash-side { grid-template-columns: 1fr; }
  .doc-welcome h1 { font-size: 24px; }
  .doc-th { display: none; }
  .doc-tr { grid-template-columns: 1fr auto; grid-template-areas: "case act" "type status" "date date"; gap: 6px 10px; padding: 12px 6px; }
  .doc-td-case { grid-area: case; }
  .doc-tr > span:nth-child(2) { grid-area: type; }
  .doc-tr > span:nth-child(3) { grid-area: status; justify-self: end; }
  .doc-td-date { grid-area: date; }
  .doc-td-act { grid-area: act; }
  .doc-summary { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .doc-stat-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .doc-stat-card { flex-direction: column; align-items: flex-start; padding: 14px; gap: 8px; }
  .doc-stat-icon { width: 40px; height: 40px; flex-basis: 40px; }
  .doc-cta { flex-wrap: wrap; }
  .doc-steps { overflow-x: auto; }
  .doc-wiz-step { white-space: nowrap; padding: 0 8px 12px; }
  .doc-step-actions .btn { min-width: 0; flex: 1; }
}
@media (max-width: 860px) {
  .doc-side-foot { gap: 6px; }
  .doc-lang select { flex: none; max-width: 120px; padding: 6px 8px; font-size: 13px; }
  .doc-signout { padding: 6px 10px; }
  .doc-top .topbar-identity-name { display: none; }
  .doc-search { max-width: none; flex-basis: 100%; }
}
/* v82: how soon the doctor needs it; due time shown to doctors */
.doc-side-foot { margin-top: auto; }
.doc-prio-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.doc-prio-card { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--ink-100); background: var(--white); cursor: pointer; font: inherit; text-align: left; }
.doc-prio-card strong { font-size: 15px; color: var(--charcoal); }
.doc-prio-card span { font-size: 13px; color: var(--ink-500); }
.doc-prio-card:hover { border-color: var(--gold); }
.doc-prio-card.selected { border-color: var(--green-600); background: #f0fdf4; }
.doc-prio-card[data-prio="urgent"].selected { border-color: #dc2626; background: #fef2f2; }
.doc-prio-card[data-prio="urgent"].selected strong { color: #b91c1c; }
.doc-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.prio-chip { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; vertical-align: middle; white-space: nowrap; }
.prio-urgent { background: #fee2e2; color: #b91c1c; }
.prio-week { background: var(--ink-100); color: var(--ink-700); }
.due-chip.due-late { background: #fee2e2; color: #b91c1c; font-weight: 700; }
.doc-case-head-chips { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.doc-td-date .due-chip, .doc-td-date .prio-chip { margin: 2px 0; }
@media (max-width: 860px) { .doc-prio-cards { grid-template-columns: 1fr; } .doc-summary { grid-template-columns: 1fr 1fr; } }

.doc-td-date .due-chip { white-space: normal; }
/* Dashboard: the case table uses the full width; recent messages below it. */
.doc-dash-grid { grid-template-columns: minmax(0, 1fr); }
.doc-dash-side { display: block; }
.doc-td-date .due-chip { white-space: nowrap; }

/* Which arches (clear aligner cases) */
.rx-arches { display: inline-block; margin-left: auto; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #e0f2fe; color: #075985; white-space: nowrap; }
.rx-arches-upper, .rx-arches-lower { background: #fef3c7; color: #92400e; }
.rx-head .rx-arches + .rx-edit-btn { margin-left: 8px; }

/* New case: Back / Continue also at the top, next to the steps */
.doc-steps-bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 22px; border-bottom: 1px solid var(--ink-100); }
.doc-steps-bar .doc-steps { margin-bottom: 0; border-bottom: 0; }
.doc-step-actions-top { margin: 0 0 10px; gap: 8px; }
.doc-step-actions-top .btn { min-width: 0; }
@media (max-width: 860px) { .doc-steps-bar { flex-direction: column; align-items: stretch; } .doc-step-actions-top { justify-content: space-between; } }

/* Top bar: Back on the left of the steps, Continue on the right */
.doc-steps-bar .doc-back-top { width: auto; flex: 0 0 auto; margin: 0 0 10px; }
.doc-steps-bar .doc-steps { flex: 1; }
.doc-steps-bar .doc-step-actions-top { margin-left: auto; }
@media (max-width: 860px) { .doc-steps-bar { flex-direction: row; flex-wrap: wrap; align-items: center; } .doc-steps-bar .doc-steps { order: -1; flex-basis: 100%; } }

/* ---- Profile pictures: small round photos that open large when clicked ---- */
.zoomable-avatar { cursor: zoom-in; }
.name-with-avatar { display: flex; align-items: center; gap: 10px; }
.avatar-thumb { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; background: var(--ink-100); color: var(--ink-500); font-weight: 700; font-size: 14px; border: 1px solid var(--ink-200, #e5e7eb); }
img.avatar-thumb { transition: transform .15s ease, box-shadow .15s ease; }
img.avatar-thumb:hover { transform: scale(1.08); box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
.photo-viewer { position: fixed; inset: 0; z-index: 3000; background: rgba(10, 12, 16, .88); display: flex; align-items: center; justify-content: center; padding: 24px; animation: photoFade .15s ease; }
.photo-viewer.hidden { display: none; }
.photo-viewer figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 100%; }
.photo-viewer img { max-width: min(92vw, 900px); max-height: 80vh; border-radius: 12px; object-fit: contain; box-shadow: 0 12px 40px rgba(0, 0, 0, .5); background: #111; cursor: default; }
.photo-viewer figcaption { color: #fff; font-size: 16px; font-weight: 600; text-align: center; }
.photo-viewer figcaption:empty { display: none; }
.photo-viewer-close { position: absolute; top: 14px; right: 18px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .14); color: #fff; font-size: 30px; line-height: 1; cursor: pointer; }
.photo-viewer-close:hover, .photo-viewer-close:focus-visible { background: rgba(255, 255, 255, .28); outline: none; }
@keyframes photoFade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .photo-viewer { animation: none; } img.avatar-thumb { transition: none; } }

/* BRANDA visible colour pass — mirrors the Arcus doctor-dashboard treatment. */
body.doc-app {
  background:
    radial-gradient(circle at 92% 5%, rgba(34,184,204,.18), transparent 28%),
    radial-gradient(circle at 18% 0%, rgba(21,101,192,.10), transparent 30%),
    linear-gradient(180deg, #f4faff 0%, #eaf3fa 100%);
}
body.doc-app .doc-side {
  background: linear-gradient(180deg, #ffffff 0%, #f1f8fc 100%);
  border-right: 1px solid #cfe1ef;
}
body.doc-app .doc-top.topbar {
  background: linear-gradient(90deg, rgba(239,248,255,.97) 0%, rgba(232,251,251,.97) 100%);
  border-bottom: 2px solid #8edee6;
  box-shadow: 0 8px 24px rgba(11,37,69,.07);
}
body.doc-app .doc-nav-btn:not(.active):hover {
  background: #eaf6fb;
  border-color: #cde5f1;
}
body.doc-app .doc-nav-btn.active {
  background: linear-gradient(135deg, #0b3158 0%, #0e5d84 100%);
  color: #fff;
  box-shadow: inset 4px 0 0 #2ed0d7, 0 9px 22px rgba(11,49,88,.20);
}
body.doc-app .doc-nav-btn.active svg { stroke: #74edf1; }
body.doc-app .doc-stat-card:nth-child(1) {
  background: linear-gradient(180deg, #fffaf0 0%, #fff4d9 100%);
  border-color: #f2d48f;
}
body.doc-app .doc-stat-card:nth-child(2) {
  background: linear-gradient(180deg, #f5f9ff 0%, #e7f1ff 100%);
  border-color: #bcd6f5;
}
body.doc-app .doc-stat-card:nth-child(3) {
  background: linear-gradient(180deg, #faf8ff 0%, #f0ebff 100%);
  border-color: #d5c8f3;
}
body.doc-app .doc-stat-card:nth-child(4) {
  background: linear-gradient(180deg, #f4fff9 0%, #e5f8ee 100%);
  border-color: #bfe7d1;
}
body.doc-app .doc-stat-card::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 4px;
  background: linear-gradient(90deg, #1565c0, #22c3d6);
  opacity: .52;
}
body.doc-app .doc-cta-row .doc-cta:first-child {
  background: linear-gradient(135deg, #edf6ff 0%, #e5f3ff 100%);
  border-color: #bedbf3;
}
body.doc-app .doc-cta-row .doc-cta:last-child {
  background: linear-gradient(135deg, #effcfb 0%, #e3f8f6 100%);
  border-color: #b8e5df;
}
body.doc-app .doc-table-card {
  border-top: 3px solid #56c6d2;
}
body.doc-app .doc-th {
  background: linear-gradient(90deg, #eaf4fb 0%, #edfafa 100%);
  color: #365c78;
}
body.doc-app .doc-date {
  background: linear-gradient(135deg, #ffffff 0%, #eef8fc 100%);
  border-color: #bcd9ea;
}
body.doc-app .btn-primary {
  background: linear-gradient(135deg, #105cae 0%, #1688c2 52%, #28bdc9 100%);
  box-shadow: 0 8px 18px rgba(18,104,196,.23);
}
body.doc-app .btn-primary:hover {
  box-shadow: 0 12px 26px rgba(18,104,196,.30);
}

/* Doctor portal cleanup — remove strong horizontal accent lines. */
body.doc-app .doc-top.topbar {
  border-bottom: 0 !important;
  border-image: none !important;
}
body.doc-app .doc-table-card {
  border-top: 0 !important;
}

/* Remove full-width stat accent artifact on doctor dashboard. */
body.doc-app .doc-stat-card::after {
  content: none !important;
  display: none !important;
}

/* Doctor dashboard: keep recent cases compact until the doctor asks to see them. */
.doc-recent-card { padding-bottom: 18px; }
.doc-recent-card .doc-table-head { align-items: center; margin-bottom: 0; }
.doc-recent-card #doc-recent:not(.hidden) { margin-top: 10px; }
.doc-recent-card #recent-cases-toggle { width: auto; white-space: nowrap; }

/* Friendly dashboard pass — doctor attention, clearer progress, admin today's work. */
.doc-action-summary,
.doc-action-card { margin: 0 0 18px; border-radius: 16px; }
.doc-action-summary { display:flex; align-items:center; gap:12px; padding:13px 16px; border:1px solid #bfe7d1; background:linear-gradient(135deg,#f5fff9 0%,#eaf8f0 100%); }
.doc-action-summary > span:last-child { display:flex; flex-direction:column; gap:2px; }
.doc-action-summary small { color:var(--ink-500); font-size:13px; }
.doc-action-icon { width:34px; height:34px; flex:0 0 34px; display:inline-flex; align-items:center; justify-content:center; border-radius:50%; background:#dcfce7; color:#15803d; font-weight:800; }
.doc-action-card { overflow:hidden; border:1px solid #f2d48f; background:linear-gradient(180deg,#fffdf8 0%,#fff8e8 100%); box-shadow:var(--shadow); }
.doc-action-head { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:13px 16px; border-bottom:1px solid rgba(180,83,9,.10); }
.doc-action-head > div { display:flex; flex-direction:column; gap:2px; }
.doc-action-head strong { font-size:16px; color:var(--ink-900); }
.doc-action-head span:not(.doc-action-count) { font-size:13px; color:var(--ink-500); }
.doc-action-count { min-width:30px; height:30px; padding:0 9px; display:inline-flex; align-items:center; justify-content:center; border-radius:999px; background:#f59e0b; color:#fff; font-weight:800; }
.doc-action-list { display:flex; flex-direction:column; }
.doc-action-item { width:100%; display:flex; align-items:center; justify-content:space-between; gap:14px; padding:11px 16px; border:0; border-bottom:1px solid rgba(180,83,9,.09); background:transparent; text-align:left; font:inherit; cursor:pointer; }
.doc-action-item:hover { background:rgba(255,255,255,.55); }
.doc-action-item > span:first-child { display:flex; flex-direction:column; gap:2px; min-width:0; }
.doc-action-item strong { color:var(--ink-900); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.doc-action-item small { color:var(--ink-500); font-size:13px; }
.doc-action-item .btn { width:auto; flex:0 0 auto; pointer-events:none; }
.doc-action-more { width:100%; border:0; background:transparent; padding:10px 16px; color:var(--gold-text); font-weight:700; cursor:pointer; }
.doc-action-more:hover { background:rgba(255,255,255,.55); }

.doc-progress-wrap { margin:10px 0 16px; padding:13px 14px 2px; border:1px solid var(--ink-100); border-radius:14px; background:linear-gradient(180deg,#fff 0%,var(--ink-50,#f8fafc) 100%); }
.doc-progress-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:4px; }
.doc-progress-head strong { font-size:15px; color:var(--ink-900); }
.doc-progress-head span { font-size:13px; color:var(--ink-500); font-weight:600; }
.doc-progress-wrap .doc-progress { margin:6px 0 10px; border:0; background:transparent; padding:10px 2px; }

.today-work-card { margin:16px 0; }
.today-work-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:12px; }
.today-work-item { min-width:0; padding:14px; border-radius:14px; border:1px solid var(--ink-100); background:var(--white); display:flex; flex-direction:column; gap:3px; }
.today-work-value { font-size:28px; line-height:1; font-weight:800; color:var(--charcoal); }
.today-work-label { font-size:14px; font-weight:700; color:var(--ink-900); }
.today-work-sub { font-size:12px; color:var(--ink-500); line-height:1.35; }
.today-work-item.today-new { background:#f5f9ff; border-color:#cfe0f5; }
.today-work-item.today-due { background:#fffaf0; border-color:#f2d48f; }
.today-work-item.today-danger { background:#fff1f2; border-color:#fecdd3; }
.today-work-item.today-danger .today-work-value { color:#be123c; }
.today-work-item.today-ok { background:#f4fff9; border-color:#bfe7d1; }
.today-work-item.today-wait { background:#faf8ff; border-color:#d9cff4; }
.today-work-item.today-qa { background:#effcfb; border-color:#b8e5df; }
@media (max-width:1100px) { .today-work-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media (max-width:700px) { .today-work-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .doc-action-item { align-items:flex-start; } .doc-progress-head { align-items:flex-start; flex-direction:column; gap:3px; } }

/* BRANDA doctor login — subtle premium blue refresh (2026-10-09). */
html.branda-blue-auth body.auth-page {
  background:
    radial-gradient(circle at 14% 10%, rgba(37,99,235,.11), transparent 28%),
    radial-gradient(circle at 88% 88%, rgba(14,165,233,.09), transparent 30%),
    linear-gradient(180deg, #f8fbff 0%, #edf5fd 100%);
  background-attachment: fixed;
}
html.branda-blue-auth body.auth-page .centered-shell { gap: 20px; }
html.branda-blue-auth body.auth-page .centered-shell::before {
  background: radial-gradient(ellipse at 50% 0%, rgba(37,99,235,.08), transparent 58%);
}
html.branda-blue-auth body.auth-page .auth-brand {
  width: 340px;
  max-width: 82vw;
  filter: drop-shadow(0 10px 22px rgba(14,48,93,.08));
}
html.branda-blue-auth body.auth-page .auth-card {
  position: relative;
  overflow: hidden;
  border: 1px solid #d7e5f3;
  border-top: 0;
  border-radius: 18px;
  box-shadow: 0 22px 60px rgba(15,54,96,.12);
  background: rgba(255,255,255,.97);
}
html.branda-blue-auth body.auth-page .auth-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, #0b2f5b 0%, #1769d2 52%, #22aeea 100%);
}
html.branda-blue-auth body.auth-page .auth-title { color: #0a2f5c; font-weight: 800; }
html.branda-blue-auth body.auth-page .auth-sub { color: #607b96; }
html.branda-blue-auth body.auth-page input {
  border-color: #cbdced;
  background: #fbfdff;
}
html.branda-blue-auth body.auth-page input:focus {
  outline: none;
  border-color: #2b7de9;
  box-shadow: 0 0 0 3px rgba(43,125,233,.13);
  background: #fff;
}
html.branda-blue-auth body.auth-page .remember-row input { accent-color: #1769d2; }
html.branda-blue-auth body.auth-page .btn-primary {
  background: linear-gradient(135deg, #0b2f5b 0%, #155fb8 58%, #167bcf 100%);
  color: #fff;
  box-shadow: 0 9px 20px rgba(21,95,184,.22);
}
html.branda-blue-auth body.auth-page .btn-primary:hover {
  background: linear-gradient(135deg, #09294f 0%, #1256a9 58%, #1472c2 100%);
  box-shadow: 0 12px 24px rgba(21,95,184,.28);
}
html.branda-blue-auth body.auth-page .auth-lang {
  border-color: #d7e4f1;
  background: rgba(255,255,255,.92);
  box-shadow: 0 6px 18px rgba(15,54,96,.07);
}
html.branda-blue-auth body.auth-page .auth-lang svg { stroke: #52769c; }
html.branda-blue-auth body.auth-page .auth-lang select { color: #193d63; }
html.branda-blue-auth body.auth-page .signed-out-note { border-color: #bcd5f0; background: #f3f8fe; color: #24557f; }


/* ===== BRANDA Option 2 — Premium Portal Experience (2026-10-09) ===== */
.branda-auth-intro,
.branda-auth-card-title,
.branda-auth-card-sub { display:none; }

html.branda-blue-auth body.auth-page {
  min-height:100vh;
  background:
    radial-gradient(circle at 8% 12%, rgba(37,99,235,.20), transparent 31%),
    radial-gradient(circle at 92% 86%, rgba(124,58,237,.15), transparent 34%),
    linear-gradient(135deg,#f7fbff 0%,#edf6ff 48%,#f4f0ff 100%);
}
html.branda-blue-auth body.auth-page .centered-shell {
  width:min(1120px,calc(100% - 48px));
  min-height:100vh;
  margin:0 auto;
  display:grid;
  grid-template-columns:minmax(0,1.1fr) minmax(360px,.9fr);
  align-items:center;
  gap:0;
  padding:72px 0;
  overflow:visible;
}
html.branda-blue-auth body.auth-page .centered-shell::before {
  inset:8% -8%;
  filter:blur(68px);
  opacity:.58;
  background:
    radial-gradient(circle at 15% 48%,rgba(14,165,233,.22),transparent 34%),
    radial-gradient(circle at 82% 42%,rgba(99,102,241,.18),transparent 34%);
}
html.branda-blue-auth body.auth-page .branda-auth-intro {
  display:flex;
  min-height:560px;
  flex-direction:column;
  justify-content:center;
  position:relative;
  overflow:hidden;
  padding:56px 64px;
  border:1px solid rgba(191,219,254,.95);
  border-right:0;
  border-radius:28px 0 0 28px;
  background:linear-gradient(145deg,rgba(255,255,255,.90),rgba(222,240,255,.86));
  box-shadow:0 30px 80px rgba(30,64,175,.13);
}
html.branda-blue-auth body.auth-page[data-portal="staff"] .branda-auth-intro {
  background:linear-gradient(145deg,rgba(255,255,255,.92),rgba(235,230,255,.86));
}
html.branda-blue-auth body.auth-page .branda-auth-logo { width:245px; height:auto; margin-bottom:38px; }
html.branda-blue-auth body.auth-page .branda-auth-kicker {
  width:max-content; max-width:100%;
  padding:7px 12px; border-radius:999px;
  background:rgba(37,99,235,.09); color:#1d4ed8;
  font-size:12px; font-weight:800; letter-spacing:.08em; text-transform:uppercase;
}
html.branda-blue-auth body.auth-page .branda-auth-intro h1 {
  margin:16px 0 8px; color:#0b2f5b; font-size:38px; line-height:1.05; letter-spacing:-.03em;
}
html.branda-blue-auth body.auth-page .branda-auth-intro p {
  max-width:430px; margin:0; color:#486785; font-size:17px; line-height:1.55;
}
html.branda-blue-auth body.auth-page .branda-aligner-art {
  position:absolute; width:285px; height:122px; left:52px; bottom:-26px;
  border:3px solid rgba(96,165,250,.33); border-top:0; border-radius:0 0 150px 150px;
  transform:rotate(-7deg); filter:drop-shadow(0 18px 22px rgba(37,99,235,.10));
}
html.branda-blue-auth body.auth-page .branda-aligner-art::before,
html.branda-blue-auth body.auth-page .branda-aligner-art::after {
  content:''; position:absolute; inset:16px 24px 18px; border:2px solid rgba(147,197,253,.30); border-top:0; border-radius:0 0 130px 130px;
}
html.branda-blue-auth body.auth-page .branda-aligner-art::after { inset:32px 50px 34px; border-color:rgba(191,219,254,.44); }
html.branda-blue-auth body.auth-page .auth-brand { display:none; }
html.branda-blue-auth body.auth-page .auth-card {
  max-width:none; min-height:560px; border:1px solid rgba(219,234,254,.96); border-left:0;
  border-radius:0 28px 28px 0; padding:64px 58px;
  display:flex; flex-direction:column; justify-content:center;
  background:rgba(255,255,255,.96); box-shadow:0 30px 80px rgba(30,64,175,.13);
}
html.branda-blue-auth body.auth-page .auth-card::before { height:0; }
html.branda-blue-auth body.auth-page .branda-auth-card-title { display:block; color:#0b2f5b; font-size:25px; font-weight:800; letter-spacing:-.02em; }
html.branda-blue-auth body.auth-page .branda-auth-card-sub { display:block; margin:6px 0 28px; color:#6b829a; font-size:14px; }
html.branda-blue-auth body.auth-page .auth-title,
html.branda-blue-auth body.auth-page .auth-sub { display:none; }
html.branda-blue-auth body.auth-page .field { margin-bottom:14px; }
html.branda-blue-auth body.auth-page label { color:#294d71; }
html.branda-blue-auth body.auth-page input[type="text"],
html.branda-blue-auth body.auth-page input[type="password"] { min-height:46px; border-radius:11px; }
html.branda-blue-auth body.auth-page .remember-row { margin:5px 0 18px; }
html.branda-blue-auth body.auth-page .btn-primary { min-height:46px; border-radius:11px; font-weight:800; background:linear-gradient(100deg,#08a4ef 0%,#1268f3 52%,#3154f4 100%); }
html.branda-blue-auth body.auth-page[data-portal="staff"] .btn-primary { background:linear-gradient(100deg,#169df0 0%,#4568f5 52%,#7c3aed 100%); }
html.branda-blue-auth body.auth-page .auth-switch { margin-top:18px; color:#71869b; }
html.branda-blue-auth body.auth-page .auth-lang { top:20px; right:24px; }

@media (max-width:860px) {
  html.branda-blue-auth body.auth-page .centered-shell { width:min(560px,calc(100% - 28px)); grid-template-columns:1fr; padding:84px 0 28px; }
  html.branda-blue-auth body.auth-page .branda-auth-intro { min-height:auto; border-right:1px solid rgba(191,219,254,.95); border-bottom:0; border-radius:24px 24px 0 0; padding:34px 32px 42px; }
  html.branda-blue-auth body.auth-page .branda-auth-logo { width:210px; margin-bottom:24px; }
  html.branda-blue-auth body.auth-page .branda-auth-intro h1 { font-size:30px; }
  html.branda-blue-auth body.auth-page .branda-aligner-art { opacity:.45; left:auto; right:-45px; bottom:-46px; }
  html.branda-blue-auth body.auth-page .auth-card { min-height:auto; border-left:1px solid rgba(219,234,254,.96); border-radius:0 0 24px 24px; padding:36px 30px; }
}

/* BRANDA staff-role pages: premium blue dashboard treatment. */
html.branda-premium-ui body { background:linear-gradient(180deg,#f7fbff 0%,#edf5fd 100%); }
html.branda-premium-ui .topbar { background:rgba(255,255,255,.94); border-bottom:1px solid #d8e7f6; border-image:none; box-shadow:0 8px 28px rgba(15,54,96,.07); backdrop-filter:blur(12px); }
html.branda-premium-ui .brand-badge { background:#eaf2ff; color:#174f9a; border-color:#cfe0f7; }
html.branda-premium-ui .main { width:min(1240px,calc(100% - 32px)); margin:0 auto; }
html.branda-premium-ui .card { border:1px solid #dce9f5; box-shadow:0 10px 28px rgba(15,54,96,.06); }
html.branda-premium-ui .tabs { border-bottom-color:#d7e5f2; }
html.branda-premium-ui .tab-btn.active { color:#125fd0; border-bottom-color:#1677ee; }
html.branda-premium-ui .stat-card { border-top:0; box-shadow:0 12px 28px rgba(15,54,96,.09); }
html.branda-premium-ui .stat-card:nth-child(1) { background:linear-gradient(135deg,#ffb16d,#ff7b69); }
html.branda-premium-ui .stat-card:nth-child(2) { background:linear-gradient(135deg,#3e9cf5,#1769e8); }
html.branda-premium-ui .stat-card:nth-child(3) { background:linear-gradient(135deg,#a26af3,#7839df); }
html.branda-premium-ui .stat-card:nth-child(4) { background:linear-gradient(135deg,#34cf83,#08a765); }
html.branda-premium-ui .stat-card:nth-child(-n+4) .stat-value,
html.branda-premium-ui .stat-card:nth-child(-n+4) .stat-label,
html.branda-premium-ui .stat-card:nth-child(-n+4) .stat-hint { color:#fff; }
html.branda-premium-ui .stat-card:nth-child(5),
html.branda-premium-ui .stat-card:nth-child(6) { background:rgba(255,255,255,.95); border:1px solid #dbe9f6; }
html.branda-premium-ui .stat-card:nth-child(5) .stat-value { color:#0b2f5b; }
html.branda-premium-ui .stat-card:nth-child(6) .stat-value { color:#1769d2; }
.stat-card-filter { appearance:none; width:100%; text-align:left; font:inherit; cursor:pointer; border-left:0; border-right:0; border-bottom:0; }
.stat-card-filter:hover { transform:translateY(-2px); box-shadow:0 16px 32px rgba(15,54,96,.14); }
.stat-card-filter:focus-visible { outline:3px solid rgba(37,99,235,.22); outline-offset:2px; }
html.branda-premium-ui .today-work-card { border-color:#d8e7f6; background:rgba(255,255,255,.97); }

/* BRANDA Doctor Portal — Option 2 premium blue UI (2026-10-09). BRANDA hostname only. */
html.branda-doctor-premium body.doc-app {
  background:
    radial-gradient(circle at 88% 4%, rgba(112,78,255,.12), transparent 26%),
    radial-gradient(circle at 18% 0%, rgba(24,144,255,.16), transparent 30%),
    linear-gradient(180deg,#f5faff 0%,#edf5ff 48%,#f7f9ff 100%);
}
html.branda-doctor-premium body.doc-app .doc-side {
  background: linear-gradient(180deg,rgba(255,255,255,.98) 0%,rgba(246,250,255,.98) 100%);
  border-right: 1px solid #d9e7f5;
  box-shadow: 12px 0 34px rgba(23,75,130,.05);
}
html.branda-doctor-premium body.doc-app .doc-side-brand { padding: 2px 8px 12px; }
html.branda-doctor-premium body.doc-app .doc-side-brand .brand-logo { height: 46px; }
html.branda-doctor-premium body.doc-app .doc-side-sub { color:#55718e; letter-spacing:.12em; }
html.branda-doctor-premium body.doc-app .doc-nav-btn { color:#35516f; border:1px solid transparent; }
html.branda-doctor-premium body.doc-app .doc-nav-btn:not(.active):hover { background:#eef6ff; border-color:#d8e8f8; color:#0b4d92; }
html.branda-doctor-premium body.doc-app .doc-nav-btn.active {
  background:linear-gradient(135deg,#0f6fe8 0%,#365df6 58%,#6747ef 100%);
  color:#fff;
  box-shadow:0 10px 24px rgba(44,92,232,.24);
}
html.branda-doctor-premium body.doc-app .doc-nav-btn.active svg { stroke:#fff; }
html.branda-doctor-premium body.doc-app .doc-lang select { border-color:#d6e5f4; background:#fff; }
html.branda-doctor-premium body.doc-app .doc-signout { border-color:#d7e5f3; background:#fff; color:#294d73; }

html.branda-doctor-premium body.doc-app .doc-top.topbar {
  background:rgba(248,252,255,.88);
  backdrop-filter:blur(16px);
  box-shadow:0 9px 30px rgba(20,72,129,.07);
  border-bottom:0!important;
}
html.branda-doctor-premium body.doc-app .doc-search {
  max-width:600px;
  background:#fff;
  border:1px solid #dce9f5;
  box-shadow:0 5px 18px rgba(32,83,135,.05);
}
html.branda-doctor-premium body.doc-app .doc-search:focus-within { border-color:#79aef7; box-shadow:0 0 0 4px rgba(39,120,238,.10); }
html.branda-doctor-premium body.doc-app .doc-search svg { color:#51779f; }
html.branda-doctor-premium body.doc-app .doc-welcome h1 { color:#082f63; }
html.branda-doctor-premium body.doc-app .doc-welcome .subtitle { color:#5d7691; }
html.branda-doctor-premium body.doc-app .doc-date {
  color:#214f7d; background:rgba(255,255,255,.92); border:1px solid #d8e8f6;
  box-shadow:0 8px 22px rgba(31,81,132,.08);
}
html.branda-doctor-premium body.doc-app .doc-date svg { color:#2176e8; }

html.branda-doctor-premium body.doc-app .doc-stat-card {
  border:0; min-height:112px; color:#fff; overflow:hidden;
  box-shadow:0 15px 30px rgba(25,69,120,.13);
}
html.branda-doctor-premium body.doc-app .doc-stat-card:nth-child(1) { background:linear-gradient(135deg,#ff9d62 0%,#ff795f 100%); }
html.branda-doctor-premium body.doc-app .doc-stat-card:nth-child(2) { background:linear-gradient(135deg,#27a3ff 0%,#1768ef 100%); }
html.branda-doctor-premium body.doc-app .doc-stat-card:nth-child(3) { background:linear-gradient(135deg,#ad6df1 0%,#7047e9 100%); }
html.branda-doctor-premium body.doc-app .doc-stat-card:nth-child(4) { background:linear-gradient(135deg,#29d084 0%,#00a867 100%); }
html.branda-doctor-premium body.doc-app .doc-stat-card:hover { transform:translateY(-4px); box-shadow:0 20px 36px rgba(25,69,120,.18); }
html.branda-doctor-premium body.doc-app .doc-stat-card.attention { box-shadow:0 0 0 3px rgba(255,255,255,.70),0 18px 34px rgba(232,108,62,.24); }
html.branda-doctor-premium body.doc-app .doc-stat-card .doc-stat-num,
html.branda-doctor-premium body.doc-app .doc-stat-card .doc-stat-label,
html.branda-doctor-premium body.doc-app .doc-stat-card .doc-stat-sub { color:#fff; }
html.branda-doctor-premium body.doc-app .doc-stat-card .doc-stat-sub { opacity:.82; }
html.branda-doctor-premium body.doc-app .doc-stat-card .doc-stat-icon { background:rgba(255,255,255,.16); color:#fff; }
html.branda-doctor-premium body.doc-app .doc-stat-card::after { content:none!important; display:none!important; }

html.branda-doctor-premium body.doc-app .doc-cta {
  background:rgba(255,255,255,.94)!important; border:1px solid #dce9f6!important;
  box-shadow:0 12px 26px rgba(28,75,124,.08); padding:18px 20px;
}
html.branda-doctor-premium body.doc-app .doc-cta:first-child { background:linear-gradient(135deg,#f5faff 0%,#edf6ff 100%)!important; }
html.branda-doctor-premium body.doc-app .doc-cta:last-child { background:linear-gradient(135deg,#faf8ff 0%,#f2efff 100%)!important; }
html.branda-doctor-premium body.doc-app .doc-cta-icon { border-radius:14px; }
html.branda-doctor-premium body.doc-app .doc-cta:first-child .doc-cta-icon { background:#dcecff; color:#176be7; }
html.branda-doctor-premium body.doc-app .doc-cta:last-child .doc-cta-icon { background:#ece4ff; color:#7047e9; }
html.branda-doctor-premium body.doc-app .doc-cta-text strong { color:#0b315d; }

html.branda-doctor-premium body.doc-app .card,
html.branda-doctor-premium body.doc-app .doc-table-card,
html.branda-doctor-premium body.doc-app .doc-new-card {
  border:1px solid #dce8f4; background:rgba(255,255,255,.96); box-shadow:0 14px 32px rgba(31,78,127,.08);
}
html.branda-doctor-premium body.doc-app .doc-table-card { border-top:0!important; }
html.branda-doctor-premium body.doc-app .doc-table-head h2 { color:#0b315d; }
html.branda-doctor-premium body.doc-app .doc-th { background:linear-gradient(90deg,#edf5ff 0%,#f4f2ff 100%); color:#456887; }
html.branda-doctor-premium body.doc-app .doc-tr:not(.doc-th):hover { background:#f2f8ff; }
html.branda-doctor-premium body.doc-app .doc-filter-tab.active { color:#145fc5; border-bottom-color:#2d7cf0; }
html.branda-doctor-premium body.doc-app .doc-filter-tab.active span { background:#dcecff; color:#145fc5; }
html.branda-doctor-premium body.doc-app #recent-cases-toggle { color:#1766d3; border-color:#bcd6f5; background:#f8fbff; }
html.branda-doctor-premium body.doc-app #recent-cases-toggle:hover { background:#eaf4ff; }

html.branda-doctor-premium body.doc-app .btn-primary {
  background:linear-gradient(135deg,#159ce9 0%,#1769ed 52%,#663bf0 100%);
  color:#fff; border-color:transparent; box-shadow:0 9px 20px rgba(41,94,225,.24);
}
html.branda-doctor-premium body.doc-app .btn-primary:hover { box-shadow:0 13px 28px rgba(41,94,225,.31); transform:translateY(-1px); }
html.branda-doctor-premium body.doc-app .btn-outline { border-color:#bad3ef; color:#1766c8; background:#fff; }
html.branda-doctor-premium body.doc-app .btn-outline:hover { background:#edf6ff; border-color:#8eb9ea; }

html.branda-doctor-premium body.doc-app .doc-new-card { overflow:hidden; }
html.branda-doctor-premium body.doc-app .doc-eyebrow { color:#1f6fd6; }
html.branda-doctor-premium body.doc-app .doc-type-card,
html.branda-doctor-premium body.doc-app .doc-prio-card { border-color:#d8e6f4; background:#fbfdff; }
html.branda-doctor-premium body.doc-app .doc-type-card:hover,
html.branda-doctor-premium body.doc-app .doc-prio-card:hover { border-color:#8db8ec; background:#f2f8ff; }
html.branda-doctor-premium body.doc-app .doc-type-card.selected,
html.branda-doctor-premium body.doc-app .doc-prio-card.selected { border-color:#2f7ce9; background:linear-gradient(180deg,#f0f7ff,#e7f1ff); box-shadow:0 0 0 3px rgba(47,124,233,.10); }
html.branda-doctor-premium body.doc-app .file-drop { border-color:#a9c8ea; background:#f7fbff; }
html.branda-doctor-premium body.doc-app .file-drop:hover { border-color:#367ee5; background:#eef6ff; }

html.branda-doctor-premium body.doc-app .doc-progress-wrap { background:linear-gradient(180deg,#f8fbff,#f1f6ff); border-color:#d7e5f4; }
html.branda-doctor-premium body.doc-app .doc-progress-head strong { color:#0b315d; }
html.branda-doctor-premium body.doc-app .doc-case-modal { border:1px solid #d9e6f3; box-shadow:0 28px 70px rgba(12,44,82,.22); }
html.branda-doctor-premium body.doc-app input:focus,
html.branda-doctor-premium body.doc-app select:focus,
html.branda-doctor-premium body.doc-app textarea:focus { outline:2px solid #4d91ed; border-color:#4d91ed; }

@media (max-width:860px) {
  html.branda-doctor-premium body.doc-app .doc-side { box-shadow:0 8px 24px rgba(23,75,130,.07); border-right:0; border-bottom:1px solid #d9e7f5; }
  html.branda-doctor-premium body.doc-app .doc-side-brand .brand-logo { height:40px; }
  html.branda-doctor-premium body.doc-app .doc-top.topbar { background:rgba(248,252,255,.95); }
}

/* BRANDA login simplification — cleaner corporate treatment (2026-10-09). */
html.branda-blue-auth body.auth-page {
  background: linear-gradient(135deg,#f7fbff 0%,#eef5fc 100%);
}
html.branda-blue-auth body.auth-page .centered-shell {
  width:min(1000px,calc(100% - 48px));
  grid-template-columns:minmax(0,.9fr) minmax(360px,1.1fr);
  padding:64px 0;
}
html.branda-blue-auth body.auth-page .centered-shell::before {
  display:none;
}
html.branda-blue-auth body.auth-page .branda-auth-intro {
  min-height:500px;
  padding:52px 54px;
  border:1px solid #dbe7f3;
  border-right:0;
  border-radius:24px 0 0 24px;
  background:#f8fbff;
  box-shadow:0 18px 52px rgba(24,72,120,.08);
}
html.branda-blue-auth body.auth-page[data-portal="staff"] .branda-auth-intro {
  background:#f8fbff;
}
html.branda-blue-auth body.auth-page .branda-brand-lockup {
  display:flex;
  align-items:center;
  gap:13px;
  margin-bottom:42px;
}
html.branda-blue-auth body.auth-page .branda-brand-lockup > img {
  width:54px;
  height:54px;
  object-fit:contain;
  flex:0 0 54px;
  filter:none;
  box-shadow:none;
  background:transparent;
}
html.branda-blue-auth body.auth-page .branda-brand-copy {
  display:flex;
  flex-direction:column;
  line-height:1;
}
html.branda-blue-auth body.auth-page .branda-brand-copy strong {
  font-size:41px;
  letter-spacing:-.045em;
  color:#072d61;
  font-weight:800;
}
html.branda-blue-auth body.auth-page .branda-brand-copy em {
  margin-top:6px;
  font-style:normal;
  font-size:12px;
  letter-spacing:.24em;
  color:#173e73;
  font-weight:800;
}
html.branda-blue-auth body.auth-page .branda-auth-kicker,
html.branda-blue-auth body.auth-page .branda-aligner-art,
html.branda-blue-auth body.auth-page .branda-auth-logo {
  display:none!important;
}
html.branda-blue-auth body.auth-page .branda-auth-intro h1 {
  margin:0 0 10px;
  font-size:34px;
  color:#0b315f;
}
html.branda-blue-auth body.auth-page .branda-auth-intro p {
  max-width:390px;
  color:#5b7189;
  font-size:16px;
  line-height:1.55;
}
html.branda-blue-auth body.auth-page .branda-site-link {
  display:inline-flex;
  align-items:center;
  gap:7px;
  width:max-content;
  margin-top:30px;
  color:#1767c7;
  font-size:14px;
  font-weight:700;
  text-decoration:none;
  border-bottom:1px solid rgba(23,103,199,.28);
  padding-bottom:2px;
}
html.branda-blue-auth body.auth-page .branda-site-link:hover {
  color:#0b4f9f;
  border-bottom-color:#0b4f9f;
}
html.branda-blue-auth body.auth-page .auth-card {
  min-height:500px;
  padding:54px 56px;
  border:1px solid #dbe7f3;
  border-left:0;
  border-radius:0 24px 24px 0;
  background:#fff;
  box-shadow:0 18px 52px rgba(24,72,120,.08);
}
html.branda-blue-auth body.auth-page .branda-auth-card-title {
  font-size:24px;
  color:#0b315f;
}
html.branda-blue-auth body.auth-page .branda-auth-card-sub {
  margin:6px 0 26px;
  color:#6b7f94;
}
html.branda-blue-auth body.auth-page .btn-primary,
html.branda-blue-auth body.auth-page[data-portal="staff"] .btn-primary {
  background:linear-gradient(90deg,#1287e8 0%,#2766ea 100%);
  box-shadow:0 8px 18px rgba(28,104,214,.18);
}
html.branda-blue-auth body.auth-page .btn-primary:hover {
  box-shadow:0 11px 24px rgba(28,104,214,.24);
}
html.branda-blue-auth body.auth-page .auth-switch {
  margin-top:18px;
  color:#7b8da0;
}
@media (max-width:860px) {
  html.branda-blue-auth body.auth-page .centered-shell {
    width:min(560px,calc(100% - 28px));
    grid-template-columns:1fr;
    padding:84px 0 28px;
  }
  html.branda-blue-auth body.auth-page .branda-auth-intro {
    min-height:auto;
    padding:34px 30px 30px;
    border-right:1px solid #dbe7f3;
    border-bottom:0;
    border-radius:22px 22px 0 0;
  }
  html.branda-blue-auth body.auth-page .branda-brand-lockup { margin-bottom:26px; }
  html.branda-blue-auth body.auth-page .branda-brand-copy strong { font-size:34px; }
  html.branda-blue-auth body.auth-page .branda-auth-intro h1 { font-size:28px; }
  html.branda-blue-auth body.auth-page .branda-site-link { margin-top:22px; }
  html.branda-blue-auth body.auth-page .auth-card {
    min-height:auto;
    border-left:1px solid #dbe7f3;
    border-radius:0 0 22px 22px;
    padding:34px 30px;
  }
}

html.branda-blue-auth body.auth-page .auth-switch a { color:#1767c7; text-decoration:none; font-weight:700; }
html.branda-blue-auth body.auth-page .auth-switch a:hover { color:#0b4f9f; text-decoration:underline; }

/* BRANDA auth: single centered simple login (2026-10-09). */
html.branda-blue-auth body.auth-page .branda-simple-auth-shell {
  width:min(440px,calc(100% - 28px));
  min-height:100vh;
  margin:0 auto;
  padding:86px 0 36px;
  display:flex!important;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:18px;
  overflow:visible;
}
html.branda-blue-auth body.auth-page .branda-simple-auth-shell::before,
html.branda-blue-auth body.auth-page .branda-auth-intro,
html.branda-blue-auth body.auth-page .auth-brand { display:none!important; }
html.branda-blue-auth body.auth-page .branda-simple-brand {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:14px;
  background:transparent;
  filter:none;
}
html.branda-blue-auth body.auth-page .branda-simple-brand > img {
  width:60px;
  height:60px;
  object-fit:contain;
  background:transparent;
  box-shadow:none;
  filter:none;
}
html.branda-blue-auth body.auth-page .branda-simple-brand > span {
  display:flex;
  flex-direction:column;
  line-height:1;
}
html.branda-blue-auth body.auth-page .branda-simple-brand strong {
  font-size:44px;
  font-weight:800;
  letter-spacing:-.045em;
  color:#072d61;
}
html.branda-blue-auth body.auth-page .branda-simple-brand em {
  margin-top:6px;
  font-size:11px;
  font-style:normal;
  font-weight:800;
  letter-spacing:.22em;
  color:#173e73;
}
html.branda-blue-auth body.auth-page .branda-simple-auth-card {
  width:100%;
  min-height:0!important;
  padding:30px 32px 28px!important;
  border:1px solid #dbe7f3!important;
  border-radius:18px!important;
  background:#fff!important;
  box-shadow:0 14px 38px rgba(24,72,120,.10)!important;
}
html.branda-blue-auth body.auth-page .branda-simple-auth-card .branda-auth-card-title {
  text-align:center;
  font-size:25px;
  color:#0b315f;
}
html.branda-blue-auth body.auth-page .branda-simple-auth-card .branda-auth-card-sub {
  text-align:center;
  margin:6px 0 24px;
  color:#6b7f94;
}
html.branda-blue-auth body.auth-page .branda-simple-site-link {
  display:block;
  width:max-content;
  max-width:100%;
  margin:10px auto 0;
  color:#1767c7;
  font-size:13px;
  font-weight:700;
  text-decoration:none;
}
html.branda-blue-auth body.auth-page .branda-simple-site-link:hover { text-decoration:underline; }
html.branda-blue-auth body.auth-page .auth-switch { text-align:center; }
@media (max-width:520px) {
  html.branda-blue-auth body.auth-page .branda-simple-auth-shell { padding:78px 0 24px; }
  html.branda-blue-auth body.auth-page .branda-simple-brand strong { font-size:38px; }
  html.branda-blue-auth body.auth-page .branda-simple-brand > img { width:52px; height:52px; }
  html.branda-blue-auth body.auth-page .branda-simple-auth-card { padding:26px 22px 24px!important; }
}

/* Shared-brand safety: BRANDA-only simple auth elements stay hidden on Arcus. */
.branda-simple-brand,
.branda-simple-site-link { display:none; }

/* BRANDA Staff login: compact centered card + website-only footer (2026-10-09). */
html.branda-blue-auth body.auth-page[data-portal="staff"] .branda-simple-auth-shell {
  width:min(400px,calc(100% - 28px));
  min-height:100vh;
  padding:42px 0 30px;
  justify-content:center;
  gap:16px;
}
html.branda-blue-auth body.auth-page[data-portal="staff"] .branda-simple-auth-card {
  padding:26px 28px 24px!important;
}
html.branda-blue-auth body.auth-page[data-portal="staff"] .branda-simple-auth-card .branda-auth-card-sub {
  margin-bottom:20px;
}
html.branda-blue-auth body.auth-page[data-portal="staff"] .auth-switch {
  display:none!important;
}
html.branda-blue-auth body.auth-page[data-portal="staff"] .branda-simple-site-link {
  margin-top:14px;
}
@media (max-width:520px) {
  html.branda-blue-auth body.auth-page[data-portal="staff"] .branda-simple-auth-shell {
    width:min(380px,calc(100% - 24px));
    padding:72px 0 22px;
  }
  html.branda-blue-auth body.auth-page[data-portal="staff"] .branda-simple-auth-card {
    padding:24px 20px 22px!important;
  }
}

/* BRANDA Doctor login: true viewport-centered compact layout (2026-10-09). */
html.branda-blue-auth body.auth-page[data-portal="doctor"] .branda-simple-auth-shell {
  width:100%;
  max-width:none;
  min-height:100vh;
  margin:0;
  padding:46px 20px 30px;
  justify-content:center;
  gap:16px;
}
html.branda-blue-auth body.auth-page[data-portal="doctor"] .branda-simple-auth-card {
  width:min(400px,100%);
  padding:26px 28px 24px!important;
}
html.branda-blue-auth body.auth-page[data-portal="doctor"] .branda-simple-auth-card .branda-auth-card-sub {
  margin-bottom:20px;
}
@media (max-width:520px) {
  html.branda-blue-auth body.auth-page[data-portal="doctor"] .branda-simple-auth-shell {
    padding:72px 12px 22px;
  }
  html.branda-blue-auth body.auth-page[data-portal="doctor"] .branda-simple-auth-card {
    width:min(380px,100%);
    padding:24px 20px 22px!important;
  }
}

/* BRANDA doctor sidebar brand compact/centered polish — 2026-10-09 */
html.branda-doctor-premium body.doc-app .doc-side {
  gap: 12px;
  padding-top: 14px;
}
html.branda-doctor-premium body.doc-app .doc-side-brand {
  align-items: center;
  gap: 3px;
  padding: 0 8px 4px;
  text-align: center;
}
html.branda-doctor-premium body.doc-app .doc-side-brand .brand-logo {
  height: 42px;
  width: auto;
  align-self: center;
}
html.branda-doctor-premium body.doc-app .doc-side-sub {
  line-height: 1.2;
}


/* BRANDA doctor header/sidebar alignment fix 2026-10-09h */
.doc-brand-branda { display:none; }
html.branda-doctor-premium body.doc-app .doc-side {
  padding:0 16px 22px;
  gap:16px;
}
html.branda-doctor-premium body.doc-app .doc-side-brand {
  flex:0 0 88px;
  height:88px;
  min-height:88px;
  padding:0 6px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:3px;
  border-bottom:1px solid #e2edf7;
}
html.branda-doctor-premium body.doc-app .doc-side-brand .doc-brand-default { display:none; }
html.branda-doctor-premium body.doc-app .doc-side-brand .doc-brand-branda {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  width:100%;
}
html.branda-doctor-premium body.doc-app .doc-side-brandmark > img {
  width:34px;
  height:34px;
  object-fit:contain;
  flex:0 0 34px;
}
html.branda-doctor-premium body.doc-app .doc-side-brandmark > span {
  display:flex;
  flex-direction:column;
  line-height:1;
}
html.branda-doctor-premium body.doc-app .doc-side-brandmark strong {
  color:#062f66;
  font-size:25px;
  font-weight:800;
  letter-spacing:-.045em;
}
html.branda-doctor-premium body.doc-app .doc-side-brandmark em {
  margin-top:4px;
  color:#062f66;
  font-style:normal;
  font-size:7px;
  font-weight:800;
  letter-spacing:.22em;
}
html.branda-doctor-premium body.doc-app .doc-side-sub {
  width:100%;
  text-align:center;
  font-size:10px;
  line-height:1.1;
  letter-spacing:.14em;
}
html.branda-doctor-premium body.doc-app .doc-top.topbar {
  height:88px;
  min-height:88px;
  box-sizing:border-box;
  margin-bottom:22px;
}
@media (max-width:860px) {
  html.branda-doctor-premium body.doc-app .doc-side { padding:12px 16px; }
  html.branda-doctor-premium body.doc-app .doc-side-brand { height:auto; min-height:0; flex-basis:auto; border-bottom:0; }
  html.branda-doctor-premium body.doc-app .doc-top.topbar { height:auto; min-height:0; }
}


/* Doctor clinical instructions + review (Branda advanced flow) */
.doc-clinical-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px 16px; margin:16px 0 10px; }
.doc-clinical-grid .field { margin:0; }
.doc-clinical-grid .field > span, .doc-step-panel > .field > span { display:block; font-size:14px; font-weight:700; color:var(--ink-700); margin-bottom:7px; }
.doc-save-pref { display:flex; align-items:center; gap:9px; margin:12px 0 2px; font-size:14px; font-weight:600; color:var(--ink-700); cursor:pointer; }
.doc-save-pref input { width:17px; height:17px; accent-color:#1976ed; }
.doc-review-summary { display:flex; flex-direction:column; gap:14px; margin-top:16px; }
.doc-review-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.doc-review-grid > div, .doc-review-clinical > div { border:1px solid #dce8f4; background:#f8fbff; border-radius:12px; padding:11px 12px; display:flex; flex-direction:column; gap:3px; min-width:0; }
.doc-review-grid span, .doc-review-block > span { font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--ink-500); }
.doc-review-grid strong, .doc-review-clinical strong { color:var(--ink-900); overflow-wrap:anywhere; }
.doc-review-block { border:1px solid #dce8f4; border-radius:14px; padding:14px 16px; background:#fff; }
.doc-review-block > p { margin:8px 0 0; white-space:pre-wrap; color:var(--ink-700); }
.doc-review-clinical { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; margin-top:10px; }
.doc-review-clinical small { color:var(--ink-500); font-size:11px; }
.doc-review-note { padding-top:10px; border-top:1px solid #e5eef6; }
.doc-review-files { display:flex; flex-wrap:wrap; gap:7px; margin-top:10px; }
.doc-review-files span { text-transform:none; letter-spacing:0; border:1px solid #d8e4f0; background:#f8fbff; border-radius:999px; padding:6px 9px; font-size:12px; color:var(--ink-700); }
.doc-case-clinical { margin:14px 0; border:1px solid #dce8f4; border-radius:14px; padding:14px; background:#f8fbff; }
.doc-section-minihead { font-weight:800; color:var(--ink-900); margin-bottom:8px; }
.doc-case-clinical p { margin:10px 0 0; white-space:pre-wrap; color:var(--ink-700); }
@media (max-width:900px) { .doc-review-grid,.doc-review-clinical { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:680px) { .doc-clinical-grid,.doc-review-grid,.doc-review-clinical { grid-template-columns:1fr; } }


/* Doctor structured revision form */
.doctor-revision-box{margin:12px 0;border:1px solid #dbe7f3;border-radius:12px;background:#f8fbff;overflow:hidden}.doctor-revision-box summary{cursor:pointer;padding:12px 14px;font-weight:800;color:#123b68}.doctor-revision-box[open] summary{border-bottom:1px solid #e1ebf4;background:#f2f8ff}.doctor-revision-box>.help-text{padding:0 14px;margin:10px 0}.doctor-revision-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 12px;padding:0 14px 12px}.doctor-revision-grid label,.doctor-revision-notes{display:flex;flex-direction:column;gap:6px}.doctor-revision-grid label>span,.doctor-revision-notes>span{font-size:13px;font-weight:700;color:var(--ink-700)}.doctor-revision-notes{padding:0 14px 14px}.doctor-revision-grid input,.doctor-revision-grid select,.doctor-revision-notes textarea{width:100%}@media(max-width:680px){.doctor-revision-grid{grid-template-columns:1fr}}

/* Patient demographics fields */
.doc-patient-demographics{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:14px;margin:12px 0}.doc-sex-field{margin:0}.patient-demographics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:0 0 14px;padding:12px 14px;border:1px solid #d9e6f3;border-radius:12px;background:#f8fbff}.patient-demographics div{display:flex;flex-direction:column;gap:3px}.patient-demographics span{font-size:12.5px;color:var(--ink-500)}.patient-demographics strong{font-size:15px;color:var(--ink-800)}@media(max-width:680px){.doc-patient-demographics,.patient-demographics{grid-template-columns:1fr}}

/* Compact setup-version history: one selected setup at a time. */
.setup-log-title { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.setup-version-select { min-width:170px; max-width:260px; padding:8px 34px 8px 10px; border:1px solid #cbd5e1; border-radius:9px; background:#fff; color:#0f2747; font-weight:700; font:inherit; }
.version-history-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 12px; margin:0 0 10px; border:1px solid #dbeafe; border-radius:10px; background:#f8fbff; }
.version-history-toolbar > span { font-weight:800; color:#16345f; }
.version-history-panel .version-card { margin-bottom:0; }
.slog-version-archive .file-list { margin:0; }
@media (max-width:700px){ .setup-log-title,.version-history-toolbar{align-items:stretch;flex-direction:column}.setup-version-select{width:100%;max-width:none}.slog-version-archive{grid-template-columns:1fr!important} }

/* Compact clarification disclosure — keeps case workflow short until needed. */
.clarification-disclosure{margin:14px 0;border:1px solid #cfe2ff;border-radius:12px;background:#fff;overflow:hidden}
.clarification-disclosure>summary{list-style:none;cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 15px;font-weight:800;color:#0b376e;background:#f7fbff}
.clarification-disclosure>summary::-webkit-details-marker{display:none}
.clarification-disclosure>summary:before{content:'›';font-size:22px;line-height:1;transition:transform .15s ease}
.clarification-disclosure[open]>summary:before{transform:rotate(90deg)}
.clarification-disclosure-body{padding:12px}
.clarification-disclosure .questions-panel{margin:0;border:0;box-shadow:none;padding:0}
.clarification-disclosure .q-panel-head{margin-bottom:10px}
.slog-compact-file-links{display:flex;flex-wrap:wrap;gap:6px 10px;align-items:center}
.slog-compact-file-links a{font-weight:600}

/* Technician overview: keep completed history compact until it is needed. */
.completed-cases-dropdown { padding: 0; overflow: hidden; }
.completed-cases-summary {
  list-style: none; cursor: pointer; padding: 22px 26px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  font-size: 22px; font-weight: 700; color: var(--ink-900, #0f172a);
}
.completed-cases-summary::-webkit-details-marker { display: none; }
.completed-cases-summary-meta { display: inline-flex; align-items: center; gap: 10px; }
.completed-cases-count {
  font-size: 14px; font-weight: 700; color: var(--blue-700, #1d4ed8);
  background: var(--blue-50, #eff6ff); border: 1px solid var(--blue-100, #dbeafe);
  border-radius: 999px; padding: 5px 10px; white-space: nowrap;
}
.completed-cases-chevron { font-size: 22px; line-height: 1; transition: transform .18s ease; }
.completed-cases-dropdown[open] .completed-cases-chevron { transform: rotate(180deg); }
.completed-cases-dropdown[open] .completed-cases-summary { border-bottom: 1px solid var(--ink-100, #e5e7eb); }
.completed-cases-dropdown #completed-list { padding: 16px 24px 24px; }
@media (max-width: 640px) {
  .completed-cases-summary { padding: 18px; font-size: 19px; }
  .completed-cases-dropdown #completed-list { padding: 12px 14px 18px; }
}


/* Clinical preferences v2 */
.clinical-pref-shell{display:flex;flex-direction:column;gap:16px;margin-top:18px}.clinical-pref-section{border:1px solid #d9e8f6;border-radius:18px;background:linear-gradient(180deg,#fff 0%,#fbfdff 100%);padding:16px;box-shadow:0 8px 22px rgba(19,59,104,.045)}.clinical-section-head{display:flex;align-items:flex-start;gap:10px;margin-bottom:14px}.clinical-section-no{display:inline-flex;align-items:center;justify-content:center;min-width:34px;height:34px;padding:0 8px;border-radius:10px;background:#eaf4ff;color:#1769d2;font-size:12px;font-weight:900;letter-spacing:.04em}.clinical-section-head h3{margin:0;color:#0f2947;font-size:17px}.clinical-section-head p{margin:3px 0 0;color:#6a7f95;font-size:13px}.clinical-card-grid,.clinical-two-column{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.clinical-pref-card{border:1px solid #dfeaf5;border-radius:14px;background:#fff;padding:13px}.clinical-pref-title{font-weight:800;color:#173654;margin-bottom:10px}.clinical-segments{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.clinical-segments-short{grid-template-columns:repeat(2,minmax(0,1fr))}.clinical-segments label,.clinical-package,.tooth-chip{cursor:pointer}.clinical-segments input,.clinical-package input,.tooth-chip input{position:absolute;opacity:0;pointer-events:none}.clinical-segments label span{display:flex;align-items:center;justify-content:center;min-height:38px;padding:7px 9px;text-align:center;border:1px solid #d7e4f0;border-radius:10px;background:#f8fbff;color:#526a82;font-size:13px;font-weight:700;transition:.16s ease}.clinical-segments label:hover span{border-color:#9fc9f7;background:#f2f8ff}.clinical-segments label input:checked+span{border-color:#1976e8;background:#1976e8;color:#fff;box-shadow:0 3px 10px rgba(25,118,232,.20),inset 0 0 0 1px #1976e8}.clinical-package-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px}.clinical-package>span{display:flex;flex-direction:column;gap:3px;align-items:center;justify-content:center;min-height:72px;border:1px solid #d7e4f0;border-radius:13px;background:#fff;color:#173654;transition:.16s ease}.clinical-package small{color:#7890a7;font-size:11px}.clinical-package input:checked+span{border-color:#1976e8;background:#1976e8;box-shadow:0 4px 12px rgba(25,118,232,.20),inset 0 0 0 1px #1976e8;color:#fff}.clinical-package input:checked+span small{color:#eaf4ff}.clinical-tooth-picker{margin-top:12px;border:1px solid #cfe2f5;border-radius:14px;background:#f7fbff;padding:13px}.clinical-inline-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}.clinical-inline-head strong{color:#173654}.clinical-inline-head span{font-size:12px;color:#7890a7}.tooth-arch{display:grid;grid-template-columns:54px 1fr;gap:8px;align-items:center;margin-top:8px}.tooth-arch-label{font-size:12px;font-weight:800;color:#6a7f95}.tooth-row{display:grid;grid-template-columns:minmax(0,1fr) 2px minmax(0,1fr);gap:7px;align-items:center}.tooth-quadrant{display:grid;grid-template-columns:repeat(8,minmax(30px,1fr));gap:4px}.tooth-midline{height:38px;background:#b9cfe4;border-radius:4px}.tooth-chip span{display:flex;align-items:center;justify-content:center;min-height:36px;border:1px solid #d5e2ee;border-radius:8px;background:#fff;font-size:12px;font-weight:800;color:#516a82}.tooth-chip input:checked+span{background:#1976e8;border-color:#1976e8;color:#fff;box-shadow:0 2px 8px rgba(25,118,232,.18),inset 0 0 0 1px #1976e8}.relationship-row{display:grid;grid-template-columns:44px 1fr;gap:8px;align-items:center;margin-top:8px}.relationship-row>span{font-size:12px;font-weight:800;color:#71869c}.clinical-inline-input{display:flex;flex-direction:column;gap:6px;margin-top:10px}.clinical-inline-input>span{font-size:12px;font-weight:800;color:#647b92}.clinical-inline-input input{width:100%}.clinical-pref-notes textarea{width:100%;border-color:#d8e6f3;background:#fff}.doc-save-pref{border:1px solid #dce8f4;border-radius:12px;background:#f8fbff;padding:11px 12px}.doc-review-clinical{grid-template-columns:repeat(5,minmax(0,1fr))}.doc-additional-clinical{color:#173654!important;font-weight:700!important;border-color:#dce8f4!important;background:#f8fbff!important}.doc-review-note{color:#173654!important;font-weight:700!important}
@media(max-width:980px){.clinical-package-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.doc-review-clinical{grid-template-columns:repeat(2,minmax(0,1fr))}.tooth-quadrant{grid-template-columns:repeat(4,minmax(34px,1fr))}}
@media(max-width:680px){.clinical-card-grid,.clinical-two-column{grid-template-columns:1fr}.clinical-package-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.tooth-arch{grid-template-columns:1fr}.tooth-row{grid-template-columns:1fr}.tooth-midline{width:100%;height:2px}.clinical-segments{grid-template-columns:1fr}.clinical-segments-short{grid-template-columns:repeat(2,minmax(0,1fr))}.relationship-row{grid-template-columns:1fr}.doc-review-clinical{grid-template-columns:1fr}}


/* Revision submission v1 */
.revision-picker-card{max-width:1060px;margin:0 auto}.revision-picker-head{align-items:flex-start}.revision-search-wrap{display:flex;align-items:center;gap:9px;max-width:620px;margin:4px 0 18px;border:1px solid #d7e4f0;border-radius:12px;background:#fff;padding:0 12px}.revision-search-wrap svg{width:18px;height:18px;fill:none;stroke:#6f879e;stroke-width:1.8}.revision-search-wrap input{width:100%;border:0!important;box-shadow:none!important;padding:12px 0;background:transparent}.revision-case-list{display:flex;flex-direction:column;gap:10px}.revision-case-row{display:flex;align-items:center;justify-content:space-between;gap:18px;border:1px solid #dce8f4;border-radius:14px;background:#fff;padding:14px 16px}.revision-case-row.has-active{background:#fbfdff}.revision-case-main{display:flex;flex-direction:column;gap:3px;min-width:0}.revision-case-main strong{color:#102f4c;font-size:15px}.revision-case-main span{color:#71869a;font-size:12px}.revision-case-action{display:flex;align-items:center;justify-content:flex-end;gap:10px;flex-wrap:wrap}.revision-context{display:flex;align-items:center;justify-content:space-between;gap:18px;margin:0 0 18px;padding:13px 15px;border:1px solid #acd2fb;border-radius:14px;background:#f2f8ff}.revision-context>div{display:grid;grid-template-columns:auto 1fr;gap:2px 10px;align-items:center}.revision-context-badge{grid-row:1/3;display:inline-flex;align-items:center;justify-content:center;min-height:34px;padding:0 11px;border-radius:10px;background:#1976e8;color:#fff;font-size:12px;font-weight:900}.revision-context strong{color:#10395f;font-size:15px}.revision-context span:last-child{color:#68839c;font-size:12px}.revision-parent-link{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:12px 0;padding:10px 12px;border:1px solid #dce8f4;border-radius:12px;background:#f8fbff}.revision-parent-link>span{font-size:12px;font-weight:800;color:#1976e8}.doc-revision-history{margin:14px 0;padding:13px;border:1px solid #dce8f4;border-radius:14px;background:#fbfdff}.revision-history-row{width:100%;border:0;border-top:1px solid #e7eef6;background:transparent;padding:10px 2px;display:flex;align-items:center;justify-content:space-between;gap:12px;text-align:left;cursor:pointer}.revision-history-row:first-of-type{border-top:0}.revision-history-row>span:first-child{display:flex;flex-direction:column;gap:2px}.revision-history-row strong{color:#173654}.revision-history-row small{color:#7890a7}.revision-history-row:hover{background:#f2f8ff}.revision-pill{background:#eaf4ff!important;color:#075fbe!important;border-color:#a9d2fb!important}
@media(max-width:680px){.revision-case-row,.revision-context{align-items:stretch;flex-direction:column}.revision-case-action{justify-content:flex-start}.revision-context>div{width:100%}.revision-context .btn{width:100%}.revision-history-row{align-items:flex-start;flex-direction:column}}


/* Technician CCM workspace layout v1 */
.technician-ccm { background:#f3f6fa; }
.technician-ccm .topbar { position:sticky; top:0; z-index:40; border-bottom:1px solid #dce6f0; box-shadow:0 2px 10px rgba(15,39,71,.05); }
.technician-ccm .tech-utility-bars { position:sticky; top:58px; z-index:35; width:100%; display:flex; flex-direction:column; gap:0; margin:0; padding:0; background:#fff; border-bottom:1px solid #cfdbe6; box-shadow:0 2px 7px rgba(15,39,71,.035); }
.technician-ccm .topbar,.technician-ccm .tech-menu-bar,.technician-ccm .tech-action-bar{margin:0!important;}
.technician-ccm .tech-menu-bar,.technician-ccm .tech-action-bar{flex:0 0 auto;}
.technician-ccm .tech-menu-bar { min-height:28px; padding:0 18px; display:flex; align-items:center; gap:0; overflow:visible; background:linear-gradient(180deg,#f5ffe9 0%,#dff5c2 100%); border-top:1px solid #e2efd2; border-bottom:1px solid #b8d49a; }
.technician-ccm .tech-menu-item { flex:0 0 auto; min-height:27px; padding:3px 10px; border:0; border-right:1px solid rgba(94,128,63,.18); border-radius:0; background:transparent; color:#316b2d; font:600 11px/1.1 Arial,Helvetica,sans-serif; cursor:pointer; box-shadow:none; }
.technician-ccm .tech-menu-item:first-child { border-left:1px solid rgba(94,128,63,.18); }
.technician-ccm .tech-menu-item span { margin-left:2px; font-size:8px; color:#5e8753; }
.technician-ccm .tech-menu-item:hover { background:rgba(255,255,255,.55); color:#214f20; }
.technician-ccm .tech-action-bar { min-height:34px; padding:3px 18px; display:flex; align-items:center; gap:1px; overflow-x:auto; background:linear-gradient(180deg,#fbfdff 0%,#e8f4f9 100%); border-bottom:1px solid #c9dce6; }
.technician-ccm .tech-action-item { flex:0 0 auto; min-height:27px; padding:3px 12px 3px 8px; display:inline-flex; align-items:center; gap:6px; border:0; border-right:1px solid #d4e1e8; border-radius:0; background:transparent; color:#5a6f7f; font:600 11px/1 Arial,Helvetica,sans-serif; cursor:pointer; box-shadow:none; }
.technician-ccm .tech-action-item:hover { background:#fff; color:#173d59; }
.technician-ccm .tech-action-icon { width:18px; height:18px; display:inline-flex; align-items:center; justify-content:center; color:#6e8a9b; font-size:15px; line-height:1; }
.technician-ccm .tech-refresh-icon { color:#3f9fcb; font-size:20px; }
.technician-ccm .tech-main { max-width:1480px; padding:18px 22px 30px; display:grid; grid-template-columns:230px minmax(0,1fr); gap:18px; align-items:start; }
.technician-ccm .tech-nav-rail { position:sticky; top:144px; border:1px solid #dbe6f0; border-radius:16px; background:#fff; padding:12px; box-shadow:0 8px 24px rgba(15,39,71,.055); }
.technician-ccm .tech-nav-head { padding:8px 10px 13px; border-bottom:1px solid #edf2f7; margin-bottom:8px; display:flex; flex-direction:column; gap:2px; }
.technician-ccm .tech-nav-head span { font-weight:850; font-size:15px; color:#123555; letter-spacing:.01em; }
.technician-ccm .tech-nav-head small { color:#8192a5; font-size:11.5px; }
.technician-ccm .tech-tabs { display:flex; flex-direction:column; gap:6px; border:0; margin:0; }
.technician-ccm .tech-tabs .tab-btn { width:100%; min-height:58px; border:1px solid transparent; border-radius:12px; padding:8px 9px; display:grid; grid-template-columns:32px minmax(0,1fr) auto; align-items:center; gap:9px; text-align:left; color:#526b82; }
.technician-ccm .tech-tabs .tab-btn:hover { background:#f5f9fd; color:#174b78; border-color:#e0ebf4; }
.technician-ccm .tech-tabs .tab-btn.active { background:#eaf4ff; color:#0d5fb8; border-color:#b9d8fa; box-shadow:inset 3px 0 0 #1976e8; }
.technician-ccm .tech-tab-icon { width:30px; height:30px; border-radius:9px; display:flex; align-items:center; justify-content:center; background:#f0f4f8; color:#6b7e91; font-size:10px; font-weight:900; }
.technician-ccm .tech-tabs .tab-btn.active .tech-tab-icon { background:#1976e8; color:#fff; }
.technician-ccm .tech-tab-copy { min-width:0; display:flex; flex-direction:column; gap:1px; }
.technician-ccm .tech-tab-copy strong { font-size:13.5px; line-height:1.2; color:inherit; }
.technician-ccm .tech-tab-copy small { font-size:10.5px; font-weight:600; color:#8a9bac; }
.technician-ccm .tech-tabs .tab-btn.active .tech-tab-copy small { color:#5d86af; }
.technician-ccm .tech-tabs .tab-count { margin:0; min-width:19px; line-height:17px; font-size:11px; padding:1px 6px; }
.technician-ccm .tech-content { min-width:0; }
.technician-ccm .tech-content > .tab-panel > .card, .technician-ccm #overview-view > .card { border:1px solid #dce6ef; box-shadow:0 8px 24px rgba(15,39,71,.045); }
.technician-ccm .case-row { border-color:#e1e8f0; border-radius:12px; box-shadow:none; }
.technician-ccm .case-row-clickable:hover { border-color:#9fc9f5; box-shadow:0 7px 20px rgba(22,77,129,.08); transform:translateY(-1px); }
.technician-ccm .tech-case-head { min-height:68px; margin-bottom:12px; padding:11px 14px; background:#fff; border:1px solid #dce6ef; border-radius:14px; display:flex; align-items:center; justify-content:space-between; gap:14px; box-shadow:0 5px 16px rgba(15,39,71,.04); }
.technician-ccm .tech-case-head .ws-crumb { margin:0; min-width:0; }
.technician-ccm .tech-case-head .ws-back { margin:0; color:#1976e8; font-size:13.5px; }
.technician-ccm .tech-case-head .ws-crumb-name { font-size:18px; color:#102f4c; }
.technician-ccm .tech-case-meta { display:flex; flex-direction:column; align-items:flex-end; gap:2px; text-align:right; min-width:0; }
.technician-ccm .tech-case-id { font-size:12px; font-weight:900; letter-spacing:.04em; color:#1976e8; text-transform:uppercase; }
.technician-ccm .tech-case-doctor { max-width:360px; font-size:11.5px; color:#71869a; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.technician-ccm .tech-production-progress { margin:0 0 12px; padding:11px 14px; background:#fff; border:1px solid #dce6ef; border-radius:14px; display:flex; align-items:center; gap:10px; }
.technician-ccm .tech-progress-step { display:flex; align-items:center; gap:7px; color:#94a3b1; font-size:12px; font-weight:800; white-space:nowrap; }
.technician-ccm .tech-progress-dot { width:24px; height:24px; display:flex; align-items:center; justify-content:center; border-radius:50%; background:#edf2f7; color:#7b8da0; font-size:10px; font-weight:900; border:1px solid #dde6ee; }
.technician-ccm .tech-progress-line { height:2px; flex:1; min-width:28px; background:#e4eaf0; border-radius:999px; }
.technician-ccm .tech-progress-step.is-done { color:#18864b; }
.technician-ccm .tech-progress-step.is-done .tech-progress-dot { background:#e9f8ef; color:#18864b; border-color:#bfe7ce; }
.technician-ccm .tech-progress-step.is-active { color:#0f67c6; }
.technician-ccm .tech-progress-step.is-active .tech-progress-dot { background:#1976e8; color:#fff; border-color:#1976e8; box-shadow:0 0 0 4px rgba(25,118,232,.10); }
.technician-ccm .tech-progress-step.is-issue { color:#bf3b3b; }
.technician-ccm .tech-progress-step.is-issue .tech-progress-dot { background:#fff0f0; color:#c43d3d; border-color:#f2b9b9; }
.technician-ccm .ws-subtabs { grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; margin-bottom:12px; padding:4px; border:1px solid #dce6ef; border-radius:13px; background:#fff; }
.technician-ccm .ws-subtab { min-height:42px; padding:8px 10px; border:0; border-radius:9px; background:transparent; color:#64788d; font-size:13.5px; box-shadow:none; }
.technician-ccm .ws-subtab.active { background:#1976e8; color:#fff; box-shadow:0 4px 12px rgba(25,118,232,.18); }
.technician-ccm .ws-subtab-num { width:20px; height:20px; font-size:11px; }
.technician-ccm .tech-patient-panel { padding:0; overflow:hidden; }
.technician-ccm .patient-files-box { max-width:none; margin:0; max-height:calc(100vh - 300px); min-height:470px; padding:16px; border:0; border-radius:0; background:#f7f9fc; }
.technician-ccm .tech-patient-grid { display:grid; grid-template-columns:minmax(0,1.65fr) minmax(285px,.72fr); gap:16px; align-items:start; }
.technician-ccm .tech-patient-primary { min-width:0; }
.technician-ccm .tech-patient-sidebar { display:flex; flex-direction:column; gap:12px; position:sticky; top:0; }
.technician-ccm .tech-side-card, .technician-ccm .tech-records-block { background:#fff; border:1px solid #dce6ef; border-radius:13px; padding:13px; }
.technician-ccm .tech-records-block { margin-top:12px; }
.technician-ccm .tech-section-title { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; padding-bottom:10px; margin-bottom:11px; border-bottom:1px solid #edf2f7; }
.technician-ccm .tech-section-title span { color:#153755; font-size:14px; font-weight:850; }
.technician-ccm .tech-section-title small { color:#8a9caf; font-size:10.5px; text-align:right; }
.technician-ccm .tech-side-card .patient-demographics { grid-template-columns:1fr; gap:0; margin:0; padding:0; border:0; border-radius:0; background:transparent; }
.technician-ccm .tech-side-card .patient-demographics > div { padding:8px 0; border-bottom:1px solid #edf2f7; }
.technician-ccm .tech-side-card .patient-demographics > div:last-child { border-bottom:0; }
.technician-ccm .tech-clinical-card .doc-case-clinical { margin:0; padding:0; border:0; background:transparent; }
.technician-ccm .tech-clinical-card .doc-section-minihead { font-size:14px; padding-bottom:10px; border-bottom:1px solid #edf2f7; margin-bottom:10px; }
.technician-ccm .tech-clinical-card .doc-review-clinical { grid-template-columns:1fr; gap:6px; margin-top:0; }
.technician-ccm .tech-clinical-card .doc-review-clinical > div { padding:8px 9px; border-radius:9px; background:#f8fbff; }
.technician-ccm .rx-box { margin-bottom:12px; border-radius:13px; box-shadow:none; }
.technician-ccm #ws-additional-clinical .doc-additional-clinical { margin-bottom:12px!important; color:#c62828!important; background:#fff7f7!important; border-color:#fecaca!important; }
.technician-ccm #ws-panel-workflow { border:1px solid #dce6ef; box-shadow:0 8px 24px rgba(15,39,71,.045); }
.technician-ccm .setup-log { border-color:#cfe5f8; background:#fbfdff; box-shadow:none; }
.technician-ccm .ws-deliver { background:#f7fbff; border-color:#cfe0f0; }
@media (max-width:1050px) {
  .technician-ccm .tech-main { grid-template-columns:1fr; }
  .technician-ccm .tech-nav-rail { position:static; padding:8px; }
  .technician-ccm .tech-nav-head { display:none; }
  .technician-ccm .tech-tabs { flex-direction:row; overflow-x:auto; }
  .technician-ccm .tech-tabs .tab-btn { min-width:180px; }
}
@media (max-width:860px) {
  .technician-ccm .tech-patient-grid { grid-template-columns:1fr; }
  .technician-ccm .tech-patient-sidebar { position:static; }
  .technician-ccm .patient-files-box { max-height:none; }
}
@media (max-width:640px) {
  .technician-ccm .tech-main { padding:12px; }
  .technician-ccm .tech-case-head { align-items:flex-start; flex-direction:column; }
  .technician-ccm .tech-case-meta { align-items:flex-start; text-align:left; }
  .technician-ccm .tech-production-progress { overflow-x:auto; }
  .technician-ccm .tech-progress-line { min-width:18px; }
  .technician-ccm .ws-subtabs { grid-template-columns:1fr; }
}

/* Technician completed work split: Cut vs Stage */
.technician-ccm .tech-completed-groups { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.technician-ccm .tech-completed-group { min-width:0; border:1px solid #dce6ef; border-radius:14px; background:#fff; overflow:hidden; }
.technician-ccm .tech-completed-group-head { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:13px 14px; border-bottom:1px solid #edf2f7; background:#f8fbfd; }
.technician-ccm .tech-completed-group-head > div { display:flex; flex-direction:column; gap:2px; min-width:0; }
.technician-ccm .tech-completed-group-head strong { color:#153755; font-size:14px; }
.technician-ccm .tech-completed-group-head small { color:#7f93a7; font-size:10.5px; }
.technician-ccm .tech-completed-group-head > span { min-width:26px; height:26px; padding:0 7px; border-radius:999px; display:flex; align-items:center; justify-content:center; background:var(--teal-50); color:var(--teal-700); font-size:11px; font-weight:900; border:1px solid var(--teal-100); }
.technician-ccm .tech-completed-group > .case-list { padding:10px; display:flex; flex-direction:column; gap:8px; }
.technician-ccm .tech-completed-row { margin:0; }
.technician-ccm .tech-completed-empty { padding:20px 12px; }
@media (max-width:900px) { .technician-ccm .tech-completed-groups { grid-template-columns:1fr; } }


/* Staff sticky topbar parity — Technician is the visual master. Admin intentionally excluded.
   QA pages also carry .technician-ccm; Manager is listed next to Technician in
   the header rules below, so all three get the same blue header. */
.technician-ccm .topbar, body.is-manager .topbar {
  position:sticky; top:0; z-index:40;
}

/* Global compact portal toolbar — ClearComm-inspired layout */
/* ONLY Technician, QA and Manager. Doctor, Admin and Exocad keep their original toolbar. */
.portal-top-search{display:none;}
.technician-ccm .topbar,.qa-staff .topbar,body.is-manager .topbar{display:grid;grid-template-columns:minmax(180px,1fr) minmax(280px,560px) minmax(250px,1fr);align-items:center;gap:18px;min-height:58px;padding:8px 18px;background:#fff;}
.technician-ccm .topbar-left,.qa-staff .topbar-left,body.is-manager .topbar-left{min-width:0;display:flex;align-items:center;gap:10px}
.technician-ccm .topbar-right,.qa-staff .topbar-right,body.is-manager .topbar-right{min-width:0;display:flex;align-items:center;justify-content:flex-end;gap:10px}
.technician-ccm .portal-top-search,.qa-staff .portal-top-search,body.is-manager .portal-top-search{position:relative;display:flex;align-items:center;justify-self:center;width:min(100%,560px);height:34px}
.technician-ccm .portal-top-search input,.qa-staff .portal-top-search input,body.is-manager .portal-top-search input{height:34px;flex:1;min-width:0;border:1px solid #aebdcb;border-right:0;border-radius:5px 0 0 5px;padding:0 11px;font-size:12.5px;background:#fff;outline:none}
.technician-ccm .portal-top-search input:focus,.qa-staff .portal-top-search input:focus,body.is-manager .portal-top-search input:focus{border-color:#2b72b9;box-shadow:0 0 0 2px rgba(43,114,185,.12)}
.technician-ccm .portal-top-search>button,.qa-staff .portal-top-search>button,body.is-manager .portal-top-search>button{height:34px;border:1px solid #2465a3;border-radius:0 5px 5px 0;background:#1768b5;color:#fff;font-size:12px;font-weight:700;padding:0 14px;cursor:pointer}
.portal-search-results{position:absolute;top:39px;left:0;right:0;z-index:250;background:#fff;border:1px solid #ced8e2;border-radius:8px;box-shadow:0 14px 34px rgba(15,39,71,.18);overflow:hidden;max-height:360px;overflow-y:auto}
.portal-search-result{width:100%;border:0;border-bottom:1px solid #edf2f6;background:#fff;text-align:left;padding:10px 12px;cursor:pointer;display:flex;flex-direction:column;gap:2px}.portal-search-result:hover{background:#f2f7fc}.portal-search-result strong{font-size:13px;color:#143653}.portal-search-result span,.portal-search-empty{font-size:11.5px;color:#75879a}.portal-search-empty{padding:14px}
.technician-ccm .portal-profile-btn,.qa-staff .portal-profile-btn,body.is-manager .portal-profile-btn{border:0;background:transparent;color:#23415f;font-weight:700;font-size:12.5px;padding:6px 4px;cursor:pointer}
.technician-ccm .portal-profile-btn:hover,.qa-staff .portal-profile-btn:hover,body.is-manager .portal-profile-btn:hover{color:#0b65b5;text-decoration:underline}
.technician-ccm .topbar .btn.btn-secondary.btn-sm,.qa-staff .topbar .btn.btn-secondary.btn-sm,body.is-manager .topbar .btn.btn-secondary.btn-sm{background:transparent;border:0;color:#23415f;padding:6px 4px;font-size:12.5px;font-weight:700}
.technician-ccm .topbar .btn.btn-secondary.btn-sm:hover,.qa-staff .topbar .btn.btn-secondary.btn-sm:hover,body.is-manager .topbar .btn.btn-secondary.btn-sm:hover{background:transparent;color:#0b65b5;text-decoration:underline}
.technician-ccm .topbar-identity,.qa-staff .topbar-identity,body.is-manager .topbar-identity{display:flex;align-items:center;gap:7px}
.technician-ccm .topbar-identity-name,.qa-staff .topbar-identity-name,body.is-manager .topbar-identity-name{font-size:12px}
.technician-ccm .topbar-avatar,.qa-staff .topbar-avatar,body.is-manager .topbar-avatar{width:28px;height:28px}
.technician-ccm .notif-bell,.qa-staff .notif-bell,body.is-manager .notif-bell{width:34px;height:34px}
.technician-ccm .brand-logo,.qa-staff .brand-logo,body.is-manager .brand-logo{max-height:38px}.technician-ccm .brand-badge,.qa-staff .brand-badge,body.is-manager .brand-badge{font-size:11px}
@media(max-width:900px){.technician-ccm .topbar,.qa-staff .topbar,body.is-manager .topbar{grid-template-columns:auto 1fr auto;gap:8px;padding:7px 10px}.technician-ccm .brand-badge,.qa-staff .brand-badge,body.is-manager .brand-badge{display:none}.technician-ccm .portal-top-search,.qa-staff .portal-top-search,body.is-manager .portal-top-search{width:100%}.technician-ccm .topbar-identity-name,.technician-ccm .topbar-avatar,.qa-staff .topbar-identity-name,.qa-staff .topbar-avatar,body.is-manager .topbar-identity-name,body.is-manager .topbar-avatar{display:none}}
@media(max-width:620px){.technician-ccm .topbar,.qa-staff .topbar,body.is-manager .topbar{grid-template-columns:1fr auto;grid-template-areas:'left right' 'search search';height:auto}.technician-ccm .topbar-left,.qa-staff .topbar-left,body.is-manager .topbar-left{grid-area:left}.technician-ccm .topbar-right,.qa-staff .topbar-right,body.is-manager .topbar-right{grid-area:right}.technician-ccm .portal-top-search,.qa-staff .portal-top-search,body.is-manager .portal-top-search{grid-area:search;max-width:none}.technician-ccm .portal-top-search input,.qa-staff .portal-top-search input,body.is-manager .portal-top-search input{font-size:12px}}

/* Doctor toolbar: follow the marked desktop position; keep the rest original. */
body.doc-app .doc-top.topbar{display:flex;align-items:center;}
body.doc-app .doc-top .doc-search{flex:0 0 500px;width:500px;max-width:500px;margin-left:155px;}
body.doc-app .doc-top .topbar-right{margin-left:auto;}
@media(max-width:1200px){body.doc-app .doc-top .doc-search{margin-left:40px;flex-basis:min(500px,48vw);width:min(500px,48vw);}}
@media(max-width:900px){body.doc-app .doc-top.topbar{display:flex;flex-wrap:wrap;}body.doc-app .doc-top .doc-search{width:100%;max-width:none;flex:1 0 100%;margin-left:0;order:1;}body.doc-app .doc-top .topbar-right{margin-left:auto;}}

/* Admin toolbar safeguard: keep the original pre-ClearComm layout. */
body.is-admin-original .topbar{display:flex !important;align-items:center !important;justify-content:space-between !important;padding:14px 24px !important;gap:16px !important;min-height:0 !important;background:#fff !important;}
body.is-admin-original .topbar-left{display:flex;align-items:center;gap:10px;}
body.is-admin-original .topbar-right{display:flex;align-items:center;justify-content:flex-end;gap:10px;margin-left:auto;}

/* Technician ClearComm reference colors — temporary parity pass */
.technician-ccm .tech-utility-bars{width:100%;border-bottom:1px solid #c7d3dc;background:#fff;box-shadow:0 1px 0 rgba(0,0,0,.03)}
.technician-ccm .tech-menu-bar{min-height:25px;display:flex;align-items:center;gap:0;padding:0 18px;background:linear-gradient(180deg,#e8f8d8 0%,#c7ec9f 52%,#b8e58c 100%);border-top:1px solid #eef9e4;border-bottom:1px solid #a9cf82}
.technician-ccm .tech-menu-item{appearance:none;border:0;border-right:1px solid rgba(112,151,76,.26);background:transparent;color:#4f7350;height:24px;padding:0 8px;font:700 11px Arial,Helvetica,sans-serif;line-height:24px;cursor:pointer;border-radius:0;box-shadow:none}
.technician-ccm .tech-menu-item:first-child{padding-left:10px}
.technician-ccm .tech-menu-item:hover{background:rgba(255,255,255,.42);color:#315c35}
.technician-ccm .tech-menu-item span{font-size:8px;color:#688b60;margin-left:2px}
.technician-ccm .tech-action-bar{min-height:31px;display:flex;align-items:center;gap:0;padding:3px 18px;background:linear-gradient(180deg,#f9fcfd 0%,#e6f2f6 46%,#d4e9ef 100%);border-top:1px solid #fff;border-bottom:1px solid #bdcfd7}
.technician-ccm .tech-action-item{appearance:none;display:inline-flex;align-items:center;gap:5px;height:24px;padding:0 10px;border:0;border-right:1px solid #c7d6dc;background:transparent;color:#65727b;font:500 10.5px Arial,Helvetica,sans-serif;cursor:pointer;border-radius:0;box-shadow:none}
.technician-ccm .tech-action-item:first-child{padding-left:7px}
.technician-ccm .tech-action-item:hover{background:rgba(255,255,255,.58);color:#394b56}
.technician-ccm .tech-action-icon{display:inline-flex;align-items:center;justify-content:center;min-width:13px;color:#8a9aa3;font-size:14px;line-height:1}
.technician-ccm .tech-refresh-icon{color:#2d9fd1;font-size:18px;font-weight:700}
@media(max-width:640px){.technician-ccm .tech-menu-bar,.technician-ccm .tech-action-bar{overflow-x:auto;padding-left:8px;padding-right:8px;scrollbar-width:none;-ms-overflow-style:none}.technician-ccm .tech-menu-bar::-webkit-scrollbar,.technician-ccm .tech-action-bar::-webkit-scrollbar{width:0;height:0;display:none}.technician-ccm .tech-menu-item,.technician-ccm .tech-action-item{flex:0 0 auto}}

/* Technician ClearComm-style topbar + working dropdowns */
.technician-ccm .topbar,body.is-manager .topbar{background:#075fb8 !important;border-bottom:1px solid #064d94 !important;box-shadow:none !important;min-height:58px}
.technician-ccm .topbar-left,body.is-manager .topbar-left{background:transparent}
.technician-ccm .topbar .brand-logo{max-height:40px;background:#fff;border-radius:2px;padding:2px 4px}
.technician-ccm .portal-top-search,body.is-manager .portal-top-search{gap:6px;height:32px}
.technician-ccm .portal-top-search input,body.is-manager .portal-top-search input{height:30px;border:1px solid #d6dce2 !important;border-radius:2px !important;background:#fff;padding:0 10px;box-shadow:inset 0 1px 2px rgba(0,0,0,.08)}
.technician-ccm .portal-top-search>button,body.is-manager .portal-top-search>button{height:30px;border:1px solid #d2d8de !important;border-radius:2px !important;background:#f4f6f8 !important;color:#163b60 !important;padding:0 12px;font-size:11px;font-weight:700;box-shadow:0 1px 1px rgba(0,0,0,.12)}
.technician-ccm .portal-top-search>button:hover,body.is-manager .portal-top-search>button:hover{background:#fff !important}
.technician-ccm .topbar-right,body.is-manager .topbar-right{color:#fff}
.technician-ccm .tech-welcome-name,body.is-manager .tech-welcome-name{font:500 11.5px Arial,Helvetica,sans-serif;color:#fff;white-space:nowrap}
.technician-ccm .tech-topbar-logout,body.is-manager .tech-topbar-logout{border:0;background:transparent;color:#fff;font:600 11.5px Arial,Helvetica,sans-serif;padding:4px 0 4px 8px;cursor:pointer}
.technician-ccm .tech-topbar-logout:hover,body.is-manager .tech-topbar-logout:hover{text-decoration:underline}
.technician-ccm .tech-menu-dropdown{position:relative;height:24px;display:flex;align-items:stretch}
.technician-ccm .tech-menu-dropdown>.tech-menu-item{height:24px}
.technician-ccm .tech-menu-popover{display:none;position:absolute;left:0;top:24px;z-index:300;min-width:190px;background:#eef9df;border:1px solid #9bc46f;box-shadow:0 4px 10px rgba(30,60,20,.18);padding:2px 0}
.technician-ccm .tech-menu-dropdown:hover .tech-menu-popover,.technician-ccm .tech-menu-dropdown:focus-within .tech-menu-popover,.technician-ccm .tech-menu-dropdown.is-open .tech-menu-popover{display:block}
.technician-ccm .tech-menu-popover button{width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px;border:0;background:transparent;color:#355c37;text-align:left;padding:5px 10px;font:500 11px Arial,Helvetica,sans-serif;cursor:pointer}
.technician-ccm .tech-menu-popover button:hover{background:#d7efbb;color:#244c28}
.technician-ccm .tech-menu-popover small{font-size:9px;color:#78956c;font-weight:400}

/* Technician right-side support tools outside the white workspace */
.technician-ccm .tech-main{
  max-width:none;
  width:100%;
  min-height:calc(100vh - 122px);
  padding:18px 22px 30px;
  display:grid;
  grid-template-columns:minmax(0,1fr) 220px;
  gap:18px;
  align-items:start;
  background:#f3f6fa;
}
.technician-ccm .tech-workspace{
  min-width:0;
  min-height:calc(100vh - 170px);
  display:grid;
  grid-template-columns:230px minmax(0,1fr);
  gap:18px;
  align-items:start;
  padding:0;
  background:#f3f6fa;
}
.technician-ccm .tech-right-tools{
  position:sticky;
  top:154px;
  align-self:start;
  display:flex;
  flex-direction:column;
  gap:8px;
  min-height:calc(100vh - 170px);
  padding:14px 14px 18px;
  background:#fff;
}
.technician-ccm .tech-support-btn{
  width:100%;
  min-height:28px;
  padding:5px 10px;
  border:1px solid #f1edb7;
  border-radius:3px;
  background:#fffed9;
  color:#111;
  text-align:left;
  font:700 11px Arial,Helvetica,sans-serif;
  cursor:pointer;
}
.technician-ccm .tech-support-btn:hover{background:#fffbc2}
.technician-ccm .tech-check-tasks-btn{
  align-self:flex-start;
  min-height:25px;
  padding:3px 8px;
  border:1px solid #8a8a8a;
  border-radius:2px;
  background:#fff;
  color:#111;
  font:500 11px Arial,Helvetica,sans-serif;
  cursor:pointer;
}
.technician-ccm .tech-check-tasks-btn:hover{background:#f3f3f3}
@media(max-width:1100px){
  .technician-ccm .tech-main{grid-template-columns:1fr}
  .technician-ccm .tech-workspace{grid-template-columns:220px minmax(0,1fr)}
  .technician-ccm .tech-right-tools{position:static;flex-direction:row;padding-top:0}
  .technician-ccm .tech-support-btn{width:auto;min-width:140px}
}
@media(max-width:760px){
  .technician-ccm .tech-workspace{grid-template-columns:1fr}
}

/* Technician Check Tasks expandable menu */
.technician-ccm .tech-task-menu-wrap{width:100%}
.technician-ccm .tech-check-tasks-btn{display:flex;align-items:center;justify-content:space-between;gap:8px}
.technician-ccm .tech-check-tasks-btn span{font-size:8px;transition:transform .15s ease}
.technician-ccm .tech-check-tasks-btn.is-open span{transform:rotate(180deg)}
.technician-ccm .tech-task-menu{margin-top:6px;border:1px solid #cfd6dc;background:#fff;box-shadow:0 4px 12px rgba(15,39,71,.08)}
.technician-ccm .tech-task-menu.hidden{display:none}
.technician-ccm .tech-task-menu button{width:100%;display:flex;align-items:center;justify-content:space-between;gap:8px;border:0;border-bottom:1px solid #e7ebef;background:#fff;color:#24384c;text-align:left;padding:8px 10px;font:600 11px Arial,Helvetica,sans-serif;cursor:pointer}
.technician-ccm .tech-task-menu button:last-child{border-bottom:0}
.technician-ccm .tech-task-menu button:hover{background:#f4f8fb}
.technician-ccm .tech-task-menu small{font-size:9px;font-weight:500;color:#7b8792}

/* Technician task-count badges */
.technician-ccm .tech-task-menu button{display:flex;align-items:center;justify-content:space-between;gap:10px}
.technician-ccm .tech-task-count{display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:20px;padding:0 6px;border-radius:10px;background:#e8edf3;color:#173d59;font:700 11px Arial,Helvetica,sans-serif;line-height:20px}

/* Technician task-led layout: production rail removed */
.technician-ccm .tech-workspace{grid-template-columns:minmax(0,1fr) !important;}
.technician-ccm .tech-content{min-width:0;width:100%;}

/* Technician ClearComm-inspired content colors */
.technician-ccm .tech-main{
  width:100% !important;
  max-width:none !important;
  margin:0 !important;
  box-sizing:border-box;
  grid-template-columns:minmax(0,1fr) 250px;
  gap:0;
  padding:18px 0 30px 22px;
  background:#fff;
}
.technician-ccm .tech-workspace{
  background:#dbeaf1;
}
.technician-ccm .tech-content{
  background:#dbeaf1;
}
.technician-ccm .tech-right-tools{
  width:250px;
  box-sizing:border-box;
  justify-self:end;
  min-height:calc(100vh - 170px);
  padding:14px 18px 18px;
  background:#fff;
}

/* Technician text wordmark */
.technician-ccm .brand-wordmark,body.is-manager .brand-wordmark{display:inline-flex;align-items:baseline;gap:6px;color:#fff;font-family:Arial,Helvetica,sans-serif;font-size:25px;line-height:1;white-space:nowrap;letter-spacing:.2px}
.technician-ccm .brand-wordmark-branda,body.is-manager .brand-wordmark-name{font-weight:900;color:#fff}
.technician-ccm .brand-wordmark-rest,body.is-manager .brand-wordmark-rest{font-weight:500;color:#fff}

/* Technician ClearComm-style bottom dock */
.technician-ccm .tech-workspace{display:flex !important;flex-direction:column;min-height:calc(100vh - 170px);}
.technician-ccm .tech-content{flex:1 1 auto;}
.technician-ccm .tech-bottom-dock{margin-top:auto;padding-top:10px;background:#dbeaf1;}
.technician-ccm .tech-bottom-toolbar{display:flex;align-items:flex-end;gap:2px;border-bottom:1px solid #9fb7c4;padding:0 4px;}
.technician-ccm .tech-bottom-tab{min-height:22px;padding:2px 8px;border:1px solid #aab9c1;border-bottom:0;border-radius:0;background:linear-gradient(180deg,#f7fbfd 0%,#dfeaf0 100%);color:#344b5d;font:600 10px Arial,Helvetica,sans-serif;cursor:pointer;box-shadow:none;}
.technician-ccm .tech-bottom-tab:hover{background:#fff;}
.technician-ccm .tech-bottom-tab.active{background:#fff;color:#111;position:relative;top:1px;}
.technician-ccm .tech-bottom-panel{min-height:54px;border:1px solid #9fb7c4;border-top:0;background:#fff;padding:7px 9px;font:500 10px Arial,Helvetica,sans-serif;color:#334b5d;}
.technician-ccm .bottom-tool-view{min-height:38px;}

/* Technician bottom dock refinement — compact ClearComm-style grid */
.technician-ccm .tech-bottom-dock{padding-top:8px;background:#dbeaf1;border-top:1px solid #b9ccd6}
.technician-ccm .tech-bottom-toolbar{gap:1px;padding:0 6px;border-bottom:1px solid #9fb7c4;background:#eef5f8}
.technician-ccm .tech-bottom-tab{min-height:20px;padding:2px 7px;background:linear-gradient(180deg,#fdfefe 0%,#e1ebef 100%);border-color:#aab8bf;color:#364b59;font:600 9px Arial,Helvetica,sans-serif}
.technician-ccm .tech-bottom-tab.active{background:#fff;color:#111;border-top:2px solid #d9a400;top:1px}
.technician-ccm .tech-bottom-panel{min-height:112px;padding:5px 6px 7px;background:#fff;border-color:#9fb7c4;overflow:auto}
.technician-ccm .tech-bottom-grid{display:grid;align-items:center;min-width:760px;height:24px;border:1px solid #b7c6cd;background:linear-gradient(180deg,#f9fcfd 0%,#dcebf1 100%);color:#1f3441;font:700 9px Arial,Helvetica,sans-serif}
.technician-ccm .tech-bottom-grid>span{padding:4px 6px;border-right:1px solid #c8d3d9;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.technician-ccm .tech-bottom-grid>span:last-child{border-right:0}
.technician-ccm .tech-bottom-grid-rejects{grid-template-columns:52px 120px 88px 92px 82px minmax(180px,1fr) 96px 96px 130px}
.technician-ccm .tech-bottom-grid-notes{grid-template-columns:120px 100px minmax(420px,1fr) 140px}
.technician-ccm .tech-bottom-grid-history{grid-template-columns:140px 110px minmax(420px,1fr) 150px}
.technician-ccm .tech-bottom-grid-export{grid-template-columns:140px 100px minmax(300px,1fr) 140px 140px}
.technician-ccm .tech-bottom-grid-help{grid-template-columns:70px 100px minmax(320px,1fr) 100px 140px 140px}
.technician-ccm .tech-bottom-empty{min-width:760px;padding:16px 8px;color:#75858f;font:500 10px Arial,Helvetica,sans-serif;border:1px solid #e2e8eb;border-top:0;background:#fafcfd}

/* Technician bottom dock full-width across workspace + right rail */
.technician-ccm .tech-workspace{overflow:visible;}
.technician-ccm .tech-bottom-dock{width:calc(100% + 250px);margin-right:-250px;box-sizing:border-box;}
.technician-ccm .tech-bottom-toolbar,.technician-ccm .tech-bottom-panel{width:100%;box-sizing:border-box;}

/* Technician ClearComm-inspired accepted case detail screen */
.technician-ccm #workspace-view>.tech-case-head,.technician-ccm #workspace-view>.tech-production-progress{display:none!important}
.technician-ccm .ccm-case-page{background:transparent;border:0;box-shadow:none;padding:0;margin:0}
.technician-ccm .ccm-treatment-preferences{margin:0 0 8px;background:#fff;border:3px solid #d51f1f;padding:7px 9px;font-family:Arial,Helvetica,sans-serif}
.technician-ccm .ccm-treatment-title{font-size:12px;line-height:1.1;font-weight:800;color:#23802f;margin-bottom:3px;text-transform:none}
.technician-ccm .ccm-treatment-preferences .rx-box{margin:0!important;padding:0!important;border:0!important;background:transparent!important;box-shadow:none!important}
.technician-ccm .ccm-treatment-preferences .rx-head{display:none!important}
.technician-ccm .ccm-treatment-preferences .rx-body{padding:0!important;background:transparent!important;border:0!important;color:#9f0808!important;font-size:12px!important;font-weight:700!important;line-height:1.35!important}
.technician-ccm .ccm-treatment-preferences .rx-none{color:#8d1b1b!important;font-weight:600!important}
.technician-ccm .ccm-case-info-panel{display:grid;grid-template-columns:minmax(0,.92fr) minmax(0,1.08fr);gap:28px;background:#d8ebf3;border-radius:10px;padding:16px 22px 18px;min-height:290px;font-family:Arial,Helvetica,sans-serif}
.technician-ccm .ccm-case-info-column{min-width:0}
.technician-ccm .ccm-case-section-title{font-size:12px;font-weight:800;color:#193b4d;margin-bottom:10px;border-bottom:1px solid rgba(45,92,111,.22);padding-bottom:5px}
.technician-ccm .ccm-info-line{display:grid;grid-template-columns:92px minmax(0,1fr);gap:10px;align-items:start;margin:5px 0;font-size:11px;line-height:1.3;color:#203b49}
.technician-ccm .ccm-info-line>span{font-weight:700;text-align:right;color:#253d4a}
.technician-ccm .ccm-info-line>strong{font-weight:500;color:#145d87}
.technician-ccm .ccm-case-info-panel .patient-demographics{display:grid!important;grid-template-columns:1fr!important;gap:0!important;margin:8px 0 0!important;padding:0!important;background:transparent!important;border:0!important;box-shadow:none!important}
.technician-ccm .ccm-case-info-panel .patient-demographics>div{display:grid!important;grid-template-columns:92px minmax(0,1fr)!important;gap:10px!important;padding:3px 0!important;border:0!important;background:transparent!important}
.technician-ccm .ccm-case-info-panel .patient-demographics span{font-size:11px!important;font-weight:700!important;text-align:right!important;color:#253d4a!important}
.technician-ccm .ccm-case-info-panel .patient-demographics strong{font-size:11px!important;font-weight:500!important;color:#145d87!important}
.technician-ccm .ccm-case-info-panel .clinical-instructions,.technician-ccm .ccm-case-info-panel .clinical-box,.technician-ccm .ccm-case-info-panel .additional-clinical-preferences{background:transparent!important;border:0!important;box-shadow:none!important;margin:0!important;padding:0!important}
.technician-ccm .ccm-case-info-panel .tech-section-title,.technician-ccm .ccm-case-info-panel .clinical-title{font-size:11px!important;margin:4px 0!important}
.technician-ccm .ccm-case-ledger{margin-top:10px;border-bottom:1px solid #9eb4bf;background:#eef4f7;padding-left:6px;height:28px;display:flex;align-items:flex-end}
.technician-ccm .ccm-case-ledger-tab{height:24px;padding:2px 14px;border:1px solid #9eb4bf;border-bottom:0;background:linear-gradient(180deg,#fff 0%,#e2ebef 100%);color:#22516e;font:700 10px Arial,Helvetica,sans-serif;cursor:pointer}
.technician-ccm .ccm-case-ledger-tab:hover{background:#fff;color:#0f3954}
.technician-ccm .ccm-ledger-badge{margin-left:4px;color:#6b7f8a;font-weight:700}
.technician-ccm .ccm-workflow-page{margin:0;background:#fff;border:1px solid #aec2cc;border-radius:0;box-shadow:none;padding:10px}
.technician-ccm .ccm-workflow-head{display:flex;align-items:center;gap:12px;margin:-10px -10px 10px;padding:7px 9px;background:#e5f1f6;border-bottom:1px solid #afc3cd;font:600 11px Arial,Helvetica,sans-serif;color:#1d4054}
.technician-ccm .ccm-back-to-case{border:1px solid #9eb2bd;background:#fff;padding:3px 8px;font:600 10px Arial,Helvetica,sans-serif;color:#20516d;cursor:pointer}
.technician-ccm .ccm-back-to-case:hover{background:#f7fbfd}
@media(max-width:900px){.technician-ccm .ccm-case-info-panel{grid-template-columns:1fr;gap:16px}.technician-ccm .ccm-info-line,.technician-ccm .ccm-case-info-panel .patient-demographics>div{grid-template-columns:110px minmax(0,1fr)!important}}

/* Technician accepted-case screen — closer ClearComm layout */
.technician-ccm #workspace-view{padding:0 8px 0 0}
.technician-ccm .ccm-treatment-preferences{width:58%;min-width:620px;max-width:920px;margin:0 0 6px;background:#fff;border:4px solid #d81f1f;padding:6px 8px}
.technician-ccm .ccm-treatment-title{font-size:13px;font-weight:900;color:#167c25;margin-bottom:2px}
.technician-ccm .ccm-treatment-preferences .rx-body{font-size:12px!important;font-weight:800!important;color:#9d0b0b!important;line-height:1.22!important}
.technician-ccm .ccm-case-info-panel{position:relative;display:grid;grid-template-columns:minmax(260px,.82fr) minmax(380px,1.2fr) minmax(230px,.58fr);gap:34px;width:100%;min-height:325px;padding:10px 18px 14px;border-radius:10px;background:#d7eaf2;align-items:start}
.technician-ccm .ccm-case-info-column{padding-top:0}
.technician-ccm .ccm-info-line{display:grid;grid-template-columns:105px minmax(0,1fr);gap:8px;margin:4px 0;font-size:10.5px;line-height:1.25}
.technician-ccm .ccm-info-line>span{text-align:right;font-weight:700;color:#1d2d35}
.technician-ccm .ccm-info-line>strong{font-weight:500;color:#12628e;min-width:0;overflow-wrap:anywhere}
.technician-ccm .ccm-case-info-panel .patient-demographics{margin:5px 0 6px!important}
.technician-ccm .ccm-case-info-panel .patient-demographics>div{grid-template-columns:105px minmax(0,1fr)!important;padding:2px 0!important}
.technician-ccm .ccm-case-info-panel .patient-demographics span,.technician-ccm .ccm-case-info-panel .patient-demographics strong{font-size:10.5px!important}
.technician-ccm .ccm-clinical-protocol-column{padding-left:8px}
.technician-ccm .ccm-case-info-panel .clinical-instructions,.technician-ccm .ccm-case-info-panel .clinical-box,.technician-ccm .ccm-case-info-panel .additional-clinical-preferences{font-size:10.5px!important;line-height:1.25!important}
.technician-ccm .ccm-case-status-column .ccm-info-line{grid-template-columns:90px minmax(0,1fr)}
.technician-ccm .ccm-summary-box{margin:26px 0 0 auto;width:150px;padding:8px 10px;border-radius:10px;background:#c6e1ed;font:600 10px Arial,Helvetica,sans-serif;color:#283c47}
.technician-ccm .ccm-summary-box>div{display:grid;grid-template-columns:1fr 20px;gap:8px;align-items:center;padding:2px 0}
.technician-ccm .ccm-summary-box b{text-align:center;color:#21a34a;font-size:12px}
.technician-ccm .ccm-summary-box b:empty{color:#999}
.technician-ccm .ccm-case-ledger{margin-top:12px;height:28px;padding-left:8px;background:#fff;border-top:1px solid #aebfc7;border-bottom:1px solid #aebfc7}
.technician-ccm .ccm-case-ledger-tab{height:24px;min-width:72px;padding:2px 10px;border:1px solid #aebfc7;border-bottom:0;background:linear-gradient(180deg,#fdfefe,#e5edef);color:#22516e;font-size:10px;font-weight:700}
.technician-ccm .ccm-case-ledger-tab:hover{background:#fff}
@media(max-width:1200px){.technician-ccm .ccm-case-info-panel{grid-template-columns:1fr 1.15fr}.technician-ccm .ccm-case-status-column{grid-column:1/-1;display:grid;grid-template-columns:repeat(4,minmax(150px,1fr)) 160px;gap:8px}.technician-ccm .ccm-case-status-column .ccm-info-line{display:block}.technician-ccm .ccm-case-status-column .ccm-info-line>span{display:block;text-align:left}.technician-ccm .ccm-summary-box{margin:0;width:160px}}
@media(max-width:760px){.technician-ccm .ccm-treatment-preferences{width:100%;min-width:0}.technician-ccm .ccm-case-info-panel{grid-template-columns:1fr;gap:14px}.technician-ccm .ccm-case-status-column{display:block}.technician-ccm .ccm-summary-box{margin:10px 0 0;width:100%}}

/* Accepted case detail — closer ClearComm composition */
.technician-ccm .ccm-case-heading-row{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:2px 6px 6px;font-family:Arial,Helvetica,sans-serif;background:#fff}
.technician-ccm .ccm-clearcut-title{font-size:13px;font-weight:800;color:#1f8a2d;line-height:1.15}
.technician-ccm .ccm-clearcut-case{font-size:12px;font-weight:800;color:#222;margin-top:2px}
.technician-ccm .ccm-clearcut-sub{font-size:9px;color:#5f6a70;margin-top:1px}
.technician-ccm .ccm-created-meta{font-size:8px;color:#8b959a;text-align:right;max-width:300px;line-height:1.25;padding-top:4px}
.technician-ccm .ccm-treatment-preferences{margin-bottom:5px}
.technician-ccm .ccm-case-info-panel{grid-template-columns:minmax(0,1fr) minmax(0,1.08fr) 210px!important;gap:24px!important;border-radius:9px!important;padding:10px 18px 12px!important;min-height:310px!important}
.technician-ccm .ccm-clinical-protocol-column{padding-top:1px}
.technician-ccm .ccm-case-status-column{display:flex;flex-direction:column;min-width:0}
.technician-ccm .ccm-summary-box{margin-top:auto;margin-left:auto;width:150px;background:#c5e2ee;border-radius:9px;padding:8px 10px;font:500 9px Arial,Helvetica,sans-serif;color:#203640}
.technician-ccm .ccm-summary-box:before{content:'Submission';display:block;text-align:right;font-weight:800;margin-bottom:3px}
.technician-ccm .ccm-summary-box>div{display:flex;justify-content:flex-end;gap:9px;line-height:1.45}
.technician-ccm .ccm-summary-box span{min-width:45px;text-align:right;font-weight:700}
.technician-ccm .ccm-summary-box b{min-width:12px;color:#2da942;text-align:center}
.technician-ccm .ccm-translate-strip{height:32px;display:flex;align-items:center;justify-content:center;gap:4px;background:#fff;border-bottom:1px solid #1c1c1c;font:500 9px Arial,Helvetica,sans-serif}
.technician-ccm .ccm-translate-btn{height:19px;padding:1px 5px;border:1px solid #8d9aa0;background:#fff;color:#111;font:500 9px Arial,Helvetica,sans-serif}
.technician-ccm .ccm-translate-strip>span{display:inline-flex;width:13px;height:13px;border-radius:50%;align-items:center;justify-content:center;background:#78bee0;color:#fff;font-size:9px;font-weight:700}
.technician-ccm .ccm-ledger-tabs{display:flex;align-items:flex-end;gap:1px;background:#fff;padding:5px 6px 0;border-bottom:1px solid #9eafb8}
.technician-ccm .ccm-ledger-tabs button{height:23px;padding:2px 10px;border:1px solid #b8c5cb;border-bottom:0;background:linear-gradient(#f8fafb,#e5ebee);font:600 9px Arial,Helvetica,sans-serif;color:#354a56;cursor:pointer}
.technician-ccm .ccm-ledger-tabs button.active{background:#eef7fb;color:#1d4e67}
.technician-ccm .ccm-ledger-sheet{background:#fff;border:1px solid #aebdc5;border-top:0;margin:0 6px 8px;font-family:Arial,Helvetica,sans-serif}
.technician-ccm .ccm-ledger-head{height:22px;display:grid;grid-template-columns:1fr 160px;align-items:center;background:linear-gradient(#f8fcfd,#dcebf1);border-bottom:1px solid #b7c5cb;color:#24506a;font-size:9px;font-weight:800;padding:0 8px}
.technician-ccm .ccm-ledger-head span:last-child{text-align:right}
.technician-ccm .ccm-ledger-row{width:100%;display:grid;grid-template-columns:24px 1fr 160px;align-items:center;gap:8px;border:0;background:#f7f7f7;padding:5px 8px;text-align:left;cursor:pointer;color:#22516f;font:500 10px Arial,Helvetica,sans-serif}
.technician-ccm .ccm-ledger-row:hover{background:#eef6fa}
.technician-ccm .ccm-ledger-symbol{color:#d08b00;font-weight:800}
.technician-ccm .ccm-ledger-row strong{display:block;font-weight:700}
.technician-ccm .ccm-ledger-row small{display:block;color:#7d8b92;font-size:8px;margin-top:1px}
.technician-ccm .ccm-ledger-status{text-align:right;color:#657985;font-size:9px}
@media(max-width:1100px){.technician-ccm .ccm-case-info-panel{grid-template-columns:1fr 1fr!important}.technician-ccm .ccm-case-status-column{grid-column:1/-1}.technician-ccm .ccm-summary-box{margin-top:10px}}

/* Technician ledger — match ClearComm reference */
.technician-ccm .ccm-ledger-tabs{display:flex;align-items:flex-end;gap:1px;margin-top:8px;border-bottom:1px solid #aebbc4;padding-left:4px}
.technician-ccm .ccm-ledger-tabs button{height:23px;padding:2px 9px;border:1px solid #b8c4cb;border-bottom:0;background:linear-gradient(#f7f7f7,#dce3e7);color:#202f38;font:500 10px Arial,Helvetica,sans-serif;border-radius:2px 2px 0 0;cursor:default}
.technician-ccm .ccm-ledger-tabs button.active{background:#e9f4f8;font-weight:700}
.technician-ccm .ccm-ledger-toolbar{height:20px;border:1px solid #bdc8ce;border-top:0;background:#f7f9fa;padding:1px 5px}
.technician-ccm .ccm-add-phase{border:0;background:transparent;color:#243b47;font:500 9px Arial,Helvetica,sans-serif;padding:0;cursor:default}
.technician-ccm .ccm-ledger-reference{border:1px solid #b9c6cd;border-top:0;background:#fff;font:9px Arial,Helvetica,sans-serif;color:#111}
.technician-ccm .ccm-ledger-reference .ccm-ledger-head{display:grid;grid-template-columns:170px 1fr 180px;min-height:18px;background:linear-gradient(#eef8fb,#dbeef5);border-bottom:1px solid #b8c5cb;color:#234e66;font-weight:700}
.technician-ccm .ccm-ledger-reference .ccm-ledger-head span{padding:2px 6px}.technician-ccm .ccm-ledger-reference .ccm-ledger-head span:last-child{text-align:right}
.technician-ccm .ccm-ledger-entry{display:grid;grid-template-columns:170px 1fr 180px;width:100%;min-height:39px;border:0;border-bottom:1px solid #c8c8c8;background:#efefef;padding:0;text-align:left;color:inherit;font:inherit}
.technician-ccm button.ccm-ledger-entry{cursor:pointer}.technician-ccm button.ccm-ledger-entry:hover{filter:none;background:#f1f1f1}
.technician-ccm .ccm-entry-action{padding:6px 5px;border-right:1px solid #c6c6c6;background:#f3f3f3;white-space:nowrap}
.technician-ccm .ccm-ledger-symbol{display:inline-block;width:14px;color:#d58900;font-weight:700}.technician-ccm .ccm-ledger-x{color:#b20f0f}
.technician-ccm .ccm-entry-link{color:#23688f;font-style:italic;margin-left:5px}
.technician-ccm .ccm-entry-main{min-width:0;border-right:1px solid #c6c6c6;background:#e7e7e7}
.technician-ccm .ccm-mini-head,.technician-ccm .ccm-mini-row{display:grid;align-items:center;text-align:center}.technician-ccm .ccm-mini-head{background:#b9b9b9;font-weight:700;color:#111;min-height:16px}.technician-ccm .ccm-mini-row{background:#ececec;min-height:17px;color:#222}
.technician-ccm .ccm-mini-head-9,.technician-ccm .ccm-mini-row-9{grid-template-columns:1.25fr .7fr .75fr .75fr .75fr .75fr .75fr .75fr 1.1fr}
.technician-ccm .ccm-mini-head-5,.technician-ccm .ccm-mini-row-5{grid-template-columns:1.45fr 1fr 1fr 1fr 1fr}
.technician-ccm .ccm-mini-head span,.technician-ccm .ccm-mini-row span{padding:1px 3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.technician-ccm .ccm-ledger-type-cell{position:relative;display:flex;align-items:center;justify-content:center;min-height:17px;padding-left:20px !important}.technician-ccm .ccm-ledger-type-cell>span{padding:0;overflow:visible}.technician-ccm .ccm-ledger-search{position:absolute;left:2px;top:1px;width:16px;height:15px;padding:0;border:0;background:transparent;color:#222;font:700 13px/15px Arial,Helvetica,sans-serif;cursor:pointer}.technician-ccm .ccm-ledger-search:hover{background:#d8d8d8}
.technician-ccm .ccm-mini-row-9 span:nth-child(2),.technician-ccm .ccm-mini-row-9 span:nth-child(3),.technician-ccm .ccm-mini-row-9 span:nth-child(4),.technician-ccm .ccm-mini-row-9 span:nth-child(8){color:#1aaa28;font-weight:700}.technician-ccm .ccm-mini-row-9 span:nth-child(5),.technician-ccm .ccm-mini-row-9 span:nth-child(6){color:#c20e0e}.technician-ccm .ccm-mini-row-9 span:nth-child(7),.technician-ccm .ccm-mini-row-9 span:nth-child(9){color:#aaa;font-style:italic}
.technician-ccm .ccm-ledger-subnote{padding:1px 5px;background:#ededed;color:#555;border-top:1px solid #d7d7d7;font-size:8px}
.technician-ccm .ccm-entry-date{padding:4px 5px;text-align:right;background:#dfdfdf;color:#777;line-height:1.25}.technician-ccm .ccm-entry-date small{display:block;color:#777;font-style:italic}.technician-ccm .ccm-ledger-status{margin-top:2px;color:#777;font-weight:600}

/* Technician Setup page — ClearComm-inspired reference layout */
.technician-ccm .ccm-workflow-page{padding:0!important;border-radius:0!important;box-shadow:none!important;background:#fff!important;border:0!important}
.technician-ccm .ccm-setup-reference-head{position:relative;display:grid;grid-template-columns:1fr 1fr 1fr;align-items:center;gap:12px;padding:5px 10px 2px;background:#fff;border-top:1px solid #8fb5c3;font:600 10px Arial,Helvetica,sans-serif;color:#111}
.technician-ccm .ccm-setup-reference-head>strong:first-child{font-size:11px;text-align:left}
.technician-ccm .ccm-setup-pref-mod{text-align:center;color:#6db533;font-size:11px;font-weight:700}
.technician-ccm .ccm-setup-reference-head>small{text-align:right;color:#999;font-size:7.5px;font-weight:400}
.technician-ccm .ccm-setup-reference-panel{display:grid;grid-template-columns:minmax(0,38%) minmax(0,45%);gap:3%;align-content:start;justify-content:start;min-height:0;padding:9px 12px 12px;background:#d7eaf2;border-radius:12px;font:400 9.5px/1.22 Arial,Helvetica,sans-serif;color:#111}
.technician-ccm .ccm-setup-reference-col{min-width:0;padding-top:1px}
.technician-ccm .ccm-setup-ref-row{display:grid;grid-template-columns:150px minmax(0,1fr);align-items:baseline;gap:10px;min-height:21px;padding:1px 0}
.technician-ccm .ccm-setup-ref-row>span{text-align:right;font-weight:700;color:#222;white-space:nowrap}
.technician-ccm .ccm-setup-ref-row>b{font-weight:400;color:#111;overflow-wrap:anywhere}
.technician-ccm .ccm-setup-ref-row.ccm-setup-due-row b{font-weight:700}
.technician-ccm .ccm-setup-reference-actions{display:flex;justify-content:flex-start;align-items:center;padding:4px 8px;background:#fff}
.technician-ccm .ccm-setup-reference-actions .ccm-back-to-case{border:1px solid #b8c4ca;border-radius:2px;background:#f6f6f6;color:#31566b;padding:2px 7px;font:600 9px Arial,Helvetica,sans-serif;cursor:pointer}
.technician-ccm .ccm-setup-working-log{margin:0 4px 6px}
.technician-ccm .ccm-setup-working-log .setup-log{border-top:1px solid #b6c6cd}
.technician-ccm .ccm-setup-working-log .setup-log-title{font-size:10px}
.technician-ccm .ccm-setup-working-log .slog-section{font-size:10px}
@media(max-width:900px){.technician-ccm .ccm-setup-reference-head{grid-template-columns:1fr}.technician-ccm .ccm-setup-pref-mod,.technician-ccm .ccm-setup-reference-head>small{text-align:left}.technician-ccm .ccm-setup-reference-panel{grid-template-columns:1fr;gap:8px;padding:10px 14px}.technician-ccm .ccm-setup-ref-row{grid-template-columns:140px 1fr}}

/* Setup page: toolbar is attached directly to the setup summary; legacy long setup log stays out of view. */
.technician-ccm .ccm-workflow-page .ccm-setup-tools{
  width:100% !important;
  margin:0 !important;
  padding-top:0 !important;
  border-top:0 !important;
  background:#dbeaf1;
  box-sizing:border-box;
}
.technician-ccm .ccm-workflow-page .ccm-setup-tools .tech-bottom-toolbar{margin:0;border-top:1px solid #9fb7c4}
.technician-ccm .ccm-legacy-hidden{display:none !important}

/* Setup summary: Cut work sits inline with the reference layout. */
.technician-ccm .ccm-top-cut-work{margin:1px 0 3px;padding:0;border:0;border-radius:0;background:transparent;font:500 9px Arial,Helvetica,sans-serif}
.technician-ccm .ccm-top-cut-row{display:grid;grid-template-columns:150px minmax(0,1fr);gap:10px;align-items:start;margin:1px 0;min-height:20px}
.technician-ccm .ccm-top-cut-row>span{text-align:right;font-weight:700;color:#222;white-space:nowrap;padding-top:2px}
.technician-ccm .ccm-top-cut-row>span small{font-weight:400;color:#666;font-size:8px}
.technician-ccm .ccm-top-cut-row>div{min-width:0}
.technician-ccm .ccm-top-cut-actions{display:flex;align-items:center;gap:5px;flex-wrap:wrap}
.technician-ccm .ccm-top-upload{display:inline-block;margin:0;padding:2px 7px;border:1px solid #879da8;border-radius:2px;background:#f8fbfc;color:#111;font-weight:400;cursor:pointer}
.technician-ccm .ccm-top-cut-work em{color:#c62828;font-style:normal;font-size:8px}
.technician-ccm .ccm-top-cut-warning{margin:0 0 2px 123px;padding-left:0;color:#a65b14;font-size:8px}
.technician-ccm .ccm-top-cut-notes textarea{width:100%;height:40px;min-height:40px;max-height:140px;box-sizing:border-box;border:1px solid #3ca2c8;border-radius:4px;padding:4px 6px;font:500 9px Arial,Helvetica,sans-serif;resize:vertical;overflow-y:auto;background:#fff}
.technician-ccm .ccm-top-complete{margin-top:3px;padding:2px 8px;border:1px solid #879da8;border-radius:2px;background:#f8fbfc;color:#111;font:400 9px Arial,Helvetica,sans-serif;cursor:pointer}
.technician-ccm .ccm-top-cut-readonly{margin:1px 0 3px;padding:0;border:0;background:transparent}

/* Setup workflow: keep bottom toolbar tight to content instead of filling viewport. */
.technician-ccm .tech-workspace.setup-compact-mode{min-height:0!important;}
.technician-ccm .tech-workspace.setup-compact-mode .tech-content{flex:0 0 auto!important;}
.technician-ccm .tech-workspace.setup-compact-mode .ccm-setup-tools{min-height:0!important;height:auto!important;}
.technician-ccm .tech-workspace.setup-compact-mode .ccm-setup-tools .tech-bottom-panel.hidden{display:none!important;}
/* Setup finishing pass: keep the toolbar tight under the setup panel. */
.technician-ccm .ccm-top-upload{font:400 8px/1.2 Arial,Helvetica,sans-serif!important;padding:1px 5px!important;}
.technician-ccm .tech-workspace.setup-compact-mode{min-height:0!important;}
.technician-ccm .tech-workspace.setup-compact-mode .tech-content{flex:0 0 auto!important;display:block!important;}
.technician-ccm .tech-workspace.setup-compact-mode #workspace-view{display:block!important;}
.technician-ccm .tech-workspace.setup-compact-mode .ccm-workflow-page{display:block!important;background:#fff!important;}
.technician-ccm .tech-workspace.setup-compact-mode .ccm-setup-tools{margin-top:0!important;min-height:0!important;height:auto!important;background:#eef5f8!important;padding-top:0!important;border-top:0!important;}
.technician-ccm .tech-workspace.setup-compact-mode .ccm-setup-tools .tech-bottom-toolbar{margin:0!important;}
.technician-ccm .tech-workspace.setup-compact-mode .ccm-setup-tools .tech-bottom-panel.hidden{display:none!important;}

/* Setup reference notes: Cut, Stage and QC notes use the same boxed presentation. */
.technician-ccm .ccm-reference-notes-row{display:grid;grid-template-columns:150px minmax(0,1fr);gap:10px;align-items:start;margin:2px 0 4px;}
.technician-ccm .ccm-reference-notes-row>span{text-align:right;font-weight:700;color:#222;padding-top:5px;white-space:nowrap;}
.technician-ccm .ccm-reference-notes-box{min-height:30px;padding:5px 8px;box-sizing:border-box;border:1px solid #2f9fc7;border-radius:6px;background:#fff;color:#222;font:500 9px/1.3 Arial,Helvetica,sans-serif;white-space:pre-wrap;overflow-wrap:anywhere;}

/* Compact Setup action selector + Done button. */
.technician-ccm .ccm-setup-action-wrap{display:flex;align-items:center;gap:4px;margin-top:3px;width:max-content;max-width:100%;}
.technician-ccm .ccm-setup-action-select{width:92px!important;min-width:92px!important;max-width:92px!important;height:22px!important;min-height:22px!important;padding:1px 20px 1px 5px!important;margin:0!important;border:1px solid #879da8!important;border-radius:2px!important;background:#fff!important;color:#111!important;font:400 9px/1.2 Arial,Helvetica,sans-serif!important;box-sizing:border-box!important;}
.technician-ccm .ccm-setup-action-done{height:22px!important;padding:1px 8px!important;margin:0!important;border:1px solid #879da8!important;border-radius:2px!important;background:#f8fbfc!important;color:#111!important;font:400 9px/1.2 Arial,Helvetica,sans-serif!important;cursor:pointer;}

/* Technician Setup readability pass */
.technician-ccm .ccm-setup-ref-row{font-size:13px!important;line-height:1.45!important;}
.technician-ccm .ccm-setup-ref-row>span{font-size:13px!important;}
.technician-ccm .ccm-setup-ref-row>b{font-size:13px!important;font-weight:500!important;}
.technician-ccm .ccm-reference-notes-row>span{font-size:13px!important;}
.technician-ccm .ccm-reference-notes-box{font-size:13px!important;line-height:1.4!important;}

/* Stage/Cut active-work controls: match the readable setup scale without becoming bulky. */
.technician-ccm #ws-setup-ref-right .ccm-setup-ref-row{grid-template-columns:180px minmax(0,1fr)!important;gap:10px!important;}
.technician-ccm .ccm-top-cut-work{font:500 13px/1.35 Arial,Helvetica,sans-serif!important;}
.technician-ccm .ccm-top-cut-row{grid-template-columns:180px minmax(0,1fr)!important;gap:10px!important;min-height:24px!important;}
.technician-ccm .ccm-top-cut-row>span{font-size:13px!important;padding-top:3px!important;}
.technician-ccm .ccm-top-cut-row>span small{font-size:10px!important;}
.technician-ccm .ccm-top-upload{font:400 11px/1.2 Arial,Helvetica,sans-serif!important;padding:2px 6px!important;}
.technician-ccm .ccm-top-cut-work em{font-size:10px!important;}
.technician-ccm .ccm-top-cut-warning{margin-left:190px!important;font-size:10px!important;}
.technician-ccm .ccm-top-cut-notes textarea{font:400 13px/1.35 Arial,Helvetica,sans-serif!important;height:52px;min-height:52px!important;max-height:360px!important;resize:vertical!important;overflow-y:auto!important;}
.technician-ccm .ccm-top-upload-progress{margin:6px 0 6px 190px!important;max-width:calc(100% - 190px);height:24px!important;border-radius:5px!important;}
.technician-ccm .ccm-top-upload-progress .progress-bar-label{font-size:11px!important;}
.technician-ccm .ccm-setup-action-select{width:110px!important;min-width:110px!important;max-width:110px!important;height:26px!important;min-height:26px!important;font:400 11px/1.2 Arial,Helvetica,sans-serif!important;}
.technician-ccm .ccm-setup-action-done,.technician-ccm .ccm-top-complete{height:26px!important;font:400 11px/1.2 Arial,Helvetica,sans-serif!important;}

/* Technician notification bell */
.technician-ccm .tech-notify-wrap{position:relative;display:flex;align-items:center;}
.technician-ccm .tech-notify-btn{position:relative;display:flex;align-items:center;justify-content:center;width:32px;height:30px;padding:0;border:0!important;border-radius:0;background:transparent!important;color:#fff;box-shadow:none!important;cursor:pointer;appearance:none;-webkit-appearance:none;}
.technician-ccm .tech-notify-btn:hover{background:rgba(255,255,255,.12)!important;}
.technician-ccm .tech-notify-icon{width:18px;height:18px;display:block;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;}
.technician-ccm .tech-notify-count{position:absolute;top:-1px;right:-2px;min-width:16px;height:16px;padding:0 4px;border-radius:10px;background:#d72638;color:#fff;font:700 10px/16px Arial,Helvetica,sans-serif;text-align:center;box-sizing:border-box;}
.technician-ccm .tech-notify-menu{position:absolute;right:0;top:32px;width:260px;z-index:120;background:#fff;border:1px solid #9bb7c4;box-shadow:0 4px 14px rgba(0,0,0,.18);color:#111;}
.technician-ccm .tech-notify-title{padding:8px 10px;font:700 12px Arial,Helvetica,sans-serif;border-bottom:1px solid #d7e2e7;background:#eef6f9;}
.technician-ccm .tech-notify-item{width:100%;display:flex;justify-content:space-between;align-items:center;gap:10px;border:0;border-bottom:1px solid #e5ecef;background:#fff;padding:8px 10px;text-align:left;font:400 12px Arial,Helvetica,sans-serif;cursor:pointer;}
.technician-ccm .tech-notify-item:hover{background:#f3f8fa;}
.technician-ccm .tech-notify-item b{min-width:20px;text-align:center;border-radius:10px;background:#e8f1f5;padding:1px 6px;font-size:11px;}
.technician-ccm .tech-notify-empty{padding:10px;font:400 12px Arial,Helvetica,sans-serif;color:#666;}

/* QA dual-role profile — same ClearComm shell as Technician, QA-specific queues */
.qa-ccm .qa-hidden-tabs{display:none!important}
.qa-ccm .tech-main{align-items:stretch}
.qa-ccm .tech-workspace{min-height:calc(100vh - 170px)}
.qa-ccm .tech-content{min-width:0}
.qa-ccm .tech-right-tools{flex:0 0 250px}
.qa-ccm .tech-task-menu button{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%}
.qa-ccm #panel-queue>.card,.qa-ccm #panel-new>.card,.qa-ccm #panel-assigned>.card,.qa-ccm #panel-reviewed>.card{margin:0}

/* QA Production/QC menu + working Check Tasks dropdown */
.qa-ccm .qa-menu-section-label{padding:5px 10px 3px;color:#5f6f78;font:700 9px Arial,Helvetica,sans-serif;text-transform:uppercase;letter-spacing:.04em;background:#eef6df;border-bottom:1px solid #d6e8bd}
.qa-ccm .tech-task-menu-wrap{width:100%;position:relative}
.qa-ccm .tech-check-tasks-btn{display:flex;align-items:center;justify-content:space-between;gap:8px}
.qa-ccm .tech-check-tasks-btn span{font-size:8px;transition:transform .15s ease}
.qa-ccm .tech-check-tasks-btn.is-open span{transform:rotate(180deg)}
.qa-ccm .tech-task-menu{margin-top:6px;border:1px solid #cfd6dc;background:#fff;box-shadow:0 4px 12px rgba(15,39,71,.08);position:relative;z-index:20}
.qa-ccm .tech-task-menu.hidden{display:none!important}
.qa-ccm .tech-task-menu button{width:100%;display:flex;align-items:center;justify-content:space-between;gap:8px;border:0;border-bottom:1px solid #e7ebef;background:#fff;color:#24384c;text-align:left;padding:8px 10px;font:600 11px Arial,Helvetica,sans-serif;cursor:pointer}
.qa-ccm .tech-task-menu button:last-child{border-bottom:0}
.qa-ccm .tech-task-menu button:hover{background:#f4f8fb}
.qa-ccm .tech-task-count{display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:20px;padding:0 6px;border-radius:10px;background:#e8edf3;color:#173d59;font:700 11px Arial,Helvetica,sans-serif;line-height:20px}

/* QA and Manager topbar: identical to Technician. QA pages carry .technician-ccm
   and Manager is listed next to Technician in its header rules, so the blue bar,
   wordmark, search, welcome and Log out come from there. Only their bell is the
   general notification bell, so it gets the Technician bell's look here.
   Manager's "Welcome, name" is a button that opens the profile (until the
   Manager menu bar with View > Profile exists). */
body.is-manager .manager-welcome{border:0;background:transparent;padding:4px 0;cursor:pointer}
body.is-manager .manager-welcome:hover{text-decoration:underline}
/* Phones: the Manager header keeps everything on one row (smaller name, long names shortened). */
@media(max-width:620px){body.is-manager .brand-wordmark{font-size:18px;gap:4px}body.is-manager .manager-welcome{max-width:34vw;overflow:hidden;text-overflow:ellipsis}}
.qa-ccm .topbar .notif-wrap,body.is-manager .topbar .notif-wrap{margin-right:0}
.qa-ccm .topbar .notif-bell,body.is-manager .topbar .notif-bell{width:32px;height:30px;padding:0;border:0!important;border-radius:0;background:transparent!important;color:#fff!important;box-shadow:none!important}
.qa-ccm .topbar .notif-bell:hover,body.is-manager .topbar .notif-bell:hover{background:rgba(255,255,255,.12)!important;color:#fff!important}
.qa-ccm .topbar .notif-bell svg,body.is-manager .topbar .notif-bell svg{width:18px;height:18px;stroke-width:1.8}
.qa-ccm .topbar .notif-badge,body.is-manager .topbar .notif-badge{top:-1px;right:-2px;min-width:16px;height:16px;padding:0 4px;font:700 10px/16px Arial,Helvetica,sans-serif;background:#d72638;border:0;box-sizing:border-box}

/* Technician Re-Cut acceptance + history - 2026-10-13 */
.ccm-recut-panel{margin:10px 12px 12px;border:1px solid #8bb8d1;border-left:5px solid #0d67b7;border-radius:5px;background:#f8fcff;box-shadow:0 1px 2px rgba(20,65,92,.08);font:13px Arial,Helvetica,sans-serif;color:#18384f}
.ccm-recut-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;padding:9px 12px;background:#e8f4fb;border-bottom:1px solid #bcd8e7}
.ccm-recut-head strong{display:block;font-size:13px;color:#0a3550}.ccm-recut-head span{display:block;margin-top:2px;font-size:11px;color:#607d90}
.ccm-recut-status{flex:0 0 auto;padding:4px 8px;border-radius:12px;background:#fff4d8;border:1px solid #ebc56b;font-weight:700;font-size:11px;color:#805a00}
.ccm-recut-body{padding:10px 12px}.ccm-recut-line{display:grid;grid-template-columns:110px 1fr;gap:8px;margin:4px 0}.ccm-recut-line>span,.ccm-recut-note>span{font-weight:700;color:#496578}
.ccm-recut-note{display:grid;grid-template-columns:110px 1fr;gap:8px;margin-top:7px}.ccm-recut-note>div{min-height:34px;padding:7px 9px;border:1px solid #b8d3e2;border-radius:4px;background:#fff;line-height:1.4;white-space:pre-wrap}
.ccm-recut-accept{margin:10px 0 0 118px}
.ccm-recut-history{margin:12px 0 4px;border:1px solid #b8cfdd;background:#fff}.ccm-recut-history-in-rejects{margin:0 0 10px}.ccm-recut-history-title{padding:6px 8px;background:#dff0fa;border-bottom:1px solid #b8cfdd;font:700 12px Arial,Helvetica,sans-serif;color:#173d59}
.ccm-recut-history-scroll{overflow-x:auto}.ccm-recut-history table{width:100%;min-width:1480px;border-collapse:collapse;font:11px Arial,Helvetica,sans-serif}.ccm-recut-history th{padding:6px 7px;text-align:left;white-space:nowrap;background:#f1f6f9;color:#34566c;border-bottom:1px solid #c8d9e3}.ccm-recut-history td{padding:7px;border-bottom:1px solid #dce7ed;vertical-align:top;color:#253f50}.ccm-recut-history tr.is-open td{background:#fff9e8}.ccm-recut-history-note{min-width:220px;white-space:normal}.ccm-recut-history small{color:#718797}.ccm-recut-legacy{color:#8799a5;font-style:italic;white-space:nowrap}.ccm-recut-resolution{display:inline-block;padding:2px 6px;border-radius:10px;background:#e3f5e9;color:#176533;font-weight:700}.ccm-recut-resolution.is-open{background:#fff0cc;color:#805a00}
@media(max-width:640px){.ccm-recut-head{display:block}.ccm-recut-status{display:inline-block;margin-top:7px}.ccm-recut-line,.ccm-recut-note{grid-template-columns:1fr}.ccm-recut-accept{margin-left:0;width:100%}.ccm-recut-panel{margin-left:6px;margin-right:6px}}

/* Technician viewport-fit pass - 2026-10-16 */
.technician-ccm .tech-bottom-dock{width:100%!important;max-width:100%!important;margin-right:0!important;min-width:0!important;box-sizing:border-box!important}
.technician-ccm .tech-bottom-toolbar,.technician-ccm .tech-bottom-panel{max-width:100%!important;min-width:0!important;box-sizing:border-box!important}
.technician-ccm .ccm-recut-history{max-width:100%;min-width:0;overflow:hidden}
.technician-ccm .ccm-recut-history-scroll{width:100%;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
.technician-ccm .ccm-recut-history table{width:100%!important;min-width:0!important;table-layout:fixed!important;font-size:10px!important}
.technician-ccm .ccm-recut-history th{padding:5px 4px!important;white-space:normal!important;line-height:1.15!important;overflow-wrap:anywhere}
.technician-ccm .ccm-recut-history td{padding:6px 4px!important;line-height:1.2!important;overflow-wrap:anywhere;word-break:break-word}
.technician-ccm .ccm-recut-history th:nth-child(1),.technician-ccm .ccm-recut-history td:nth-child(1){width:3.5%}
.technician-ccm .ccm-recut-history th:nth-child(2),.technician-ccm .ccm-recut-history td:nth-child(2){width:6%}
.technician-ccm .ccm-recut-history th:nth-child(3),.technician-ccm .ccm-recut-history td:nth-child(3){width:7.5%}
.technician-ccm .ccm-recut-history th:nth-child(4),.technician-ccm .ccm-recut-history td:nth-child(4){width:7.5%}
.technician-ccm .ccm-recut-history th:nth-child(5),.technician-ccm .ccm-recut-history td:nth-child(5){width:7.5%}
.technician-ccm .ccm-recut-history th:nth-child(6),.technician-ccm .ccm-recut-history td:nth-child(6){width:7.5%}
.technician-ccm .ccm-recut-history th:nth-child(7),.technician-ccm .ccm-recut-history td:nth-child(7){width:7.5%}
.technician-ccm .ccm-recut-history th:nth-child(8),.technician-ccm .ccm-recut-history td:nth-child(8){width:7.5%}
.technician-ccm .ccm-recut-history th:nth-child(9),.technician-ccm .ccm-recut-history td:nth-child(9){width:22%}
.technician-ccm .ccm-recut-history th:nth-child(10),.technician-ccm .ccm-recut-history td:nth-child(10){width:10%}
.technician-ccm .ccm-recut-history th:nth-child(11),.technician-ccm .ccm-recut-history td:nth-child(11){width:13%}
.technician-ccm .ccm-recut-history-note{min-width:0!important}
.technician-ccm .ccm-recut-legacy{white-space:normal!important}
@media(max-width:1100px){.technician-ccm .ccm-recut-history table{min-width:980px!important}}
@media(max-width:760px){.technician-ccm .ccm-recut-history table{min-width:900px!important}}
