/* Report Generator — light theme */
:root {
  --rg-primary: #0E53BE;
  --rg-primary-dark: #0A3F92;
  --rg-navy: #142149;
  --rg-soft: #F2F5FE;
  --rg-bg: #FFFFFF;
  --rg-fg: #142149;
  --rg-muted: #6B7A99;
  --rg-surface: #FFFFFF;
  --rg-surface-2: #F2F5FE;
  --rg-border: #E3EAF7;
  --rg-border-strong: #C9D5EE;
  --rg-danger: #D64545;
  --rg-success: #1F9D55;
  --rg-ring: rgba(14, 83, 190, 0.25);
  --rg-shadow: 0 1px 2px rgba(20,33,73,.05), 0 12px 32px -14px rgba(20,33,73,.18);
  --rg-radius: 14px;
  --rg-radius-sm: 10px;
  --rg-radius-lg: 20px;
  --rg-gap: 20px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; min-height: 100vh;
  background: var(--rg-soft); color: var(--rg-fg);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body {
  background:
    radial-gradient(1200px 600px at 90% -10%, rgba(14,83,190,.10), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(14,83,190,.06), transparent 60%),
    var(--rg-soft);
}

.rg-shell {
  display: block; padding: var(--rg-gap); min-height: 100vh;
  max-width: 1500px; margin: 0 auto;
}
.rg-inline-tool { min-width: 220px; }
.rg-template-label { font-size: 13.5px; font-weight: 600; color: var(--rg-navy); margin-right: 4px; }
.rg-logo-inline { cursor: pointer; }
.rg-logo-inline {
  cursor: pointer;
  background-color: #000000 !important;
  color: #ffffff !important;
  border-color: #000000 !important;
}
.rg-logo-inline:hover {
  background-color: #000000 !important;
  color: #ffffff !important;
  border-color: #000000 !important;
}
.rg-logo-inline #logoName { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rg-head-right { display: flex; align-items: center; gap: 12px; }
.rg-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--rg-soft); border: 1px solid var(--rg-border);
  color: var(--rg-primary); cursor: pointer; transition: background .15s, border-color .15s;
}
.rg-icon-btn:hover { background: var(--rg-bg); border-color: var(--rg-border-strong); }

/* Compact transcript surface + expand toggle */
.rg-surface-compact { min-height: 0 !important; }
.rg-surface-compact .rg-transcript { min-height: 140px; max-height: 180px; padding: 18px 24px; font-size: 15px; line-height: 1.6; }
.rg-surface-compact.is-expanded .rg-transcript { min-height: 380px; max-height: 60vh; }

/* Report Generator — light theme */
:root {
  --rg-primary: #0E53BE;
  --rg-primary-dark: #0A3F92;
  --rg-navy: #142149;
  --rg-soft: #F2F5FE;
  --rg-bg: #FFFFFF;
  --rg-fg: #142149;
  --rg-muted: #6B7A99;
  --rg-surface: #FFFFFF;
  --rg-surface-2: #F2F5FE;
  --rg-border: #E3EAF7;
  --rg-border-strong: #C9D5EE;
  --rg-danger: #D64545;
  --rg-success: #1F9D55;
  --rg-ring: rgba(14, 83, 190, 0.25);
  --rg-shadow: 0 1px 2px rgba(20,33,73,.05), 0 12px 32px -14px rgba(20,33,73,.18);
  --rg-radius: 14px;
  --rg-radius-sm: 10px;
  --rg-radius-lg: 20px;
  --rg-gap: 20px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; min-height: 100vh;
  background: var(--rg-soft); color: var(--rg-fg);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body {
  background:
    radial-gradient(1200px 600px at 90% -10%, rgba(14,83,190,.10), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(14,83,190,.06), transparent 60%),
    var(--rg-soft);
}

.rg-shell {
  display: block; padding: var(--rg-gap); min-height: 100vh;
  max-width: 1500px; margin: 0 auto;
}
.rg-inline-tool { min-width: 220px; }
.rg-template-label { font-size: 13.5px; font-weight: 600; color: var(--rg-navy); margin-right: 4px; }
.rg-logo-inline { cursor: pointer; }
.rg-logo-inline {
  cursor: pointer;
  background-color: #000000 !important;
  color: #ffffff !important;
  border-color: #000000 !important;
}
.rg-logo-inline:hover {
  background-color: #000000 !important;
  color: #ffffff !important;
  border-color: #000000 !important;
}
.rg-logo-inline #logoName { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rg-head-right { display: flex; align-items: center; gap: 12px; }
.rg-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--rg-soft); border: 1px solid var(--rg-border);
  color: var(--rg-primary); cursor: pointer; transition: background .15s, border-color .15s;
}
.rg-icon-btn:hover { background: var(--rg-bg); border-color: var(--rg-border-strong); }

/* Compact transcript surface + expand toggle */
.rg-surface-compact { min-height: 0 !important; }
.rg-surface-compact .rg-transcript { min-height: 140px; max-height: 180px; padding: 18px 24px; font-size: 15px; line-height: 1.6; }
.rg-surface-compact.is-expanded .rg-transcript { min-height: 380px; max-height: 60vh; }

