:root {
  --bg: #050813;
  --bg-elevated: #0c1020;
  --bg-elevated-2: #151a2e;
  --accent: #33b5ff;
  --accent-soft: rgba(51, 181, 255, 0.16);
  --accent-strong: #0af;
  --text-main: #f5f7ff;
  --text-muted: #9aa0c2;
  --danger: #ff5370;
  --ok: #4caf50;
  --border-subtle: #262c4a;
  --card-radius: 18px;
  --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.45);
  --transition-fast: 0.18s ease-out;
  --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  font-family: var(--font-main);
  background-color: var(--bg);
  color: var(--text-main);
}

body {
  overflow: hidden;
}

/* App Shell */

.app-shell {
  display: flex;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at top, #121935 0, #050813 55%);
}

/* Side Navigation */

.side-nav {
  width: 260px;
  background: linear-gradient(180deg, #070a16 0%, #050813 100%);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  gap: 24px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 4px 4px 6px;
}

.logo-dot {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 20%, #66e0ff, #0a84ff 55%, #020615);
  box-shadow: 0 0 16px rgba(15, 210, 255, 0.7);
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-weight: 600;
  letter-spacing: 0.08em;
  font-size: 13px;
  text-transform: uppercase;
}

.logo-subtitle {
  font-size: 11px;
  color: var(--text-muted);
}

.nav-links {
  list-style: none;
  margin: 0;
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 14px;
  transition: background var(--transition-fast), color var(--transition-fast),
    transform var(--transition-fast);
}

.nav-link span:first-child {
  width: 20px;
  text-align: center;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  transform: translateX(2px);
}

.nav-link.active {
  background: linear-gradient(90deg, var(--accent-soft), transparent);
  color: var(--accent-strong);
}

.nav-footer {
  margin-top: auto;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(9, 14, 33, 0.9);
  border: 1px solid var(--border-subtle);
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-footer-label {
  color: var(--text-muted);
}

.nav-footer-value {
  font-family: "SF Mono", ui-monospace, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-size: 11px;
}

/* Main Panel */

.main-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
}

/* Top Bar */

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
}

.top-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(0, 255, 170, 0.55);
}

.status-ready {
  background: var(--ok);
}

.top-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-indicator {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.indicator-label {
  font-size: 11px;
  color: var(--text-muted);
}

.indicator-pill {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
}

.indicator-pill.online {
  border-color: rgba(76, 175, 80, 0.6);
  color: #98e59f;
}

.indicator-pill.standby {
  border-color: rgba(255, 193, 7, 0.6);
  color: #ffd666;
}

/* Voice Toggle Button */
.voice-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(51, 181, 255, 0.1);
  border: 1px solid rgba(51, 181, 255, 0.3);
  border-radius: 8px;
  color: var(--accent-strong);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-right: 12px;
}

.voice-toggle:hover {
  background: rgba(51, 181, 255, 0.2);
  border-color: rgba(51, 181, 255, 0.5);
  box-shadow: 0 0 20px rgba(51, 181, 255, 0.3);
}

.voice-toggle.voice-off {
  background: rgba(255, 83, 112, 0.1);
  border-color: rgba(255, 83, 112, 0.3);
  color: var(--danger);
}

.voice-toggle.voice-off:hover {
  background: rgba(255, 83, 112, 0.2);
  border-color: rgba(255, 83, 112, 0.5);
}

.voice-icon {
  font-size: 16px;
}

.voice-label {
  font-weight: 500;
}

/* Language Selector */
.language-selector {
  position: relative;
}

.language-btn {
  background: linear-gradient(135deg, #2196F3, #1976D2);
  border: none;
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.language-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
}

.language-icon {
  font-size: 16px;
}

.language-label {
  font-size: 14px;
}

.language-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  min-width: 160px;
  overflow: hidden;
}

.language-dropdown.hidden {
  display: none;
}

.language-option {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.language-option:hover {
  background: #3a3a3a;
}

.language-option.active {
  background: rgba(33, 150, 243, 0.2);
  border-left: 3px solid #2196F3;
}

.lang-flag {
  font-size: 20px;
}

.lang-name {
  font-size: 14px;
  color: #fff;
  font-weight: 500;
}

/* Emergency Button */
.emergency-btn {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border: none;
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
  animation: emergencyPulse 2s infinite;
}

.emergency-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.5);
}

@keyframes emergencyPulse {
  0%, 100% { box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3); }
  50% { box-shadow: 0 4px 20px rgba(239, 68, 68, 0.6); }
}

.emergency-icon {
  font-size: 16px;
  animation: shake 0.5s infinite;
}

@keyframes shake {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-5deg); }
  75% { transform: rotate(5deg); }
}

