/* Page-specific 1:1 styles */

.brand-script {
  font-style: italic;
  font-weight: 600;
  color: var(--primary);
}

.brand-telehealth {
  font-weight: 800;
  color: #1e3a8a;
  font-size: 1rem;
  line-height: 1.3;
}

.brand-medicare {
  font-weight: 800;
  color: #0ea5e9;
  font-size: 1.15rem;
}

.brand-admin {
  font-weight: 800;
  color: #0f172a;
}

.brand-healthcare {
  font-weight: 800;
  color: #0f172a;
}

.nav-ico {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: block;
  object-fit: contain;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-chevron {
  margin-left: auto;
  font-size: 10px;
  color: #94a3b8;
}

.sidebar-user .meta .role {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
}

/* Landing 1 */
.page-landing {
  background: linear-gradient(180deg, #e8f4fc 0%, #f8fafc 42%, #fff 42%);
}

.landing-logo {
  font-style: italic;
  color: #3b82f6;
}

.role-card .btn-green-landing {
  background: #10b981;
  color: #fff;
  border: none;
  border-radius: 8px;
}

.landing-footer {
  background: #1a1f2b;
}

/* Dashboard 2 */
.kpi-card.with-icon {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: start;
}

.kpi-card .kpi-ico {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.kpi-ico.blue {
  background: #dbeafe;
}
.kpi-ico.orange {
  background: #ffedd5;
}
.kpi-ico.purple {
  background: #ede9fe;
}
.kpi-ico.green {
  background: #dcfce7;
}

.card-head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.card-head-row h2 {
  margin: 0;
}

.btn-icon-dl {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
}

.disease-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 16px;
}

.disease-item {
  display: flex;
  gap: 12px;
  align-items: center;
}

.disease-item .d-ico {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.severity-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.severity-bar {
  height: 8px;
  border-radius: 4px;
  background: #fecaca;
  min-width: 40px;
}

.map-card {
  min-height: 280px;
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

.map-region {
  position: absolute;
  inset: 15% 20%;
  border: 3px solid #7dd3fc;
  border-radius: 40% 60% 50% 40%;
  background: rgba(255, 255, 255, 0.35);
}

.map-bubble {
  position: absolute;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}

.map-legend {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #fff;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 11px;
  box-shadow: var(--shadow);
}

/* Queue 3 */
.queue-subhead {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.queue-card {
  border-radius: 12px;
}

.queue-reject-btn {
  border-color: #fecaca;
  color: #b91c1c;
}

.queue-reject-btn:hover {
  background: #fef2f2;
  border-color: #f87171;
}

.consult-rx-head {
  margin-bottom: 12px;
}

.consult-rx-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.consult-rx-void-btn {
  border-color: #fecaca;
  color: #b91c1c;
}

.consult-rx-void-btn:hover {
  background: #fef2f2;
}

.consult-rx-empty {
  margin: 0 0 12px;
}

.consult-rx-voided-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.consult-rx-voided-title {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
}

.consult-rx-voided-item {
  margin-bottom: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 12px;
  background: #f9fafb;
}

.consult-rx-voided-item summary {
  cursor: pointer;
  font-size: 13px;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.consult-rx-voided-item summary::-webkit-details-marker {
  display: none;
}

.consult-rx-voided-meds {
  color: var(--text-muted);
  font-size: 12px;
}

.consult-rx-voided-body {
  margin-top: 12px;
}

.consult-rx-voided-instruction {
  margin-bottom: 12px;
  font-size: 13px;
}

.consult-rx-modal-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.consult-rx-add-grid .span-full {
  grid-column: 1 / -1;
}

.system-params-form .system-params-section {
  margin-bottom: 16px;
}

.system-params-section-intro {
  margin: -4px 0 16px;
}

.system-param-hint,
.system-param-field-hint {
  margin: 6px 0 0;
  font-size: 12px;
}

.system-params-form .grid-2 .span-full {
  grid-column: 1 / -1;
}

.system-params-actions {
  margin-top: 8px;
}

.param-input-unit {
  display: flex;
  align-items: center;
  gap: 8px;
}

.param-input-unit input {
  flex: 1;
  min-width: 0;
}

.param-input-unit .param-unit {
  flex-shrink: 0;
  font-size: 14px;
  color: var(--text-muted);
}

.queue-reject-modal-hint {
  margin: 0 0 12px;
}

.queue-reject-reason-input {
  width: 100%;
  min-height: 96px;
  resize: vertical;
}

.queue-reject-modal-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.queue-rejection-view-reason {
  margin-top: 6px;
  white-space: pre-wrap;
}

.queue-rejection-view-meta {
  margin: 4px 0 0;
  font-size: 14px;
  color: #111827;
}

.time-urgent {
  color: var(--red) !important;
  font-size: 1.1rem;
}

.time-warn {
  color: #ea580c !important;
}

.time-ok {
  color: var(--green) !important;
}

.queue-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 24px;
  margin-top: 8px;
}

.queue-profile-kv .k {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.queue-profile-kv .v {
  font-size: 14px;
  color: #111827;
  line-height: 1.45;
}

@media (max-width: 900px) {
  .queue-profile-grid {
    grid-template-columns: 1fr;
  }
}

.queue-patient-dossier {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.queue-dossier-intro {
  margin: 0 0 4px;
}

.queue-dossier-section-title {
  margin: 8px 0 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.queue-patient-clinical-card .allergy-em {
  color: #dc2626;
  font-weight: 600;
}

.queue-clinical-rows .patient-info-row:last-child {
  border-bottom: none;
}

.doctor-consult-settings-card {
  margin-top: 16px;
}

.doctor-consult-hint {
  margin: 4px 0 0;
  font-size: 12px;
}

.doctor-consult-live-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 4px;
}

.doctor-consult-max-field {
  margin-top: 16px;
  max-width: 280px;
}

.doctor-consult-form-actions {
  margin-top: 12px;
  padding-top: 0;
  border: none;
}

.doctor-consult-section-intro {
  margin: 0 0 12px;
}

.doctor-consult-admin-note {
  margin: -8px 0 20px;
}

.doctor-queue-control-bar {
  margin-bottom: 16px;
}

.doctor-queue-control-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.doctor-queue-banner {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.doctor-queue-banner--off {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.doctor-queue-banner--warn {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.doctors-list-kpi {
  margin-bottom: 16px;
}

.doctor-online-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  white-space: nowrap;
}

.doctor-online-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.doctor-online-dot--avail {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
}

.doctor-online-dot--on {
  background: #f59e0b;
}

.doctor-online-dot--off {
  background: #cbd5e1;
}

.doctors-list-table-wrap {
  overflow-x: auto;
}

.doctors-list-table {
  min-width: 1100px;
}

.sidebar-doctor-consult {
  margin-top: 4px;
  padding: 10px 10px 8px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.sidebar-doctor-consult-title {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sidebar-doctor-consult-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-consult-toggle-row,
.sidebar-consult-max-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-consult-toggle-label {
  font-size: 12px;
  color: #334155;
  font-weight: 500;
}

.sidebar-consult-max-row input {
  width: 44px;
  padding: 3px 4px;
  font-size: 11px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.sidebar-doctor-consult .toggle.toggle--sm {
  width: 34px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-doctor-consult .toggle.toggle--sm::after {
  width: 14px;
  height: 14px;
  top: 2px;
  left: 2px;
}

.sidebar-doctor-consult .toggle.toggle--sm.on::after {
  left: 18px;
}

.sidebar-consult-more {
  display: block;
  text-align: center;
  font-size: 11px;
  color: var(--primary);
  text-decoration: none;
}

.sidebar-consult-more:hover {
  text-decoration: underline;
}

/* Consultation 3.1 — Patient Consultation */
.main.consult-main {
  background: #f1f5f9;
  padding-bottom: 96px;
}

.consult-page {
  max-width: 100%;
}

.consult-head {
  margin-bottom: 20px;
}

.consult-head h1 {
  margin: 0 0 6px;
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
}

.consult-head .subtitle {
  margin: 0;
  color: #64748b;
  font-size: 14px;
}

.consult-top {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 20px;
  align-items: stretch;
  margin-bottom: 20px;
  min-height: 360px;
}

.consult-video-module {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
}

.consult-video-frame {
  position: relative;
  flex: 1;
  min-height: 268px;
  background: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.consult-video-frame .consult-video-portrait {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 0;
  object-fit: cover;
}

.consult-video-frame.is-video-ended {
  background: #0f172a;
}

.consult-video-ended-panel {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
  pointer-events: auto;
}

.consult-video-ended-panel[hidden] {
  display: none;
}

.consult-video-ended-text {
  margin: 0;
  max-width: 280px;
  font-size: 13px;
  line-height: 1.55;
  color: #cbd5e1;
}

.consult-video-status-top {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
}

.consult-connect-label {
  font-size: 12px;
  font-weight: 600;
  color: #f87171;
}

.live-pill {
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 4px;
  flex-shrink: 0;
}

.consult-video-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px 18px;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 55%, rgba(15, 23, 42, 0.55) 100%);
}

.consult-video-overlay-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  pointer-events: auto;
}

.consult-video-timer .timer-text .label,
.consult-video-timer .timer-text .sub {
  color: #f8fafc;
}

.consult-video-timer .timer-ring {
  background: rgba(15, 23, 42, 0.45);
  border-color: #f87171;
  color: #fecaca;
}

.consult-video-timer {
  display: flex;
  align-items: center;
  gap: 14px;
}

.timer-ring {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #ef4444;
  flex-shrink: 0;
}

.timer-text .label {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}

.timer-text .sub {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}

.video-ctrls {
  display: flex;
  gap: 8px;
}

.video-ctrl-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.92);
  border: 1px solid rgba(226, 232, 240, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

.video-ctrl-btn.is-off {
  background: rgba(254, 226, 226, 0.95);
  border-color: #fecaca;
  color: #b91c1c;
}

.video-ctrl-btn--end {
  background: rgba(239, 68, 68, 0.95);
  border-color: #dc2626;
  color: #fff;
}

.video-ctrl-btn--end:hover {
  background: rgba(220, 38, 38, 0.98);
  border-color: #b91c1c;
}

.video-ctrl-btn--end .video-ctrl-icon {
  filter: brightness(0) invert(1);
}

.video-ctrl-icon {
  display: block;
  width: 22px;
  height: 22px;
  object-fit: contain;
  pointer-events: none;
}

.patient-panel {
  margin-bottom: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.patient-panel h2 {
  margin: 0 0 16px;
  font-size: 1.05rem;
  font-weight: 700;
}

.patient-info-rows {
  flex: 1;
}

.patient-info-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14px;
}

.patient-info-row .k {
  color: #64748b;
  flex-shrink: 0;
}

.patient-info-row .v {
  color: #0f172a;
  font-weight: 500;
  text-align: right;
}

.patient-panel .symptoms-block {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}

.patient-panel .symptoms-block .field-label {
  margin-bottom: 8px;
}

.allergy-line {
  margin-top: 14px;
  font-size: 14px;
}

.allergy-line strong {
  color: #334155;
}

.allergy-line .val {
  color: #dc2626;
  font-weight: 600;
}

.consult-reports-card {
  padding: 0;
  overflow: hidden;
}

.consult-reports-card .tabs {
  padding: 0 20px;
  margin: 0;
  background: #fff;
}

.consult-reports-card .tabs-body {
  padding: 16px 20px 20px;
  background: #fff;
}

.consult-reports-card .tabs .tab {
  background: none;
  border: none;
  font: inherit;
}

.consult-reports-panel[hidden] {
  display: none;
}

.consult-history-intro {
  margin: 0 0 14px;
}

.consult-history-archived-title {
  margin: 20px 0 12px;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.consult-history-archived {
  margin-top: 0;
}

.report-mini-grid.consult-reports {
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.report-mini.consult-rpt {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 16px;
  background: #fafafa;
}

.report-mini.consult-rpt .rpt-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 6px;
  color: #0f172a;
}

.report-mini.consult-rpt .rpt-date {
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 4px;
}

.report-mini.consult-rpt .rpt-body {
  font-size: 13px;
  color: #475569;
  line-height: 1.45;
}

.lab-results-card h2 {
  margin: 0 0 4px;
}

.lab-results-card .lab-sub {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 12px;
}

.lab-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.lab-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14px;
}

.lab-list li:last-child {
  border-bottom: none;
}

.lab-list .param {
  color: #334155;
}

.lab-list .val-normal {
  color: #0f172a;
  font-weight: 500;
}

.symptom-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  margin: 2px 4px 2px 0;
}

.sym-blue {
  background: #dbeafe;
  color: #1d4ed8;
}
.sym-yellow {
  background: #fef9c3;
  color: #a16207;
}
.sym-green {
  background: #dcfce7;
  color: #166534;
}

.report-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.report-mini {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  font-size: 13px;
}

.ai-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 16px;
}

.icd-tags span {
  display: inline-block;
  background: #dbeafe;
  color: #1d4ed8;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  margin: 2px;
}

.rx-lines-table .num,
.rx-history-table .num {
  text-align: right;
  white-space: nowrap;
}

.rx-total-row td {
  border-top: 2px solid var(--border);
  padding-top: 12px;
}

.rx-total-label {
  text-align: right;
  font-weight: 600;
  color: #334155;
}

.consult-footer-bar {
  position: fixed;
  z-index: 50;
  left: var(--sidebar-w);
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 28px;
  margin-top: 0;
  background: #fff;
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.08);
}

.consult-footer-bar .btn {
  min-width: 120px;
}

@media (max-width: 900px) {
  .consult-footer-bar {
    left: 0;
    padding: 12px 16px;
  }

  .consult-footer-bar .btn {
    min-width: 0;
    flex: 1 1 calc(50% - 6px);
  }
}

.referral-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.referral-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  font-size: 13px;
}

.referral-live-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.referral-live-head h2 {
  margin: 0;
}

.referral-live-intro {
  margin: 0 0 14px;
}

.referral-live-actions {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.referral-quick-link {
  color: var(--primary);
  border-color: #bfdbfe;
  background: #eff6ff;
}

.referral-status-tabs {
  margin-bottom: 16px;
}

.referral-form-grid .span-full {
  grid-column: 1 / -1;
}

.referral-form-page .form-footer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.referral-progress {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 200px;
}

.referral-progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.referral-progress-step .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e5e7eb;
  border: 2px solid #d1d5db;
}

.referral-progress-step .lbl {
  font-size: 10px;
  color: #9ca3af;
  white-space: nowrap;
  max-width: 72px;
  text-align: center;
  line-height: 1.2;
}

.referral-progress-step.is-active .dot {
  background: #fff;
  border-color: #f97316;
  box-shadow: 0 0 0 3px #ffedd5;
}

.referral-progress-step.is-active .lbl {
  color: #ea580c;
  font-weight: 600;
}

.referral-progress-step.is-done .dot {
  background: #22c55e;
  border-color: #22c55e;
}

.referral-progress-step.is-done .lbl {
  color: #374151;
}

.referral-progress-connector {
  flex: 1 1 24px;
  height: 2px;
  background: #e5e7eb;
  margin: 0 4px 14px;
  min-width: 12px;
}

.referral-progress-connector.is-done {
  background: #22c55e;
}

.referral-list-table .referral-progress-cell {
  min-width: 220px;
}

.referral-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 20px;
  margin-bottom: 20px;
  font-size: 13px;
}

.referral-detail-grid .k {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.referral-readonly-block {
  padding: 10px 12px;
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
}

.referral-detail-modal .referral-progress {
  margin: 8px 0 20px;
  justify-content: center;
}

.table-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 28px 16px;
}

.lab-low {
  color: var(--red);
  font-weight: 600;
}

/* Reports 4 */
.rpt-icon {
  display: inline-block;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  margin-right: 4px;
  vertical-align: middle;
}

.rpt-blue {
  background: #dbeafe;
}
.rpt-green {
  background: #dcfce7;
}
.rpt-purple {
  background: #ede9fe;
}
.rpt-orange {
  background: #ffedd5;
}

.rpt-metric-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #1e293b;
  font-weight: 600;
  font-size: 13px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}

.rpt-metric-link:hover {
  filter: brightness(0.96);
}

.rpt-metric-num {
  line-height: 1;
}

.rpt-consult-metric {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 4px 8px;
  border-radius: 6px;
  background: #ede9fe;
  font-size: 12px;
  line-height: 1.35;
  color: #1e293b;
}

.rpt-consult-duration {
  font-weight: 600;
}

.rpt-consult-fee {
  color: var(--text-muted);
  font-size: 11px;
}

.data-table.reports-aggregate-table .rpt-col-metric {
  text-align: center;
  white-space: nowrap;
}

.queue-consult-export-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.queue-list-toolbar .queue-consult-export-actions {
  flex-shrink: 0;
}

.report-row-actions,
.report-mini-actions,
.phr-report-row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.phr-report-row-actions {
  flex-direction: column;
  align-items: flex-end;
}

@media (min-width: 640px) {
  .phr-report-row-actions {
    flex-direction: row;
    align-items: center;
  }
}

.report-review-head.queue-record-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.queue-record-head-main {
  flex: 1;
  min-width: 220px;
}

.report-review-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
}

.report-review-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 12px 16px;
}

.report-review-head-actions .patient-meta-top {
  text-align: right;
}

.patient-meta-top {
  text-align: right;
  font-size: 13px;
  color: var(--text-muted);
}

.tabs-medicare .tab.active {
  color: #0ea5e9;
  border-bottom-color: #0ea5e9;
}

.report-review-tabs .tab {
  text-decoration: none;
}

.report-review-tabs .tab:hover {
  color: #0ea5e9;
}

.report-review-panel .card + .card {
  margin-top: 16px;
}

.report-review-split {
  align-items: stretch;
  margin-bottom: 16px;
}

.report-review-split > .card {
  margin-bottom: 0;
}

.vital-value {
  font-size: 1.25rem;
  display: block;
  margin: 4px 0 8px;
}

.report-diagnosis-block {
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.65;
  color: #374151;
}

.report-notes-muted {
  font-size: 13px;
  color: #4b5563;
}

.report-rx-instruction {
  font-size: 13px;
  color: #4b5563;
  line-height: 1.6;
  margin: 0 0 16px;
  padding: 12px 14px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.report-subheading {
  font-size: 14px;
  font-weight: 600;
  margin: 18px 0 10px;
}

.report-transcript-snippet {
  font-size: 13px;
  line-height: 1.65;
  color: #6b7280;
  padding: 12px 14px;
  background: #f9fafb;
  border-radius: 8px;
  border-left: 3px solid #0ea5e9;
}

.report-video-placeholder {
  aspect-ratio: 16 / 9;
  background: linear-gradient(145deg, #0f172a 0%, #1e293b 50%, #334155 100%);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 12px 0;
}

.report-video-play {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #0ea5e9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  padding-left: 4px;
}

.report-video-placeholder-label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
}

.report-video-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  font-size: 13px;
  color: var(--text-muted);
}

.badge-gray {
  background: #f3f4f6;
  color: #6b7280;
}

@media (max-width: 900px) {
  .report-video-layout {
    grid-template-columns: 1fr;
  }
}

.queue-patient-records .queue-patient-context {
  margin-bottom: 16px;
}

.queue-meta-inline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px 16px;
}

.foundation-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 12px;
}

.foundation-nav-link {
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: #374151;
  text-decoration: none;
}

.foundation-nav-link.active {
  border-color: #0ea5e9;
  background: #eff6ff;
  color: #0284c7;
}

.foundation-nav-link:hover {
  border-color: #93c5fd;
}

.foundation-account-grid {
  align-items: stretch;
  margin-bottom: 16px;
}

.perm-matrix {
  margin-top: 8px;
}

.perm-matrix th,
.perm-matrix td {
  vertical-align: middle;
}

.perm-cell {
  text-align: center;
}

.perm-toggle {
  margin: 0 auto;
}

/* Privileges management (#/settings/privileges) */
.privileges-page-header {
  margin-bottom: 16px;
}

.privileges-role-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.privileges-role-tab {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.privileges-role-tab:hover {
  border-color: #93c5fd;
  color: var(--primary);
}

.privileges-role-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.privileges-user-card {
  margin-bottom: 20px;
}

.privileges-user-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.privileges-user-card-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.privileges-select-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.privileges-user-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid #eef0f2;
  border-radius: 10px;
  overflow: hidden;
}

.privileges-user-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: #fff;
  border-bottom: 1px solid #f3f4f6;
}