/* Generated report output box */
.rg-report-output {
  margin-top: 18px; background: var(--rg-surface);
  border: 1px solid var(--rg-border); border-radius: var(--rg-radius-lg);
  box-shadow: var(--rg-shadow); overflow: hidden;
}
.rg-report-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  background: #ffffff;
  border-bottom: 1px solid var(--rg-border);
}
.rg-report-body {
  height: 460px; overflow-y: auto; padding: 20px 32px;
  font-size: 15px; line-height: 1.75; color: var(--rg-navy);
  outline: none; white-space: pre-wrap; background: #fff;
}
.rg-report-body:empty::before { content: attr(data-placeholder); color: var(--rg-muted); pointer-events: none; }
.rg-report-body::-webkit-scrollbar { width: 10px; }
.rg-report-body::-webkit-scrollbar-track { background: var(--rg-soft); }
.rg-report-body::-webkit-scrollbar-thumb { background: var(--rg-border-strong); border-radius: 8px; border: 2px solid var(--rg-soft); }
.rg-report-body::-webkit-scrollbar-thumb:hover { background: var(--rg-primary); }
.rg-report-body { scrollbar-color: var(--rg-border-strong) var(--rg-soft); scrollbar-width: thin; }

/* Sidebar */
.rg-sidebar {
  display: flex; flex-direction: column; gap: 16px; padding: 22px;
  background: var(--rg-surface); border: 1px solid var(--rg-border);
  border-radius: var(--rg-radius-lg); box-shadow: var(--rg-shadow);
  height: fit-content; position: sticky; top: var(--rg-gap);
}
.rg-brand {
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 16px; border-bottom: 1px solid var(--rg-border);
}
.rg-brand-mark {
  width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(135deg, var(--rg-primary), var(--rg-navy));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
}
.rg-brand-name { font-family: "Sora","Inter",sans-serif; font-weight: 700; letter-spacing: -0.01em; color: var(--rg-navy); }
.rg-brand-sub { font-size: 12px; color: var(--rg-muted); }

.rg-panel { display: flex; flex-direction: column; gap: 10px; }
.rg-panel-mini { gap: 12px; padding-top: 6px; border-top: 1px solid var(--rg-border); }
.rg-panel-head { display: flex; align-items: center; justify-content: space-between; }
.rg-panel-title {
  font-size: 11px; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--rg-muted);
}
.rg-field-label { font-size: 12px; color: var(--rg-muted); margin-bottom: -4px; }

.rg-select {
  appearance: none; width: 100%; padding: 11px 36px 11px 14px;
  border-radius: var(--rg-radius-sm); border: 1px solid var(--rg-border-strong);
  background: var(--rg-bg); color: var(--rg-fg); font: inherit;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--rg-muted) 50%),
    linear-gradient(-45deg, transparent 50%, var(--rg-muted) 50%);
  background-position: right 16px center, right 11px center;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
  transition: border-color .15s, box-shadow .15s;
}
.rg-select:focus { outline: none; border-color: var(--rg-primary); box-shadow: 0 0 0 4px var(--rg-ring); }
.rg-select-inline { width: auto; padding: 6px 28px 6px 10px; font-size: 13.5px; }
.rg-hint { font-size: 12px; color: var(--rg-muted); line-height: 1.5; }

/* Logo */
.rg-logo-drop {
  display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: center;
  padding: 14px; border: 1px dashed var(--rg-border-strong);
  border-radius: var(--rg-radius); background: var(--rg-bg);
  transition: border-color .15s, background .15s;
}
.rg-logo-drop:focus, .rg-logo-drop.is-drag {
  outline: none; border-color: var(--rg-primary); background: var(--rg-soft);
}
.rg-logo-preview {
  width: 64px; height: 64px; border-radius: 12px;
  background: var(--rg-soft); display: flex; align-items: center; justify-content: center;
  overflow: hidden; border: 1px solid var(--rg-border);
}
.rg-logo-preview img { width: 100%; height: 100%; object-fit: contain; }
.rg-logo-placeholder { font-size: 11px; font-weight: 700; letter-spacing: 0.14em; color: var(--rg-muted); }
.rg-logo-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px; color: var(--rg-navy); }
.rg-logo-hint { font-size: 11px; color: var(--rg-muted); margin-top: 2px; }
.rg-logo-actions { display: flex; gap: 6px; margin-top: 8px; }

/* Switch */
.rg-meta-row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--rg-navy); }
.rg-switch { position: relative; display: inline-block; width: 34px; height: 20px; }
.rg-switch input { opacity: 0; width: 0; height: 0; }
.rg-switch span {
  position: absolute; inset: 0; background: var(--rg-soft);
  border: 1px solid var(--rg-border-strong); border-radius: 999px; transition: background .18s;
}
.rg-switch span::before {
  content: ""; position: absolute; width: 14px; height: 14px; border-radius: 50%;
  background: var(--rg-bg); border: 1px solid var(--rg-border-strong);
  top: 50%; left: 2px; transform: translateY(-50%); transition: left .18s;
}
.rg-switch input:checked + span { background: var(--rg-primary); border-color: var(--rg-primary); }
.rg-switch input:checked + span::before { left: 17px; border-color: transparent; }

/* Main */
.rg-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.rg-topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.rg-eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--rg-primary); }
.rg-title { font-family: "Sora","Inter",sans-serif; font-size: clamp(24px, 2.4vw, 32px); font-weight: 700; letter-spacing: -0.02em; margin: 4px 0 0; color: var(--rg-navy); }
.rg-topbar-meta { display: flex; gap: 8px; flex-wrap: wrap; }