.emergency-label {
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* Views */

.view-container {
  flex: 1;
  overflow: hidden;
}

.view {
  width: 100%;
  height: 100%;
  overflow: auto;
  padding-bottom: 10px;
}

.hidden {
  display: none;
}

/* Cards and Grid */

.grid {
  display: grid;
  gap: 16px;
}

.grid-2-1 {
  grid-template-columns: 1.7fr 1.1fr;
}

.card {
  background: radial-gradient(circle at top left, #202746 0, #090d1c 55%);
  border-radius: var(--card-radius);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
  padding: 16px 18px;
}

.card-primary {
  background: radial-gradient(circle at top left, #222a4f 0, #0a0f21 60%);
}

.card-secondary {
  background: linear-gradient(145deg, #101427, #070b17);
}

.card-tertiary {
  background: linear-gradient(145deg, #090d19, #050813);
}

.card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}

.card-header h2 {
  margin: 0;
  font-size: 18px;
}

.card-tag {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

/* Vitals Grid */

.vitals-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.vital-item {
  padding: 10px 10px;
  border-radius: 10px;
  background: rgba(6, 11, 35, 0.9);
  border: 1px solid rgba(69, 83, 136, 0.6);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.vital-label {
  font-size: 11px;
  color: var(--text-muted);
}

.vital-value {
  font-size: 18px;
  font-weight: 600;
}

.vital-unit {
  font-size: 11px;
  color: var(--text-muted);
}

/* AI Summary */

.ai-summary {
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(2, 150, 255, 0.08);
  border: 1px solid rgba(2, 150, 255, 0.25);
}

.ai-label {
  font-size: 11px;
  color: var(--accent-strong);
  margin-bottom: 4px;
}

.ai-text {
  font-size: 12px;
  color: var(--text-main);
}

/* Buttons */

.btn {
  border: none;
  outline: none;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 13px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  transition: background var(--transition-fast), transform var(--transition-fast),
    box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.btn:hover:not(.btn-disabled) {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.btn-primary {
  background: linear-gradient(135deg, #28a5ff, #00f5ff);
  color: #020617;
  border-color: transparent;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #3bb6ff, #4ef5ff);
}

.btn-disabled {
  opacity: 0.35;
  cursor: default;
}

/* Quick tests */

.quick-tests {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-test {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  background: rgba(5, 9, 24, 0.9);
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: background var(--transition-fast), transform var(--transition-fast),
    border-color var(--transition-fast);
}

.quick-test:hover {
  background: rgba(15, 23, 42, 0.95);
  transform: translateY(-1px);
  border-color: var(--accent-soft);
}

.qt-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--accent-strong);
  text-shadow: 0 0 8px rgba(51, 181, 255, 0.4);
}

.qt-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.card-footer-note {
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-muted);
}

/* Recent Tests */

.recent-tests-card {
  margin-top: 14px;
}

.recent-tests-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
}

.recent-test-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(10, 16, 40, 0.9);
  border: 1px solid rgba(32, 41, 86, 0.85);
}

.recent-test-main {
  display: flex;
  flex-direction: column;
}

.recent-test-label {
  font-weight: 500;
}

.recent-test-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.recent-test-result {
  font-size: 13px;
  font-weight: 500;
}

/* Run Test view */

.test-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Symptom Checker */
.symptom-checker {
  background: rgba(59, 130, 246, 0.05);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
}

.symptom-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--text-main);
}

.btn-link {
  background: none;
  border: none;
  color: var(--accent-strong);
  cursor: pointer;
  font-size: 13px;
  text-decoration: underline;
  padding: 0;
  transition: opacity 0.2s;
}

.btn-link:hover {
  opacity: 0.8;
}

.symptom-input-container {
  margin-top: 12px;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
  }
  to {
    opacity: 1;
    max-height: 500px;
  }
}

.symptom-textarea {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px;
  color: var(--text-main);
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 8px;
}

.symptom-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.symptom-results {
  margin-top: 12px;
  padding: 12px;
  background: var(--bg-elevated);
  border-radius: 8px;
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.symptom-results h4 {
  margin: 0 0 8px 0;
  font-size: 14px;
  color: var(--accent-strong);
}

.suggested-test {
  background: rgba(76, 175, 80, 0.1);
  border: 1px solid rgba(76, 175, 80, 0.3);
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.suggested-test:hover {
  background: rgba(76, 175, 80, 0.2);
  border-color: rgba(76, 175, 80, 0.5);
  transform: translateX(4px);
}

.suggested-test-name {
  font-weight: 600;
  color: var(--text-main);
  font-size: 13px;
  margin-bottom: 4px;
}

.suggested-test-reason {
  font-size: 12px;
  color: var(--text-muted);
}

.test-description {
  font-size: 13px;
  color: var(--text-muted);
}

.test-instructions {
  font-size: 13px;
  background: rgba(5, 11, 31, 0.9);
  border-radius: 10px;
  border: 1px dashed rgba(63, 80, 135, 0.8);
  padding: 10px 12px;
}

.test-instructions ol {
  margin: 0;
  padding-left: 20px;
  font-size: 13px;
}

.test-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.test-status {
  min-height: 24px;
  font-size: 12px;
  color: var(--text-muted);
}

.test-status-running {
  color: #ffd666;
}

.test-status-done {
  color: var(--ok);
}

.test-status-error {
  color: var(--danger);
}

/* Test Progress Bar */
.test-progress-container {
  margin: 20px 0;
  padding: 16px;
  background: linear-gradient(135deg, rgba(51, 181, 255, 0.05) 0%, rgba(10, 170, 255, 0.02) 100%);
  border: 1px solid rgba(51, 181, 255, 0.2);
  border-radius: 12px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.progress-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
}

.progress-percentage {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-strong);
  min-width: 45px;
  text-align: right;
}

.progress-bar-track {
  height: 8px;
  background: rgba(5, 10, 26, 0.9);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(51, 181, 255, 0.3);
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-strong) 100%);
  border-radius: 999px;
  width: 0%;
  transition: width 0.3s ease;
  box-shadow: 0 0 10px rgba(51, 181, 255, 0.6);
  position: relative;
  z-index: 2;
}

.progress-bar-pulse {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(255, 255, 255, 0.3) 50%, 
    transparent 100%);
  animation: progress-pulse 1.5s ease-in-out infinite;
  z-index: 3;
}

@keyframes progress-pulse {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.progress-details {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(51, 181, 255, 0.15);
}

.progress-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 0;
  animation: fade-in 0.3s ease;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.progress-step-icon {
  font-size: 14px;
}

.progress-step.completed {
  color: var(--ok);
}

.progress-step.active {
  color: var(--accent-strong);
  font-weight: 500;
}

/* Test result panel */

.test-result {
  margin-top: 8px;
  font-size: 12px;
}

.result-card {
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(6, 12, 36, 0.95);
  border: 1px solid rgba(41, 60, 120, 0.9);
}

.result-header {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
}

.result-risk {
  font-size: 11px;
  margin-bottom: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  display: inline-block;
}

.result-risk.risk-low {
  background: rgba(76, 175, 80, 0.12);
  color: #9df0a3;
  border: 1px solid rgba(76, 175, 80, 0.6);
}

.result-risk.risk-moderate {
  background: rgba(255, 193, 7, 0.12);
  color: #ffe08a;
  border: 1px solid rgba(255, 193, 7, 0.6);
}

.result-risk.risk-high {
  background: rgba(244, 67, 54, 0.12);
  color: #ff9a9a;
  border: 1px solid rgba(244, 67, 54, 0.6);
}

.result-metrics {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid rgba(50, 65, 120, 0.8);
  border-bottom: 1px solid rgba(50, 65, 120, 0.8);
  padding: 6px 0;
}

.result-metrics li {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
}

.result-metric-name {
  color: var(--text-muted);
}

.result-metric-value {
  font-weight: 500;
}

.flag-normal {
  color: #9df0a3;
}

.flag-borderline {
  color: #ffe08a;
}

.flag-high {
  color: #ff9a9a;
}

.result-summary {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-main);
}