.privileges-user-row:last-child {
  border-bottom: none;
}

.privileges-user-check {
  flex-shrink: 0;
  margin: 0;
  cursor: pointer;
}

.privileges-user-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.privileges-user-avatar {
  flex-shrink: 0;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.privileges-user-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.privileges-user-meta strong {
  font-size: 14px;
}

.privileges-user-meta span {
  font-size: 13px;
  color: var(--text-muted);
}

.privileges-user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}

.privileges-individual-hint {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.privileges-assign-card h2 {
  margin: 0 0 16px;
  font-size: 1.05rem;
}

.privileges-toggle-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px 40px;
}

.priv-toggle-block-title {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.priv-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f3f4f6;
}

.priv-toggle-row:last-child {
  border-bottom: none;
}

.priv-toggle-label {
  font-size: 14px;
  color: var(--text);
}

.priv-toggle-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.priv-yesno {
  font-size: 13px;
  font-weight: 600;
  color: #9ca3af;
  min-width: 28px;
  text-align: right;
}

.priv-yesno.on {
  color: var(--primary);
}

.privileges-feature-toggle {
  flex-shrink: 0;
  cursor: pointer;
}

.privileges-member-note {
  margin-top: 16px;
  margin-bottom: 0;
}

.privileges-form-actions {
  margin-top: 8px;
}