.rg-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px;
  border-radius: 999px; font-size: 12px; font-weight: 500;
  background: var(--rg-surface); border: 1px solid var(--rg-border); color: var(--rg-navy);
}
.rg-chip-quiet { color: var(--rg-muted); }
.rg-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rg-muted); }
.rg-chip.is-live .rg-dot { background: var(--rg-danger); animation: rg-pulse 1.2s infinite; }
.rg-chip.is-live { border-color: rgba(214,69,69,.35); }
.rg-chip.is-processing .rg-dot { background: var(--rg-primary); animation: rg-pulse 1s infinite; }
@keyframes rg-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(214,69,69,.4); }
  50% { box-shadow: 0 0 0 6px rgba(214,69,69,0); }
}

/* Toolbar */
.rg-toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between;
  padding: 14px; background: var(--rg-surface); border: 1px solid var(--rg-border);
  border-radius: var(--rg-radius); box-shadow: var(--rg-shadow);
  align-items: center;
}
.rg-toolbar-group { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.rg-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px;
  border-radius: 10px; border: 1px solid var(--rg-border);
  font: inherit; font-weight: 500; font-size: 13.5px; cursor: pointer;
  transition: transform .06s, background .15s, border-color .15s, box-shadow .15s, opacity .15s;
  background: var(--rg-bg); color: var(--rg-navy);
}
.rg-btn:hover { border-color: var(--rg-border-strong); background: var(--rg-soft); }
.rg-btn:active { transform: translateY(1px); }
.rg-btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--rg-ring); }
.rg-btn[disabled] { opacity: .5; cursor: not-allowed; }

.rg-btn-primary {
  background: var(--rg-primary); color: #fff; border-color: transparent;
  box-shadow: 0 8px 22px -10px rgba(14,83,190,.6);
}
.rg-btn-primary:hover { background: var(--rg-primary-dark); border-color: transparent; }

.rg-btn-danger {
  background: #FDECEC; color: #A32626; border-color: rgba(214,69,69,.35);
}
.rg-btn-danger:not([disabled]):hover { background: #F9D9D9; border-color: rgba(214,69,69,.55); }

.rg-btn-outline { background: transparent; border-color: var(--rg-border-strong); color: var(--rg-navy); }
.rg-btn-outline:hover { background: var(--rg-soft); }
.rg-btn-outline-secondary { background: transparent; border-color: var(--rg-border-strong); color: var(--rg-muted); }
.rg-btn-outline-secondary:hover { background: var(--rg-soft); color: var(--rg-navy); }
.rg-btn-light { background: var(--rg-surface-2); border-color: var(--rg-border); color: var(--rg-navy); }
.rg-btn-light:hover { background: var(--rg-soft); border-color: var(--rg-border-strong); }
.rg-btn-ghost { background: transparent; border-color: transparent; color: var(--rg-muted); }
.rg-btn-ghost:hover { color: var(--rg-navy); background: var(--rg-soft); }
.rg-btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.rg-btn-icon { display: inline-flex; width: 16px; height: 16px; align-items: center; justify-content: center; font-size: 10px; line-height: 1; }

.rg-link-btn {
  background: none; border: none; color: var(--rg-primary); font: inherit;
  font-weight: 500; font-size: 13px; cursor: pointer; padding: 4px 6px; border-radius: 6px;
}
.rg-link-btn:hover { background: rgba(14,83,190,.08); }

/* Surface */
.rg-surface {
  background: var(--rg-surface); border: 1px solid var(--rg-border);
  border-radius: var(--rg-radius-lg); box-shadow: var(--rg-shadow);
  overflow: hidden; display: flex; flex-direction: column; min-height: 520px;
}
#templatesView .rg-surface {
  padding: 24px 28px;
}
.rg-surface-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 24px; border-bottom: 1px solid var(--rg-border); background: #fff;
}
.rg-surface-title { font-family: "Sora","Inter",sans-serif; font-weight: 600; letter-spacing: -0.01em; font-size: 16px; color: var(--rg-navy); }
.rg-surface-sub { font-size: 12.5px; color: var(--rg-muted); margin-top: 2px; }

.rg-waves { display: flex; align-items: center; gap: 3px; height: 26px; }
.rg-waves span {
  display: block; width: 3px; height: 30%; border-radius: 2px;
  background: var(--rg-border-strong); transition: background .2s;
}
.rg-waves.is-live span { background: var(--rg-primary); animation: rg-wave 1s ease-in-out infinite; }
.rg-waves span:nth-child(1) { animation-delay: 0s; }
.rg-waves span:nth-child(2) { animation-delay: .08s; }
.rg-waves span:nth-child(3) { animation-delay: .16s; }
.rg-waves span:nth-child(4) { animation-delay: .24s; }
.rg-waves span:nth-child(5) { animation-delay: .32s; }
.rg-waves span:nth-child(6) { animation-delay: .40s; }
.rg-waves span:nth-child(7) { animation-delay: .48s; }
.rg-waves span:nth-child(8) { animation-delay: .56s; }
.rg-waves span:nth-child(9) { animation-delay: .64s; }
.rg-waves span:nth-child(10) { animation-delay: .72s; }
@keyframes rg-wave { 0%,100% { height: 20%; } 50% { height: 100%; } }

