@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

/* ===== CSS Custom Properties — Warm Premium Design System ===== */

:root {
  /* Primary Colors — Copper / Rose Gold */
  --hakeem-primary: #B76E79;
  --hakeem-primary-dark: #9B5860;
  --hakeem-primary-light: #F5E6E8;

  /* Secondary Colors — Warm Sage */
  --hakeem-secondary: #7A8F6E;
  --hakeem-secondary-dark: #5E7353;
  --hakeem-secondary-light: #EDF2EA;

  /* Neutral Colors — Warm tones */
  --hakeem-surface: #FAF7F2;
  --hakeem-surface-secondary: #F5F0EA;
  --hakeem-surface-tertiary: #EDE9E3;
  --hakeem-border: #D9D4CD;
  --hakeem-border-light: #E8E3DC;

  /* Text Colors */
  --hakeem-text-primary: #2C2C2C;
  --hakeem-text-secondary: #8B8681;
  --hakeem-text-tertiary: #B0AAA3;
  --hakeem-text-inverse: #FFFFFF;

  /* Status Colors */
  --hakeem-success: #7A8F6E;
  --hakeem-success-light: #EDF2EA;
  --hakeem-warning: #C4946A;
  --hakeem-warning-light: #FFF6EE;
  --hakeem-error: #C84C4C;
  --hakeem-error-light: #FFF3F3;
  --hakeem-info: #6E8FAF;
  --hakeem-info-light: #EDF2F7;

  /* Recording States */
  --hakeem-recording: #C84C4C;
  --hakeem-paused: #C4946A;
  --hakeem-processing: #6E8FAF;
  --hakeem-idle: #B0AAA3;

  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 12px;
  --spacing-lg: 16px;
  --spacing-xl: 24px;
  --spacing-2xl: 32px;
  --spacing-3xl: 48px;

  /* Shadows — warm tint */
  --shadow-sm: 0 1px 3px rgba(44, 44, 44, 0.06);
  --shadow-md: 0 4px 12px rgba(44, 44, 44, 0.08);
  --shadow-lg: 0 12px 32px rgba(44, 44, 44, 0.12);

  /* Border Radius — softer, more organic */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  /* Transitions */
  --transition-fast: 200ms ease;
  --transition-normal: 300ms ease;
}

/* ===== Global Styles ===== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(180deg, #FAF7F2 0%, #F5F0EA 100%);
  color: var(--hakeem-text-primary);
  line-height: 1.6;
  font-weight: 400;
}

body[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

/* ===== Typography ===== */

h1 {
  font-size: 28px;
  line-height: 36px;
  font-weight: 600;
  letter-spacing: -0.5px;
  color: var(--hakeem-text-primary);
}

h2 {
  font-size: 24px;
  line-height: 32px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

h3 {
  font-size: 20px;
  line-height: 28px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

h4 {
  font-size: 18px;
  line-height: 26px;
  font-weight: 600;
}

.body-large {
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
  letter-spacing: 0.1px;
}

.body-regular {
  font-size: 14px;
  line-height: 22px;
  font-weight: 400;
  letter-spacing: 0.1px;
}

.body-small {
  font-size: 12px;
  line-height: 18px;
  font-weight: 400;
  letter-spacing: 0.1px;
}

.label {
  font-size: 11px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.caption {
  font-size: 11px;
  line-height: 16px;
  font-weight: 400;
  letter-spacing: 0.2px;
}

.mono {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  line-height: 20px;
  font-weight: 400;
}

/* ===== Layout ===== */

body {
  min-height: 100vh;
}

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

.container {
  max-width: 100%;
  padding: var(--spacing-lg);
  margin: 0 auto;
}

.safe-area {
  padding: var(--spacing-md) var(--spacing-lg);
}

/* ===== Header ===== */

.header {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hakeem-border-light);
  padding: var(--spacing-lg) var(--spacing-xl);
  box-shadow: 0 1px 0 rgba(44, 44, 44, 0.04);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-lg);
}

.header__title {
  font-size: 22px;
  font-weight: 600;
  color: var(--hakeem-primary);
  margin: 0;
  letter-spacing: -0.5px;
}

.header__content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: var(--spacing-lg);
}

.language-toggle {
  display: flex;
  gap: 2px;
  background-color: var(--hakeem-surface-tertiary);
  border-radius: var(--radius-md);
  padding: 3px;
}

.lang-btn {
  padding: var(--spacing-sm) var(--spacing-lg);
  border: none;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border-radius: calc(var(--radius-md) - 2px);
  transition: all var(--transition-fast);
  color: var(--hakeem-text-secondary);
}

.lang-btn.active {
  background: linear-gradient(135deg, var(--hakeem-primary) 0%, var(--hakeem-primary-dark) 100%);
  color: var(--hakeem-text-inverse);
  box-shadow: 0 2px 8px rgba(183, 110, 121, 0.25);
}

/* ===== Buttons ===== */

button {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  font-weight: 500;
  font-size: 14px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--hakeem-primary) 0%, var(--hakeem-primary-dark) 100%);
  color: var(--hakeem-text-inverse);
  padding: var(--spacing-md) var(--spacing-xl);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 12px rgba(183, 110, 121, 0.25);
  letter-spacing: 0.2px;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(183, 110, 121, 0.35);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-primary:disabled {
  background: var(--hakeem-surface-tertiary);
  color: var(--hakeem-text-tertiary);
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  background: var(--hakeem-surface-tertiary);
  color: var(--hakeem-text-primary);
  padding: var(--spacing-md) var(--spacing-xl);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--hakeem-border);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background-color: transparent;
  color: var(--hakeem-primary);
  border: 1.5px solid var(--hakeem-primary);
  padding: calc(var(--spacing-md) - 1.5px) var(--spacing-xl);
  border-radius: var(--radius-lg);
}

.btn-outline:hover:not(:disabled) {
  background-color: var(--hakeem-primary-light);
}

.btn-danger {
  background: linear-gradient(135deg, var(--hakeem-error) 0%, #a33a3a 100%);
  color: var(--hakeem-text-inverse);
  padding: var(--spacing-md) var(--spacing-xl);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 12px rgba(200, 76, 76, 0.25);
}

.btn-danger:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(200, 76, 76, 0.35);
}

.btn-sm {
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: 12px;
  min-height: 36px;
}

.btn-lg {
  padding: var(--spacing-lg) var(--spacing-2xl);
  font-size: 15px;
  min-height: 48px;
  font-weight: 500;
}

.btn-block {
  width: 100%;
}

/* ===== Forms ===== */

.form-group {
  margin-bottom: var(--spacing-xl);
}

.form-group.last {
  margin-bottom: 0;
}

label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--hakeem-text-secondary);
  margin-bottom: var(--spacing-sm);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 12px var(--spacing-lg);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  border: 1.5px solid var(--hakeem-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.8);
  color: var(--hakeem-text-primary);
  transition: all var(--transition-fast);
  min-height: 44px;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--hakeem-primary);
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(183, 110, 121, 0.1);
}

textarea {
  resize: vertical;
  min-height: 120px;
  padding: var(--spacing-md) var(--spacing-lg);
}

input[type="checkbox"],
input[type="radio"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--hakeem-primary);
}

.checkbox-group,
.radio-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.checkbox-item,
.radio-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  cursor: pointer;
  min-height: 44px;
}

.checkbox-item input,
.radio-item input {
  margin: 0;
  flex-shrink: 0;
}

.checkbox-label,
.radio-label {
  font-size: 14px;
  color: var(--hakeem-text-primary);
  margin: 0;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
}

/* ===== Cards ===== */

.card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--hakeem-border-light);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--hakeem-primary) 0%, var(--hakeem-primary-light) 100%);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--hakeem-primary-light);
  transform: translateY(-2px);
}

.card:hover::before {
  opacity: 1;
}

.card.selectable {
  cursor: pointer;
}

.card.selectable.selected {
  border-color: var(--hakeem-primary);
  background: var(--hakeem-primary-light);
  box-shadow: 0 0 0 3px rgba(183, 110, 121, 0.1);
}

.card.selectable.selected::before {
  opacity: 1;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--hakeem-text-primary);
  margin: 0;
}

.card-content {
  color: var(--hakeem-text-secondary);
  font-size: 14px;
  line-height: 22px;
}

/* ===== Alert Banner ===== */

.alert {
  padding: var(--spacing-lg);
  border-radius: var(--radius-lg);
  margin-bottom: var(--spacing-xl);
  display: flex;
  gap: var(--spacing-md);
  align-items: flex-start;
}

.alert.alert-error {
  background-color: var(--hakeem-error-light);
  border: 1px solid var(--hakeem-error);
  color: var(--hakeem-error);
}

.alert.alert-warning {
  background-color: var(--hakeem-warning-light);
  border: 1px solid var(--hakeem-warning);
  color: var(--hakeem-warning);
}

.alert.alert-info {
  background-color: var(--hakeem-info-light);
  border: 1px solid var(--hakeem-info);
  color: var(--hakeem-info);
}

.alert.alert-success {
  background-color: var(--hakeem-success-light);
  border: 1px solid var(--hakeem-success);
  color: var(--hakeem-success);
}

.alert-icon {
  flex-shrink: 0;
  font-weight: 600;
  font-size: 18px;
}

.alert-content {
  flex: 1;
}

.alert-title {
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
}

/* ===== Screens ===== */

.screen {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: var(--spacing-xl);
}

.screen.active {
  display: flex;
  flex-direction: column;
}

.screen-inner {
  max-width: 100%;
  margin: 0 auto;
}

/* ===== Patient Lookup Screen ===== */

.search-container {
  margin-bottom: var(--spacing-2xl);
}

.search-container h2 {
  color: var(--hakeem-text-primary);
  margin-bottom: var(--spacing-lg);
}

.search-box {
  position: relative;
  margin-bottom: var(--spacing-lg);
}

.search-box input {
  padding-left: 44px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.9);
  border: 1.5px solid var(--hakeem-border);
}

.search-box input:focus {
  background: #FFFFFF;
}

.search-icon {
  position: absolute;
  left: var(--spacing-lg);
  top: 50%;
  transform: translateY(-50%);
  color: var(--hakeem-text-tertiary);
  font-size: 16px;
  pointer-events: none;
}

.patient-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--spacing-xl);
}

.patient-card {
  cursor: pointer;
}

.patient-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--spacing-md);
}