/* AI Insights Section */
.ai-insights-section {
  margin-top: 16px;
  padding: 14px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(51, 181, 255, 0.08) 0%, rgba(10, 170, 255, 0.04) 100%);
  border: 1px solid rgba(51, 181, 255, 0.25);
}

.ai-header {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-strong);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-trends {
  font-size: 12px;
  color: var(--text-main);
  margin-bottom: 12px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  border-left: 3px solid var(--accent);
}

.ai-subsection {
  margin-top: 12px;
}

.ai-subsection strong {
  font-size: 12px;
  color: var(--accent);
  display: block;
  margin-bottom: 6px;
}

.ai-recommendations, .ai-next-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ai-recommendations li, .ai-next-steps li {
  font-size: 12px;
  color: var(--text-main);
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  border-left: 2px solid rgba(51, 181, 255, 0.4);
  line-height: 1.5;
}

.ai-next-steps li {
  border-left-color: rgba(76, 175, 80, 0.6);
}

.clinical-note {
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(255, 193, 7, 0.08);
  border: 1px solid rgba(255, 193, 7, 0.4);
  border-radius: 8px;
  font-size: 12px;
  color: #ffe08a;
  line-height: 1.5;
}

.result-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid rgba(50, 65, 120, 0.4);
}

.result-actions .btn {
  flex: 1;
  font-size: 12px;
  padding: 10px 16px;
}

/* Cartridge Bay System */
.cartridge-bay-container {
  display: flex;
  gap: 12px;
  margin: 16px 0;
  justify-content: space-between;
}

.cartridge-slot {
  flex: 1;
  background: rgba(5, 8, 20, 0.9);
  border: 2px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: border-color 0.3s ease;
}

.cartridge-slot.slot-occupied {
  border-color: rgba(76, 175, 80, 0.6);
}

.cartridge-slot.slot-active {
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(51, 181, 255, 0.3);
}

.cartridge-slot.slot-error {
  border-color: var(--danger);
  box-shadow: 0 0 20px rgba(255, 83, 112, 0.3);
}

.slot-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(154, 160, 194, 0.3);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.slot-occupied .slot-indicator {
  background: #4caf50;
  box-shadow: 0 0 8px rgba(76, 175, 80, 0.6);
}

.slot-active .slot-indicator {
  background: var(--accent);
  box-shadow: 0 0 12px rgba(51, 181, 255, 0.8);
  animation: pulse-indicator 2s ease-in-out infinite;
}

.slot-error .slot-indicator {
  background: var(--danger);
  box-shadow: 0 0 8px rgba(255, 83, 112, 0.6);
}

@keyframes pulse-indicator {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.2); }
}