.rg-transcript {
  flex: 1; padding: 28px 32px; font-size: 16px; line-height: 1.75;
  min-height: 380px; outline: none; overflow: auto; white-space: pre-wrap;
  caret-color: var(--rg-primary); color: var(--rg-navy); background: #fff;
}
.rg-transcript:empty::before {
  content: attr(data-placeholder); color: var(--rg-muted); pointer-events: none;
}
.rg-transcript .rg-interim { color: var(--rg-muted); font-style: italic; }
.rg-transcript h3.rg-heading {
  font-family: "Sora","Inter",sans-serif; font-size: 13px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--rg-primary);
  margin: 24px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--rg-border);
}

.rg-surface-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 20px; border-top: 1px solid var(--rg-border); background: var(--rg-soft);
}
.rg-legend { display: flex; gap: 16px; font-size: 12px; color: var(--rg-muted); }
.rg-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.rg-legend-item i { width: 10px; height: 10px; border-radius: 2px; }
.rg-legend-final { background: var(--rg-navy); }
.rg-legend-interim { background: transparent; border: 1px dashed var(--rg-border-strong); }
.rg-foot-actions { display: flex; gap: 6px; align-items: center; margin-left: auto; }

/* Generate report button (near text area) */
.rg-generate-btn {
  background: var(--rg-primary); color: #fff; border: none;
  padding: 8px 16px; border-radius: 8px; font-weight: 600; font-size: 13px;
  cursor: pointer; box-shadow: 0 6px 18px -8px rgba(14,83,190,.55);
  display: inline-flex; align-items: center; gap: 8px;
}
.rg-generate-btn:hover { background: var(--rg-primary-dark); }
.rg-generate-btn[disabled] { opacity: .55; cursor: not-allowed; }
.rg-generate-btn.is-generating { background: var(--rg-primary-dark); }

.rg-report-banner {
  display: none; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 20px 12px; padding: 10px 14px;
  background: var(--rg-soft); border: 1px solid var(--rg-border);
  border-left: 3px solid var(--rg-primary); border-radius: 10px;
  font-size: 13px; color: var(--rg-navy);
}
.rg-report-banner.is-visible { display: flex; }
.rg-report-banner.is-success { border-left-color: var(--rg-success); }
.rg-report-banner.is-cancelled { border-left-color: var(--rg-danger); }

@media print {
  body { background: #fff; }
  .rg-sidebar, .rg-toolbar, .rg-surface-head, .rg-surface-foot { display: none !important; }
  .rg-shell { grid-template-columns: 1fr; padding: 0; }
  .rg-surface { border: none; box-shadow: none; }
}

/* Templates Dashboard */
.rg-tbl-label { font-size: 13px; color: var(--rg-muted); font-weight: 500; white-space: nowrap; }
#tplSearch, #tplName, #templateName { background-image: none; padding-right: 14px; }
#tplSearch { width: 220px; }
.rg-table-wrap { border: 1px solid var(--rg-border); border-radius: var(--rg-radius-sm); overflow-x: auto; }
.rg-table { width: 100%; border-collapse: collapse; background: var(--rg-surface); }
.rg-table thead th {
  background: var(--rg-surface-2); color: var(--rg-navy);
  font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  font-weight: 600; padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--rg-border);
}
.rg-table tbody td { padding: 14px 16px; border-bottom: 1px solid var(--rg-border); font-size: 14px; color: var(--rg-fg); vertical-align: middle; }
.rg-table tbody tr:last-child td { border-bottom: none; }
.rg-table tbody tr:hover { background: var(--rg-surface-2); }
.rg-badge {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: .02em;
}
.rg-badge-info { background: var(--rg-soft); color: var(--rg-primary); border: 1px solid var(--rg-border-strong); }
.rg-badge-muted { background: var(--rg-surface-2); color: var(--rg-muted); border: 1px solid var(--rg-border); }
.rg-btn-sm { padding: 6px 12px; font-size: 12px; }
.rg-pagination { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0; }
.rg-page-btn {
  min-width: 34px; height: 34px; padding: 0 10px;
  border-radius: 8px; border: 1px solid var(--rg-border);
  background: var(--rg-surface); color: var(--rg-fg); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all .15s ease;
}
.rg-page-btn:hover:not(:disabled):not(.is-active) { background: var(--rg-surface-2); border-color: var(--rg-border-strong); }
.rg-page-btn.is-active { background: var(--rg-primary); color: #fff; border-color: var(--rg-primary); }
.rg-page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* Template form editor */
.rg-editor { border: 1px solid var(--rg-border-strong); border-radius: var(--rg-radius-sm); overflow: hidden; background: var(--rg-bg); }
.rg-editor-toolbar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  padding: 8px 10px; background: var(--rg-surface-2);
  border-bottom: 1px solid var(--rg-border);
}
.rg-editor-toolbar .btn-group { display: inline-flex; gap: 2px; }
.rg-ed-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 32px; padding: 0 8px;
  border: 1px solid transparent; background: transparent; color: var(--rg-navy);
  border-radius: 6px; cursor: pointer; font-size: 14px; font-family: inherit;
}
.rg-ed-btn:hover { background: var(--rg-bg); border-color: var(--rg-border); }
.rg-ed-btn:active { background: var(--rg-soft); }
.rg-ed-select {
  height: 32px; padding: 0 26px 0 10px; font-size: 13px; font-family: inherit;
  border: 1px solid var(--rg-border); border-radius: 6px; background: var(--rg-bg);
  color: var(--rg-navy); cursor: pointer;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--rg-muted) 50%),
    linear-gradient(-45deg, transparent 50%, var(--rg-muted) 50%);
  background-position: right 12px center, right 7px center;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; appearance: none;
}
.rg-ed-sep { width: 1px; height: 22px; background: var(--rg-border); margin: 0 4px; }
.rg-editor-body {
  min-height: 340px; max-height: 60vh; overflow-y: auto;
  padding: 20px 24px; outline: none; font-size: 14.5px; line-height: 1.7;
  color: var(--rg-navy); background: var(--rg-bg);
}
.rg-editor-body:empty::before { content: attr(data-placeholder); color: var(--rg-muted); }
.rg-editor-body h2, .rg-editor-body h3, .rg-editor-body h4 {
  font-family: "Sora","Inter",sans-serif; color: var(--rg-navy);
  margin: 16px 0 8px; font-weight: 700; letter-spacing: -0.01em;
}
.rg-editor-body h2 { font-size: 18px; } .rg-editor-body h3 { font-size: 15px; } .rg-editor-body h4 { font-size: 14px; }
.rg-editor-body p { margin: 0 0 10px; }
.rg-editor-body blockquote {
  margin: 10px 0; padding: 8px 14px; border-left: 3px solid var(--rg-primary);
  background: var(--rg-soft); color: var(--rg-navy);
}
.rg-editor-body .rg-ed-table, .rg-editor-body table {
  border-collapse: collapse; margin: 10px 0; width: 100%;
}
.rg-editor-body th, .rg-editor-body td {
  border: 1px solid var(--rg-border-strong); padding: 6px 10px; font-size: 13px;
}
.rg-editor-body th { background: var(--rg-surface-2); }