.patient-name {
  font-weight: 600;
  color: var(--hakeem-text-primary);
  font-size: 15px;
}

.patient-meta {
  font-size: 12px;
  color: var(--hakeem-text-secondary);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.patient-allergies {
  margin-top: var(--spacing-md);
}

/* Compact patient rows */
.patient-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border: 1px solid var(--hakeem-border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.9);
}

.patient-row:hover {
  border-color: var(--hakeem-primary);
  background: var(--hakeem-primary-light);
  box-shadow: var(--shadow-sm);
  transform: translateX(4px);
}

.patient-row-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.patient-row-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--hakeem-text-primary);
}

.patient-row-details {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--hakeem-text-secondary);
}

.patient-row-conditions {
  max-width: 350px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.patient-row-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.patient-row-arrow {
  color: var(--hakeem-text-tertiary);
  flex-shrink: 0;
}

.allergy-badge {
  display: inline-block;
  background-color: var(--hakeem-error-light);
  color: var(--hakeem-error);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  margin-right: var(--spacing-xs);
  margin-bottom: var(--spacing-xs);
}

.action-buttons {
  display: flex;
  gap: var(--spacing-md);
  margin-top: var(--spacing-xl);
}

.action-buttons button {
  flex: 1;
}

/* ===== Consent Screen ===== */

.consent-container {
  max-width: 600px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: var(--spacing-3xl) var(--spacing-2xl);
  box-shadow: var(--shadow-lg);
}

.consent-header {
  text-align: center;
  margin-bottom: var(--spacing-2xl);
}

.consent-header h1 {
  color: var(--hakeem-primary);
  margin-bottom: var(--spacing-md);
}

.consent-items {
  margin-bottom: var(--spacing-2xl);
}

.consent-item {
  background: var(--hakeem-surface);
  border: 1px solid var(--hakeem-border-light);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg) var(--spacing-xl);
  margin-bottom: var(--spacing-md);
  display: flex;
  gap: var(--spacing-lg);
  transition: all var(--transition-fast);
}

.consent-item:hover {
  border-color: var(--hakeem-primary-light);
  background: var(--hakeem-primary-light);
}

.consent-item input {
  margin: 0;
  flex-shrink: 0;
  margin-top: 2px;
}

.consent-item-content {
  flex: 1;
}

.consent-item-title {
  font-weight: 600;
  color: var(--hakeem-text-primary);
  margin-bottom: var(--spacing-xs);
  font-size: 14px;
}

.consent-item-description {
  font-size: 12px;
  color: var(--hakeem-text-secondary);
  line-height: 18px;
}

.consent-actions {
  display: flex;
  gap: var(--spacing-md);
}

.consent-actions button {
  flex: 1;
}

/* ===== Consultation Screen ===== */

.consultation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-lg);
  padding: var(--spacing-lg) var(--spacing-xl);
  background: rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-lg);
  border: 1px solid var(--hakeem-border-light);
  box-shadow: var(--shadow-sm);
}

.consultation-patient-info {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.consultation-patient-name {
  font-weight: 600;
  color: var(--hakeem-text-primary);
  font-size: 16px;
}

.consultation-patient-meta {
  font-size: 12px;
  color: var(--hakeem-text-secondary);
}

.consultation-timer {
  font-size: 28px;
  font-weight: 600;
  color: var(--hakeem-primary);
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: 1px;
}

.consultation-body {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: var(--spacing-lg);
}

.transcript-section {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--hakeem-border-light);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}

.transcript-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-lg);
  border-bottom: 1px solid var(--hakeem-border-light);
}

.recording-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--hakeem-idle);
  transition: background-color 0.3s;
}

.recording-indicator.active {
  background-color: var(--hakeem-recording);
  animation: pulse 1.2s ease-in-out infinite;
  box-shadow: 0 0 8px rgba(200, 76, 76, 0.4);
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.15); }
}

.transcript-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--hakeem-text-primary);
  margin: 0;
}

/* Audio Waveform */
.waveform-bar {
  width: 100%;
  height: 52px;
  margin-bottom: var(--spacing-md);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--hakeem-surface);
  border: 1px solid var(--hakeem-border-light);
}

.waveform-bar canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* ===== Parallel Transcript Lanes ===== */

.transcript-lanes {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-bottom: var(--spacing-lg);
  background: var(--hakeem-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--hakeem-border-light);
  overflow: hidden;
  max-height: 400px;
}

/* Lane column headers (sticky) */
.lane-headers {
  display: grid;
  grid-template-columns: 50px 1fr 1fr;
  flex-shrink: 0;
  border-bottom: 1px solid var(--hakeem-border-light);
  background: #fff;
}

.lane-header {
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.lane-header-time {
  color: var(--hakeem-text-tertiary);
  background: #fff;
  border-right: 1px solid var(--hakeem-border-light);
}

.lane-header-dr {
  color: #3B72C4;
  background: rgba(59, 130, 246, 0.02);
  border-right: 1px solid var(--hakeem-border-light);
  display: flex;
  align-items: center;
  gap: 5px;
}

.lane-header-pt {
  color: #1A8A4A;
  background: rgba(34, 197, 94, 0.02);
  display: flex;
  align-items: center;
  gap: 5px;
}

.lane-hdot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.lane-hdot-dr { background: #3B82F6; }
.lane-hdot-pt { background: #22C55E; }

/* Scrollable transcript body */
.transcript-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.transcript-body::-webkit-scrollbar {
  width: 6px;
}

.transcript-body::-webkit-scrollbar-track {
  background: transparent;
}

.transcript-body::-webkit-scrollbar-thumb {
  background: var(--hakeem-border);
  border-radius: 3px;
}

.transcript-body::-webkit-scrollbar-thumb:hover {
  background: var(--hakeem-text-tertiary);
}

/* Segment row */
.seg-row {
  display: grid;
  grid-template-columns: 50px 1fr 1fr;
  min-height: 24px;
  border-bottom: 1px solid rgba(237, 233, 227, 0.4);
}

.seg-row:hover {
  background: rgba(183, 110, 121, 0.02);
}

.seg-row-enter {
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.seg-row-enter.visible {
  opacity: 1;
  transform: translateY(0);
}

.seg-time {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  color: var(--hakeem-text-tertiary);
  padding: 3px 4px 3px 6px;
  border-right: 1px solid var(--hakeem-border-light);
  white-space: nowrap;
  line-height: 1.6;
}

.seg-lane {
  padding: 3px 8px;
  font-size: 12px;
  line-height: 1.55;
  min-height: 24px;
  position: relative;
}

.seg-lane-dr {
  background: rgba(59, 130, 246, 0.02);
  border-right: 1px solid var(--hakeem-border-light);
}

.seg-lane-pt {
  background: rgba(34, 197, 94, 0.02);
}

/* Overlap indicator */
.seg-row.overlap .seg-lane-dr.has-text,
.seg-row.overlap .seg-lane-pt.has-text {
  border-left: 2px solid rgba(217, 119, 6, 0.35);
}

.overlap-badge {
  position: absolute;
  right: 4px;
  top: 3px;
  font-size: 7px;
  font-weight: 700;
  color: var(--hakeem-warning);
  opacity: 0.5;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

/* Refined indicator (green dot for 2nd-pass correction) */
.refined-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--hakeem-secondary);
  margin-left: 4px;
  vertical-align: middle;
  position: relative;
  top: -1px;
}

.refined-tag {
  font-size: 8px;
  font-weight: 600;
  color: var(--hakeem-secondary);
  background: var(--hakeem-secondary-light);
  border-radius: 2px;
  padding: 0 3px;
  margin-left: 2px;
  vertical-align: middle;
  letter-spacing: 0.2px;
}

/* Interim text (currently being spoken) */
.interim-text {
  color: var(--hakeem-text-tertiary);
  font-style: italic;
  opacity: 0.75;
}

.interim-cursor {
  display: inline-block;
  width: 2px;
  height: 12px;
  background: var(--hakeem-primary);
  margin-left: 2px;
  vertical-align: middle;
  animation: blink-cursor 0.8s step-end infinite;
}

@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* System messages within lanes */
.seg-row-system {
  display: grid;
  grid-template-columns: 50px 1fr;
  border-bottom: 1px solid rgba(237, 233, 227, 0.4);
}

.seg-row-system .seg-system-text {
  grid-column: 2 / -1;
  font-size: 11px;
  color: var(--hakeem-text-tertiary);
  font-style: italic;
  padding: 3px 8px;
}

/* Stream status indicator */
.stream-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(156, 175, 136, 0.1);
  border: 1px solid rgba(156, 175, 136, 0.25);
  font-size: 10px;
  font-weight: 500;
  margin-left: auto;
}

.stream-status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.stream-status-connecting {
  background: var(--hakeem-error);
  animation: pulse 1.2s ease-in-out infinite;
}

.stream-status-active {
  background: var(--hakeem-secondary);
}

.stream-status-disconnected {
  background: var(--hakeem-text-tertiary);
}

.stream-status-text {
  color: var(--hakeem-text-secondary);
}

/* Transcript stats bar */
.transcript-stats {
  font-size: 10px;
  color: var(--hakeem-text-tertiary);
  padding: 4px 8px;
  display: flex;
  gap: 12px;
}

/* Legacy classes kept for backward compat */
.transcript-lang {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--hakeem-secondary-light, #E3F2FD);
  color: var(--hakeem-secondary);
  margin-right: 6px;
  vertical-align: middle;
}

.transcript-controls {
  display: flex;
  gap: var(--spacing-md);
}

.transcript-controls button {
  flex: 1;
  min-height: 44px;
}

.red-flag-sidebar {
  background: var(--hakeem-error-light);
  border: 1px solid rgba(200, 76, 76, 0.2);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  display: flex;
  flex-direction: column;
}

.red-flag-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--hakeem-error);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--spacing-md);
}

.red-flag-items {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  font-size: 12px;
  color: var(--hakeem-error);
  line-height: 16px;
}

.red-flag-item {
  display: flex;
  gap: var(--spacing-xs);
}

.red-flag-icon {
  font-weight: 600;
  flex-shrink: 0;
}

.red-flag-text {
  flex: 1;
}

.red-flag-empty {
  font-size: 12px;
  color: var(--hakeem-text-secondary);
  text-align: center;
  padding: var(--spacing-lg) 0;
}