.dashboard-ops-section {
  margin-bottom: 24px;
}

.dashboard-ops-heading {
  margin: 0 0 4px;
  font-size: 1.1rem;
}

.dashboard-ops-sub {
  margin: 0 0 14px;
}

.kpi-row.dashboard-ops-kpi-row {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

@media (max-width: 1400px) {
  .kpi-row.dashboard-ops-kpi-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .kpi-row.dashboard-ops-kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.dashboard-ops-kpi-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  min-height: 118px;
  min-width: 0;
}

.dashboard-ops-kpi-link:hover .dashboard-ops-kpi-card {
  border-color: #93c5fd;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.12);
}

.dashboard-ops-kpi-link--static {
  cursor: default;
}

.dashboard-ops-kpi-link--static:hover .dashboard-ops-kpi-card {
  border-color: var(--border);
  box-shadow: var(--shadow);
}

.dashboard-ops-kpi-trend.up {
  color: var(--green);
}

.dashboard-ops-kpi-trend.down {
  color: var(--red);
}

.dashboard-ops-kpi-card {
  flex: 1;
  width: 100%;
  min-height: 118px;
  padding: 14px 14px;
  align-items: start;
}

.dashboard-ops-kpi-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100%;
}

.dashboard-ops-kpi-card .label {
  font-size: 12px;
  line-height: 1.35;
  min-height: 2.7em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dashboard-ops-kpi-card .value {
  font-size: 1.25rem;
  margin: 6px 0 0;
  line-height: 1.2;
  white-space: nowrap;
}

.dashboard-ops-kpi-card .kpi-ico {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.dashboard-ops-kpi-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: auto;
  padding-top: 6px;
  min-height: 18px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-ops-kpi-sub--spacer {
  visibility: hidden;
  margin-top: auto;
}

.dashboard-device-online-sub {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Vending machines — env trend modal */
.vending-env-link {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.vending-env-temp {
  color: #dc2626;
}

.vending-env-hum {
  color: #2563eb;
}

.vending-env-link:hover {
  opacity: 0.85;
}

.vending-door-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  line-height: 1.3;
}

.vending-door-status--closed {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}

.vending-door-status--open {
  background: #fff7ed;
  border-color: #fdba74;
  color: #c2410c;
}

.vending-door-status--unknown {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #64748b;
}

.vending-door-status--inline {
  min-width: 0;
  padding: 2px 8px;
  cursor: default;
}

.vending-door-status--lg {
  min-width: 88px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: default;
}

.vending-door-modal-panel {
  max-width: 720px;
}

.vending-door-live {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 12px 14px;
  margin-bottom: 18px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.vending-door-live .k {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}

.vending-door-hours-hint {
  font-size: 11px;
  color: #94a3b8;
  margin-left: auto;
}

.vending-door-section {
  margin-bottom: 20px;
}

.vending-door-section h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.vending-door-empty {
  margin: 0;
}

.vending-door-alert-type {
  font-weight: 600;
  color: #b45309;
}

.vending-door-alert-row--after-hours .vending-door-alert-type {
  color: #c2410c;
}

.vending-door-alert-row--long-open .vending-door-alert-type {
  color: #b45309;
}

.vending-env-modal-panel {
  max-width: 640px;
}

.vending-env-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.vending-env-range-btn {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
}

.vending-env-range-btn:hover {
  border-color: #93c5fd;
}

.vending-env-range-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.vending-env-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.vending-env-stats .k {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.vending-env-stats strong {
  font-size: 1.1rem;
}

.vending-env-chart-wrap {
  background: #f9fafb;
  border: 1px solid #eef0f2;
  border-radius: 10px;
  padding: 12px;
}

.vending-env-chart {
  width: 100%;
  height: auto;
  display: block;
}

.vending-env-chart-hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

/* Vending stock distribution */
.vending-fleet-stock-card {
  margin-bottom: 20px;
}

.vending-fleet-stock-card h2 {
  margin: 0 0 14px;
  font-size: 1.05rem;
}

.vending-fleet-stock-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.vending-fleet-stock-row--6 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (min-width: 1100px) {
  .vending-fleet-stock-row--6 {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.vending-fleet-stat .k {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.vending-fleet-stat strong {
  font-size: 1.35rem;
}

.vending-fleet-stat .sub {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.vending-stock-col {
  min-width: 140px;
  vertical-align: middle;
}

.vending-stock-viz {
  border: none;
  background: #f9fafb;
  border-radius: 8px;
  padding: 6px;
  cursor: pointer;
  display: block;
  width: 100%;
  max-width: 120px;
}

.vending-stock-viz:hover {
  box-shadow: 0 0 0 2px #bfdbfe;
}

.vending-stock-mini-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.vending-stock-mini-row {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 2px;
}

.vending-stock-cell {
  display: block;
  border-radius: 2px;
  min-height: 6px;
  min-width: 6px;
}

.vending-stock-cell--ok {
  background: #22c55e;
}

.vending-stock-cell--low {
  background: #f59e0b;
}

.vending-stock-cell--empty {
  background: #d1d5db;
}

.vending-stock-cell--fault {
  background: #ef4444;
}

.vending-stock-stats-cell {
  font-size: 12px;
  min-width: 130px;
}

.vending-stock-fill-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.vending-stock-bar {
  height: 6px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 6px;
}

.vending-stock-bar-fill {
  height: 100%;
  border-radius: 999px;
}

.vending-stock-bar-fill--ok {
  background: #22c55e;
}

.vending-stock-bar-fill--warn {
  background: #f59e0b;
}

.vending-stock-bar-fill--danger {
  background: #ef4444;
}

.vending-stock-counts {
  color: var(--text);
  font-weight: 600;
  margin-bottom: 2px;
}

.vending-stock-alerts {
  color: var(--text-muted);
  line-height: 1.35;
}

.vending-stock-sales {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
}

.vending-stock-modal-panel {
  max-width: 920px;
}

.vending-stock-modal-stats--wide {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

@media (max-width: 768px) {
  .vending-stock-modal-stats--wide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.vending-slot-table {
  font-size: 12px;
}

.vending-slot-table .cell-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.vending-slot-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: middle;
}

.vending-slot-status-dot.vending-stock-cell--ok {
  background: #22c55e;
}

.vending-slot-status-dot.vending-stock-cell--low {
  background: #f59e0b;
}

.vending-slot-status-dot.vending-stock-cell--empty {
  background: #d1d5db;
}

.vending-slot-status-dot.vending-stock-cell--fault {
  background: #ef4444;
}

.vending-stock-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-bottom: 14px;
  font-size: 12px;
}

.vending-stock-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.vending-stock-legend .vending-stock-cell {
  width: 12px;
  height: 12px;
}

.vending-stock-modal-stats {
  margin-bottom: 16px;
}

.vending-stock-floor-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 420px;
  overflow-y: auto;
}

.vending-stock-floor-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
}

.vending-stock-detail-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.vending-stock-detail-cell {
  border-radius: 6px;
  padding: 6px 4px;
  text-align: center;
  font-size: 10px;
  line-height: 1.25;
  color: #111827;
}

.vending-stock-detail-cell .ch {
  display: block;
  font-weight: 700;
}

.vending-stock-detail-cell .qty {
  display: block;
  opacity: 0.85;
}

.vending-stock-modal-tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.vending-stock-modal-tabs .tab {
  margin-bottom: -1px;
}

.vending-ledger-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.vending-ledger-mini-tabs .tab {
  font-size: 12px;
  padding: 6px 12px;
}

.vending-ledger-tabs {
  margin-bottom: 16px;
}

.vending-ledger-filters {
  margin-bottom: 16px;
  padding: 16px 20px;
}

.vending-ledger-sn-filter {
  max-width: 420px;
  margin: 0;
}

.vending-ledger-table {
  font-size: 13px;
}

.vending-ledger-table code.vending-ledger-ref {
  font-size: 11px;
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
}

.vending-ledger-badge--in {
  background: #dcfce7;
  color: #166534;
}

.vending-ledger-badge--out {
  background: #ffedd5;
  color: #c2410c;
}

.vending-ledger-qty--in {
  color: #15803d;
}

.vending-ledger-qty--out {
  color: #c2410c;
}

.vending-ledger-remark {
  max-width: 200px;
  font-size: 12px;
  color: var(--text-muted);
}

.vending-ledger-empty {
  padding: 24px 8px;
  text-align: center;
}

@media (max-width: 900px) {
  .vending-fleet-stock-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .privileges-toggle-grid {
    grid-template-columns: 1fr;
  }

  .privileges-user-row {
    flex-wrap: wrap;
  }

  .privileges-user-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 900px) {
  .queue-meta-inline {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Doctor form 1.2 */
.doctor-form-wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 24px 32px;
}

.doctor-form-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 32px;
  box-shadow: var(--shadow);
}

.form-section {
  padding: 24px 0;
  border-bottom: 1px solid #f3f4f6;
}

.form-section:first-child {
  padding-top: 0;
}

.form-section:last-child {
  border-bottom: none;
}

.form-section h2 {
  margin: 0 0 16px;
  font-size: 1rem;
  font-weight: 700;
}

.input-add-btn {
  position: relative;
}

.input-add-btn .add-plus {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
}

.char-count {
  text-align: right;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: 13px;
}

.file-row .pdf-ico {
  color: var(--red);
}

.file-row .del-ico {
  margin-left: auto;
  color: var(--red);
  cursor: pointer;
}

.doctor-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.upload-zone-lead {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.upload-zone-text {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
}

.upload-zone-hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.upload-zone-icon {
  line-height: 0;
}

/* Org 1.3 */
.org-form-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 32px;
}

.org-hero {
  background: linear-gradient(90deg, #eff6ff, #fff);
  border: 1px solid var(--border);
  border-radius: 12px 12px 0 0;
  padding: 20px 24px;
  margin-top: 8px;
}

.org-hero h2 {
  margin: 0;
  color: #1e40af;
}

.org-main-card {
  background: #fff;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 12px 12px;
  padding: 24px;
  margin-bottom: 20px;
}

.toolbar-gray {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.toolbar-gray .btn {
  background: #f3f4f6;
  border-color: #e5e7eb;
  font-size: 12px;
  padding: 6px 12px;
}

.org-footer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

.org-add-form-card form {
  display: block;
}

.org-add-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.org-add-form-actions--colored .btn {
  min-width: 108px;
  justify-content: center;
}

.org-list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
}

.org-add-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: 16px 0 0;
}

.org-add-section-heading {
  font-size: 1rem;
  font-weight: 600;
  margin: 24px 0 14px;
  color: #111827;
}

.org-add-form-card .org-add-section-heading:first-of-type {
  margin-top: 0;
}

.org-form-section-title {
  font-size: 14px;
  font-weight: 600;
  margin: 22px 0 12px;
  color: #374151;
}

.org-form-page-in-app .org-hero {
  border-radius: 12px 12px 0 0;
  margin-top: 0;
}

.org-form-page-in-app .org-main-card {
  border-radius: 0 0 12px 12px;
  margin-bottom: 0;
  border: 1px solid var(--border);
  border-top: none;
}

.org-form-page-in-app {
  padding: 0;
  margin-bottom: 20px;
  overflow: hidden;
}

.org-hero-sub {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 14px;
}

.org-hero-name-field {
  margin: 0;
}

.org-hero-name-field .field-label {
  font-size: 11px;
}

.org-hero-name-field input {
  font-size: 1.2rem;
  font-weight: 600;
  color: #1e40af;
}

.org-profile-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 32px;
}

@media (max-width: 960px) {
  .org-profile-columns {
    grid-template-columns: 1fr;
  }
}

.org-inline-table-wrap {
  margin-top: 8px;
}

.org-inline-table input,
.org-inline-table select {
  width: 100%;
  min-width: 64px;
  font-size: 12px;
  padding: 6px 8px;
}

.org-inline-table .icon-btn-link {
  padding: 4px;
}

.org-form-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.org-form-toolbar--colored .btn-sm {
  min-width: 88px;
  justify-content: center;
  border: none;
}

.org-row-add-btn {
  margin-top: 12px;
  border: none;
}

/* Admin 1.4 */
.admin-form-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px;
}

.account-profile-card {
  padding: 24px 28px;
}

.account-profile-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.account-profile-intro {
  flex: 1;
  min-width: 160px;
}

.account-edit-profile-btn {
  margin-left: auto;
  flex-shrink: 0;
}

.account-avatar.avatar-case {
  width: 72px;
  height: 72px;
}

.account-profile-intro h2 {
  margin: 0 0 8px;
  font-size: 1.25rem;
}

.account-role-badge {
  font-size: 12px;
}

.account-fields-grid .account-readonly-field {
  margin-bottom: 0;
}

.account-fields-grid input[readonly] {
  background: #f9fafb;
  color: #111827;
}

.account-login-card {
  margin-top: 16px;
}

.account-login-card-title {
  margin: 0 0 16px;
  font-size: 1.1rem;
}

.account-subheading {
  font-size: 15px;
  font-weight: 600;
  margin: 20px 0 8px;
}

.account-reset-hint {
  margin: 0 0 12px;
}

.account-password-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.btn-account-deactivate {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  color: #6b7280;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
}

.btn-account-deactivate:hover {
  background: #e5e7eb;
  color: #4b5563;
  border-color: #d1d5db;
}

.account-page-hint {
  margin: 20px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.account-page-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px 24px;
}

.account-page-header-main {
  flex: 1;
  min-width: 220px;
}

.account-role-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding-top: 28px;
}

.account-role-switch-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.account-role-switch-btn:hover {
  background: #f8fafc;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.account-role-switch-btn.is-active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.admin-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 28px;
  box-shadow: var(--shadow);
}

.admin-card h2 {
  margin: 0 0 20px;
  font-size: 1.05rem;
}

.admin-layout {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 28px;
}

.admin-photo.avatar-case {
  width: 140px;
  height: 140px;
  margin: 0 auto 12px;
}

.admin-info-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: var(--primary);
  font-size: 13px;
  margin-top: 8px;
}

.admin-page-copy {
  margin-top: 24px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Members 7 */
.members-layout {
  display: flex;
  gap: 0;
}

.members-layout .main-members {
  flex: 1;
  min-width: 0;
}

.members-rail {
  width: 44px;
  flex-shrink: 0;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 9px;
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  padding: 24px 6px 32px;
  letter-spacing: 0.04em;
  border-left: 1px solid #f3f4f6;
}

.members-rail-logo {
  font-style: italic;
  font-weight: 600;
  color: var(--primary);
  font-size: 11px;
  transform: rotate(180deg);
}

.members-rail-text {
  transform: rotate(180deg);
  line-height: 1.5;
  max-height: 420px;
}

.members-search-panel {
  background: #eff6ff;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  padding: 18px 20px 16px;
  margin-bottom: 20px;
}

.members-filter-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr)) auto;
  gap: 12px 16px;
  align-items: end;
  width: 100%;
}

.members-filter-row .field {
  min-width: 0;
  margin-bottom: 0;
}

.members-filter-row .field-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 6px;
  line-height: 1.25;
  min-height: calc(1.25em * 2);
}