/* Auth Pages */
.auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}
.auth-card {
  background: #ffffff;
  border: 1px solid var(--rg-border);
  border-radius: var(--rg-radius-lg);
  box-shadow: var(--rg-shadow);
  width: 100%;
  max-width: 480px;
  padding: 40px;
  text-align: center;
}
.auth-title {
  font-family: "Sora", "Inter", sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--rg-navy);
  margin-bottom: 8px;
}
.auth-desc {
  font-size: 13.5px;
  color: var(--rg-muted);
  line-height: 1.5;
  margin-bottom: 24px;
}
.auth-form {
  text-align: left;
}
.auth-group {
  margin-bottom: 18px;
}
.auth-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.auth-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--rg-navy);
}
.auth-link-sm {
  font-size: 12px;
  color: var(--rg-primary);
  text-decoration: none;
  font-weight: 600;
}
.auth-link-sm:hover {
  text-decoration: underline;
}
.auth-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--rg-radius-sm);
  border: 1px solid var(--rg-border-strong);
  background: var(--rg-bg);
  color: var(--rg-fg);
  font: inherit;
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.auth-input:focus {
  outline: none;
  border-color: var(--rg-primary);
  box-shadow: 0 0 0 4px var(--rg-ring);
}
.auth-btn {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: none;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  color: #ffffff;
  background: #0E53BE;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(14, 83, 190, 0.2);
  transition: opacity .15s, transform .15s;
}
.auth-btn:hover {
  opacity: 0.95;
}
.auth-btn:active {
  transform: scale(0.99);
}
.auth-footer {
  margin-top: 20px;
  font-size: 13px;
  color: var(--rg-muted);
  text-align: center;
}
.auth-footer a {
  color: var(--rg-primary);
  text-decoration: none;
  font-weight: 600;
}
.auth-footer a:hover {
  text-decoration: underline;
}

/* Global Header */
.rg-global-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rg-border);
  box-shadow: 0 1px 2px rgba(20,33,73,.02);
}
.rg-header-inner {
  max-width: 1500px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.rg-logo-text {
  font-family: "Sora", "Inter", sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--rg-navy);
}
.rg-user-menu {
  position: relative;
}
.rg-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--rg-radius-sm);
  border: 1px solid var(--rg-border-strong);
  background: var(--rg-bg);
  color: var(--rg-navy);
  font: inherit;
  font-weight: 500;
  font-size: 13.5px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.rg-user-btn:hover {
  background: var(--rg-soft);
  border-color: var(--rg-border-strong);
}
.rg-user-arrow {
  font-size: 10px;
  color: var(--rg-muted);
}
.rg-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 170px;
  background: #ffffff;
  border: 1px solid var(--rg-border-strong);
  border-radius: var(--rg-radius-sm);
  box-shadow: var(--rg-shadow);
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.rg-user-dropdown a {
  display: block;
  padding: 10px 16px;
  font-size: 13.5px;
  color: var(--rg-navy);
  text-decoration: none;
  transition: background-color .15s;
}
.rg-user-dropdown a:hover {
  background-color: var(--rg-soft);
}
.rg-user-dropdown.d-none {
  display: none !important;
}

/* Modal Backdrop */
.rg-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
.rg-modal-backdrop.d-none {
  display: none !important;
}
/* Modal Dialog */
.rg-modal {
  background: #ffffff;
  border: 1px solid var(--rg-border);
  border-radius: var(--rg-radius-lg);
  box-shadow: var(--rg-shadow);
  width: 100%;
  max-width: 440px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.rg-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--rg-border);
}
.rg-modal-title {
  font-family: "Sora", "Inter", sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--rg-navy);
  margin: 0;
}
.rg-modal-close {
  background: var(--rg-soft);
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--rg-muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}
.rg-modal-close:hover {
  background: var(--rg-border);
  color: var(--rg-navy);
}
.rg-modal-body {
  padding: 24px;
}

