/* ==========================================================================
   PRED-E-CARE: Offline-First Healthcare Decision Support System
   Barangay Sta. Rita, Olongapo City
   Unified Stylesheet: Admin + BHW End-User Field Workstation
   ========================================================================== */

:root {
  --primary-earth: #8c5e3c;
  --primary-earth-hover: #73492c;
  --primary-green: #3b5840;
  --primary-green-hover: #2b4530;
  --biometric-purple: #5345cb;
  --biometric-purple-hover: #4335b8;
  
  --bg-sand-light: #faf7f2;
  --bg-sand-dark: #f4efe6;
  --surface-card: #ffffff;
  --surface-subtle: #fbf9f6;
  --border-card: #e7ded2;
  --border-subtle: #ebd9c8;
  
  --text-primary: #38291a;
  --text-secondary: #634f3d;
  --text-muted: #8c735d;
  
  --risk-high-bg: #fee2e2;
  --risk-high-text: #b91c1c;
  --risk-high-border: #fca5a5;
  
  --risk-med-bg: #fef3c7;
  --risk-med-text: #b45309;
  --risk-med-border: #fcd34d;
  
  --risk-low-bg: #dcfce7;
  --risk-low-text: #15803d;
  --risk-low-border: #86efac;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-primary);
  background: var(--bg-sand-light);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── SCREEN 1: LANDING & LOGIN PAGE (Image 1) ─────────────────────── */

.landing-viewport {
  min-height: 100vh;
  width: 100vw;
  background-image: url('brgy_sta_rita_arch.jpg');
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 20px;
}

.landing-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at center, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.45) 100%);
  pointer-events: none;
}

.login-glass-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 440px;
  background: rgba(240, 247, 240, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 24px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.4) inset;
  padding: 34px 30px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeIn 0.4s ease-out;
}

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

.seal-logo-img {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 2px solid #ffffff;
  margin-bottom: 10px;
}

.brand-h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #1a2e1b;
  margin: 0;
  text-transform: uppercase;
}

.brand-desc {
  font-size: 11.5px;
  font-weight: 500;
  color: #49634b;
  margin: 4px 0 10px;
  text-align: center;
  line-height: 1.35;
}

.offline-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(46, 125, 50, 0.12);
  color: #2e7d32;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(46, 125, 50, 0.25);
  margin-bottom: 14px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #2e7d32;
  box-shadow: 0 0 0 0 rgba(46, 125, 50, 0.7);
  animation: pulseGreen 1.8s infinite;
}

@keyframes pulseGreen {
  0% { box-shadow: 0 0 0 0 rgba(46, 125, 50, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(46, 125, 50, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 125, 50, 0); }
}

/* Dual Role Switcher Quick Pill */
.role-quick-select {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-bottom: 14px;
}

.role-tab-btn {
  flex: 1;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid #c7d6c7;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #3b4d3c;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.role-tab-btn:hover {
  background: #ffffff;
  border-color: var(--primary-green);
}

.role-tab-btn.active-role {
  background: var(--primary-green);
  color: #ffffff;
  border-color: var(--primary-green);
  box-shadow: 0 2px 6px rgba(59, 88, 64, 0.25);
}

.login-form-box {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: left;
}

.login-field label {
  font-size: 13px;
  font-weight: 600;
  color: #2e3d2f;
  margin-left: 2px;
}

.login-field input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  background: #ffffff;
  border: 1px solid #c7d6c7;
  border-radius: 10px;
  font-size: 14px;
  color: #1f2937;
  outline: none;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.login-field input:focus {
  border-color: var(--primary-green);
  box-shadow: 0 0 0 3px rgba(59, 95, 61, 0.2);
}

/* Dark Green Button (Image 1) */
.btn-login-darkgreen {
  height: 46px;
  background: var(--primary-green);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 10px rgba(59, 88, 64, 0.3);
}

.btn-login-darkgreen:hover {
  background: var(--primary-green-hover);
  transform: translateY(-1px);
}

/* Purple Biometrics Button (Image 1) */
.btn-login-purple {
  height: 46px;
  background: var(--biometric-purple);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(83, 69, 203, 0.35);
}

.btn-login-purple:hover {
  background: var(--biometric-purple-hover);
  transform: translateY(-1px);
}

.btn-link-forgot {
  background: none;
  border: none;
  color: #2b3a2c;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 6px;
  padding: 4px;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-align: center;
}

.landing-footer {
  margin-top: 18px;
  text-align: center;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  width: 100%;
  padding-top: 12px;
}

.landing-footer p {
  font-size: 11.5px;
  font-weight: 600;
  color: #4b5563;
  margin: 0;
}

.demo-credentials-pill {
  font-size: 11px;
  color: #6b7280;
  margin-top: 5px;
}

/* ── SCREEN 2: MAIN DASHBOARD & SIDEBAR (Image 2) ──────────────────── */

.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100vw;
  background: linear-gradient(135deg, var(--bg-sand-light) 0%, var(--bg-sand-dark) 100%);
}