/* ===== SOAP Review Screen ===== */

.soap-container {
  max-width: 900px;
  margin: 0 auto;
}

.soap-container h1 {
  margin-bottom: var(--spacing-xl);
}

.soap-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: var(--spacing-xl);
  background: var(--hakeem-surface-tertiary);
  border-radius: var(--radius-lg);
  padding: 3px;
}

.soap-tab {
  padding: var(--spacing-md) var(--spacing-xl);
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: var(--hakeem-text-secondary);
  border-bottom: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  min-height: auto;
  border-radius: calc(var(--radius-lg) - 2px);
  flex: 1;
}

.soap-tab:hover {
  color: var(--hakeem-primary);
  background: rgba(255, 255, 255, 0.5);
}

.soap-tab.active {
  color: var(--hakeem-primary);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

.soap-content {
  display: none;
}

.soap-content.active {
  display: block;
  animation: fadeIn 200ms ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.soap-section {
  background: rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  margin-bottom: var(--spacing-lg);
  border: 1px solid var(--hakeem-border-light);
  box-shadow: var(--shadow-sm);
}

.soap-textarea {
  width: 100%;
  min-height: 150px;
  margin-bottom: var(--spacing-md);
  border-radius: var(--radius-md);
  background: var(--hakeem-surface);
}

.confidence-score {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  font-size: 12px;
}

.confidence-label {
  color: var(--hakeem-text-secondary);
  font-weight: 600;
}

.confidence-value {
  color: var(--hakeem-primary);
  font-weight: 600;
}

.soap-extracts {
  margin-top: var(--spacing-2xl);
}

.extract-section {
  margin-bottom: var(--spacing-xl);
}

.extract-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--hakeem-text-secondary);
  margin-bottom: var(--spacing-md);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.extract-items {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.extract-item {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--hakeem-border-light);
  border-radius: var(--radius-md);
  padding: var(--spacing-md) var(--spacing-lg);
  transition: all var(--transition-fast);
}

.extract-item:hover {
  border-color: var(--hakeem-primary-light);
  box-shadow: var(--shadow-sm);
}

.extract-item-code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--hakeem-primary);
  font-weight: 500;
  margin-bottom: var(--spacing-xs);
}

.extract-item-description {
  font-size: 13px;
  color: var(--hakeem-text-primary);
}

/* ===== Prescription Review Screen ===== */

.prescription-container {
  max-width: 700px;
  margin: 0 auto;
}

.prescription-container h1 {
  margin-bottom: var(--spacing-xl);
}

.medication-section {
  margin-bottom: var(--spacing-2xl);
}

.medication-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--hakeem-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: var(--spacing-lg);
}

.medication-item {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--hakeem-border-light);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  margin-bottom: var(--spacing-md);
  transition: all var(--transition-fast);
}

.medication-item:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--hakeem-primary-light);
}

.medication-name {
  font-weight: 600;
  color: var(--hakeem-text-primary);
  margin-bottom: var(--spacing-sm);
  font-size: 15px;
}

.medication-details {
  display: flex;
  gap: var(--spacing-lg);
  font-size: 12px;
  color: var(--hakeem-text-secondary);
}

.medication-detail {
  flex: 1;
}

.medication-detail-label {
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.drug-interaction-warning {
  background-color: var(--hakeem-warning-light);
  border: 1px solid rgba(196, 148, 106, 0.3);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
  display: flex;
  gap: var(--spacing-md);
  align-items: flex-start;
}

.drug-interaction-icon {
  font-size: 20px;
  color: var(--hakeem-warning);
  flex-shrink: 0;
}

.drug-interaction-content {
  flex: 1;
}

.drug-interaction-title {
  font-weight: 600;
  color: var(--hakeem-warning);
  margin-bottom: var(--spacing-xs);
}

.drug-interaction-text {
  font-size: 12px;
  color: var(--hakeem-warning);
  line-height: 18px;
}

/* ===== Sign-Off Screen ===== */

.sign-off-container {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.sign-off-container h1 {
  margin-bottom: var(--spacing-2xl);
}

.sign-off-summary {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--hakeem-border-light);
  border-radius: var(--radius-lg);
  padding: var(--spacing-2xl);
  margin-bottom: var(--spacing-2xl);
  box-shadow: var(--shadow-sm);
}

.sign-off-item {
  margin-bottom: var(--spacing-lg);
  text-align: left;
  padding-bottom: var(--spacing-lg);
  border-bottom: 1px solid var(--hakeem-border-light);
}

.sign-off-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.sign-off-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--hakeem-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: var(--spacing-xs);
}

.sign-off-value {
  font-size: 16px;
  color: var(--hakeem-text-primary);
  font-weight: 500;
}

.sign-off-confirmation {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--hakeem-border-light);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  margin-bottom: var(--spacing-2xl);
  text-align: left;
}

.sign-off-confirmation-item {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-md);
}

.sign-off-confirmation-item input {
  margin-top: 4px;
  margin: 0;
}

.sign-off-confirmation-label {
  font-size: 14px;
  color: var(--hakeem-text-primary);
  margin: 0;
  text-transform: none;
}

/* ===== History Screen ===== */

.history-container {
  max-width: 800px;
  margin: 0 auto;
}

.history-container h1 {
  margin-bottom: var(--spacing-xl);
}

.consultation-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.consultation-item {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--hakeem-border-light);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-lg);
  transition: all var(--transition-fast);
}

.consultation-item:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--hakeem-primary-light);
}

.consultation-item-info {
  flex: 1;
}

.consultation-item-patient {
  font-weight: 600;
  color: var(--hakeem-text-primary);
  margin-bottom: var(--spacing-xs);
}

.consultation-item-meta {
  font-size: 12px;
  color: var(--hakeem-text-secondary);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.completed {
  background-color: var(--hakeem-success-light);
  color: var(--hakeem-success);
}

.status-badge.in-progress {
  background: linear-gradient(135deg, var(--hakeem-primary) 0%, var(--hakeem-primary-dark) 100%);
  color: var(--hakeem-text-inverse);
}

.consultation-item-actions {
  display: flex;
  gap: var(--spacing-sm);
}

.consultation-item-actions button {
  min-height: 40px;
  padding: var(--spacing-sm) var(--spacing-md);
}

.consultation-detail {
  margin-top: var(--spacing-lg);
  padding-top: var(--spacing-lg);
  border-top: 1px solid var(--hakeem-border-light);
}

.consultation-detail-content {
  font-size: 12px;
  color: var(--hakeem-text-secondary);
  line-height: 18px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ===== Success Screen ===== */

.success-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
}

.success-icon {
  font-size: 64px;
  margin-bottom: var(--spacing-lg);
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--hakeem-success) 0%, #5E7353 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(122, 143, 110, 0.3);
}

.success-title {
  color: var(--hakeem-text-primary);
  margin-bottom: var(--spacing-md);
}

.success-message {
  color: var(--hakeem-text-secondary);
  margin-bottom: var(--spacing-2xl);
  font-size: 14px;
  line-height: 22px;
}

/* ===== Responsive ===== */

@media (max-width: 768px) {
  .consultation-body {
    grid-template-columns: 1fr;
  }

  .patient-list {
    grid-template-columns: 1fr;
  }

  .consent-actions,
  .action-buttons {
    flex-direction: column;
  }

  .soap-tabs {
    flex-wrap: wrap;
  }
}

/* ===== RTL Support ===== */

[dir="rtl"] .patient-info,
[dir="rtl"] .search-icon,
[dir="rtl"] .alert,
[dir="rtl"] .consultation-item {
  flex-direction: row-reverse;
}

[dir="rtl"] .search-icon {
  right: var(--spacing-lg);
  left: auto;
}

[dir="rtl"] input[type="text"],
[dir="rtl"] input[type="email"],
[dir="rtl"] input[type="password"],
[dir="rtl"] textarea {
  text-align: right;
}

[dir="rtl"] .lang-btn {
  text-align: center;
}

[dir="rtl"] .seg-row.overlap .seg-lane-dr.has-text,
[dir="rtl"] .seg-row.overlap .seg-lane-pt.has-text {
  border-left: none;
  border-right: 2px solid rgba(217, 119, 6, 0.35);
}

[dir="rtl"] .patient-row:hover {
  transform: translateX(-4px);
}

/* ===== Voice Activation Screen (SCR-002) ===== */

.va-container {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 60px);
  padding: var(--spacing-md) var(--spacing-xl);
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}

.va-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-sm) 0;
  margin-bottom: var(--spacing-sm);
}

.va-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  font-size: 13px;
  border: 1px solid var(--hakeem-border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--hakeem-text-primary);
  cursor: pointer;
  min-height: 36px;
}

.va-back-btn:hover {
  background: var(--hakeem-surface-tertiary);
}

.va-back-btn:focus {
  outline: 2px solid var(--hakeem-primary);
  outline-offset: 1px;
}

.va-patient-context {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--hakeem-text-secondary);
}

.va-patient-name {
  font-weight: 600;
  color: var(--hakeem-text-primary);
}

.va-page-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--hakeem-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  margin-bottom: var(--spacing-md);
}

/* Compat warning */
.va-compat-warning {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--hakeem-warning-light);
  border: 1px solid var(--hakeem-warning);
  border-radius: var(--radius-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: 13px;
  color: var(--hakeem-text-primary);
  margin-bottom: var(--spacing-md);
}

/* State visibility */
.va-state {
  display: none;
  animation: va-fade-in 0.4s ease;
}

.va-state.va-state--active {
  display: block;
}

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

/* Card */
.va-card {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--hakeem-border-light);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl) var(--spacing-xl);
  box-shadow: var(--shadow-md);
  text-align: center;
}

.va-card--active {
  border-color: var(--hakeem-primary);
  box-shadow: 0 2px 12px rgba(183, 110, 121, 0.15);
}

/* Owl container */
.va-owl-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--spacing-md);
}

/* Owl ring */
.va-owl-ring {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.va-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid var(--hakeem-border);
  transition: border-color 0.4s ease, opacity 0.4s ease;
}

/* Speaking state ring */
.va-owl-ring--speaking .va-ring {
  border-color: var(--hakeem-primary);
}

/* Listening state ring — pulsing copper */
.va-owl-ring--listening .va-ring {
  border-color: var(--hakeem-primary);
  animation: va-pulse-ring 2s ease-in-out infinite;
}