/* Admin Portal Page */
.rg-portal-title {
  font-family: "Sora", "Inter", sans-serif;
  font-size: 32px;
  font-weight: 700;
  color: var(--rg-primary);
  margin-bottom: 8px;
}
.rg-portal-sub {
  font-size: 15px;
  color: var(--rg-muted);
  margin-bottom: 24px;
}
.rg-portal-grid {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  max-width: 960px;
  margin: 0 auto;
}
.rg-portal-card {
  background: #ffffff;
  border: 1px solid var(--rg-border);
  border-radius: var(--rg-radius-lg);
  box-shadow: var(--rg-shadow);
  flex: 1;
  min-width: 320px;
  max-width: 440px;
  padding: 40px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}
.rg-portal-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #3B82F6, #8B5CF6);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.rg-portal-card:hover::before {
  opacity: 1;
}
.rg-portal-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 38px -12px rgba(14, 83, 190, 0.18);
  border-color: var(--rg-primary);
}
.rg-portal-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background-color: #F2F5FE !important;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  transition: background-color 0.3s ease;
}
.rg-portal-icon-wrap svg {
  stroke: var(--rg-primary) !important;
  transition: stroke 0.3s ease;
}
.rg-portal-card:hover .rg-portal-icon-wrap {
  background-color: var(--rg-primary) !important;
}
.rg-portal-card:hover .rg-portal-icon-wrap svg {
  stroke: #ffffff !important;
}
.rg-portal-card-title {
  font-family: "Sora", "Inter", sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--rg-primary);
  margin-bottom: 12px;
}
.rg-portal-card-desc {
  font-size: 13.5px;
  color: var(--rg-muted);
  line-height: 1.6;
  margin-bottom: 24px;
  flex-grow: 1;
}
.rg-portal-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--rg-primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.rg-portal-link .rg-arrow {
  display: inline-block;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.rg-portal-card:hover .rg-portal-link .rg-arrow {
  transform: translateX(6px);
}
.rg-portal-card:hover .rg-portal-link {
  text-decoration: underline;
}

/* User Management List Page */
.rg-user-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}
.rg-user-card {
  background: #ffffff;
  border: 1px solid var(--rg-border);
  border-radius: var(--rg-radius);
  box-shadow: var(--rg-shadow);
  padding: 24px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  width: 100%;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.rg-user-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -8px rgba(20,33,73,.12);
}
.rg-user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.rg-user-name {
  font-family: "Sora", "Inter", sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--rg-navy);
  margin: 0;
}
.rg-user-email {
  font-size: 13px;
  background: var(--rg-soft);
  color: var(--rg-muted);
  padding: 4px 10px;
  border-radius: 6px;
  font-family: inherit;
}
.rg-user-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--rg-muted);
  margin-top: 4px;
}
.rg-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.rg-status-dot.approved {
  background: var(--rg-success);
}
.rg-status-dot.rejected {
  background: var(--rg-danger);
}
.rg-user-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.rg-approved-badge {
  font-size: 13px;
  font-weight: 600;
  color: var(--rg-success);
  margin-right: 8px;
}
.rg-approved-badge.rejected {
  color: var(--rg-danger);
}

.rg-container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}
.rg-form-container {
  padding: 24px 28px;
}

/* Responsive Design System */
@media (max-width: 992px) {
  .rg-portal-grid {
    gap: 16px;
  }
}