.slot-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.slot-type {
  font-size: 12px;
  color: var(--text-main);
  text-align: center;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cartridge-visual {
  width: 100%;
  height: 80px;
  background: linear-gradient(135deg, rgba(30, 40, 70, 0.6) 0%, rgba(15, 20, 40, 0.8) 100%);
  border: 1px solid rgba(100, 120, 180, 0.3);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  opacity: 0.3;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.slot-occupied .cartridge-visual {
  opacity: 1;
  transform: translateY(0);
  background: linear-gradient(135deg, rgba(51, 181, 255, 0.15) 0%, rgba(10, 170, 255, 0.25) 100%);
  border-color: rgba(51, 181, 255, 0.5);
}

.cartridge-visual.inserting {
  animation: cartridge-insert 0.6s ease-out;
}

.cartridge-visual.ejecting {
  animation: cartridge-eject 0.5s ease-in;
}

@keyframes cartridge-insert {
  0% { transform: translateY(-100px); opacity: 0; }
  60% { transform: translateY(5px); }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes cartridge-eject {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-100px); opacity: 0; }
}

.cartridge-stripe {
  position: absolute;
  top: 50%;
  left: 10%;
  right: 10%;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.slot-occupied .cartridge-stripe {
  opacity: 0.8;
}

.cartridge-inventory {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.inventory-title {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.inventory-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.inventory-item {
  padding: 6px 10px;
  background: rgba(51, 181, 255, 0.08);
  border: 1px solid rgba(51, 181, 255, 0.3);
  border-radius: 6px;
  font-size: 11px;
  color: var(--accent);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.inventory-item:hover {
  background: rgba(51, 181, 255, 0.15);
  transform: translateY(-1px);
}

.inventory-item.depleted {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: rgba(154, 160, 194, 0.3);
  color: var(--text-muted);
}


/* Test list on right side */

.test-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.test-list-item {
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  padding: 10px 12px;
  background: rgba(6, 10, 26, 0.9);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: border-color var(--transition-fast),
    background var(--transition-fast), transform var(--transition-fast);
}

.test-list-item:hover {
  border-color: var(--accent-soft);
  background: rgba(16, 22, 46, 0.95);
  transform: translateY(-1px);
}

.test-list-title {
  font-size: 14px;
  font-weight: 500;
}

.test-list-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

/* History */

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
}

.history-filter {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: rgba(5, 10, 26, 0.9);
  color: var(--text-main);
  font-size: 12px;
  cursor: pointer;
}

.history-filter:focus {
  outline: none;
  border-color: var(--accent);
}

.history-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(5, 10, 26, 0.9);
  border: 1px solid rgba(26, 36, 78, 0.9);
}

.history-main {
  display: flex;
  flex-direction: column;
}

.history-label {
  font-weight: 500;
}

.history-meta {
  font-size: 11px;
  color: var(--text-muted);
}

/* Trend Charts */
.trend-charts {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.trend-chart {
  background: rgba(5, 10, 26, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 16px;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.chart-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

.chart-range {
  font-size: 11px;
  color: var(--text-muted);
}

.chart-canvas {
  position: relative;
  height: 120px;
  margin-bottom: 8px;
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  height: 100%;
  gap: 4px;
  padding: 0 8px;
}

.chart-bar-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.chart-bar {
  width: 100%;
  max-width: 32px;
  background: linear-gradient(180deg, var(--accent-strong) 0%, var(--accent) 100%);
  border-radius: 4px 4px 0 0;
  transition: all 0.3s ease;
  position: relative;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(51, 181, 255, 0.3);
}

.chart-bar:hover {
  background: linear-gradient(180deg, #0af 0%, var(--accent-strong) 100%);
  box-shadow: 0 0 12px rgba(51, 181, 255, 0.6);
  transform: scaleY(1.05);
}

.chart-bar.risk-low {
  background: linear-gradient(180deg, #66e766 0%, #4caf50 100%);
  box-shadow: 0 0 8px rgba(76, 175, 80, 0.3);
}

.chart-bar.risk-moderate {
  background: linear-gradient(180deg, #ffeb3b 0%, #ffc107 100%);
  box-shadow: 0 0 8px rgba(255, 193, 7, 0.3);
}

.chart-bar.risk-high {
  background: linear-gradient(180deg, #ff6b6b 0%, #f44336 100%);
  box-shadow: 0 0 8px rgba(244, 67, 54, 0.3);
}

.chart-label {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
}

.chart-value {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-main);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.chart-bar:hover .chart-value {
  opacity: 1;
}

.chart-legend {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

/* Settings */

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  font-size: 13px;
}

.settings-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.settings-item label {
  font-size: 12px;
  color: var(--text-muted);
}

.settings-item input,
.settings-item select {
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  padding: 6px 8px;
  background: rgba(5, 10, 26, 0.9);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 13px;
}

.family-select {
  cursor: pointer;
  background: rgba(15, 25, 50, 0.95);
  border-color: rgba(51, 181, 255, 0.3);
}

.family-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(51, 181, 255, 0.2);
}

/* Work/School Release Form */
.release-form {
  padding: 4px 0;
}

.release-description {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}

.release-options {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.release-option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(5, 10, 26, 0.6);
  border: 1px solid var(--border-subtle);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.release-option:has(input:checked) {
  border-color: var(--accent);
  background: rgba(51, 181, 255, 0.08);
}

.release-option input[type="radio"] {
  appearance: none;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-subtle);
  border-radius: 50%;
  position: relative;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.release-option input[type="radio"]:checked {
  border-color: var(--accent);
}

.release-option input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(51, 181, 255, 0.6);
}

.release-option span {
  font-size: 13px;
  color: var(--text-main);
}

.release-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Scrollbars (for on-device dev) */

.view::-webkit-scrollbar {
  width: 8px;
}

.view::-webkit-scrollbar-track {
  background: transparent;
}

.view::-webkit-scrollbar-thumb {
  background: rgba(57, 75, 130, 0.8);
  border-radius: 999px;
}

/* ==================== Cloud Sync Modal ==================== */
.sync-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
}

.sync-modal.hidden {
  display: none;
}

.sync-modal-content {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
              0 0 40px rgba(59, 130, 246, 0.2);
  overflow: hidden;
}

.sync-header {
  padding: 20px;
  background: rgba(59, 130, 246, 0.1);
  border-bottom: 1px solid rgba(59, 130, 246, 0.2);
}

.sync-header h3 {
  margin: 0;
  font-size: 18px;
  color: var(--text-main);
  font-weight: 600;
}

.sync-body {
  padding: 24px;
}

.sync-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border: 1px solid transparent;
  transition: all 0.3s ease;
}

.sync-step.active {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
}

.sync-step.complete {
  opacity: 0.6;
}

.sync-icon {
  font-size: 24px;
  width: 32px;
  text-align: center;
}

.sync-label {
  flex: 1;
  color: var(--text-main);
  font-size: 14px;
}

.sync-status {
  font-size: 18px;
}

.sync-progress-container {
  margin: 20px 0;
  padding: 16px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
}

.sync-progress-bar {
  width: 100%;
  height: 24px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  margin-bottom: 8px;
}

.sync-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  border-radius: 12px;
  transition: width 0.3s ease;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.6);
  position: relative;
}

.sync-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255, 255, 255, 0.3), 
    transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.sync-percentage {
  display: block;
  text-align: center;
  color: var(--accent-strong);
  font-size: 16px;
  font-weight: 600;
}

.sync-footer {
  padding: 16px 20px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(59, 130, 246, 0.2);
  display: flex;
  justify-content: flex-end;
}

.sync-footer .btn {
  min-width: 100px;
}

/* ==================== AI Assistant Chat ==================== */
.ai-assistant {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 380px;
  max-height: 500px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6),
              0 0 40px rgba(59, 130, 246, 0.2);
  display: flex;
  flex-direction: column;
  z-index: 10000;
  animation: slideInUp 0.4s ease;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(100px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ai-assistant.hidden {
  display: none;
}

.ai-assistant-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: rgba(59, 130, 246, 0.1);
  border-bottom: 1px solid rgba(59, 130, 246, 0.2);
}

.ai-avatar {
  font-size: 32px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(59, 130, 246, 0.2);
  border-radius: 50%;
}

.ai-title {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ai-title strong {
  font-size: 15px;
  color: var(--text-main);
}

.ai-status {
  font-size: 12px;
  color: #4caf50;
}

.ai-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
}

.ai-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.ai-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  max-height: 340px;
}

.ai-message {
  margin-bottom: 16px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.ai-message-assistant .ai-message-content {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 12px;
  padding: 12px;
  font-size: 14px;
  color: var(--text-main);
  line-height: 1.5;
}

.ai-message-user .ai-message-content {
  background: rgba(76, 175, 80, 0.15);
  border: 1px solid rgba(76, 175, 80, 0.3);
  border-radius: 12px;
  padding: 12px;
  font-size: 14px;
  color: var(--text-main);
  margin-left: 40px;
}

.ai-quick-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.ai-quick-btn {
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: var(--accent-strong);
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.ai-quick-btn:hover {
  background: rgba(59, 130, 246, 0.3);
  border-color: rgba(59, 130, 246, 0.6);
  transform: translateX(4px);
}

.ai-chat-input {
  display: flex;
  gap: 8px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(59, 130, 246, 0.2);
}

.ai-mic-btn {
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: var(--accent-strong);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 44px;
}

.ai-mic-btn:hover {
  background: rgba(59, 130, 246, 0.3);
  border-color: rgba(59, 130, 246, 0.6);
  transform: scale(1.05);
}

.ai-mic-btn.listening {
  background: rgba(244, 67, 54, 0.3);
  border-color: rgba(244, 67, 54, 0.6);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.ai-chat-input input {
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px;
  color: var(--text-main);
  font-size: 13px;
  font-family: inherit;
}

.ai-chat-input input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.ai-chat-input .btn {
  padding: 10px 16px;
  font-size: 13px;
}

/* ==================== Schedule View ==================== */
.schedule-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  max-height: 500px;
  overflow-y: auto;
}

.schedule-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.schedule-item:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
  transform: translateY(-2px);
}

.schedule-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.schedule-test-name {
  font-weight: 600;
  color: var(--text-main);
  font-size: 15px;
}

.schedule-frequency {
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(59, 130, 246, 0.1);
  padding: 4px 10px;
  border-radius: 12px;
}

.schedule-details {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.schedule-next {
  font-size: 12px;
  color: var(--accent-strong);
  font-weight: 500;
}

.schedule-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.schedule-actions .btn {
  padding: 6px 12px;
  font-size: 12px;
}

.upcoming-tests {
  padding: 16px;
}

.upcoming-test {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-elevated);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  margin-bottom: 10px;
}

.upcoming-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 50px;
}

.upcoming-day {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-strong);
  line-height: 1;
}

.upcoming-month {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.upcoming-info {
  flex: 1;
}

.upcoming-test-name {
  font-weight: 600;
  color: var(--text-main);
  font-size: 14px;
}

.upcoming-time {
  font-size: 12px;
  color: var(--text-muted);
}

.schedule-templates {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  padding: 16px;
}

.schedule-template {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.schedule-template:hover {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.05);
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.2);
}

.template-icon {
  font-size: 32px;
}

.template-name {
  font-weight: 600;
  color: var(--text-main);
  font-size: 14px;
}

.template-desc {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* ==================== Family Comparison View ==================== */
.family-comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  padding: 16px;
}

.family-member-card {
  background: var(--bg-elevated);
  border: 2px solid var(--border-subtle);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  transition: all 0.2s;
}

.family-member-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.2);
}