.va-owl-ring--listening .va-ring--outer {
  inset: -8px;
  border: 2px solid var(--hakeem-primary);
  opacity: 0.3;
  animation: va-pulse-ring-outer 2s ease-in-out infinite;
}

@keyframes va-pulse-ring {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.06); opacity: 0.7; }
}

@keyframes va-pulse-ring-outer {
  0%, 100% { transform: scale(1); opacity: 0.3; }
  50% { transform: scale(1.12); opacity: 0.1; }
}

/* Dormant state ring — gray */
.va-owl-ring--dormant .va-ring {
  border-color: var(--hakeem-border);
}

.va-owl-svg--dormant {
  opacity: 0.4;
  filter: grayscale(0.6);
}

/* Waveform animation (State 1 — Speaking) */
.va-waveform {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 28px;
}

.va-waveform__bar {
  width: 3px;
  background: var(--hakeem-primary);
  border-radius: 2px;
  animation: va-wave 1.2s ease-in-out infinite;
}

.va-waveform__bar:nth-child(1) { height: 8px; animation-delay: 0s; }
.va-waveform__bar:nth-child(2) { height: 14px; animation-delay: 0.1s; }
.va-waveform__bar:nth-child(3) { height: 22px; animation-delay: 0.2s; }
.va-waveform__bar:nth-child(4) { height: 18px; animation-delay: 0.3s; }
.va-waveform__bar:nth-child(5) { height: 26px; animation-delay: 0.4s; }
.va-waveform__bar:nth-child(6) { height: 14px; animation-delay: 0.5s; }
.va-waveform__bar:nth-child(7) { height: 10px; animation-delay: 0.6s; }
.va-waveform__bar:nth-child(8) { height: 18px; animation-delay: 0.3s; }
.va-waveform__bar:nth-child(9) { height: 8px; animation-delay: 0.2s; }

@keyframes va-wave {
  0%, 100% { transform: scaleY(0.5); }
  50% { transform: scaleY(1.2); }
}

/* TTS text display */
.va-tts-text {
  font-size: 13px;
  color: var(--hakeem-text-primary);
  text-align: center;
  font-style: italic;
  line-height: 1.7;
  max-width: 440px;
  margin: 0 auto;
  padding: var(--spacing-sm) 0;
}

.va-tts-text em {
  color: var(--hakeem-primary);
  font-style: normal;
  font-weight: 600;
}

.va-state-label {
  font-size: 12px;
  color: var(--hakeem-text-secondary);
  margin-top: var(--spacing-sm);
}

/* Prompt text (State 2) */
.va-prompt-text {
  font-size: 20px;
  font-weight: 600;
  color: var(--hakeem-text-primary);
  margin: var(--spacing-sm) 0;
}

/* Mic status indicator */
.va-mic-status {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--hakeem-text-secondary);
  padding: var(--spacing-xs) 0 var(--spacing-md);
}

.va-mic-status--dormant {
  color: var(--hakeem-text-tertiary);
}

/* Dormant text */
.va-dormant-text {
  font-size: 13px;
  color: var(--hakeem-text-secondary);
  font-style: italic;
  margin-bottom: var(--spacing-md);
}

/* Action buttons */
.va-actions {
  display: flex;
  gap: var(--spacing-sm);
  justify-content: center;
  flex-wrap: wrap;
  margin-top: var(--spacing-sm);
}

.va-actions .btn-primary,
.va-actions .btn-secondary,
.va-actions .btn-outline {
  touch-action: manipulation;
}

/* Confirmation overlay */
.va-confirmation-overlay {
  position: fixed;
  inset: 0;
  background: rgba(237, 242, 234, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.va-confirmation-overlay.va-overlay--visible {
  opacity: 1;
  pointer-events: auto;
}

.va-confirmation-content {
  text-align: center;
  animation: va-confirm-pop 0.4s ease;
}

@keyframes va-confirm-pop {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.va-confirmation-icon {
  margin-bottom: var(--spacing-md);
}

.va-confirmation-text {
  font-size: 22px;
  font-weight: 600;
  color: var(--hakeem-success);
  margin-bottom: var(--spacing-xs);
}

.va-confirmation-sub {
  font-size: 14px;
  color: var(--hakeem-text-secondary);
}

/* Footer */
.va-footer {
  margin-top: auto;
  padding: var(--spacing-sm) 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--hakeem-text-tertiary);
  border-top: 1px solid var(--hakeem-border-light);
}

.va-footer kbd {
  display: inline-block;
  padding: 1px 4px;
  font-size: 10px;
  font-family: 'IBM Plex Mono', monospace;
  background: #fff;
  border: 1px solid var(--hakeem-border);
  border-radius: 3px;
  margin-right: 2px;
}

.va-footer-keys {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

/* ===== Patient Schedule Screen (SCR-001) ===== */

.sched-screen {
  padding: 0 !important;
  flex-direction: column;
  overflow: hidden;
}

.sched-screen.active {
  display: flex;
}

/* Schedule Header */
.sched-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--hakeem-surface);
  border-bottom: 1px solid var(--hakeem-border-light);
  flex-shrink: 0;
}

.sched-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sched-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--hakeem-text-primary);
  line-height: 1.2;
  letter-spacing: -0.3px;
}

.sched-date {
  font-size: 13px;
  color: var(--hakeem-text-secondary);
}

.sched-stats {
  display: flex;
  gap: 10px;
}

.sched-stat {
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--hakeem-surface-tertiary);
  color: var(--hakeem-text-primary);
  font-size: 12px;
  font-weight: 500;
}

.sched-stat-active {
  background: rgba(183, 110, 121, 0.15);
  color: var(--hakeem-primary-dark);
}

/* Search Bar */
.sched-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: #fff;
  border-bottom: 1px solid var(--hakeem-border-light);
  flex-shrink: 0;
}

.sched-search-icon {
  color: var(--hakeem-text-secondary);
  flex-shrink: 0;
}

.sched-search-input {
  flex: 1;
  border: 1px solid var(--hakeem-border);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 13px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--hakeem-surface);
  color: var(--hakeem-text-primary);
  outline: none;
  height: 28px;
  min-height: 28px;
}

.sched-search-input:focus {
  border-color: var(--hakeem-primary);
  box-shadow: 0 0 0 2px rgba(183, 110, 121, 0.15);
}

.sched-search-input::placeholder {
  color: var(--hakeem-text-secondary);
}

.sched-filter-btn {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--hakeem-border);
  border-radius: 4px;
  background: #fff;
  color: var(--hakeem-text-primary);
  cursor: pointer;
  height: 28px;
  min-height: 28px;
  transition: all 0.15s;
}

.sched-filter-btn:hover {
  background: var(--hakeem-surface-tertiary);
}

.sched-filter-btn:focus {
  outline: 2px solid var(--hakeem-primary);
  outline-offset: 1px;
}

.sched-filter-active {
  background: var(--hakeem-primary) !important;
  color: #fff !important;
  border-color: var(--hakeem-primary) !important;
}

.sched-kbd-hint {
  font-size: 11px;
  color: var(--hakeem-text-secondary);
  margin-left: 4px;
  white-space: nowrap;
}

.sched-kbd-hint kbd {
  display: inline-block;
  padding: 1px 4px;
  font-size: 10px;
  font-family: 'IBM Plex Mono', 'SF Mono', Menlo, monospace;
  background: var(--hakeem-surface-tertiary);
  border: 1px solid var(--hakeem-border);
  border-radius: 3px;
  color: var(--hakeem-text-secondary);
}

.sched-kbd-sep {
  margin: 0 2px;
}

/* Main Content Area */
.sched-main-content {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Table */
.sched-table-wrapper {
  flex: 1;
  overflow-y: auto;
}

.sched-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.sched-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

.sched-table th {
  padding: 4px 8px;
  background: var(--hakeem-surface-tertiary);
  border-bottom: 2px solid var(--hakeem-border);
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--hakeem-text-secondary);
  white-space: nowrap;
  user-select: none;
  height: 28px;
}

.sched-table td {
  padding: 4px 8px;
  border-bottom: 1px solid var(--hakeem-border-light);
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.sched-table tbody tr {
  height: 36px;
  cursor: pointer;
  transition: background 0.1s;
}

.sched-table tbody tr:hover {
  background: rgba(183, 110, 121, 0.06);
}

.sched-table tbody tr:focus {
  outline: 2px solid var(--hakeem-primary);
  outline-offset: -2px;
}

/* Selected row */
.sched-table tbody tr.sched-selected {
  background: rgba(183, 110, 121, 0.12);
  outline: 2px solid var(--hakeem-primary);
  outline-offset: -2px;
}

/* Completed rows */
.sched-table tbody tr.sched-completed {
  color: var(--hakeem-text-secondary);
  background: rgba(237, 233, 227, 0.5);
}

.sched-table tbody tr.sched-completed td {
  opacity: 0.65;
}

.sched-table tbody tr.sched-completed:hover {
  background: rgba(237, 233, 227, 0.7);
}

/* Current/in-progress row */
.sched-table tbody tr.sched-current {
  background: rgba(183, 110, 121, 0.08);
  font-weight: 500;
}

.sched-table tbody tr.sched-current td:first-child {
  border-left: 3px solid var(--hakeem-primary);
}

/* Cell styles */
.sched-time-cell {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--hakeem-text-secondary);
}

.sched-name-cell {
  font-weight: 500;
  color: var(--hakeem-text-primary);
}

.sched-mrn-cell {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
}

.sched-age-cell {
  font-size: 12px;
}

.sched-conditions-cell {
  font-size: 12px;
  color: var(--hakeem-text-secondary);
  max-width: 180px;
}

.sched-allergies-cell {
  font-size: 12px;
}

.sched-allergy-badge {
  display: inline-block;
  padding: 1px 5px;
  font-size: 10px;
  font-weight: 600;
  background: var(--hakeem-error-light);
  color: var(--hakeem-error);
  border: 1px solid rgba(200, 76, 76, 0.3);
  border-radius: 3px;
  margin-right: 2px;
}

.sched-nka {
  font-size: 11px;
  color: var(--hakeem-text-tertiary);
}