.members-filter-row input,
.members-filter-row select {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  font-size: 13px;
  line-height: normal;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  box-sizing: border-box;
}

.members-filter-actions-wrap {
  flex-shrink: 0;
}

.members-filter-actions-spacer {
  visibility: hidden;
  user-select: none;
}

.members-filter-gray {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 20px;
}

.search-panel-blue {
  background: #eff6ff;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.members-search-panel .members-filter-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 0;
  padding: 0;
  white-space: nowrap;
}

.members-search-panel .members-filter-actions .btn {
  height: 36px;
  padding: 0 16px;
  font-size: 13px;
  line-height: 1;
  box-sizing: border-box;
  border-radius: 6px;
}

.search-panel-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.members-page-header h1 {
  font-size: 1.5rem;
}

.members-list-card {
  padding: 20px 24px 16px;
}

.members-list-head h2 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}

.members-list-head .subtitle {
  margin: 0;
}

.members-table th {
  font-size: 12px;
  white-space: nowrap;
}

.member-id-line {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.disease-count-pill {
  min-width: 28px;
  text-align: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
}

.members-table tbody td {
  vertical-align: middle;
}

.members-table .avatar-sm {
  width: 40px;
  height: 40px;
  font-size: 13px;
}

.members-pagination {
  padding-top: 16px;
  border-top: 1px solid #f3f4f6;
  margin-top: 8px;
}

.members-pages {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* PHR 7.1 */
.phr-page {
  max-width: 100%;
  padding-bottom: 8px;
}

.phr-narrative-card,
.phr-extra-card {
  margin-bottom: 16px;
}

.phr-narrative-card > h2,
.phr-extra-card > h2 {
  font-size: 1rem;
  margin: 0 0 12px;
}

.phr-subheading {
  font-size: 14px;
  font-weight: 600;
  margin: 20px 0 12px;
}

.phr-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  margin-bottom: 12px;
}

.phr-pregnancy-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px 28px;
  margin-bottom: 4px;
}