.family-member-card.active-member {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.05);
}

.family-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), rgba(59, 130, 246, 0.6));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  color: white;
  margin: 0 auto 12px;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.family-member-name {
  font-weight: 600;
  font-size: 16px;
  color: var(--text-main);
  margin-bottom: 4px;
}

.family-member-relation {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.family-metric {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--border-subtle);
  font-size: 13px;
}

.metric-label {
  color: var(--text-secondary);
}

.metric-value {
  font-weight: 600;
  color: var(--text-main);
}

.metric-value.status-low {
  color: #3b82f6;
}

.metric-value.status-normal {
  color: #10b981;
}

.metric-value.status-elevated {
  color: #f59e0b;
}

.metric-value.status-high {
  color: #ef4444;
}

.family-health-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 8px;
}

.badge-excellent {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.badge-good {
  background: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
}

.badge-fair {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.badge-needs-attention {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.family-trends-chart {
  padding: 20px;
  min-height: 300px;
}

.trend-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.trend-label {
  min-width: 100px;
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.trend-bars {
  flex: 1;
  display: flex;
  gap: 8px;
  align-items: center;
}

.trend-bar {
  flex: 1;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: white;
  transition: all 0.3s;
  cursor: pointer;
}

.trend-bar:hover {
  transform: scaleY(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.family-health-score {
  padding: 24px;
  text-align: center;
}

.overall-score {
  font-size: 72px;
  font-weight: 700;
  background: linear-gradient(135deg, #10b981, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.score-label {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.score-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.score-item {
  text-align: center;
}

.score-item-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-strong);
}

.score-item-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ==================== Emergency Protocol Modal ==================== */
.emergency-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20000;
  animation: fadeIn 0.2s ease;
}

.emergency-modal.hidden {
  display: none;
}

.emergency-modal-content {
  background: var(--bg-surface);
  border: 2px solid #ef4444;
  border-radius: 16px;
  max-width: 800px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(239, 68, 68, 0.5),
              0 0 100px rgba(239, 68, 68, 0.3);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.emergency-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  border-radius: 14px 14px 0 0;
}

.emergency-header h2 {
  font-size: 20px;
  margin: 0;
  font-weight: 700;
}

.emergency-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.emergency-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.emergency-body {
  padding: 24px;
}

.emergency-alert {
  background: rgba(239, 68, 68, 0.1);
  border: 2px solid #ef4444;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.alert-pulse {
  width: 16px;
  height: 16px;
  background: #ef4444;
  border-radius: 50%;
  animation: pulse 1s infinite;
}

.alert-text {
  flex: 1;
  font-weight: 600;
  color: var(--text-main);
  font-size: 14px;
}

.emergency-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.emergency-option {
  background: var(--bg-elevated);
  border: 2px solid var(--border-subtle);
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.emergency-option:hover {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.05);
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.2);
}

.emergency-option-icon {
  font-size: 48px;
  margin-bottom: 8px;
}

.emergency-option-title {
  font-weight: 700;
  font-size: 16px;
  color: var(--text-main);
  margin-bottom: 4px;
}

.emergency-option-desc {
  font-size: 13px;
  color: var(--text-muted);
}

.emergency-contacts {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 20px;
}

.emergency-contact-title {
  font-weight: 700;
  font-size: 16px;
  color: var(--text-main);
  margin-bottom: 16px;
  text-align: center;
}

.emergency-contact-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.emergency-contact-buttons .btn {
  flex: 1;
  min-width: 150px;
}

.emergency-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  justify-content: center;
}

.emergency-actions .btn {
  min-width: 150px;
}

.emergency-guidance-list {
  background: var(--bg-elevated);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.guidance-step {
  display: flex;
  align-items: start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.guidance-step:last-child {
  border-bottom: none;
}

.guidance-number {
  background: #ef4444;
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.guidance-text {
  flex: 1;
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.6;
}

.guidance-warning {
  background: rgba(245, 158, 11, 0.1);
  border: 2px solid #f59e0b;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  gap: 12px;
  align-items: start;
}

.guidance-warning-icon {
  font-size: 24px;
}

.guidance-warning-text {
  flex: 1;
  color: var(--text-main);
  font-size: 14px;
  font-weight: 600;
}

/* ==================== Photo Documentation ==================== */
.photo-gallery-section {
  margin-top: 24px;
  padding: 20px;
  background: var(--bg-elevated);
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
}

.photo-gallery-section.hidden {
  display: none;
}

.photo-gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.photo-gallery-header h3 {
  margin: 0;
  font-size: 16px;
  color: var(--text-main);
}

.photo-count {
  font-size: 13px;
  color: var(--text-muted);
  background: rgba(59, 130, 246, 0.1);
  padding: 4px 12px;
  border-radius: 12px;
}

.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.photo-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.2s;
}

.photo-item:hover {
  border-color: var(--accent);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-timestamp {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  color: white;
  padding: 8px 6px 4px;
  font-size: 11px;
  text-align: center;
}

.photo-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 15000;
  animation: fadeIn 0.2s ease;
}

.photo-modal.hidden {
  display: none;
}

.photo-modal-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  max-width: 700px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.photo-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.photo-modal-header h2 {
  margin: 0;
  font-size: 20px;
  color: var(--text-main);
}

.photo-close {
  background: var(--bg-elevated);
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.photo-close:hover {
  background: var(--border-subtle);
  color: var(--text-main);
  transform: rotate(90deg);
}

.photo-modal-body {
  padding: 24px;
}

.photo-upload-area {
  margin-bottom: 20px;
}

.upload-placeholder {
  border: 3px dashed var(--border-subtle);
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.upload-placeholder:hover {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.05);
}

.upload-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.upload-text {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}

.upload-hint {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.upload-formats {
  font-size: 12px;
  color: var(--text-muted);
}

.photo-preview-section {
  margin-bottom: 20px;
}

.photo-preview-section h3 {
  font-size: 16px;
  color: var(--text-main);
  margin: 0 0 12px 0;
}

.photo-previews {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
}

.photo-preview {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--border-subtle);
}

.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(239, 68, 68, 0.9);
  border: none;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.photo-remove:hover {
  background: #ef4444;
  transform: scale(1.1);
}

.photo-notes-section {
  margin-bottom: 20px;
}

.photo-notes-section label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}

.photo-notes-section textarea {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 12px;
  color: var(--text-main);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}

.photo-notes-section textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.ai-photo-analysis {
  background: rgba(59, 130, 246, 0.05);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}

.ai-analysis-header {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-main);
  margin-bottom: 12px;
}

.ai-analysis-content {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.photo-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.photo-modal-actions .btn {
  min-width: 100px;
}

/* ============================================
   User Profile Settings
   ============================================ */

.profile-section {
  display: flex;
  gap: 32px;
  padding: 24px;
}

.profile-photo-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  min-width: 200px;
}

.profile-photo-container {
  position: relative;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
  border: 4px solid #333;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.profile-photo-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
}

.profile-initials {
  font-size: 64px;
  font-weight: bold;
  color: white;
  text-transform: uppercase;
}

.profile-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.profile-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.profile-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-form-group label {
  font-size: 14px;
  font-weight: 600;
  color: #ddd;
}

.profile-form-group input,
.profile-form-group select {
  padding: 12px;
  border: 1px solid #444;
  border-radius: 8px;
  background: #1a1a1a;
  color: #fff;
  font-size: 14px;
  transition: all 0.3s ease;
}

.profile-form-group input:focus,
.profile-form-group select:focus {
  outline: none;
  border-color: #2196F3;
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.profile-form-group input::placeholder {
  color: #666;
}

.profile-form-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.profile-form-actions .btn {
  min-width: 120px;
}

@media (max-width: 768px) {
  .profile-section {
    flex-direction: column;
    align-items: center;
  }
  
  .profile-form-row {
    grid-template-columns: 1fr;
  }
}

/* Multi-Select Dropdown Styles */
.multi-select-container {
  position: relative;
}

.multi-select-display {
  padding: 12px;
  border: 1px solid #444;
  border-radius: 8px;
  background: #1a1a1a;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  min-height: 44px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  transition: all 0.3s ease;
}

.multi-select-display:hover {
  border-color: #2196F3;
}

.multi-select-placeholder {
  color: #666;
}

.multi-select-tag {
  background: #2196F3;
  color: white;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.multi-select-tag-remove {
  cursor: pointer;
  font-weight: bold;
  opacity: 0.8;
}

.multi-select-tag-remove:hover {
  opacity: 1;
}

.multi-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: #1a1a1a;
  border: 1px solid #444;
  border-radius: 8px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.multi-select-dropdown.hidden {
  display: none;
}

.multi-select-option {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.multi-select-option:hover {
  background: #2a2a2a;
}

.multi-select-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #2196F3;
}

.multi-select-option label {
  flex: 1;
  cursor: pointer;
  color: #ddd;
  font-size: 14px;
  margin: 0;
}

.multi-select-dropdown::-webkit-scrollbar {
  width: 8px;
}

.multi-select-dropdown::-webkit-scrollbar-track {
  background: #1a1a1a;
}

.multi-select-dropdown::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 4px;
}

.multi-select-dropdown::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* ============================================
   Medication Tracker Styles
   ============================================ */

.medications-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.medication-card {
  background: linear-gradient(135deg, #1a1a1a 0%, #252525 100%);
  border: 1px solid #333;
  border-radius: 12px;
  padding: 16px;
  transition: all 0.3s ease;
}

.medication-card:hover {
  border-color: #2196F3;
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.2);
  transform: translateY(-2px);
}

.medication-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.medication-info h3 {
  font-size: 18px;
  color: #fff;
  margin: 0 0 4px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.medication-dosage {
  color: #2196F3;
  font-size: 14px;
  font-weight: 600;
}

.medication-purpose {
  color: #999;
  font-size: 13px;
  margin-top: 4px;
}

.medication-actions {
  display: flex;
  gap: 8px;
}

.medication-actions button {
  padding: 6px 12px;
  font-size: 12px;
  min-width: auto;
}

.medication-schedule {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #333;
}

.medication-detail {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.medication-detail-label {
  font-size: 11px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.medication-detail-value {
  font-size: 13px;
  color: #ddd;
}

.medication-photo {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  border: 2px solid #333;
}

.todays-doses {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dose-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.dose-item.taken {
  opacity: 0.6;
  border-color: #4CAF50;
}

.dose-time {
  font-size: 16px;
  font-weight: bold;
  color: #2196F3;
  min-width: 70px;
}

.dose-info {
  flex: 1;
}

.dose-name {
  font-size: 14px;
  color: #fff;
  margin-bottom: 2px;
}

.dose-dosage {
  font-size: 12px;
  color: #999;
}

.dose-action button {
  padding: 6px 12px;
  font-size: 12px;
}

.refill-alerts {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.refill-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 152, 0, 0.1);
  border: 1px solid #FF9800;
  border-radius: 8px;
}

.refill-alert.critical {
  background: rgba(244, 67, 54, 0.1);
  border-color: #f44336;
}

.refill-icon {
  font-size: 24px;
}

.refill-info {
  flex: 1;
}

.refill-med-name {
  font-size: 14px;
  color: #fff;
  font-weight: 600;
  margin-bottom: 4px;
}

.refill-status {
  font-size: 12px;
  color: #FF9800;
}

.refill-alert.critical .refill-status {
  color: #f44336;
}

.refill-action button {
  padding: 6px 12px;
  font-size: 12px;
}

/* Medication Modal */
.medication-modal-content {
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 14px;
  color: #ddd;
  margin-bottom: 6px;
  font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  background: #1a1a1a;
  border: 1px solid #444;
  border-radius: 6px;
  color: #fff;
  font-size: 14px;
  transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #2196F3;
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.med-photo-preview {
  margin-top: 12px;
  width: 120px;
  height: 120px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #333;
}

.med-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease;
}

.modal-overlay.hidden {
  display: none;
}

.modal-content {
  background: #2a2a2a;
  border-radius: 16px;
  border: 1px solid #444;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.3s ease;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #333;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
  color: #fff;
}

.modal-close {
  background: none;
  border: none;
  color: #999;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.modal-close:hover {
  background: #444;
  color: #fff;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #333;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   Health Reports Styles
   ============================================ */

.reports-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  padding: 24px;
}

.report-card {
  background: linear-gradient(135deg, #1a1a1a 0%, #252525 100%);
  border: 1px solid #333;
  border-radius: 12px;
  padding: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.report-card:hover {
  border-color: #2196F3;
  box-shadow: 0 8px 24px rgba(33, 150, 243, 0.3);
  transform: translateY(-4px);
}

.report-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.report-card h3 {
  font-size: 18px;
  color: #fff;
  margin: 0 0 12px 0;
}

.report-card p {
  font-size: 13px;
  color: #999;
  line-height: 1.5;
  margin: 0 0 20px 0;
}

.report-card .btn {
  width: 100%;
}

.report-preview-content {
  padding: 32px;
  background: white;
  color: #000;
  min-height: 600px;
  font-family: 'Segoe UI', Arial, sans-serif;
}

.report-preview-content h1 {
  color: #2196F3;
  border-bottom: 3px solid #2196F3;
  padding-bottom: 12px;
  margin-bottom: 24px;
}

.report-preview-content h2 {
  color: #333;
  margin-top: 32px;
  margin-bottom: 16px;
  font-size: 20px;
}

.report-preview-content h3 {
  color: #666;
  margin-top: 20px;
  margin-bottom: 12px;
  font-size: 16px;
}

.report-section {
  margin-bottom: 32px;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

.report-table th {
  background: #f5f5f5;
  padding: 12px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid #ddd;
}

.report-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #eee;
}

.report-table tr:hover {
  background: #fafafa;
}

.report-header-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
  padding: 16px;
  background: #f9f9f9;
  border-radius: 8px;
}

.report-info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.report-info-label {
  font-size: 12px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.report-info-value {
  font-size: 14px;
  color: #000;
  font-weight: 600;
}

.report-metric-card {
  display: inline-block;
  padding: 12px 16px;
  margin: 8px 8px 8px 0;
  background: #f5f5f5;
  border-radius: 8px;
  border-left: 4px solid #2196F3;
}

.report-metric-name {
  font-size: 12px;
  color: #666;
  margin-bottom: 4px;
}

.report-metric-value {
  font-size: 18px;
  color: #000;
  font-weight: bold;
}

.report-metric-value.normal {
  color: #4CAF50;
}

.report-metric-value.warning {
  color: #FF9800;
}

.report-metric-value.critical {
  color: #f44336;
}

.report-actions {
  display: flex;
  gap: 12px;
}

.report-footer {
  margin-top: 48px;
  padding-top: 16px;
  border-top: 2px solid #ddd;
  font-size: 11px;
  color: #999;
  text-align: center;
}

@media print {
  .report-preview-content {
    padding: 0;
  }
  
  .report-actions {
    display: none;
  }
  
  .card-header {
    display: none;
  }
}

/* ============================================
   Predictive Health Alerts
   ============================================ */

.predictive-alerts {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.alert-item {
  padding: 16px;
  border-radius: 8px;
  border-left: 4px solid;
  display: flex;
  gap: 16px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.alert-item:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.alert-item.info {
  background: rgba(33, 150, 243, 0.1);
  border-color: #2196F3;
}

.alert-item.warning {
  background: rgba(255, 152, 0, 0.1);
  border-color: #FF9800;
}

.alert-item.critical {
  background: rgba(244, 67, 54, 0.1);
  border-color: #f44336;
  animation: alertPulse 2s infinite;
}

.alert-item.success {
  background: rgba(76, 175, 80, 0.1);
  border-color: #4CAF50;
}

.alert-icon {
  font-size: 32px;
  min-width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.alert-content {
  flex: 1;
}

.alert-title {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
}

.alert-badge.info {
  background: #2196F3;
  color: white;
}

.alert-badge.warning {
  background: #FF9800;
  color: white;
}

.alert-badge.critical {
  background: #f44336;
  color: white;
}

.alert-badge.success {
  background: #4CAF50;
  color: white;
}

.alert-message {
  font-size: 13px;
  color: #ddd;
  line-height: 1.5;
  margin-bottom: 8px;
}

.alert-recommendation {
  font-size: 12px;
  color: #999;
  font-style: italic;
  margin-top: 8px;
}

.alert-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.alert-actions .btn {
  padding: 6px 12px;
  font-size: 12px;
  min-width: auto;
}

.alert-timestamp {
  font-size: 11px;
  color: #666;
  margin-top: 8px;
}

.alert-metrics {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}

.alert-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.alert-metric-label {
  font-size: 10px;
  color: #666;
  text-transform: uppercase;
}

.alert-metric-value {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

@keyframes alertPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(244, 67, 54, 0);
  }
}

.no-alerts {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

.no-alerts-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.no-alerts-text {
  font-size: 14px;
}

/* ==================== GAMIFICATION SYSTEM ==================== */

.gamification-widget {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  padding: 24px;
  color: white;
  margin-bottom: 24px;
  box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.game-header h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}

.game-level {
  background: rgba(255, 255, 255, 0.2);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  backdrop-filter: blur(10px);
}

.game-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.game-stat {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  backdrop-filter: blur(10px);
  transition: transform 0.2s;
}

.game-stat:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.2);
}

.game-stat-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.game-stat-value {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

.game-stat-label {
  font-size: 12px;
  opacity: 0.9;
}

.game-badges {
  margin-bottom: 20px;
}

.game-badges h4 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 12px 0;
  opacity: 0.9;
}

.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.badge-earned {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  backdrop-filter: blur(10px);
  transition: transform 0.2s;
}

.badge-earned:hover {
  transform: scale(1.05);
  background: rgba(255, 255, 255, 0.25);
}

.badge-icon {
  font-size: 32px;
  display: block;
  margin-bottom: 8px;
}

.badge-name {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
}

.game-progress {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  backdrop-filter: blur(10px);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
}

.progress-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4ade80 0%, #22c55e 100%);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.progress-desc {
  font-size: 11px;
  opacity: 0.8;
}

.btn-game {
  width: 100%;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.4);
  color: white;
  font-weight: 600;
  backdrop-filter: blur(10px);
}

.btn-game:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-2px);
}

/* Badge Notification */
.badge-notification {
  position: fixed;
  top: 100px;
  right: -400px;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: white;
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(251, 191, 36, 0.4);
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 10000;
  min-width: 320px;
  transition: right 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  animation: badgePulse 2s infinite;
}

.badge-notification.show {
  right: 24px;
}

.badge-notif-icon {
  font-size: 48px;
  animation: badgeSpin 1s ease;
}

.badge-notif-title {
  font-size: 14px;
  font-weight: 600;
  opacity: 0.9;
  margin-bottom: 4px;
}

.badge-notif-name {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

.badge-notif-desc {
  font-size: 12px;
  opacity: 0.85;
}

@keyframes badgeSpin {
  0% {
    transform: rotate(0deg) scale(0);
  }
  50% {
    transform: rotate(180deg) scale(1.2);
  }
  100% {
    transform: rotate(360deg) scale(1);
  }
}

@keyframes badgePulse {
  0%, 100% {
    box-shadow: 0 12px 40px rgba(251, 191, 36, 0.4);
  }
  50% {
    box-shadow: 0 12px 40px rgba(251, 191, 36, 0.6), 0 0 30px rgba(251, 191, 36, 0.4);
  }
}

/* Points Notification */
.points-notification {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: white;
  padding: 32px 48px;
  border-radius: 24px;
  box-shadow: 0 16px 48px rgba(34, 197, 94, 0.5);
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 10001;
  font-size: 36px;
  font-weight: 700;
  transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  opacity: 0;
}

.points-notification.show {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.points-notif-icon {
  font-size: 56px;
  animation: pointsPop 0.6s ease;
}

@keyframes pointsPop {
  0% {
    transform: scale(0) rotate(0deg);
  }
  50% {
    transform: scale(1.3) rotate(180deg);
  }
  100% {
    transform: scale(1) rotate(360deg);
  }
}

/* Badges Modal */
.badges-modal {
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
}

.badges-collection {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.badge-card {
  background: #2a2a2a;
  border: 2px solid #444;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: all 0.3s;
}

.badge-card.earned {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: #764ba2;
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

.badge-card.earned:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.5);
}

.badge-card.locked {
  opacity: 0.5;
}

.badge-card.locked:hover {
  opacity: 0.7;
}

.badge-card-icon {
  font-size: 56px;
  margin-bottom: 12px;
}

.badge-card-name {
  font-size: 16px;
  font-weight: 600;
  color: white;
  margin-bottom: 8px;
}

.badge-card-desc {
  font-size: 12px;
  color: #aaa;
  margin-bottom: 8px;
}

.badge-card-progress {
  font-size: 11px;
  color: #888;
  font-style: italic;
}