/* Status badges */
.sched-status-badge {
  display: inline-block;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.sched-status-completed {
  background: rgba(122, 143, 110, 0.2);
  color: #5A7A4A;
}

.sched-status-in-progress {
  background: rgba(183, 110, 121, 0.15);
  color: var(--hakeem-primary-dark);
}

.sched-status-scheduled {
  background: var(--hakeem-surface-tertiary);
  color: var(--hakeem-text-secondary);
}

.sched-status-draft {
  background: #FEF3C7;
  color: #92400E;
}

/* No results message */
.sched-no-results {
  text-align: center;
  padding: 48px 24px;
  color: var(--hakeem-text-secondary);
  font-size: 14px;
}

/* Skeleton loading */
.skeleton-row td {
  padding: 0 8px;
}

.skeleton-pulse {
  height: 20px;
  background: linear-gradient(90deg, var(--hakeem-surface-tertiary) 25%, var(--hakeem-border-light) 50%, var(--hakeem-surface-tertiary) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 4px;
  margin: 8px 0;
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Detail Panel */
.sched-detail-panel {
  width: 320px;
  background: #fff;
  border-left: 1px solid var(--hakeem-border);
  padding: 0;
  overflow-y: auto;
  flex-shrink: 0;
  display: none;
}

.sched-detail-panel.sched-detail-visible {
  display: block;
}

.sched-detail-header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--hakeem-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sched-detail-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--hakeem-text-primary);
  line-height: 1.3;
}

.sched-detail-close-btn {
  width: 24px;
  height: 24px;
  min-height: 24px;
  border: none;
  background: var(--hakeem-surface-tertiary);
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  color: var(--hakeem-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.sched-detail-close-btn:hover {
  background: var(--hakeem-border);
}

.sched-detail-close-btn:focus {
  outline: 2px solid var(--hakeem-primary);
}

.sched-detail-section {
  padding: 8px 12px;
  border-bottom: 1px solid var(--hakeem-border-light);
}

.sched-detail-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--hakeem-text-secondary);
  margin-bottom: 4px;
}

.sched-detail-content {
  font-size: 13px;
  line-height: 1.5;
}

.sched-detail-med-item {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
  font-size: 12px;
}

.sched-detail-dose {
  color: var(--hakeem-text-secondary);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
}

.sched-detail-allergy {
  display: inline-block;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 600;
  background: var(--hakeem-error-light);
  color: var(--hakeem-error);
  border: 1px solid rgba(200, 76, 76, 0.3);
  border-radius: 3px;
  margin-right: 4px;
  margin-bottom: 2px;
}

.sched-detail-lab-item {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
  font-size: 12px;
}

.sched-detail-lab-value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 500;
}

.sched-detail-lab-date {
  font-size: 10px;
  color: var(--hakeem-text-secondary);
}

.sched-detail-last-visit {
  font-size: 12px;
  color: var(--hakeem-text-secondary);
  line-height: 1.5;
}

.sched-detail-last-visit strong {
  color: var(--hakeem-text-primary);
}

/* Begin Consultation Button */
.sched-detail-action-bar {
  padding: 8px 12px;
  background: #fff;
}

.sched-begin-btn {
  width: 100%;
  padding: 8px 16px;
  background: linear-gradient(135deg, var(--hakeem-primary) 0%, var(--hakeem-primary-dark) 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(183, 110, 121, 0.25);
  transition: all 0.15s;
  min-height: 40px;
}

.sched-begin-btn:hover:not(:disabled) {
  box-shadow: 0 6px 16px rgba(183, 110, 121, 0.35);
  transform: translateY(-1px);
}

.sched-begin-btn:focus {
  outline: 2px solid var(--hakeem-primary);
  outline-offset: 2px;
}

.sched-begin-btn:disabled {
  background: var(--hakeem-surface-tertiary);
  color: var(--hakeem-text-tertiary);
  cursor: not-allowed;
  box-shadow: none;
}

/* Footer */
.sched-footer {
  padding: 4px 16px;
  background: var(--hakeem-surface-tertiary);
  border-top: 1px solid var(--hakeem-border);
  font-size: 11px;
  color: var(--hakeem-text-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  height: 24px;
}

.sched-footer kbd {
  display: inline-block;
  padding: 0 3px;
  font-size: 10px;
  font-family: 'IBM Plex Mono', 'SF Mono', Menlo, monospace;
  background: #fff;
  border: 1px solid var(--hakeem-border);
  border-radius: 2px;
}

/* ==========================================================================
   NOTE BUILDER (SCR-004) — 4-Quadrant Workspace
   ========================================================================== */

/* When note-builder screen is active, make it fill viewport */
/* Note builder needs full viewport, no padding, own header */
#note-builder.screen.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  background: #fff;
  padding: 0;
}
/* Hide the main app header when note-builder is active */
body:has(#note-builder.screen.active) > #app > .header {
  display: none;
}
/* Make #app fill viewport when note builder is active */
body:has(#note-builder.screen.active) > #app {
  height: 100vh;
  overflow: hidden;
}

/* ── Header (36px) ── */
.nb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  background: #fff;
  border-bottom: 1px solid #E5E5E5;
  height: 36px;
  flex-shrink: 0;
}
.nb-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nb-logo {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.nb-logo-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--hakeem-primary);
  letter-spacing: -0.3px;
}
.nb-header-sep {
  width: 1px;
  height: 16px;
  background: #E5E5E5;
}
.nb-consultation-info {
  font-size: 12px;
  font-weight: 500;
  color: var(--hakeem-text-primary);
}
.nb-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--hakeem-text-secondary);
}
.nb-timer-badge {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  padding: 2px 8px;
  background: var(--hakeem-surface);
  border: 1px solid var(--hakeem-border-light);
  border-radius: 4px;
}

/* ── Safety Banner ── */
.nb-safety-banner {
  padding: 3px 12px;
  background: #FFFDF5;
  border-bottom: 1px solid rgba(198,138,29,0.15);
  font-size: 10px;
  color: #92400E;
  text-align: center;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

/* ── 4-Quadrant Grid ── */
.nb-quadrant-grid {
  display: grid;
  grid-template-columns: var(--q-col-1, 33%) var(--q-col-2, 33%) var(--q-col-3, 34%);
  grid-template-rows: var(--q-row-top, 50%) var(--q-row-bottom, 50%);
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* ── Quadrant shared ── */
.nb-quadrant {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overflow-y: auto;
  min-width: 200px;
  min-height: 0;
  background: #fff;
  border-right: 1px solid #E0E0E0;
  border-bottom: 1px solid #E0E0E0;
}
.nb-q1  { grid-column: 1; grid-row: 1; }
.nb-q2a { grid-column: 2; grid-row: 1; }
.nb-q2b { grid-column: 3; grid-row: 1; }
.nb-q3  { grid-column: 1; grid-row: 2; }
.nb-q4  { grid-column: 2 / 4; grid-row: 2; }

/* ── Quadrant headers ── */
.nb-q-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 10px;
  flex-shrink: 0;
  height: 26px;
  background: #fff;
  border-bottom: 1px solid #F0F0F0;
  gap: 6px;
}
.nb-q-header-blue { border-top: 2px solid #3B7DD8; }
.nb-q-header-green { border-top: 2px solid #2D9D5E; }
.nb-q-header-amber { border-top: 2px solid #C68A1D; }
.nb-q-header-copper { border-top: 2px solid var(--hakeem-primary); }

.nb-q-header-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--hakeem-text-secondary);
  white-space: nowrap;
}
.nb-q-header-label {
  font-size: 10px;
  color: #AAA;
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Badge counts ── */
.nb-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  background: #3B7DD8;
}
.nb-badge-green { background: #2D9D5E; }

/* ── Quadrant body ── */
.nb-q-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--hakeem-text-primary);
  -webkit-user-select: text;
  user-select: text;
}
.nb-q-body::-webkit-scrollbar { width: 4px; }
.nb-q-body::-webkit-scrollbar-track { background: transparent; }
.nb-q-body::-webkit-scrollbar-thumb { background: #D9D4CD; border-radius: 2px; }

/* ── Section headers inside quadrants ── */
.nb-section-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  margin-bottom: 4px;
  padding-bottom: 2px;
  border-bottom: 1px solid #F0F0F0;
}
.nb-section-header:first-child { margin-top: 0; }

.nb-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--hakeem-text-secondary);
}
.nb-section-meta {
  font-size: 10px;
  color: #AAA;
}
.nb-add-all-link {
  font-size: 10px;
  color: var(--hakeem-primary);
  cursor: pointer;
  margin-left: auto;
  text-decoration: none;
}
.nb-add-all-link:hover { text-decoration: underline; }

.nb-subsection-label {
  font-size: 11px;
  color: var(--hakeem-text-secondary);
  font-style: italic;
  margin: 6px 0 3px;
}

.nb-source-cite {
  display: block;
  font-size: 10px;
  color: #AAA;
  font-style: italic;
  margin-top: 6px;
  padding-top: 4px;
  border-top: 1px solid #F0F0F0;
}

/* ── WP-04: Actionable Research Balloons (CR-009) ── */
.nb-balloon-actionable {
  cursor: pointer;
}
.nb-balloon-actionable:hover {
  border-color: #B45309;
  background: #FFF8E1;
}
.nb-action-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  font-family: var(--hakeem-font-mono, monospace);
  padding: 1px 4px;
  border-radius: 2px;
  margin-left: 6px;
  background: #D97706;
  color: #fff;
  vertical-align: middle;
}

/* ── Marking Balloons ── */
.nb-balloon {
  position: relative;
  cursor: pointer;
  border-radius: 3px;
  padding: 1px 3px;
  transition: background 0.15s, opacity 0.2s;
  text-decoration: none;
  display: inline;
  touch-action: manipulation;
}
.nb-balloon:hover { text-decoration: none; }
.nb-balloon:focus { outline: 1px solid var(--hakeem-primary); outline-offset: 1px; }

/* Balloon number circles */
.nb-balloon-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  vertical-align: middle;
  margin-right: 2px;
  position: relative;
  top: -1px;
}