@media (max-width: 768px) {
  .rg-topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
  .rg-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  .rg-toolbar-group {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
  }
  #recordBtn {
    grid-column: span 2;
    order: 3;
  }
  #clearBtn {
    order: 4;
  }
  .rg-logo-inline {
    order: 5;
  }
  .rg-template-label {
    grid-column: span 2;
    margin-bottom: -4px;
  }
  .template-select-wrap, .template-select-trigger, .rg-inline-tool {
    grid-column: span 2;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
  .rg-toolbar .rg-btn {
    width: 100%;
    justify-content: center;
    margin: 0;
  }
  #startBtn, #stopBtn {
    grid-column: span 1;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    font-size: 12.5px !important;
    padding: 10px 4px !important;
    white-space: nowrap;
  }
  #startBtn .rg-btn-icon, #stopBtn .rg-btn-icon {
    display: none !important;
  }
  #clearBtn:hover {
    background: var(--rg-soft);
  }
  .rg-logo-inline {
    grid-column: span 1;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
  }
  #exportPdfBtn, #exportDocxBtn, #printBtn {
    grid-column: span 1;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
  }
  .rg-user-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
  }
  .rg-user-actions {
    width: 100%;
    justify-content: flex-start;
    border-top: 1px solid var(--rg-border);
    padding-top: 14px;
  }
  .rg-approved-badge {
    margin-right: auto;
  }
  .rg-surface {
    padding: 16px !important;
    border-radius: 12px !important;
  }
  .rg-surface-head {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px;
  }
  .rg-head-right {
    width: 100%;
    justify-content: space-between;
  }
  .rg-surface-foot .rg-foot-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    gap: 8px !important;
  }
  .rg-foot-actions .rg-btn, .rg-foot-actions .rg-generate-btn {
    width: 100% !important;
    margin: 0 !important;
  }
  .rg-report-header {
    justify-content: center !important;
    padding: 10px 14px !important;
    gap: 6px !important;
  }
  .rg-report-header .rg-btn {
    padding: 6px 10px !important;
    font-size: 12px !important;
  }
  .rg-header-inner {
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    padding: 12px 16px !important;
  }
  .rg-logo-text {
    font-size: 15px !important;
    white-space: nowrap;
  }
  .rg-header-right {
    gap: 8px !important;
  }
  .rg-report-banner {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 576px) {
  .rg-global-header {
    padding: 12px 16px;
  }
  .rg-logo-text {
    font-size: 15px;
  }
  .rg-user-btn {
    padding: 6px 12px;
    font-size: 12px;
  }
  #adminBackBtn {
    padding: 6px 10px !important;
    font-size: 12px !important;
  }
  .rg-shell {
    padding: 12px;
  }
  .rg-main {
    gap: 12px;
  }
  .rg-title {
    font-size: 24px;
  }
  .rg-transcript, .rg-report-body {
    padding: 16px 20px;
    font-size: 14.5px;
  }
  .rg-surface-head {
    padding: 16px;
  }
  .auth-card {
    padding: 30px 20px;
    border-radius: var(--rg-radius);
  }
  .auth-title {
    font-size: 20px;
  }
  .rg-portal-title {
    font-size: 24px;
  }
  .rg-portal-card {
    padding: 24px;
    min-width: 100%;
  }
  .rg-portal-icon-wrap {
    margin-bottom: 16px;
  }
  .rg-surface {
    padding: 12px !important;
  }
  .rg-table tbody td {
    padding: 10px 6px !important;
    font-size: 12.5px !important;
  }
  .rg-table thead th {
    padding: 10px 6px !important;
    font-size: 11.5px !important;
  }
  /* Table Actions side-by-side */
  .rg-table td.text-end {
    white-space: nowrap;
  }
  .rg-table td.text-end button {
    display: inline-block !important;
    vertical-align: middle;
    margin: 0 2px;
    padding: 4px 8px !important;
    font-size: 11px !important;
  }
  /* Search / Filters on mobile */
  .rg-tbl-filter-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }
  .rg-tbl-filter-row > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }
  #tplSearch {
    width: 100% !important;
    max-width: 180px;
  }
  .rg-form-container {
    padding: 12px !important;
  }
}


/* ==========================================================================
   AI Medical Report Generator Custom/Integrated Styles
   ========================================================================== */

/* Dropdown Menu Open Trigger */
.rg-user-dropdown {
  display: none !important;
}
.rg-user-dropdown.open {
  display: flex !important;
}
.account-menu {
  position: relative;
}

/* Visualizer Waves active state */
.rg-waves.active span {
  background: var(--rg-primary);
  animation: rg-wave 1s ease-in-out infinite;
}

/* Findings Textarea Adaptation */
textarea#findingsInput.rg-transcript {
  width: 100%;
  border: none;
  resize: vertical;
  background: #fff;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.6;
  outline: none;
  min-height: 140px;
}
textarea#findingsInput.rg-transcript:focus {
  outline: none;
}

.rg-surface-compact.is-expanded textarea#findingsInput.rg-transcript {
  min-height: 380px;
  max-height: 60vh;
}

/* Relative positioning for voice edit banner in report output */
.rg-report-output {
  position: relative;
}

/* Custom Template Dropdown Selector */
.template-select-wrap {
  position: relative;
  width: 250px;
  display: inline-block;
  vertical-align: middle;
}

.template-select-control {
  display: flex;
  width: 100%;
  height: 38px;
}

.template-select-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  height: 38px;
  padding: 8px 12px;
  border-radius: 8px 0 0 8px;
  border: 1px solid var(--rg-border-strong);
  background: white;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--rg-navy);
  cursor: pointer;
  outline: none;
  box-sizing: border-box;
  user-select: none;
}
.template-select-button:hover {
  background: var(--rg-soft);
  border-color: var(--rg-border-strong);
}

.template-search-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 40px;
  width: 40px;
  height: 38px;
  padding: 0;
  border-radius: 0 8px 8px 0;
  border: 1px solid var(--rg-border-strong);
  border-left: none;
  background: white;
  color: var(--rg-muted);
  cursor: pointer;
}
.template-search-button:hover {
  background: var(--rg-soft);
  border-color: var(--rg-border-strong);
}

.template-select-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-select-chevron {
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 18px;
  color: var(--rg-muted);
  font-size: 14px;
}

.template-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 1000;
  display: none;
  max-height: 280px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid var(--rg-border-strong);
  border-radius: 8px;
  box-shadow: var(--rg-shadow);
  padding: 6px;
  box-sizing: border-box;
}

.template-select-wrap.open .template-select-menu {
  display: block;
}

.template-search-row {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  padding: 4px;
  background: #ffffff;
  border-bottom: 1px solid var(--rg-border);
}

.template-search-input {
  width: 100%;
  min-width: 0;
  height: 30px;
  padding: 4px 8px;
  border: 1px solid var(--rg-border-strong);
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
}
.template-search-input:focus {
  border-color: var(--rg-primary);
  box-shadow: 0 0 0 3px var(--rg-ring);
}

.template-select-options {
  max-height: 200px;
  overflow-y: auto;
}

