:root {
      --color-primary: #6366f1;
      --color-success: #10b981;
      --color-warning: #f59e0b;
      --color-danger: #ef4444;
      --color-info: #3b82f6;
      --color-bg: #f8fafc;
      --color-card: #ffffff;
      --color-text: #1e293b;
      --color-text-light: #64748b;
      --color-border: #e2e8f0;
      --radius: 12px;
      --shadow: 0 1px 3px rgba(0,0,0,0.1);
    }
    
    * { box-sizing: border-box; margin: 0; padding: 0; }
    
    body {
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
      background: var(--color-bg);
      color: var(--color-text);
      line-height: 1.5;
    }
    
    .header {
      background: var(--color-card);
      border-bottom: 1px solid var(--color-border);
      padding: 1rem 2rem;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    
    .header__brand {
      display: flex;
      align-items: center;
      gap: 0.75rem;
    }
    
    .header__logo { font-weight: 700; font-size: 1.25rem; }
    
    .header__badge {
      background: #fef3c7;
      color: #92400e;
      padding: 2px 8px;
      border-radius: 4px;
      font-size: 0.75rem;
      font-weight: 600;
    }
    
    .header__user {
      display: flex;
      align-items: center;
      gap: 1rem;
    }
    
    .header__email {
      color: var(--color-text-light);
      font-size: 0.875rem;
    }
    
    .btn {
      padding: 0.5rem 1rem;
      border-radius: 6px;
      font-size: 0.875rem;
      font-weight: 500;
      cursor: pointer;
      border: none;
      transition: all 0.2s;
    }
    
    .btn--ghost {
      background: transparent;
      color: var(--color-text-light);
    }
    
    .btn--ghost:hover { background: var(--color-bg); }
    
    .btn--primary {
      background: var(--color-primary);
      color: white;
    }
    
    .btn--primary:hover { opacity: 0.9; }
    
    .btn--success { background: var(--color-success); color: white; }
    .btn--warning { background: var(--color-warning); color: white; }
    .btn--danger { background: var(--color-danger); color: white; }
    .btn--small { padding: 0.25rem 0.5rem; font-size: 0.75rem; }
    
    .container {
      max-width: 1200px;
      margin: 0 auto;
      padding: 2rem;
    }
    
    /* Tabs */
    .tabs {
      display: flex;
      gap: 0;
      margin-bottom: 2rem;
      border-bottom: 1px solid var(--color-border);
    }
    
    .tab {
      padding: 0.75rem 1.5rem;
      background: none;
      border: none;
      font-size: 0.9375rem;
      font-weight: 500;
      color: var(--color-text-light);
      cursor: pointer;
      border-bottom: 2px solid transparent;
      margin-bottom: -1px;
      transition: all 0.2s;
    }
    
    .tab:hover { color: var(--color-text); }
    
    .tab--active {
      color: var(--color-primary);
      border-bottom-color: var(--color-primary);
    }
    
    .tab-content { display: none; }
    .tab-content--active { display: block; }
    
    /* Login Card */
    .login-card {
      max-width: 400px;
      margin: 4rem auto;
      background: var(--color-card);
      border-radius: var(--radius);
      padding: 2rem;
      box-shadow: var(--shadow);
      text-align: center;
    }
    
    .login-card h1 { margin-bottom: 0.5rem; }
    .login-card p { color: var(--color-text-light); margin-bottom: 1.5rem; }
    
    .login-error {
      background: #fef2f2;
      color: var(--color-danger);
      padding: 0.75rem;
      border-radius: 6px;
      margin-bottom: 1rem;
      font-size: 0.875rem;
    }
    
    .hidden { display: none !important; }
    
    /* Metrics Grid */
    .metrics-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
      gap: 1rem;
      margin-bottom: 2rem;
    }
    
    .metric-card {
      background: var(--color-card);
      border-radius: var(--radius);
      padding: 1.25rem;
      box-shadow: var(--shadow);
    }
    
    .metric-card__label {
      font-size: 0.75rem;
      color: var(--color-text-light);
      text-transform: uppercase;
      letter-spacing: 0.5px;
      margin-bottom: 0.5rem;
    }
    
    .metric-card__value {
      font-size: 1.75rem;
      font-weight: 700;
      color: var(--color-text);
    }
    
    .metric-card__value--success { color: var(--color-success); }
    .metric-card__value--warning { color: var(--color-warning); }
    .metric-card__value--danger { color: var(--color-danger); }
    .metric-card__value--info { color: var(--color-info); }
    
    /* Charts Section */
    .charts-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
      gap: 1.5rem;
      margin-bottom: 2rem;
    }
    
    .chart-card {
      background: var(--color-card);
      border-radius: var(--radius);
      padding: 1.5rem;
      box-shadow: var(--shadow);
    }
    
    .chart-card__title {
      font-size: 1rem;
      font-weight: 600;
      margin-bottom: 1rem;
    }
    
    /* Triage Bars */
    .triage-bars { display: flex; flex-direction: column; gap: 0.75rem; }
    
    .triage-bar { display: flex; align-items: center; gap: 0.75rem; }
    
    .triage-bar__label {
      width: 100px;
      font-size: 0.875rem;
      color: var(--color-text-light);
    }
    
    .triage-bar__track {
      flex: 1;
      height: 24px;
      background: var(--color-bg);
      border-radius: 4px;
      overflow: hidden;
    }
    
    .triage-bar__fill {
      height: 100%;
      border-radius: 4px;
      display: flex;
      align-items: center;
      padding-left: 8px;
      font-size: 0.75rem;
      font-weight: 600;
      color: white;
      transition: width 0.5s ease;
    }
    
    .triage-bar__fill--low { background: var(--color-success); }
    .triage-bar__fill--schedule { background: var(--color-warning); }
    .triage-bar__fill--urgent { background: var(--color-danger); }
    
    /* Activity List */
    .activity-list { max-height: 300px; overflow-y: auto; }
    
    .activity-item {
      display: flex;
      align-items: flex-start;
      gap: 0.75rem;
      padding: 0.75rem 0;
      border-bottom: 1px solid var(--color-border);
    }
    
    .activity-item:last-child { border-bottom: none; }
    
    .activity-icon {
      width: 32px;
      height: 32px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.875rem;
      flex-shrink: 0;
    }
    
    .activity-icon--created { background: #dbeafe; color: var(--color-info); }
    .activity-icon--viewed { background: #fef3c7; color: var(--color-warning); }
    .activity-icon--responded { background: #d1fae5; color: var(--color-success); }
    .activity-icon--expired { background: #f1f5f9; color: var(--color-text-light); }
    
    .activity-content { flex: 1; min-width: 0; }
    .activity-text { font-size: 0.875rem; color: var(--color-text); }
    .activity-time { font-size: 0.75rem; color: var(--color-text-light); }
    
    /* Response Times */
    .response-times {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 1rem;
      text-align: center;
    }
    
    .response-time-stat {
      padding: 1rem;
      background: var(--color-bg);
      border-radius: 8px;
    }
    
    .response-time-stat__value {
      font-size: 1.5rem;
      font-weight: 700;
      color: var(--color-primary);
    }
    
    .response-time-stat__label {
      font-size: 0.75rem;
      color: var(--color-text-light);
      margin-top: 0.25rem;
    }
    
    /* Date Filter */
    .date-filter {
      display: flex;
      gap: 0.5rem;
      margin-bottom: 1.5rem;
    }
    
    .date-filter__btn {
      padding: 0.5rem 1rem;
      border: 1px solid var(--color-border);
      background: var(--color-card);
      border-radius: 6px;
      font-size: 0.875rem;
      cursor: pointer;
      transition: all 0.2s;
    }
    
    .date-filter__btn:hover { border-color: var(--color-primary); }
    
    .date-filter__btn--active {
      background: var(--color-primary);
      color: white;
      border-color: var(--color-primary);
    }
    
    /* Loading & Empty State */
    .loading { display: flex; justify-content: center; padding: 3rem; }
    
    .spinner {
      width: 32px;
      height: 32px;
      border: 3px solid var(--color-border);
      border-top-color: var(--color-primary);
      border-radius: 50%;
      animation: spin 1s linear infinite;
    }
    
    @keyframes spin { to { transform: rotate(360deg); } }
    
    .empty-state {
      text-align: center;
      padding: 2rem;
      color: var(--color-text-light);
    }
    
    .empty-state__icon { font-size: 2rem; margin-bottom: 0.5rem; }
    
    /* ==========================================
       CLINICIANS TAB STYLES
       ========================================== */
    
    .section-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 1.5rem;
    }
    
    .section-title { font-size: 1.25rem; font-weight: 600; }
    
    .search-bar {
      display: flex;
      gap: 0.75rem;
      margin-bottom: 1.5rem;
    }
    
    .search-input {
      flex: 1;
      padding: 0.625rem 1rem;
      border: 1px solid var(--color-border);
      border-radius: 6px;
      font-size: 0.875rem;
    }
    
    .search-input:focus {
      outline: none;
      border-color: var(--color-primary);
    }
    
    /* Table */
    .table-container {
      background: var(--color-card);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      overflow: hidden;
    }
    
    .table {
      width: 100%;
      border-collapse: collapse;
    }
    
    .table th,
    .table td {
      padding: 0.875rem 1rem;
      text-align: left;
      border-bottom: 1px solid var(--color-border);
    }
    
    .table th {
      background: var(--color-bg);
      font-size: 0.75rem;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      color: var(--color-text-light);
    }
    
    .table tr:last-child td { border-bottom: none; }
    
    .table tr:hover td { background: #f8fafc; }
    
    /* Status Badge */
    .status-badge {
      display: inline-flex;
      align-items: center;
      padding: 0.25rem 0.625rem;
      border-radius: 9999px;
      font-size: 0.75rem;
      font-weight: 500;
    }
    
    .status-badge--verified {
      background: #d1fae5;
      color: #065f46;
    }
    
    .status-badge--pending {
      background: #fef3c7;
      color: #92400e;
    }
    
    .status-badge--blocked {
      background: #fee2e2;
      color: #991b1b;
    }
    
    /* Actions Dropdown */
    .actions-cell {
      position: relative;
    }
    
    .actions-btn {
      background: none;
      border: 1px solid var(--color-border);
      border-radius: 4px;
      padding: 0.25rem 0.5rem;
      cursor: pointer;
      font-size: 0.875rem;
    }
    
    .actions-btn:hover { background: var(--color-bg); }
    
    .actions-btn--danger {
      color: var(--color-danger);
      border-color: var(--color-danger);
    }
    
    .actions-btn--danger:hover {
      background: var(--color-danger);
      color: white;
    }
    
    /* Section divider */
    .section-divider {
      margin-top: 2rem;
      padding-top: 1.5rem;
      border-top: 1px solid var(--color-border);
    }
    
    .section-subtitle {
      font-size: 1rem;
      font-weight: 600;
      margin-bottom: 0.5rem;
    }
    
    .section-hint {
      font-size: 0.875rem;
      color: var(--color-text-muted);
      margin-bottom: 1rem;
    }
    
    .count-badge--invites {
      background: #fef3c7;
      border-color: #f59e0b;
    }
    
    /* Modal */
    .modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.5);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 1000;
    }
    
    .modal {
      background: var(--color-card);
      border-radius: var(--radius);
      padding: 1.5rem;
      width: 100%;
      max-width: 450px;
      box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    }
    
    .modal--wide {
      max-width: 600px;
    }
    
    .detail-section {
      margin-bottom: 1.5rem;
      padding-bottom: 1rem;
      border-bottom: 1px solid var(--color-border);
    }
    
    .detail-section:last-of-type {
      border-bottom: none;
    }
    
    .detail-section__title {
      font-size: 0.75rem;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--color-text-light);
      margin-bottom: 0.75rem;
    }
    
    .detail-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0.75rem;
    }
    
    .detail-item {
      display: flex;
      flex-direction: column;
      gap: 0.25rem;
    }
    
    .detail-item .detail-label {
      font-size: 0.75rem;
      color: var(--color-text-light);
    }
    
    .detail-item .detail-value {
      font-size: 0.875rem;
      color: var(--color-text);
      word-break: break-word;
    }
    
    /* Clinician table cell */
    .clinician-cell {
      display: flex;
      flex-direction: column;
      gap: 0.125rem;
    }
    
    .clinician-name {
      font-weight: 500;
      color: var(--color-text);
    }
    
    .clinician-email {
      font-size: 0.8rem;
      color: var(--color-text-light);
    }
    
    .modal__header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 1.25rem;
    }
    
    .modal__title { font-size: 1.125rem; font-weight: 600; }
    
    .modal__close {
      background: none;
      border: none;
      font-size: 1.5rem;
      color: var(--color-text-light);
      cursor: pointer;
      line-height: 1;
    }
    
    .modal__close:hover { color: var(--color-text); }
    
    .form-group { margin-bottom: 1rem; }
    
    .form-label {
      display: block;
      font-size: 0.875rem;
      font-weight: 500;
      margin-bottom: 0.375rem;
    }
    
    .form-input,
    .form-select {
      width: 100%;
      padding: 0.625rem 0.75rem;
      border: 1px solid var(--color-border);
      border-radius: 6px;
      font-size: 0.875rem;
    }
    
    .form-input:focus,
    .form-select:focus {
      outline: none;
      border-color: var(--color-primary);
    }
    
    .form-hint {
      font-size: 0.75rem;
      color: var(--color-text-light);
      margin-top: 0.25rem;
    }
    
    .modal__footer {
      display: flex;
      justify-content: flex-end;
      gap: 0.75rem;
      margin-top: 1.5rem;
    }
    
    .form-error {
      background: #fef2f2;
      color: var(--color-danger);
      padding: 0.625rem;
      border-radius: 6px;
      font-size: 0.8125rem;
      margin-bottom: 1rem;
    }
    
    .form-success {
      background: #d1fae5;
      color: #065f46;
      padding: 0.625rem;
      border-radius: 6px;
      font-size: 0.8125rem;
      margin-bottom: 1rem;
    }

    /* Clinician count badges */
    .clinician-counts {
      display: flex;
      gap: 1rem;
      margin-bottom: 1.5rem;
    }
    
    .count-badge {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      padding: 0.5rem 1rem;
      background: var(--color-card);
      border-radius: 8px;
      font-size: 0.875rem;
      box-shadow: var(--shadow);
    }
    
    .count-badge__number {
      font-weight: 700;
      font-size: 1.125rem;
    }
    
    .count-badge--verified .count-badge__number { color: var(--color-success); }
    .count-badge--pending .count-badge__number { color: var(--color-warning); }
    .count-badge--blocked .count-badge__number { color: var(--color-danger); }