/* Blue (Transcript) */
.nb-balloon-blue { background: rgba(59,125,216,0.04); border: 1px solid rgba(59,125,216,0.12); }
.nb-balloon-blue:hover { background: rgba(59,125,216,0.10); }
.nb-num-blue { background: #3B7DD8; }

/* Green (Patient Data) */
.nb-balloon-green { background: rgba(45,157,94,0.04); border: 1px solid rgba(45,157,94,0.12); }
.nb-balloon-green:hover { background: rgba(45,157,94,0.09); }
.nb-num-green { background: #2D9D5E; }

/* Red (Allergies) */
.nb-balloon-red { background: rgba(200,76,76,0.05); border: 1px solid rgba(200,76,76,0.18); }
.nb-balloon-red:hover { background: rgba(200,76,76,0.10); }
.nb-num-red { background: #C84C4C; }

/* Amber (Research) */
.nb-balloon-amber { background: rgba(198,138,29,0.04); border: 1px solid rgba(198,138,29,0.12); }
.nb-balloon-amber:hover { background: rgba(198,138,29,0.09); }
.nb-num-amber { background: #C68A1D; }

/* Moved state */
.nb-balloon-moved {
  opacity: 0.3;
  background: none !important;
  border-style: dashed !important;
  cursor: default;
  pointer-events: none;
}

/* ── Loading Skeleton ── */
.nb-loading-skeleton {
  padding: 12px;
}
.nb-skeleton-line {
  height: 12px;
  background: linear-gradient(90deg, #f0ede8 25%, #e8e4de 50%, #f0ede8 75%);
  background-size: 200% 100%;
  animation: nb-skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: 3px;
  margin-bottom: 8px;
}
@keyframes nb-skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Q3 Empty / Loaded States ── */
.nb-q3-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
}
.nb-q3-condition-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  margin-bottom: 4px;
}
.nb-condition-tag {
  font-size: 10px;
  padding: 2px 8px;
  background: rgba(198,138,29,0.08);
  border: 1px solid rgba(198,138,29,0.2);
  border-radius: 3px;
  color: #92400E;
}
.nb-q3-load-btn {
  padding: 8px 20px;
  font-size: 12px;
  font-weight: 600;
  background: #fff;
  color: #C68A1D;
  border: 1.5px solid #C68A1D;
  border-radius: 4px;
  cursor: pointer;
  min-height: 36px;
  transition: background 0.15s;
}
.nb-q3-load-btn:hover { background: rgba(198,138,29,0.06); }
.nb-q3-load-hint {
  font-size: 10px;
  color: #AAA;
  text-align: center;
}
.nb-q3-loaded {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}
.nb-q3-footer {
  padding: 3px 10px;
  font-size: 9px;
  color: #AAA;
  font-style: italic;
  border-top: 1px solid #F0F0F0;
  flex-shrink: 0;
}

/* ── Q4 Report Editor ── */
.nb-q4-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.nb-draft-status {
  font-size: 10px;
  color: #2D9D5E;
  font-style: italic;
}
.nb-btn-draft,
.nb-btn-structured {
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 500;
  background: #fff;
  color: var(--hakeem-text-secondary);
  border: 1px solid #E5E5E5;
  border-radius: 3px;
  cursor: pointer;
  min-height: 22px;
}
.nb-btn-draft:hover,
.nb-btn-structured:hover { background: #FAFAFA; }
.nb-btn-generate {
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
  background: var(--hakeem-primary);
  color: #fff;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  min-height: 22px;
}
.nb-btn-generate:hover { background: var(--hakeem-primary-dark); }
.nb-btn-generate:disabled { opacity: 0.6; cursor: wait; }
.nb-btn-preview {
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
  background: var(--hakeem-primary);
  color: #fff;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  min-height: 22px;
}
.nb-btn-preview:hover { background: var(--hakeem-primary-dark); }

/* Q4 Split Pane */
.nb-q4-split {
  flex: 1;
  display: flex;
  overflow: hidden;
}
.nb-q4-editor-pane {
  flex: 0 0 55%;
  overflow-y: auto;
  padding: 8px 10px;
  font-size: 12.5px;
  line-height: 1.65;
  border-right: 1px solid #F0F0F0;
}
.nb-q4-divider {
  width: 1px;
  background: #F0F0F0;
  flex-shrink: 0;
}
.nb-q4-preview-pane {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px;
  font-size: 12.5px;
  line-height: 1.65;
  background: #FAFAFA;
}

.nb-q4-empty-prompt {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
  font-size: 12px;
  color: #AAA;
  font-style: italic;
  border: 1px dashed #E5E5E5;
  border-radius: 4px;
  padding: 16px;
}
.nb-q4-preview-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
  font-size: 11px;
  color: #CCC;
  font-style: italic;
}

/* Q4 Items */
.nb-q4-item {
  padding: 2px 4px;
  margin: 2px 0;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.1s;
}
.nb-q4-item:hover { background: rgba(0,0,0,0.02); }
.nb-q4-dr-item { border-left: 2px solid #E5E5E5; padding-left: 8px; }

.nb-src-marker {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 0 3px;
  border-radius: 2px;
  vertical-align: middle;
  position: relative;
  top: -1px;
  font-family: 'IBM Plex Mono', monospace;
  margin-right: 3px;
}
.nb-marker-blue { background: rgba(59,125,216,0.1); color: #3B7DD8; }
.nb-marker-green { background: rgba(45,157,94,0.1); color: #2D9D5E; }
.nb-marker-amber { background: rgba(198,138,29,0.1); color: #C68A1D; }
.nb-marker-dr { background: rgba(0,0,0,0.05); color: var(--hakeem-text-secondary); }

.nb-q4-item-text {
  font-size: 12.5px;
}

.nb-q4-annotation {
  margin: 1px 0 4px 16px;
  padding: 2px 0;
  font-size: 12px;
  color: var(--hakeem-text-secondary);
  font-style: italic;
}

.nb-q4-slash-entry {
  margin: 3px 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--hakeem-primary-dark);
  display: flex;
  align-items: center;
  gap: 6px;
}
.nb-slash-cmd {
  font-weight: 700;
  color: var(--hakeem-primary);
}

/* FM Process Status Badges */
.fm-status {
  display: inline-block;
  font-size: 9px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  line-height: 1.4;
  white-space: nowrap;
  margin-left: auto;
}
.fm-status-pending {
  background: #FFF3CD;
  color: #856404;
  border: 1px solid #FFEEBA;
}
.fm-status-done {
  background: #D4EDDA;
  color: #155724;
  border: 1px solid #C3E6CB;
}
.fm-status-error {
  background: #F8D7DA;
  color: #721C24;
  border: 1px solid #F5C6CB;
}
.fm-status-offline {
  background: #E2E3E5;
  color: #383D41;
  border: 1px solid #D6D8DB;
}

/* Q4 Text Input Area */
.nb-q4-input-area {
  display: flex;
  gap: 4px;
  padding: 4px 8px;
  border-top: 1px solid #F0F0F0;
  flex-shrink: 0;
  background: #fff;
}
.nb-q4-textarea {
  flex: 1;
  resize: none;
  border: 1px solid #E5E5E5;
  border-radius: 3px;
  padding: 4px 8px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  min-height: 32px;
  max-height: 80px;
  line-height: 1.4;
}
.nb-q4-textarea:focus {
  outline: none;
  border-color: var(--hakeem-primary);
  box-shadow: 0 0 0 2px rgba(183,110,121,0.1);
}
.nb-q4-add-btn {
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  background: var(--hakeem-primary);
  color: #fff;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  min-height: 32px;
  align-self: flex-end;
}
.nb-q4-add-btn:hover { background: var(--hakeem-primary-dark); }

/* Slash Hint Bar */
.nb-slash-hint-bar {
  padding: 3px 10px;
  background: #FAFAFA;
  border-top: 1px solid #F0F0F0;
  font-size: 10px;
  color: #AAA;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.nb-slash-hint-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  font-weight: 600;
  padding: 1px 4px;
  background: #fff;
  border: 1px solid #E5E5E5;
  border-radius: 2px;
  color: var(--hakeem-primary);
  cursor: pointer;
}
.nb-slash-hint-tag:hover { border-color: var(--hakeem-primary); }

/* ── Slash Command Dropdown ── */
.slash-dropdown {
  position: fixed;
  background: #fff;
  border: 1px solid #E5E5E5;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  z-index: 200;
  min-width: 260px;
  max-width: 360px;
  padding: 4px 0;
  font-size: 12px;
}
.slash-dropdown-item {
  padding: 6px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}
.slash-dropdown-item:hover,
.slash-dropdown-item.selected { background: #FAFAFA; }
.slash-dropdown-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.slash-dropdown-name {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  font-size: 12px;
}
.slash-dropdown-desc {
  font-size: 11px;
  color: #888;
}

/* ── Context Menu ── */
.nb-context-menu {
  position: fixed;
  background: #fff;
  border: 1px solid #E5E5E5;
  border-radius: 5px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
  z-index: 100;
  min-width: 170px;
  padding: 4px 0;
  font-size: 12px;
}
.nb-ctx-row {
  padding: 5px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--hakeem-text-primary);
}
.nb-ctx-row:hover { background: #FAFAFA; }
.nb-ctx-remove { color: #C84C4C; }
.nb-ctx-divider { height: 1px; background: #F0F0F0; margin: 3px 0; }
.nb-ctx-info { padding: 4px 12px; font-size: 9px; color: #AAA; }

/* ── Draggable Dividers ── */
.nb-divider-v {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 5px;
  left: calc(var(--q-col-left, 40%) - 2.5px);
  cursor: col-resize;
  z-index: 20;
  background: transparent;
}
.nb-divider-v::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 2px;
  width: 1px;
  background: #E5E5E5;
}
.nb-divider-v:hover::after,
.nb-divider-v.active::after { background: var(--hakeem-primary); width: 2px; left: 1.5px; }

.nb-divider-h {
  position: absolute;
  left: 0;
  right: 0;
  height: 5px;
  top: calc(var(--q-row-top, 50%) - 2.5px);
  cursor: row-resize;
  z-index: 20;
  background: transparent;
}
.nb-divider-h::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 2px;
  height: 1px;
  background: #E5E5E5;
}
.nb-divider-h:hover::after,
.nb-divider-h.active::after { background: var(--hakeem-primary); height: 2px; top: 1.5px; }

/* ── Report Preview in Q4 ── */
.nb-report-level-toggle {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}
.nb-level-btn {
  padding: 3px 10px;
  font-size: 10px;
  font-weight: 600;
  border: 1px solid #E5E5E5;
  background: #fff;
  border-radius: 3px;
  cursor: pointer;
  min-height: 24px;
  color: var(--hakeem-text-secondary);
}
.nb-level-btn.active {
  background: var(--hakeem-primary);
  color: #fff;
  border-color: var(--hakeem-primary);
}
.nb-level-btn:hover:not(.active) { background: #FAFAFA; }

.nb-report-narrative {
  font-size: 13px;
  line-height: 1.8;
}
.nb-report-narrative p { margin-bottom: 8px; }
.nb-report-narrative strong { font-weight: 600; }
.nb-report-marker {
  font-size: 9px;
  font-weight: 700;
  padding: 0 2px;
  border-radius: 2px;
  background: rgba(183,110,121,0.1);
  color: var(--hakeem-primary);
  font-family: 'IBM Plex Mono', monospace;
}

.nb-preview-section-header {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--hakeem-text-secondary);
  margin: 10px 0 4px;
  padding-bottom: 2px;
  border-bottom: 1px solid #F0F0F0;
}
.nb-preview-section-header:first-child { margin-top: 0; }
.nb-preview-item {
  font-size: 12px;
  line-height: 1.6;
  margin: 2px 0;
  white-space: pre-wrap;
}

/* ── Footer ── */
.nb-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 12px;
  background: #fff;
  border-top: 1px solid #E5E5E5;
  height: 24px;
  flex-shrink: 0;
  font-size: 10px;
  color: #AAA;
  font-style: italic;
}
.nb-footer-keys {
  font-style: normal;
}
.nb-footer-keys kbd {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  padding: 1px 4px;
  background: #FAFAFA;
  border: 1px solid #E5E5E5;
  border-radius: 2px;
  color: var(--hakeem-text-secondary);
}

/* ── Audio Playback Panel ── */
.nb-audio-panel {
  margin: 0 8px;
  border: 1px solid #E5E5E5;
  border-radius: 4px;
  background: #FAFAFA;
  font-size: 11px;
  overflow: hidden;
}
.nb-audio-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: #F5F5F5;
  border-bottom: 1px solid #E5E5E5;
  cursor: pointer;
  user-select: none;
  color: var(--hakeem-text-secondary);
}
.nb-audio-header svg { color: #B76E79; flex-shrink: 0; }
.nb-audio-title { font-weight: 500; color: var(--hakeem-text-primary); }
.nb-audio-chunk-count { color: var(--hakeem-text-secondary); font-size: 10px; }
.nb-audio-time { margin-left: auto; font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--hakeem-text-secondary); }
.nb-audio-collapse-btn {
  background: none; border: none; cursor: pointer; padding: 2px; color: var(--hakeem-text-secondary);
  transition: transform 0.2s;
}
.nb-audio-panel.collapsed .nb-audio-collapse-btn { transform: rotate(-90deg); }
.nb-audio-panel.collapsed .nb-audio-body { display: none; }

.nb-audio-body { padding: 6px 8px; }
.nb-audio-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nb-audio-btn {
  background: none; border: 1px solid #E0E0E0; border-radius: 3px;
  padding: 3px 6px; cursor: pointer; color: var(--hakeem-text-primary);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.nb-audio-btn:hover { background: #EEE; }
.nb-audio-play-btn { background: #B76E79; color: white; border-color: #B76E79; }
.nb-audio-play-btn:hover { background: #A05A65; }
.nb-audio-play-btn svg { stroke: white; }

.nb-audio-progress-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-left: 6px;
}
.nb-audio-progress {
  height: 6px;
  background: #E5E5E5;
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.nb-audio-progress-bar {
  height: 100%;
  background: #B76E79;
  border-radius: 3px;
  width: 0%;
  transition: width 0.1s linear;
}
.nb-audio-chunk-label {
  font-size: 9px;
  color: var(--hakeem-text-secondary);
  font-family: 'IBM Plex Mono', monospace;
}

.nb-audio-chunks-list {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 6px;
  max-height: 60px;
  overflow-y: auto;
}
.nb-audio-chunk-tag {
  font-size: 9px;
  padding: 2px 5px;
  border-radius: 2px;
  background: #F0F0F0;
  border: 1px solid #E0E0E0;
  cursor: pointer;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--hakeem-text-secondary);
  transition: background 0.15s;
}
.nb-audio-chunk-tag:hover { background: #E5E5E5; }
.nb-audio-chunk-tag.active {
  background: #B76E79;
  color: white;
  border-color: #B76E79;
}

/* ── Preview & Sign Modal ── */
.nb-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nb-modal {
  background: #fff;
  border-radius: 8px;
  width: 90vw;
  max-width: 800px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 48px rgba(0,0,0,0.2);
}
.nb-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #E5E5E5;
}
.nb-modal-header h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}
.nb-modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--hakeem-text-secondary);
  border-radius: 4px;
  min-height: auto;
}
.nb-modal-close:hover { background: #F0F0F0; }

.nb-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}
.nb-modal-level-toggle {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}
.nb-modal-report-content {
  font-size: 13px;
  line-height: 1.8;
  padding: 12px;
  background: #FAFAFA;
  border: 1px solid #F0F0F0;
  border-radius: 4px;
  margin-bottom: 16px;
  min-height: 100px;
}
.nb-modal-report-content p { margin-bottom: 8px; }

.nb-modal-signoff {
  border-top: 1px solid #E5E5E5;
  padding-top: 16px;
}
.nb-modal-signoff h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 12px;
}
.nb-attest-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.nb-attest-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--hakeem-text-primary);
  cursor: pointer;
  line-height: 1.5;
  text-transform: none;
  font-weight: 400;
  letter-spacing: normal;
}
.nb-attest-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}
.nb-modal-dr-row {
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 500;
}
.nb-modal-pin-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.nb-modal-pin-row label {
  font-size: 12px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  margin-bottom: 0;
}
.nb-pin-input {
  width: 160px;
  padding: 6px 10px;
  border: 1.5px solid #E5E5E5;
  border-radius: 4px;
  font-size: 14px;
  min-height: 36px;
}
.nb-pin-input:focus {
  outline: none;
  border-color: var(--hakeem-primary);
  box-shadow: 0 0 0 2px rgba(183,110,121,0.1);
}
.nb-auth-error {
  font-size: 12px;
  color: #C84C4C;
  width: 100%;
}
.nb-sign-btn {
  width: 100%;
  padding: 10px;
  font-size: 14px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--hakeem-primary), var(--hakeem-primary-dark));
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  min-height: 44px;
  box-shadow: 0 4px 12px rgba(183,110,121,0.25);
}
.nb-sign-btn:disabled {
  background: #E5E5E5;
  color: #AAA;
  cursor: not-allowed;
  box-shadow: none;
}
.nb-sign-btn:hover:not(:disabled) {
  box-shadow: 0 6px 16px rgba(183,110,121,0.35);
}