/* BHW End-User Context Header */
.bhw-field-banner {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 12px 18px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 8px rgba(80, 50, 20, 0.03);
}

.bhw-user-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bhw-avatar-ring {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #eef2eb;
  color: var(--primary-green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.bhw-meta-titles strong {
  font-size: 14.5px;
  color: var(--text-primary);
  display: block;
}

.bhw-meta-titles span {
  font-size: 12px;
  color: var(--text-muted);
}

.bhw-weather-warning {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff8f8;
  border: 1px solid #fbcaca;
  color: #991b1b;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

/* Sidebar */
.sidebar-drawer {
  width: 250px;
  min-width: 250px;
  height: 100vh;
  position: sticky;
  top: 0;
  background-color: #f7f3ec;
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 16px;
  z-index: 20;
}

.sidebar-brand-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 22px;
}

.sidebar-seal-img {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
  margin-bottom: 10px;
}

.sidebar-title {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #4a3828;
  margin: 0;
}

.sidebar-sub {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 3px;
}

.sidebar-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  overflow-y: auto;
}

.sidebar-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10.5px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  transition: all 0.18s ease;
}

.sidebar-btn:hover {
  background-color: #ece4d7;
  color: #3e2e21;
}

/* Active tab styled as warm brown capsule matching Image 2 */
.sidebar-btn.active {
  background-color: var(--primary-earth);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(140, 94, 60, 0.25);
}

.sidebar-btn.active svg {
  stroke: #ffffff;
}

.sidebar-bottom {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.offline-status-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #ede6da;
  color: #61503e;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 8px;
  text-align: center;
}

.sidebar-logout-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: #a84141;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
  width: 100%;
}

.sidebar-logout-btn:hover {
  background-color: #fee2e2;
  color: #991b1b;
}

/* Main Content Surface */
.main-view-surface {
  flex: 1;
  padding: 24px 36px 48px;
  overflow-y: auto;
  max-width: 1350px;
}

.view-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.view-header-title {
  font-size: 27px;
  font-weight: 700;
  color: #4a3423;
  margin: 0;
}

.view-header-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 3px;
}

.btn-header-outline {
  background: #ffffff;
  color: #634f3d;
  border: 1px solid #d4c4b2;
  padding: 7px 18px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.btn-header-outline:hover {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}

/* BHW Rapid Symptoms Selector Chips */
.quick-symptoms-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #ebd9c8;
}