/* Textarea */
textarea.form-input {
  min-height: 80px;
  font-family: inherit;
  line-height: 1.5;
}

/* ===========================================
   MODERATION STYLES
   =========================================== */

/* Sub-tabs */
.sub-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.5rem;
}

.sub-tab {
  padding: 0.5rem 1rem;
  background: none;
  border: none;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  color: var(--color-text-light);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
}

.sub-tab:hover {
  color: var(--color-text);
  background: var(--color-bg);
}

.sub-tab--active {
  color: var(--color-primary);
  background: var(--color-primary-light);
  border-bottom: 2px solid var(--color-primary);
}

.subtab-content {
  display: none;
}

.subtab-content--active {
  display: block;
}

/* Filter Bar */
.filter-bar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filter-bar .form-select {
  min-width: 150px;
}

/* Risk Badges */
.risk-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.risk-badge--high {
  background: #fef2f2;
  color: #dc2626;
}

.risk-badge--medium {
  background: #fffbeb;
  color: #d97706;
}

.risk-badge--low {
  background: #f0fdf4;
  color: #16a34a;
}

/* Drawer */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  justify-content: flex-end;
}

.drawer {
  width: 480px;
  max-width: 100%;
  background: var(--color-card);
  height: 100%;
  overflow-y: auto;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
}