.phr-pregnant-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  margin: 0;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
  white-space: nowrap;
  line-height: 1.25;
}

.phr-weeks-inline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.phr-weeks-inline[hidden] {
  display: none !important;
}

.phr-weeks-inline .field-label {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.phr-weeks-input {
  width: 120px;
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  box-sizing: border-box;
}

.phr-pregnancy-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: 10px 0 0;
}

.phr-header {
  margin-bottom: 20px;
}

.phr-header .back-link {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--primary);
  text-decoration: none;
}

.phr-header h1 {
  margin: 0 0 6px;
  font-size: 1.75rem;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.02em;
}

.phr-subtitle {
  margin: 0;
  font-size: 14px;
  color: #64748b;
  line-height: 1.5;
}

.phr-card-title,
.phr-report-card > h2.phr-card-title,
.phr-history-card > h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 18px;
  color: #111827;
}

.phr-basic-card,
.phr-report-card {
  padding: 24px 28px;
  margin-bottom: 20px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  background: #fff;
}

.phr-basic-card > .phr-card-title {
  padding-bottom: 16px;
  margin-bottom: 0;
  border-bottom: 1px solid #e5e7eb;
}

.phr-basic-layout {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.phr-profile-block {
  padding: 22px 0 26px;
}

.phr-profile-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 20px 24px;
}