.symptom-chip-btn {
  background: #fbf5ee;
  border: 1px solid #dfd2c0;
  color: #614d3b;
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.symptom-chip-btn:hover {
  background: var(--primary-earth);
  color: #ffffff;
  border-color: var(--primary-earth);
}

/* Intake Form Card matching Image 2 */
.intake-form-strip {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 3px 12px rgba(80, 50, 20, 0.03);
  margin-bottom: 16px;
}

.form-grid-5col {
  display: grid;
  grid-template-columns: 2fr 1fr 1.2fr 3.2fr auto;
  gap: 12px;
  align-items: center;
}

.form-grid-5col input,
.form-grid-5col select {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  background: var(--surface-subtle);
  border: 1px solid #dfd4c5;
  border-radius: 9px;
  font-size: 13.5px;
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s ease;
}

.form-grid-5col input:focus,
.form-grid-5col select:focus {
  background: #ffffff;
  border-color: var(--primary-earth);
  box-shadow: 0 0 0 3px rgba(140, 94, 60, 0.15);
}

.btn-earth-submit {
  height: 42px;
  padding: 0 20px;
  background: var(--primary-earth);
  color: #ffffff;
  border: none;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 3px 8px rgba(140, 94, 60, 0.25);
}

.btn-earth-submit:hover {
  background: var(--primary-earth-hover);
  transform: translateY(-1px);
}

/* Full Width Search Bar matching Image 2 */
.search-bar-row {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
}

.search-field-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.search-field-wrap input {
  width: 100%;
  height: 44px;
  padding: 0 16px 0 42px;
  background: #ffffff;
  border: 1px solid #dfd4c5;
  border-radius: 10px;
  font-size: 14px;
  color: #332417;
  outline: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
}

.search-field-wrap input:focus {
  border-color: var(--primary-earth);
  box-shadow: 0 0 0 3px rgba(140, 94, 60, 0.15);
}

.search-icon-svg {
  position: absolute;
  left: 14px;
  color: #9c8a78;
  pointer-events: none;
}

.purok-filter-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #dfd4c5;
  border-radius: 10px;
  padding: 0 14px;
}

.purok-filter-box select {
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: #4a3828;
  cursor: pointer;
  height: 42px;
}

/* Stat Cards Strip matching Image 2 */
.stat-chips-strip {
  display: flex;
  gap: 14px;
  margin-bottom: 22px;
}

.stat-pill {
  display: flex;
  align-items: baseline;
  gap: 12px;
  background: #ffffff;
  border: 1px solid #dfd4c5;
  border-radius: 11px;
  padding: 10px 20px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
  min-width: 130px;
}

.stat-pill-label {
  font-size: 13.5px;
  font-weight: 600;
  color: #5f4d3c;
}

.stat-pill-num {
  font-size: 20px;
  font-weight: 800;
  color: #332417;
}

.stat-pill.danger-highlight {
  border-color: #fbcaca;
  background: #fff8f8;
}

.stat-pill.danger-highlight .stat-pill-num {
  color: #dc2626 !important;
}

/* Patient Table Surface matching Image 2 */
.table-container-card {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(80, 50, 20, 0.04);
  overflow: hidden;
  margin-bottom: 24px;
}

.pred-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.pred-table thead {
  background: #fdfaf6;
  border-bottom: 1.5px solid #ebe1d4;
}

.pred-table th {
  padding: 13px 18px;
  font-size: 12px;
  font-weight: 700;
  color: #7a634f;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.pred-table tbody tr {
  border-bottom: 1px solid #f1eae0;
  transition: background-color 0.15s ease;
}

.pred-table tbody tr:hover {
  background-color: #faf5ed;
}

.pred-table td {
  padding: 13px 18px;
  font-size: 13.5px;
  color: #3d2f22;
  vertical-align: middle;
}

.patient-name-bold {
  font-weight: 600;
  color: #2e2014;
}