/* Sign success */
.nb-sign-success {
  text-align: center;
  padding: 32px 16px;
}
.nb-sign-success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #EDF2EA;
  color: #2D9D5E;
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 16px;
}
.nb-sign-success h2 {
  font-size: 20px;
  margin-bottom: 8px;
}
.nb-return-btn {
  margin-top: 16px;
  padding: 10px 24px;
  background: var(--hakeem-primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  min-height: 44px;
}
.nb-return-btn:hover { background: var(--hakeem-primary-dark); }

/* SDX source badges for Q2 */
.nb-source-badge {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 1px 5px;
  border-radius: 3px;
  line-height: 1;
  flex-shrink: 0;
}
.nb-source-sdx {
  background: #E8F5E9;
  color: #2E7D32;
  border: 1px solid #C8E6C9;
}
.nb-source-local {
  background: #FFF3E0;
  color: #E65100;
  border: 1px solid #FFE0B2;
}

/* ── Highlight animation (CR-006) ── */
.nb-balloon-highlighted {
  background: rgba(217, 119, 6, 0.15) !important;
  box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.4);
  animation: highlightPulse 1.5s ease-in-out;
}

@keyframes highlightPulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.4); }
  50% { box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.2); }
}

/* ── Reusable In-App Modal (CR-011) ── */
.hakeem-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}
.hakeem-modal {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  min-width: 360px;
  max-width: 500px;
  width: 90vw;
}
.hakeem-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px 12px;
  border-bottom: 1px solid #E0E0E0;
}
.hakeem-modal-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #333;
}
.hakeem-modal-close {
  background: none; border: none; font-size: 20px; cursor: pointer; color: #999;
  padding: 0 4px;
}
.hakeem-modal-body {
  padding: 16px 20px;
  font-size: 14px;
  color: #555;
}
.hakeem-modal-footer {
  padding: 12px 20px 16px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ── WP-02: Transcript Toggle ── */
.nb-q1-toggle {
  display: flex;
  gap: 2px;
  background: var(--hakeem-surface-tertiary, #EDE9E3);
  border-radius: 4px;
  padding: 2px;
  margin-left: 8px;
}
.nb-q1-toggle-btn {
  padding: 2px 10px;
  font-size: 11px;
  border: none;
  background: transparent;
  color: var(--hakeem-text-secondary, #666);
  cursor: pointer;
  border-radius: 3px;
  font-weight: 500;
  font-family: inherit;
}
.nb-q1-toggle-btn.active {
  background: #fff;
  color: var(--hakeem-text-primary, #333);
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Full transcript view */
.nb-full-transcript {
  font-family: var(--hakeem-font-mono, 'IBM Plex Mono', 'Consolas', monospace);
  font-size: 12px;
  line-height: 1.6;
  padding: 8px;
}
.nb-full-transcript-segment {
  display: flex;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid var(--hakeem-border-light, #F5F5F5);
  cursor: pointer;
}
.nb-full-transcript-segment:hover {
  background: var(--hakeem-surface-secondary, #FAFAFA);
}
.nb-ft-time {
  color: var(--hakeem-text-tertiary, #999);
  font-size: 11px;
  min-width: 42px;
  flex-shrink: 0;
  font-family: var(--hakeem-font-mono, monospace);
}
.nb-ft-speaker {
  font-size: 11px;
  font-weight: 600;
  min-width: 56px;
  flex-shrink: 0;
}
.nb-ft-speaker-doctor { color: #2563EB; }
.nb-ft-speaker-patient { color: #059669; }
.nb-ft-text { flex: 1; color: var(--hakeem-text-primary, #333); }

/* Play icon on transcript items */
.nb-play-icon {
  display: inline-block;
  width: 16px; height: 16px;
  font-size: 10px;
  color: #999;
  cursor: pointer;
  margin-right: 4px;
  opacity: 0;
  transition: opacity 0.15s;
  vertical-align: middle;
}
.nb-balloon:hover .nb-play-icon,
.nb-full-transcript-segment:hover .nb-play-icon { opacity: 1; }
.nb-play-icon:hover { color: #2563EB; }

/* Audio progress marker for timestamp linking */
.nb-audio-progress-marker {
  position: absolute;
  width: 2px;
  height: 100%;
  background: #D97706;
  top: 0;
  transition: left 0.2s;
  pointer-events: none;
}

/* -- WP-02: Transcript Toggle -- */
.nb-q1-toggle {
  display: flex;
  gap: 2px;
  background: var(--hakeem-surface-tertiary, #EDE9E3);
  border-radius: 4px;
  padding: 2px;
  margin-left: 8px;
}
.nb-q1-toggle-btn {
  padding: 2px 10px;
  font-size: 11px;
  border: none;
  background: transparent;
  color: var(--hakeem-text-secondary, #666);
  cursor: pointer;
  border-radius: 3px;
  font-weight: 500;
  font-family: inherit;
}
.nb-q1-toggle-btn.active {
  background: #fff;
  color: var(--hakeem-text-primary, #333);
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Full transcript view */
.nb-full-transcript {
  font-family: var(--hakeem-font-mono, 'IBM Plex Mono', 'Consolas', monospace);
  font-size: 12px;
  line-height: 1.6;
  padding: 8px;
}
.nb-full-transcript-segment {
  display: flex;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid var(--hakeem-border-light, #F5F5F5);
  cursor: pointer;
}
.nb-full-transcript-segment:hover {
  background: var(--hakeem-surface-secondary, #FAFAFA);
}
.nb-ft-time {
  color: var(--hakeem-text-tertiary, #999);
  font-size: 11px;
  min-width: 42px;
  flex-shrink: 0;
  font-family: var(--hakeem-font-mono, monospace);
}
.nb-ft-speaker {
  font-size: 11px;
  font-weight: 600;
  min-width: 56px;
  flex-shrink: 0;
}
.nb-ft-speaker-doctor { color: #2563EB; }
.nb-ft-speaker-patient { color: #059669; }
.nb-ft-text { flex: 1; color: var(--hakeem-text-primary, #333); }

/* Play icon on transcript items */
.nb-play-icon {
  display: inline-block;
  width: 16px; height: 16px;
  font-size: 10px;
  color: #999;
  cursor: pointer;
  margin-right: 4px;
  opacity: 0;
  transition: opacity 0.15s;
  vertical-align: middle;
}
.nb-balloon:hover .nb-play-icon,
.nb-full-transcript-segment:hover .nb-play-icon { opacity: 1; }
.nb-play-icon:hover { color: #2563EB; }

/* Audio progress marker for timestamp linking */
.nb-audio-progress-marker {
  position: absolute;
  width: 2px;
  height: 100%;
  background: #D97706;
  top: 0;
  transition: left 0.2s;
  pointer-events: none;
}


/* ===== WP-03: AI Agents — Verification, Medical Review, Live Report Review ===== */

/* CR-003: Verification correction dot */
.nb-correction-dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: #D97706;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
  cursor: help;
}
.nb-correction-dot:hover {
  background: #B45309;
  box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.3);
}

/* CR-004: Medical reviewer section and balloons */
.nb-reviewer-section {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px dashed var(--hakeem-border-light, #E8E3DC);
}
.nb-section-header-reviewer {
  border-left: 3px solid #D97706;
  background: #FFFBEB;
}
.nb-balloon-reviewer {
  background: #FFFBEB !important;
  border: 1px dashed #D97706 !important;
  border-left: 3px solid #D97706 !important;
}
.nb-num-reviewer {
  background: #D97706;
  color: #fff;
}
.nb-reviewer-importance {
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 3px;
  margin-left: 4px;
  font-weight: 600;
  text-transform: uppercase;
}
.nb-reviewer-high { background: #FEE2E2; color: #991B1B; }
.nb-reviewer-medium { background: #FEF3C7; color: #92400E; }
.nb-reviewer-low { background: #F0F0F0; color: #666; }

/* CR-018: Live report review suggestions */
.nb-live-review {
  padding: 8px 12px;
  background: #FAFAFA;
  border-top: 1px solid #E8E8E8;
  font-size: 12px;
  color: #888;
}
.nb-live-review-header {
  font-size: 11px;
  color: #AAA;
  margin-bottom: 4px;
  font-weight: 500;
}
.nb-live-review-item {
  display: inline-block;
  padding: 2px 8px;
  margin: 2px 4px 2px 0;
  background: #F5F5F5;
  border: 1px solid #E0E0E0;
  border-radius: 3px;
  font-size: 11px;
  color: #999;
  font-style: italic;
}

/* ============================================================
   WP-05: Report Editor Enhancement Styles
   CR-007, CR-008, CR-010, CR-012
   ============================================================ */

/* CR-008: Slash command autocomplete dropdown */
.nb-slash-dropdown {
  position: fixed;
  background: #fff;
  border: 1px solid #E0E0E0;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  min-width: 260px;
  max-height: 280px;
  overflow-y: auto;
  z-index: 5000;
  padding: 4px;
}
.nb-slash-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}
.nb-slash-dropdown-item.selected,
.nb-slash-dropdown-item:hover {
  background: #F5F5F5;
}
.nb-slash-dd-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}
.nb-slash-dd-name {
  font-weight: 600;
  font-family: var(--hakeem-font-mono, monospace);
  color: #333;
  min-width: 50px;
}
.nb-slash-dd-label {
  color: #666;
  flex: 1;
}
.nb-slash-dd-hint {
  font-size: 10px;
  color: #AAA;
  background: #F0F0F0;
  padding: 1px 6px;
  border-radius: 3px;
}

/* CR-007: Structured action blocks in preview */
.nb-preview-action-block {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-left: 3px solid #D97706;
  border-radius: 4px;
  padding: 6px 10px;
  margin: 4px 0;
  font-size: 12px;
}
.nb-preview-action-label {
  font-weight: 600;
  color: #92400E;
  margin-right: 8px;
  font-size: 11px;
  text-transform: uppercase;
}
.nb-preview-action-text {
  color: #333;
}

/* CR-007: Slash entry text span in Q4 editor */
.nb-slash-entry-text {
  color: #333;
}

/* CR-010: Preview source markers */
.nb-preview-item {
  padding: 2px 0;
  font-size: 12px;
  line-height: 1.5;
  color: #333;
}
.nb-preview-marker {
  font-size: 10px;
  font-weight: 600;
  color: #888;
  margin-right: 4px;
}

/* CR-012: Inline editing — Mac-style */
.nb-q4-item-selected {
  outline: 2px solid #2563EB;
  outline-offset: 1px;
  border-radius: 3px;
}
.nb-q4-editing {
  outline: 2px solid #D97706 !important;
}
.nb-q4-inline-input {
  width: 100%;
  padding: 4px 8px;
  border: 1px solid #D97706;
  border-radius: 3px;
  font-size: 13px;
  font-family: inherit;
  line-height: 1.4;
  background: #FFFBEB;
  outline: none;
}
.nb-edited-badge {
  font-size: 9px;
  color: #D97706;
  background: #FFF8E1;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 6px;
  font-style: italic;
}

/* ============================================================
   WP-06: Report Preview & Voice Styles
   CR-016, CR-017
   ============================================================ */

/* CR-017: MOH Report Format */
.moh-report-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 16px;
  border-bottom: 2px solid #1B7F3A;
  margin-bottom: 20px;
}
.moh-facility-name {
  font-size: 18px;
  font-weight: 700;
  color: #1B7F3A;
}
.moh-facility-subtitle {
  font-size: 13px;
  color: #666;
  margin-top: 2px;
}
.moh-report-meta {
  text-align: right;
  font-size: 12px;
}
.moh-meta-row {
  margin: 2px 0;
}
.moh-meta-label {
  color: #888;
  font-weight: 500;
}
.moh-meta-value {
  color: #333;
  font-weight: 600;
  margin-left: 4px;
}

.moh-section {
  margin-bottom: 16px;
}
.moh-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #1B7F3A;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 0;
  border-bottom: 1px solid #E0E0E0;
  margin-bottom: 8px;
}
.moh-section-body {
  font-size: 13px;
  line-height: 1.6;
  color: #333;
  padding-left: 4px;
}

.moh-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 24px;
}
.moh-info-item {
  font-size: 13px;
}
.moh-info-label {
  color: #888;
  font-weight: 500;
}
.moh-allergy-text {
  font-weight: 500;
}
.moh-allergy-present {
  color: #DC2626;
  font-weight: 700;
}

.moh-level-toggle {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  justify-content: center;
}

.moh-action-item {
  padding: 4px 0 4px 12px;
  border-left: 2px solid #D97706;
  margin: 4px 0;
  font-size: 13px;
}

.moh-signature-block {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #E0E0E0;
}
.moh-sig-line {
  display: flex;
  gap: 8px;
  padding: 3px 0;
  font-size: 13px;
}
.moh-sig-label {
  color: #888;
  min-width: 140px;
  font-weight: 500;
}
.moh-sig-value {
  color: #333;
  font-weight: 600;
}
.moh-sig-pending {
  color: #D97706;
  font-style: italic;
  font-weight: 400;
}

.moh-report-footer {
  margin-top: 24px;
  padding-top: 12px;
  border-top: 1px solid #E0E0E0;
  font-size: 10px;
  color: #AAA;
  text-align: center;
  line-height: 1.5;
}

/* CR-017: Print styles for MOH report */
@media print {
  .nb-modal-overlay { background: none !important; }
  .nb-modal { box-shadow: none !important; max-width: 100% !important; width: 100% !important; }
  .nb-modal-signoff { display: none !important; }
  .nb-modal-close { display: none !important; }
  .moh-level-toggle { display: none !important; }
  .nb-modal-header { border-bottom: none !important; }
}

/* ── Data-source banner — sample-vs-live safety indicator ─────────────── */
.data-source-banner {
  background: #FEF3C7;
  color: #78350F;
  border-bottom: 2px solid #F59E0B;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  gap: 10px;
  align-items: center;
  z-index: 1000;
}
.data-source-banner strong { font-weight: 700; letter-spacing: 0.04em; }
.data-source-banner__detail { font-weight: 400; }
.data-source-banner--hidden { display: none; }