.template-select-option {
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--rg-navy);
  font-size: 13.5px;
  line-height: 1.3;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.template-select-option:hover,
.template-select-option.selected,
.template-select-option.active {
  background: rgba(14, 83, 190, 0.08);
  color: var(--rg-primary);
}

/* Patient Details Modal */
.patient-modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.patient-modal-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}
.patient-modal-content {
  background: #ffffff;
  border: 1px solid var(--rg-border);
  border-radius: var(--rg-radius-lg);
  box-shadow: var(--rg-shadow);
  width: 90%;
  max-width: 480px;
  padding: 32px;
  transform: translateY(20px);
  transition: transform 0.2s ease;
}
.patient-modal-overlay.visible .patient-modal-content {
  transform: translateY(0);
}
.patient-modal-header {
  font-family: "Sora", "Inter", sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--rg-navy);
  margin-bottom: 24px;
}
.patient-modal-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.patient-modal-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.patient-modal-group label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--rg-navy);
}
.patient-modal-row {
  display: flex;
  gap: 16px;
}
.patient-modal-row > * {
  flex: 1;
}
.patient-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 28px;
}
.patient-modal-btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  font-family: inherit;
  font-size: 13.5px;
}
.patient-modal-btn.cancel {
  background: transparent;
  color: var(--rg-muted);
}
.patient-modal-btn.cancel:hover {
  background: var(--rg-soft);
  color: var(--rg-navy);
}
.patient-modal-btn.export {
  background: var(--rg-primary);
  color: white;
  box-shadow: 0 6px 18px -8px rgba(14,83,190,.55);
}
.patient-modal-btn.export:hover {
  background: var(--rg-primary-dark);
}

/* Voice Edit Banner */
.voice-edit-banner {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(109, 40, 217, 0.93);
  color: white;
  padding: 9px 18px 9px 14px;
  border-radius: 50px;
  font-size: 13.5px;
  font-weight: 500;
  backdrop-filter: blur(12px);
  box-shadow: 0 6px 24px rgba(109, 40, 217, 0.4);
  transition: opacity 0.25s ease, transform 0.25s ease;
  white-space: nowrap;
}

.voice-edit-banner.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(-8px);
}

.voice-edit-banner.state-listening {
  background: rgba(220, 38, 38, 0.93);
  box-shadow: 0 6px 24px rgba(220, 38, 38, 0.4);
}

.voice-edit-banner.state-processing {
  background: rgba(217, 119, 6, 0.93);
  box-shadow: 0 6px 24px rgba(217, 119, 6, 0.35);
}

.veb-mic {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.veb-mic.pulse {
  animation: veb-pulse 1.2s ease-in-out infinite;
}

@keyframes veb-pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.55;
    transform: scale(0.85);
  }
}

.veb-cancel {
  margin-left: 6px;
  background: rgba(255, 255, 255, 0.22);
  border: none;
  border-radius: 20px;
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}

.veb-cancel:hover {
  background: rgba(255, 255, 255, 0.35);
}

/* Ensure CKEditor elements do not override text margins */
.rg-report-body table, .rg-report-body th, .rg-report-body td {
  border: 1px solid var(--rg-border-strong);
  padding: 6px 10px;
  font-size: 13.5px;
}
.rg-report-body th {
  background: var(--rg-surface-2);
}
/* Change Password Modal styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-content {
  width: min(440px, 90%);
  padding: 32px;
  border-radius: 20px;
  position: relative;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.18);
  animation: modalFadeIn 0.3s ease;
}
@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
.modal-content h2 {
  margin: 0 0 20px;
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  background: linear-gradient(135deg, var(--rg-primary), var(--rg-primary-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.close-btn {
  position: absolute;
  top: 16px;
  right: 18px;
  background: transparent;
  border: 0;
  font-size: 24px;
  font-weight: 600;
  color: var(--rg-muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}
.close-btn:hover {
  background: rgba(15, 23, 42, 0.05);
  color: var(--rg-fg);
}
.modal-content .field {
  margin-bottom: 20px;
}
.modal-content label {
  display: block;
  margin-bottom: 7px;
  color: var(--rg-muted);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}
.modal-content input {
  width: 100%;
  height: 43px;
  padding: 0 13px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.78);
  color: var(--rg-fg);
  font: inherit;
  font-size: 14px;
  outline: none;
  box-shadow: 0 4px 6px rgba(15, 23, 42, 0.04);
  box-sizing: border-box;
  transition: all 0.2s ease;
}
.modal-content input:focus {
  border-color: rgba(14, 165, 233, 0.65);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.16);
}
.modal-message {
  min-height: 20px;
  margin-bottom: 14px;
  color: var(--rg-danger);
  text-align: center;
  font-weight: 700;
  font-size: 13px;
}
.modal-message.success {
  color: var(--rg-success);
}
.modal-content button.primary-btn {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--rg-primary), var(--rg-primary-dark));
  color: white;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(14, 165, 233, 0.18);
  margin-top: 8px;
  transition: all 0.2s;
}
.modal-content button.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(14, 165, 233, 0.2);
}
.modal-content button.primary-btn:disabled {
  opacity: 0.7;
  cursor: wait;
  transform: none;
}

.btn-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: btn-spin 1s ease-in-out infinite;
}
@keyframes btn-spin {
  to { transform: rotate(360deg); }
}