.phr-profile-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  min-width: 0;
  padding-top: 4px;
}

.phr-photo-label {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  text-align: left;
}

.phr-photo.avatar-case {
  width: 104px;
  height: 104px;
  margin: 0;
  border: 2px solid #f3f4f6;
}

.phr-fields-wrap {
  min-width: 0;
  padding-top: 0;
}

.phr-change-photo {
  display: inline-flex;
  width: auto;
  margin: 0 0 14px;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  border-radius: 8px;
}

.phr-plan-badges {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin: 0;
  gap: 8px;
}

.phr-plan-badges .plan-badge {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  background: #f3f4f6;
  color: #6b7280;
  border: 1px solid #e5e7eb;
}

.phr-plan-badges .plan-badge.is-active {
  background: #f97316;
  color: #fff;
  font-weight: 700;
  border-color: #f97316;
  box-shadow: none;
}

.phr-fields-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 28px;
}

.phr-fields-grid .field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin-bottom: 0;
}

.phr-fields-grid .phr-field-span-full {
  grid-column: 1 / -1;
}

.phr-fields-grid .field-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 8px;
}

.phr-field-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  box-sizing: border-box;
}

.phr-privacy {
  font-size: 12px;
  color: #94a3b8;
  margin: 16px 0 0;
  padding-top: 0;
  border-top: none;
}

.phr-latest-report-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px 24px;
}

.phr-latest-report-main {
  flex: 1;
  min-width: 200px;
}

.phr-latest-report-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  line-height: 1.35;
}

.phr-latest-report-card > .phr-card-title {
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid #e5e7eb;
}

.phr-latest-report-card .report-date-line {
  margin: 0;
}

.phr-latest-report-card .report-action-row {
  flex-shrink: 0;
  flex-wrap: nowrap;
}

.phr-latest-report-card .phr-report-row-actions {
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.report-date-line {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
}

.phr-report-card .phr-card-title {
  margin-bottom: 14px;
}

.phr-report-card .report-history-item {
  padding: 18px 0;
}

.phr-report-card .report-history-item:first-of-type {
  padding-top: 0;
}

.phr-history-report-card .report-history-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.phr-report-row-title {
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
}

.phr-history-card .history-block:first-child {
  padding-top: 4px;
}

.phr-footer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
  padding-bottom: 24px;
}

.filter-grid-6 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.pagination-go {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.pagination-go input {
  width: 48px;
  padding: 4px 8px;
}

.badge-pending {
  background: #ffedd5;
  color: #c2410c;
}

.report-good {
  background: #dcfce7;
  color: #166534;
}
.report-obs {
  background: #fef9c3;
  color: #a16207;
}
.report-care {
  background: #fee2e2;
  color: #b91c1c;
}

/* Activity logs 9 */
.logs-page {
  max-width: none;
}

.logs-title-row {
  margin-bottom: 20px;
}

.logs-title-row h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
}

.logs-filter-card {
  padding: 20px 24px;
  margin-bottom: 20px;
}

.logs-filter-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 12px 16px;
  align-items: end;
  width: 100%;
}

.logs-date-wrap {
  position: relative;
}

.logs-date-wrap input {
  width: 100%;
  padding-right: 40px;
}

.logs-date-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: #9ca3af;
  pointer-events: none;
}

.logs-filter-row .field {
  min-width: 0;
  margin-bottom: 0;
}

.logs-filter-row .field-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 6px;
  line-height: 1.25;
  min-height: calc(1.25em * 2);
}

.logs-filter-row input,
.logs-filter-row select {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  font-size: 13px;
  line-height: normal;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  box-sizing: border-box;
}

.logs-filter-actions-spacer {
  visibility: hidden;
  user-select: none;
}

.logs-filter-actions-wrap {
  flex-shrink: 0;
}

.logs-apply-btn {
  white-space: nowrap;
  height: 36px;
  padding: 0 28px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  box-sizing: border-box;
  border-radius: 6px;
}

.logs-table-card {
  padding: 20px 24px 16px;
}

.logs-table-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.logs-table-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.logs-table-head .meta {
  font-size: 13px;
  color: var(--text-muted);
}

.logs-table {
  border-collapse: collapse;
}

.logs-table th {
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
  white-space: nowrap;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding-top: 10px;
  padding-bottom: 10px;
}

.logs-table td {
  font-size: 13px;
  color: #374151;
  border-bottom: none;
  padding-top: 14px;
  padding-bottom: 14px;
}

.logs-table tbody tr + tr td {
  border-top: 1px solid #f3f4f6;
}

.logs-table tbody tr:hover td {
  background: transparent;
}

.log-time,
.log-ip {
  color: #4b5563;
  white-space: nowrap;
}

.log-details {
  color: #374151;
  max-width: 360px;
}

.log-badge-visit {
  background: #dcfce7;
  color: #166534;
}

.log-badge-download {
  background: #dbeafe;
  color: #1d4ed8;
}

.log-badge-edit {
  background: #fef9c3;
  color: #a16207;
}