.drawer__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
  position: sticky;
  top: 0;
}

.drawer__title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}

.drawer__close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--color-text-light);
  padding: 0.25rem;
  line-height: 1;
}

.drawer__close:hover {
  color: var(--color-text);
}

.drawer__content {
  padding: 1.5rem;
}

/* Detail Sections */
.detail-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.detail-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.detail-section__title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 1rem 0;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.5rem 0;
}

.detail-label {
  font-size: 0.875rem;
  color: var(--color-text-light);
}

.detail-value {
  font-size: 0.875rem;
  color: var(--color-text);
  font-weight: 500;
  text-align: right;
  max-width: 60%;
  word-break: break-word;
}

.detail-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 1.5rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0.5rem;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 2px;
  background: var(--color-border);
}

.timeline-item {
  position: relative;
  padding-bottom: 1rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.25rem;
  top: 0.5rem;
  width: 10px;
  height: 10px;
  background: var(--color-card);
  border: 2px solid var(--color-border);
  border-radius: 50%;
}

.timeline-item--complete::before {
  background: var(--color-success);
  border-color: var(--color-success);
}

.timeline-item--current::before {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.timeline-item__title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 0.25rem;
}

.timeline-item__time {
  font-size: 0.75rem;
  color: var(--color-text-light);
}

/* Button Variants */
.btn--warning {
  background: #f59e0b;
  color: white;
}

.btn--warning:hover {
  background: #d97706;
}

.btn--danger {
  background: var(--color-danger);
  color: white;
}

.btn--danger:hover {
  background: #b91c1c;
}

/* Masked UID style */
.masked-uid {
  font-family: monospace;
  background: var(--color-bg);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-size: 0.8125rem;
}

/* Audit log action badges */
.action-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
}

.action-badge--clinician { background: #dbeafe; color: #1d4ed8; }
.action-badge--patient { background: #fef3c7; color: #92400e; }
.action-badge--request { background: #f3e8ff; color: #7c3aed; }