/* Risk Badges matching Image 2 */
.risk-tag {
  display: inline-block;
  padding: 3.5px 12px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.risk-tag.risk-high {
  background: var(--risk-high-bg);
  color: var(--risk-high-text);
  border: 1px solid var(--risk-high-border);
}

.risk-tag.risk-medium {
  background: var(--risk-med-bg);
  color: var(--risk-med-text);
  border: 1px solid var(--risk-med-border);
}

.risk-tag.risk-low {
  background: var(--risk-low-bg);
  color: var(--risk-low-text);
  border: 1px solid var(--risk-low-border);
}

/* Delete & Action Buttons matching Image 2 */
.btn-delete-row {
  background: #ffffff;
  color: #6b533f;
  border: 1px solid #d8cbba;
  padding: 4px 14px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-delete-row:hover {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}

/* Modal Windows */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal-dialog {
  background: #ffffff;
  border-radius: 18px;
  padding: 28px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  animation: fadeIn 0.2s ease-out;
}

.modal-dialog h2,
.modal-dialog h3 {
  font-size: 18px;
  font-weight: 700;
  color: #4a3423;
  margin-bottom: 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.btn-sec {
  background: #f3f4f6;
  color: #374151;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.btn-prim {
  background: var(--primary-earth);
  color: #ffffff;
  border: none;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* Toast */
.toast-msg {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #111827;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 13.5px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  z-index: 200;
  animation: slideUp 0.3s ease-out;
}

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

/* ── ENHANCED SEPARATED NAME INPUT GRID & INTAKE FORM ─────────── */
.form-grid-intake {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.name-fields-row {
  display: grid;
  grid-template-columns: 2fr 1.2fr 2fr 1fr;
  gap: 10px;
}

.clinical-fields-row {
  display: grid;
  grid-template-columns: 1fr 1.3fr 3fr auto;
  gap: 10px;
  align-items: center;
}

.input-field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.input-field-group label {
  font-size: 11px;
  font-weight: 700;
  color: #7a634f;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.input-field-group input,
.input-field-group select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  background: var(--surface-subtle);
  border: 1px solid #dfd4c5;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s ease;
}

.input-field-group input:focus,
.input-field-group select:focus {
  background: #ffffff;
  border-color: var(--primary-earth);
  box-shadow: 0 0 0 3px rgba(140, 94, 60, 0.15);
}

.input-field-group input.is-invalid {
  border-color: #ef4444 !important;
  background: #fff5f5 !important;
}

.field-error-msg {
  font-size: 11px;
  color: #dc2626;
  font-weight: 600;
  margin-top: 2px;
}

/* ── REGISTRY VIEW TABS (Active vs Archive Tray) ─────────────────── */
.registry-tabs-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  border-bottom: 1.5px solid #ebd9c8;
  padding-bottom: 8px;
}

.registry-tabs-group {
  display: flex;
  gap: 8px;
}

.reg-tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: #7a634f;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.reg-tab-btn:hover {
  background: #fbf5ee;
  color: #4a3423;
}

.reg-tab-btn.active {
  background: #ffffff;
  border-color: #ebd9c8;
  color: var(--primary-earth);
  box-shadow: 0 2px 6px rgba(80, 50, 20, 0.05);
}

.reg-tab-badge {
  background: #f0ebe4;
  color: #634f3d;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}

.reg-tab-btn.active .reg-tab-badge {
  background: var(--primary-earth);
  color: #ffffff;
}

.reg-tab-badge.badge-archive {
  background: #fef3c7;
  color: #92400e;
}

/* ── RESTORE & ARCHIVE BUTTONS ──────────────────────────────────── */
.btn-archive-row {
  background: #ffffff;
  color: #78350f;
  border: 1px solid #fcd34d;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-archive-row:hover {
  background: #fef3c7;
  color: #b45309;
}

.btn-restore-row {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  padding: 5px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-restore-row:hover {
  background: #059669;
  color: #ffffff;
  border-color: #059669;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.25);
}

.btn-purge-row {
  background: #ffffff;
  color: #991b1b;
  border: 1px solid #fca5a5;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-purge-row:hover {
  background: #fee2e2;
  color: #7f1d1d;
}

.patient-code-tag {
  font-family: monospace;
  font-size: 11px;
  font-weight: 700;
  background: #f1f5f9;
  color: #334155;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  display: inline-block;
  margin-right: 6px;
}

/* ── DUPLICATE DETECTION WARNING MODAL ──────────────────────────── */
.duplicate-alert-card {
  border: 2px solid #f59e0b;
  background: #fffbeb;
  border-radius: 12px;
  padding: 16px;
  margin: 14px 0;
  text-align: left;
}

.duplicate-record-details {
  background: #ffffff;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 12px;
  margin-top: 10px;
  font-size: 13px;
  color: #451a03;
}

/* ── ADMIN DECISIONS QUEUE & USER FLOW ──────────────────────────── */
.decisions-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}

.decision-card {
  background: #ffffff;
  border: 1px solid #e7ded2;
  border-radius: 12px;
  padding: 18px 22px;
  box-shadow: 0 2px 8px rgba(80, 50, 20, 0.03);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  transition: all 0.2s ease;
}

.decision-card.is-pending {
  border-left: 5px solid #f59e0b;
}

.decision-card.is-approved {
  border-left: 5px solid #10b981;
  background: #fafdfb;
}

.decision-card.is-rejected {
  border-left: 5px solid #ef4444;
  background: #fdfafa;
}

.decision-card.urgency-critical {
  border-left: 5px solid #dc2626 !important;
}

.decision-content {
  flex: 1;
}

.decision-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.decision-urgency-badge {
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.urgency-critical-badge {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

.urgency-high-badge {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}

.urgency-medium-badge {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.decision-actions-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 170px;
}

.btn-decision-approve {
  background: #10b981;
  color: #ffffff;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-decision-approve:hover {
  background: #059669;
}

.btn-decision-rhu {
  background: #3b82f6;
  color: #ffffff;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-decision-rhu:hover {
  background: #2563eb;
}

.btn-decision-reject {
  background: #ffffff;
  color: #dc2626;
  border: 1px solid #fca5a5;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-decision-reject:hover {
  background: #fee2e2;
}

/* ── SUPER ADMIN ROLE RESTRICTIONS ─────────────────────────────── */
.super-admin-banner {
  background: linear-gradient(135deg, #1e1b4b, #312e81);
  color: #ffffff;
  padding: 14px 20px;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  box-shadow: 0 4px 14px rgba(49, 46, 129, 0.2);
}

.role-restricted-lock {
  background: #f3f4f6;
  border: 1px dashed #d1d5db;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  color: #6b7280;
  margin-bottom: 20px;
}

/* Longitudinal Patient Profile Modal */
.longitudinal-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 6px;
}

.timeline-event-card {
  background: #fdfaf6;
  border-left: 4px solid var(--primary-earth);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
}

/* ── ADMIN DECISION DASHBOARD PORTAL & INSIGHTS ─────────────────── */
.portal-container {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.portal-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.portal-stat-card {
  background: var(--surface-card);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 2px 8px rgba(80, 50, 20, 0.03);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.portal-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(80, 50, 20, 0.06);
}

.portal-stat-card.highlight-danger {
  border-left: 4px solid #ef4444;
}

.portal-stat-card.highlight-warning {
  border-left: 4px solid #f59e0b;
}

.portal-stat-card.highlight-success {
  border-left: 4px solid #10b981;
}

.portal-stat-card.highlight-brand {
  border-left: 4px solid var(--primary-earth);
}

.portal-stat-card.highlight-purple {
  border-left: 4px solid #6366f1;
}

.portal-stat-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.portal-stat-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}

.portal-stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fdfaf6;
  color: var(--primary-earth);
}

.portal-stat-val {
  font-size: 32px;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 6px;
}

.portal-stat-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 5px;
}

.portal-stat-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  width: fit-content;
}

.portal-badge-green { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.portal-badge-amber { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.portal-badge-red   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.portal-badge-blue  { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

.portal-charts-row {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 20px;
}

.portal-chart-card {
  background: var(--surface-card);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 3px 12px rgba(80, 50, 20, 0.03);
  display: flex;
  flex-direction: column;
}

.portal-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f3ece4;
}

.portal-chart-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}

.portal-chart-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.portal-legend-strip {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--text-secondary);
  align-items: center;
}

.portal-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.portal-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

/* User Account Archive & Restore Actions */
.btn-archive-user {
  background: #fff;
  color: #b45309;
  border: 1px solid #fcd34d;
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-archive-user:hover {
  background: #fef3c7;
  border-color: #f59e0b;
}

.btn-restore-user {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-restore-user:hover {
  background: #d1fae5;
  border-color: #34d399;
}

.user-protected-badge {
  background: #fef9c3;
  color: #854d0e;
  border: 1px solid #fde047;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.portal-covariate-controls {
  background: #fbf9f6;
  border: 1px solid #ebd9c8;
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 16px;
  align-items: center;
}

.portal-slider-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.portal-slider-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
}

@media (max-width: 900px) {
  .name-fields-row { grid-template-columns: 1fr; }
  .clinical-fields-row { grid-template-columns: 1fr; }
  .decision-card { flex-direction: column; }
  .portal-charts-row { grid-template-columns: 1fr; }
  .portal-covariate-controls { grid-template-columns: 1fr; }
}