.logs-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 16px;
  margin-top: 12px;
  border-top: 1px solid #f3f4f6;
  font-size: 13px;
  color: var(--text-muted);
}

.logs-pagination .pages {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Devices 8 */
.stat-ico {
  font-size: 20px;
}

.err-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
}

button.err-badge {
  border: none;
  cursor: pointer;
  padding: 0 6px;
  font-family: inherit;
}

button.err-badge:hover {
  filter: brightness(0.95);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35);
}

.proto-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.proto-modal[hidden] {
  display: none !important;
}

.proto-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.proto-modal-panel {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: min(85vh, 640px);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.proto-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 20px 12px;
  border-bottom: 1px solid var(--border);
}

.proto-modal-head h2 {
  margin: 0;
  font-size: 1.15rem;
}

.device-alerts-modal-sub {
  margin: 4px 0 0;
}

.proto-modal-x {
  border: none;
  background: #f1f5f9;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
}

.proto-modal-x:hover {
  background: #e2e8f0;
}

.proto-modal-body {
  padding: 16px 20px 20px;
  overflow: auto;
}

.device-alerts-table .device-alert-time {
  white-space: nowrap;
  font-size: 13px;
  color: #64748b;
}

.device-alert-detail {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.device-alerts-empty {
  text-align: center;
  padding: 32px 16px !important;
  color: var(--text-muted);
}

.device-alert-level {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.device-alert-level-critical {
  background: #fee2e2;
  color: #b91c1c;
}

.device-alert-level-warning {
  background: #fef9c3;
  color: #a16207;
}

.device-alert-level-info {
  background: #dbeafe;
  color: #1d4ed8;
}

.device-alerts-pagination {
  margin-top: 12px;
}

.device-alerts-pagination .page-num {
  cursor: pointer;
  border: none;
  background: transparent;
  font: inherit;
}

.device-alerts-pagination .page-num:disabled,
.device-alerts-pagination .page-num[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

.err-0 {
  background: #dcfce7;
  color: #166534;
}
.err-high {
  background: #fee2e2;
  color: #b91c1c;
}
.err-mid {
  background: #fef9c3;
  color: #a16207;
}

.action-ico-row a {
  color: var(--primary);
  margin-right: 8px;
  font-size: 14px;
  text-decoration: none;
}

.action-ico-row button {
  border: none;
  background: none;
  padding: 0;
  margin-right: 8px;
  font-size: 14px;
  cursor: pointer;
  line-height: 1;
  color: var(--primary);
}

.action-ico-row button:hover {
  opacity: 0.85;
}

.device-detail-head .device-detail-tools {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.device-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 24px;
}

.device-kv .k {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.device-kv.span-full {
  grid-column: 1 / -1;
}

.device-delete-card .device-delete-lead {
  font-size: 1.05rem;
  margin-top: 0;
}

.device-delete-meta {
  margin: 16px 0;
  padding-left: 20px;
  color: #4b5563;
  font-size: 14px;
}

.device-delete-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

/* Device view — right drawer */
.proto-drawer {
  position: fixed;
  inset: 0;
  z-index: 1980;
  pointer-events: none;
}

.proto-drawer:not([hidden]) {
  pointer-events: auto;
}

.proto-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.proto-drawer.is-open .proto-drawer-backdrop {
  opacity: 1;
}

.proto-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: min(440px, 94vw);
  max-width: 100%;
  background: #fff;
  box-shadow: -8px 0 32px rgba(15, 23, 42, 0.12);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.26s ease;
}

.proto-drawer.is-open .proto-drawer-panel {
  transform: translateX(0);
}

.proto-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.proto-drawer-head h2 {
  margin: 0;
  font-size: 1.1rem;
}

.device-drawer-sub {
  margin: 4px 0 0;
  font-size: 13px;
}

.proto-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 24px;
}

.device-drawer-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.device-drawer-section-title {
  margin: 0 0 12px;
  font-size: 14px;
  color: #374151;
}

.device-drawer-grid {
  grid-template-columns: 1fr;
  gap: 14px;
}

body.device-drawer-open {
  overflow: hidden;
}

.device-delete-confirm-panel {
  width: min(440px, 100%);
}

.device-delete-confirm-msg {
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 1.5;
  color: #334155;
}

.action-links button.del,
.action-links button.view,
.action-links button.proto-referral-detail-btn,
.action-ico-row .icon-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.action-links button.del {
  color: #dc2626;
  text-decoration: underline;
  font-size: 13px;
}

.action-links button.view,
.action-links button.proto-referral-detail-btn {
  margin-right: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
}

.del-ico {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 4px;
}

.device-delete-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.page-footer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 16px;
}

/* Settings 10 */
.settings-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.settings-user-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.settings-user-row .bell {
  position: relative;
  font-size: 18px;
}

.settings-user-row .bell .dot {
  position: absolute;
  top: 0;
  right: 0;
  width: 8px;
  height: 8px;
  background: var(--red);
  border-radius: 50%;
}

.main.main-settings {
  background: #f8f9fa;
}

.settings-card-v2 {
  display: flex;
  flex-direction: column;
  min-height: 220px;
  background: #fff;
  border-color: #eef0f2;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  margin-bottom: 0;
}

.settings-card-v2 .card-top {
  display: flex;
  gap: 14px;
  margin-bottom: 12px;
}

.settings-card-v2 .settings-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.settings-card-v2 .settings-card-desc {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.6;
  flex: 1;
  margin: 0;
}

.settings-card-v2 .btns {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.settings-card-add,
.settings-card-view {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  text-decoration: none;
  cursor: pointer;
  line-height: 1.2;
}

.settings-card-add {
  background: #2563eb;
  color: #fff;
}

.settings-card-add:hover {
  background: #1d4ed8;
  color: #fff;
}

.settings-card-view {
  background: #22c55e;
  color: #fff;
}

.settings-card-view:hover {
  background: #16a34a;
  color: #fff;
}

.page-permissions-card h2 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}

.page-permissions-panel {
  margin-top: 12px;
}

.page-perm-group {
  padding: 14px 0;
  border-bottom: 1px solid #eef0f2;
}

.page-perm-group:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.page-perm-group:first-child {
  padding-top: 0;
}

.page-perm-group-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--text);
}

.page-perm-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.page-perm-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.page-perm-role-card {
  margin-bottom: 20px;
}

.settings-module-head {
  margin-bottom: 20px;
}

.settings-list-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.settings-list-toolbar input[type="search"] {
  flex: 1;
  min-width: 200px;
  max-width: 420px;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}

.data-table .cell-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-edit-teal {
  background: #0d9488;
  color: #fff;
  border: none;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 6px;
}

.btn-del-red {
  background: #ef4444;
  color: #fff;
  border: none;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 6px;
}

/* Doctor profile 5.1 */
.profile-scroll .section-block {
  margin-bottom: 20px;
}

.profile-scroll .section-block > h2 {
  font-size: 1rem;
  margin: 0 0 12px;
}

.profile-top {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
}

.profile-photo-lg.avatar-case {
  width: 100%;
  max-width: 220px;
  height: auto;
  aspect-ratio: 1;
  border-radius: 8px;
}

.doctor-field .lbl {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  margin-bottom: 4px;
}

.doctor-field-v {
  font-size: 13px;
  font-weight: 500;
  color: #111827;
}

.doctor-lang-row {
  grid-column: 1 / -1;
  margin-top: 8px;
  font-size: 13px;
}

.doctor-lang-row .lbl {
  display: block;
  margin-bottom: 8px;
}

.doctor-lang-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 20px;
}

.doctor-bio p {
  font-size: 13px;
  color: #4b5563;
  line-height: 1.75;
  margin: 0 0 12px;
}

.doctor-bio p:last-child {
  margin-bottom: 0;
}

.doctor-video-ph {
  height: 220px;
  background: #e8eef5;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 14px;
  font-weight: 500;
}

.doctor-video-about h3 {
  font-size: 13px;
  font-weight: 600;
  margin: 14px 0 6px;
}

.doctor-video-about p {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.6;
  margin: 0;
}

.doctor-specialties-box {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 13px;
  color: #2563eb;
  line-height: 1.6;
}

.doctor-years-card {
  text-align: center;
  padding: 28px 16px;
}

.doctor-years-card .years-num {
  font-size: 2.75rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.doctor-years-card .years-cap {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.stat-pastel {
  border-radius: 10px;
  padding: 16px;
  font-size: 12px;
  color: #374151;
}

.stat-pastel strong {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 4px;
}

.stat-pastel-blue {
  background: #eff6ff;
  border: 1px solid #dbeafe;
}

.stat-pastel-green {
  background: #ecfdf5;
  border: 1px solid #d1fae5;
}

.stat-pastel-purple {
  background: #f5f3ff;
  border: 1px solid #ede9fe;
}

.stat-pastel-orange {
  background: #fff7ed;
  border: 1px solid #ffedd5;
}

.doctor-chart-line {
  height: 180px;
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 14px;
  padding: 12px;
  position: relative;
}

.doctor-chart-line svg {
  width: 100%;
  height: 100%;
}

.doctor-chart-title {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
}

.review-card {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: 13px;
}

.review-card:last-child {
  border-bottom: none;
}

.review-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.review-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin: 4px 0 8px;
}

.review-stars {
  color: #f59e0b;
  font-size: 12px;
  letter-spacing: 1px;
}

.rank-badge {
  display: inline-flex;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.rank-1 {
  background: #3b82f6;
}
.rank-2 {
  background: #22c55e;
}
.rank-3 {
  background: #f97316;
}

.doctor-revenue-head {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.revenue-bar-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 12px;
  height: 140px;
  padding: 16px 24px 8px;
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.revenue-bar-chart .bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
  justify-content: flex-end;
}

.revenue-bar-chart .bar {
  width: 100%;
  max-width: 48px;
  background: #22c55e;
  border-radius: 4px 4px 0 0;
}

.revenue-bar-chart .bar-lbl {
  font-size: 11px;
  color: var(--text-muted);
}

.doctor-account-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.doctor-account-grid h3 {
  font-size: 14px;
  margin: 0 0 12px;
}

.doctor-kv {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: 13px;
}

.doctor-kv .k {
  color: var(--text-muted);
}

.doctor-qual-list {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: #4b5563;
  line-height: 1.8;
}

.cert-grid .cert-thumb {
  aspect-ratio: 4/3;
  background: linear-gradient(145deg, #f8fafc, #e2e8f0);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
}

.cert-grid .cert-cap {
  font-size: 11px;
  color: #4b5563;
  line-height: 1.4;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 24px;
  font-size: 13px;
}

.detail-grid .lbl {
  color: var(--text-muted);
  font-size: 11px;
}

.lang-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  margin-left: 6px;
}

.lang-native {
  background: #dcfce7;
  color: #166534;
}
.lang-fluent {
  background: #dbeafe;
  color: #1d4ed8;
}

.ach-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.ach-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  font-size: 12px;
}

.stat-mini-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.stat-mini {
  border-radius: 10px;
  padding: 14px;
  color: #fff;
  font-size: 13px;
}

.stat-mini strong {
  display: block;
  font-size: 1.25rem;
}

.stat-blue {
  background: #3b82f6;
}
.stat-green {
  background: #22c55e;
}
.stat-purple {
  background: #8b5cf6;
}
.stat-orange {
  background: #f97316;
}

.chart-ph {
  height: 160px;
  background: linear-gradient(180deg, #f8fafc, #e2e8f0);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 13px;
}

.revenue-bars {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  height: 120px;
  padding: 16px;
}

.revenue-bars span {
  flex: 1;
  background: #22c55e;
  border-radius: 4px 4px 0 0;
  min-height: 20%;
}

/* Org list revenue */
.rev-main {
  font-weight: 700;
}

.rev-sub {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.org-search-row {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.org-search-row input {
  flex: 1;
}

.pagination-full {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.per-page select {
  width: auto;
  display: inline-block;
  margin-left: 8px;
}

/* PHR 7.1 */
.plan-badges {
  display: flex;
  gap: 8px;
  margin: 12px 0;
}

.plan-badge {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  background: #f3f4f6;
}

.plan-badge.platinum:not(.is-active) {
  background: #f3f4f6;
  color: #6b7280;
}

.report-action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

.btn-rpt {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 6px;
  border: none;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  line-height: 1.25;
}

.report-action-row .btn-rpt img,
.report-action-row .btn-rpt .proto-icon,
.report-action-row .btn-rpt .phr-rpt-icon-img {
  display: none !important;
}

a.btn-rpt.phr-rpt-link,
button.btn-rpt.proto-phr-expenses-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  line-height: 1.25;
  white-space: nowrap;
  font: inherit;
}

a.btn-rpt.phr-rpt-link:hover,
button.btn-rpt.proto-phr-expenses-btn:hover {
  filter: brightness(1.06);
}

.phr-exp-summary {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.phr-exp-amount {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.phr-exp-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 14px;
}

.phr-exp-totals .k {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.phr-exp-paid {
  color: #15803d;
}

.phr-exp-due {
  color: #c2410c;
}

.phr-exp-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.btn-rpt-blue {
  background: #3b82f6;
}
.btn-rpt-green {
  background: #22c55e;
}
.btn-rpt-purple {
  background: #8b5cf6;
}
.btn-rpt-yellow {
  background: #eab308;
  color: #422006;
}

.btn-rpt-sky {
  background: #2563eb;
  color: #fff;
}

.history-text-block {
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  font-size: 13px;
  color: #4b5563;
  line-height: 1.6;
}

.report-history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #f3f4f6;
  flex-wrap: wrap;
}

.privilege-user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f3f4f6;
}

.privilege-user-row .avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #cbd5e1;
}

.grid-2 .span-full,
.grid-3 .span-full {
  grid-column: 1 / -1;
}

@media (max-width: 900px) {
  .consult-top {
    grid-template-columns: 1fr;
  }

  .report-mini-grid.consult-reports {
    grid-template-columns: 1fr;
  }

  .profile-top,
  .admin-layout,
  .referral-grid,
  .ach-grid,
  .stat-mini-row,
  .doctor-account-grid,
  .doctor-revenue-head,
  .phr-fields-grid {
    grid-template-columns: 1fr;
  }

  .phr-profile-row {
    align-items: flex-start;
  }

  .phr-latest-report-row {
    flex-direction: column;
    align-items: stretch;
  }

  .phr-latest-report-card .report-action-row {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .members-layout {
    flex-direction: column;
  }

  .members-rail {
    writing-mode: horizontal-tb;
    width: auto;
    padding: 8px 0 0;
    justify-content: flex-end;
  }

  .logs-filter-row {
    grid-template-columns: 1fr;
  }

  .logs-filter-actions-wrap {
    grid-column: 1 / -1;
  }

  .logs-apply-btn {
    width: 100%;
  }

  .filter-grid-6 {
    grid-template-columns: 1fr 1fr;
  }

  .members-filter-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .members-filter-actions-wrap {
    grid-column: 1 / -1;
  }

  .members-search-panel .members-filter-actions {
    justify-content: center;
  }
}
