/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f3f4f6;
  --border-color: #e5e7eb;
  --border-light: #f0f0f0;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-light: #eef2ff;
  --success: #10b981;
  --success-bg: #d1fae5;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --danger: #ef4444;
  --danger-bg: #fee2e2;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  font-size: 14px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* App Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 240px;
  background: var(--bg-primary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-close-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.mobile-close-btn:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.sidebar-logo {
  height: 32px;
  width: auto;
}

.sidebar-nav {
  padding: 12px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: all var(--transition);
}

.nav-item:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-light);
  color: var(--accent-primary);
}

.nav-item svg {
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
}

.version {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 240px;
  min-height: 100vh;
}

.content-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px;
}

/* Page Header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
}

.subtitle {
  color: var(--text-secondary);
  margin-top: 4px;
}

.header-with-back {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-actions {
  display: flex;
  gap: 12px;
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--accent-primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.btn-primary:hover {
  background: var(--accent-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.btn-ghost:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-icon:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
}

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

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

/* Cards */
.card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 24px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.card-header h2 {
  font-size: 15px;
  font-weight: 600;
}

.card-body {
  padding: 20px;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
}

.badge-outline {
  background: transparent;
  border: 1px solid var(--border-color);
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
}

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.badge-danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.badge-low {
  background: var(--success-bg);
  color: var(--success);
}

.badge-medium {
  background: var(--warning-bg);
  color: var(--warning);
}

.badge-high {
  background: var(--danger-bg);
  color: var(--danger);
}

.badge-red {
  background: #7f1d1d;
  color: white;
}

/* Search Bar */
.search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.search-bar svg {
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  font-family: inherit;
  background: transparent;
}

.search-bar input::placeholder {
  color: var(--text-tertiary);
}

/* Table */
.table-legend {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-secondary);
  font-size: 12px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-dot.incomplete {
  background: var(--warning);
}

.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

/* Scroll indicator for tables */
.table-container::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 24px;
  background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.05));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.table-container.has-scroll::after {
  opacity: 1;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.data-table th {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--bg-secondary);
}

/* Sortable columns */
.data-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: color var(--transition), background var(--transition);
}

.data-table th.sortable:hover {
  color: var(--accent-primary);
  background: var(--accent-light);
}

.data-table th .sort-icon {
  margin-left: 4px;
  opacity: 0.3;
  vertical-align: middle;
  transition: opacity var(--transition);
}

.data-table th.sortable:hover .sort-icon {
  opacity: 0.6;
}

.data-table th.sort-asc .sort-icon,
.data-table th.sort-desc .sort-icon {
  opacity: 1;
  color: var(--accent-primary);
}

.data-table th.sort-asc .sort-icon path:last-child,
.data-table th.sort-desc .sort-icon path:first-child {
  opacity: 0.3;
}

.data-table tbody tr {
  cursor: pointer;
  transition: background var(--transition);
}

.data-table tbody tr:hover {
  background: var(--bg-secondary);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* Incomplete data row highlighting */
.data-table tbody tr.row-incomplete {
  background: rgba(245, 158, 11, 0.05);
}

.data-table tbody tr.row-incomplete:hover {
  background: rgba(245, 158, 11, 0.1);
}

.name-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.incomplete-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: var(--warning);
  color: white;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

/* Delta score styles */
.delta {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  font-family: 'Monaco', 'Consolas', monospace;
}

.delta-positive {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.delta-negative {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.delta-neutral {
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

.delta-na {
  color: var(--text-tertiary);
}

.table-actions {
  display: flex;
  gap: 8px;
}

/* Loading & Empty States */
.loading-state,
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  color: var(--text-tertiary);
  text-align: center;
}

.loading-state p,
.empty-state p {
  margin: 16px 0;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Profile Grid */
.profile-grid {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 24px;
}

@media (max-width: 1024px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }
}

/* User Details */
.details-grid {
  display: grid;
  gap: 16px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.detail-value {
  font-weight: 500;
  text-align: right;
}

/* Tests List */
.tests-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 600px;
  overflow-y: auto;
}

.test-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.test-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  cursor: pointer;
  transition: background var(--transition);
}

.test-card-header:hover {
  background: var(--bg-tertiary);
}

.test-card-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.test-date {
  font-weight: 600;
}

.test-card-badges {
  display: flex;
  gap: 8px;
}

.test-card-actions {
  display: flex;
  gap: 8px;
}

.test-card-body {
  padding: 16px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-primary);
  display: none;
}

.test-card.expanded .test-card-body {
  display: block;
}

.biomarker-results {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 768px) {
  .biomarker-results {
    grid-template-columns: repeat(2, 1fr);
  }
}

.biomarker-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
}

.biomarker-result img {
  width: 32px;
  height: 32px;
}

.biomarker-result-info {
  flex: 1;
}

.biomarker-result-name {
  font-size: 12px;
  font-weight: 600;
}

.biomarker-result-value {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Import View */
.import-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 24px;
}

@media (max-width: 900px) {
  .import-grid {
    grid-template-columns: 1fr;
  }
}

.import-section {
  margin-bottom: 20px;
}

.import-instructions {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 24px;
}

.import-instructions p {
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.import-rules {
  list-style: none;
  padding: 0;
  margin: 0;
}

.import-rules li {
  padding: 8px 0;
  padding-left: 24px;
  position: relative;
  color: var(--text-secondary);
  font-size: 14px;
}

.import-rules li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: 600;
}

.import-rules li strong {
  color: var(--text-primary);
}

.import-actions {
  margin-bottom: 24px;
}

.import-label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
}

.import-hint {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 6px;
}

.file-input {
  width: 100%;
  padding: 12px;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.file-input:hover {
  border-color: var(--accent-primary);
  background: var(--accent-light);
}

.json-input {
  width: 100%;
  min-height: 200px;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: 'Monaco', 'Consolas', monospace;
  font-size: 12px;
  resize: vertical;
}

.json-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.import-log {
  max-height: 300px;
  overflow-y: auto;
  font-family: 'Monaco', 'Consolas', monospace;
  font-size: 12px;
  line-height: 1.6;
}

.import-log .log-placeholder {
  color: var(--text-tertiary);
}

.log-entry {
  padding: 4px 0;
}

.log-entry.success {
  color: var(--success);
}

.log-entry.error {
  color: var(--danger);
}

.log-entry.warning {
  color: var(--warning);
}

/* Form Elements */
.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.form-row-3 {
  grid-template-columns: repeat(3, 1fr);
}

.form-section {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-light);
}

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

.form-section h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-secondary);
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.input-group:last-child {
  margin-bottom: 0;
}

.input-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.input-group input,
.input-group select,
.input-group textarea {
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-primary);
  transition: all var(--transition);
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.input-group input::placeholder,
.input-group textarea::placeholder {
  color: var(--text-tertiary);
}

/* Biomarker Inputs */
.biomarker-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.biomarker-input {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  gap: 16px;
}

.biomarker-label {
  display: flex;
  align-items: center;
  gap: 12px;
}

.biomarker-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  object-fit: contain;
}

.marker-name {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
}

.marker-subname {
  display: block;
  font-size: 12px;
  color: var(--text-tertiary);
}

.biomarker-input input {
  width: 140px;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: inherit;
  text-align: right;
  background: var(--bg-primary);
}

.biomarker-input input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-light);
}

/* Reference Ranges */
.ranges-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 900px) {
  .ranges-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .ranges-grid {
    grid-template-columns: 1fr;
  }
}

.range-input {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.range-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.range-fields {
  display: flex;
  align-items: center;
  gap: 8px;
}

.range-fields input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
}

.range-fields input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.range-separator {
  color: var(--text-tertiary);
}

.ranges-actions {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-large {
  max-width: 700px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  background: var(--text-primary);
  color: white;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  animation: slideIn 0.3s ease;
}

.toast.success {
  background: var(--success);
}

.toast.error {
  background: var(--danger);
}

.toast.info {
  background: var(--primary);
}

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

/* PDF Preview Styles */
.pdf-preview {
  width: 800px;
  transform-origin: top center;
}

.pdf-page {
  background: white;
  padding: 40px;
  box-shadow: var(--shadow-lg);
  border-radius: 4px;
  font-size: 11px;
}

.pdf-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.pdf-logo {
  height: 36px;
  width: auto;
}

.pdf-header-right {
  text-align: right;
  font-size: 10px;
  color: var(--text-secondary);
}

.pdf-header-right p {
  margin: 2px 0;
}

.pdf-company-info {
  margin-bottom: 20px;
  font-size: 10px;
  color: var(--text-secondary);
}

.pdf-company-info p {
  margin: 2px 0;
}

.pdf-patient-box {
  display: flex;
  gap: 40px;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
}

.pdf-patient-left,
.pdf-patient-right {
  flex: 1;
}

.pdf-patient-box p {
  margin: 4px 0;
  font-size: 10px;
}

.pdf-patient-box strong {
  color: var(--text-secondary);
}

.pdf-results-title {
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  margin: 24px 0 16px;
  color: var(--text-primary);
}

.pdf-results-table {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.pdf-table-header {
  display: grid;
  grid-template-columns: 2fr 1fr 1.2fr 1fr;
  padding: 12px 16px;
  background: var(--bg-secondary);
  font-weight: 600;
  font-size: 11px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}

.pdf-table-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1.2fr 1fr;
  padding: 12px 16px;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
}

.pdf-table-row:last-child {
  border-bottom: none;
}

.pdf-biomarker-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pdf-biomarker-cell img {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  object-fit: contain;
}

.pdf-biomarker-cell strong {
  display: block;
  font-size: 12px;
  color: var(--text-primary);
}

.pdf-biomarker-cell span {
  display: block;
  font-size: 9px;
  color: var(--text-tertiary);
}

.pdf-value-cell {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
}

.pdf-range-cell {
  font-size: 11px;
  color: var(--text-secondary);
}

.pdf-interp-cell {
  display: flex;
}

.interp-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-tertiary);
  color: var(--text-tertiary);
}

.interp-badge.in-range {
  background: var(--success-bg);
  color: var(--success);
}

.interp-badge.high {
  background: var(--danger-bg);
  color: var(--danger);
}

.interp-badge.low {
  background: var(--warning-bg);
  color: var(--warning);
}

.pdf-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

.pdf-footer p {
  font-size: 7px;
  color: var(--text-tertiary);
  margin-bottom: 8px;
  line-height: 1.4;
}

/* Mobile Header */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  padding: 0 16px;
  align-items: center;
  gap: 16px;
  z-index: 150;
}

.mobile-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.mobile-menu-btn:hover,
.mobile-menu-btn:active {
  background: var(--bg-secondary);
}

.mobile-logo {
  height: 28px;
  width: auto;
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 199;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
  display: block;
  opacity: 1;
}

/* Prevent body scroll when mobile menu is open */
body.mobile-menu-open {
  overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
  .mobile-header {
    display: flex;
  }

  .mobile-close-btn {
    display: flex;
    width: 44px;
    height: 44px;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
    z-index: 200;
  }

  .main-content {
    margin-left: 0;
    padding-top: 60px;
  }

  .content-wrapper {
    padding: 16px;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .page-header h1 {
    font-size: 20px;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }

  .header-with-back {
    gap: 12px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .form-row-3 {
    grid-template-columns: 1fr;
  }

  .modal-content {
    margin: 16px;
    max-height: calc(100vh - 32px);
  }

  .modal-large {
    max-width: calc(100vw - 32px);
  }

  /* Improve biomarker input on mobile */
  .biomarker-input {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .biomarker-input input {
    width: 100%;
    text-align: left;
  }

  /* Better touch targets */
  .btn-primary,
  .btn-ghost {
    min-height: 44px;
    padding: 12px 20px;
  }

  .btn-icon {
    width: 44px;
    height: 44px;
  }

  .btn-small {
    min-height: 36px;
    padding: 8px 12px;
  }

  .nav-item {
    min-height: 44px;
    padding: 12px 16px;
  }

  /* Search bar touch target */
  .search-bar {
    min-height: 48px;
  }

  .search-bar input {
    min-height: 44px;
  }

  /* Toast positioning for mobile */
  .toast {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  /* Table improvements for mobile */
  .data-table th,
  .data-table td {
    padding: 10px 12px;
    font-size: 13px;
  }

  .data-table th {
    font-size: 10px;
  }

  /* Hide less important columns on mobile */
  .data-table th:nth-child(2),
  .data-table td:nth-child(2) {
    display: none;
  }

  .table-actions {
    flex-direction: column;
    gap: 4px;
  }

  .table-actions .btn-ghost {
    min-height: 36px;
    padding: 6px 10px;
    font-size: 12px;
  }

  /* Card improvements */
  .card-header {
    padding: 12px 16px;
  }

  .card-body {
    padding: 16px;
  }

  /* Test card mobile improvements */
  .test-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .test-card-info {
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
  }

  .test-card-badges {
    flex-wrap: wrap;
  }

  .test-card-actions {
    width: 100%;
    justify-content: flex-start;
  }

  /* Biomarker results grid */
  .biomarker-results {
    grid-template-columns: 1fr;
  }

  /* Profile page improvements */
  .detail-row {
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
  }

  .detail-value {
    text-align: left;
  }

  /* Login card mobile */
  .login-card {
    padding: 24px;
  }

  .login-header h1 {
    font-size: 20px;
  }
}

/* Small mobile devices */
@media (max-width: 480px) {
  .content-wrapper {
    padding: 12px;
  }

  .page-header h1 {
    font-size: 18px;
  }

  .subtitle {
    font-size: 13px;
  }

  .modal-content {
    margin: 8px;
    max-height: calc(100vh - 16px);
  }

  .modal-header {
    padding: 16px;
  }

  .modal-body {
    padding: 16px;
  }

  .modal-footer {
    padding: 12px 16px;
    flex-direction: column;
  }

  .modal-footer .btn-ghost,
  .modal-footer .btn-primary {
    width: 100%;
    justify-content: center;
  }

  /* Reduce table columns on very small screens */
  .data-table th:nth-child(3),
  .data-table td:nth-child(3),
  .data-table th:nth-child(6),
  .data-table td:nth-child(6) {
    display: none;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .import-instructions {
    padding: 12px;
  }

  .import-rules li {
    font-size: 13px;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .mobile-header {
    height: 50px;
  }

  .main-content {
    padding-top: 50px;
  }

  .modal-content {
    max-height: calc(100vh - 24px);
  }

  .login-screen {
    padding: 12px;
  }

  .login-card {
    padding: 20px;
  }
}

/* Tablet breakpoint */
@media (min-width: 769px) and (max-width: 1024px) {
  .content-wrapper {
    padding: 24px;
  }

  .page-header h1 {
    font-size: 22px;
  }

  /* Keep sidebar visible on tablet */
  .sidebar {
    width: 220px;
  }

  .main-content {
    margin-left: 220px;
  }
}

/* Login Screen */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px;
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo {
  height: 48px;
  width: auto;
  margin-bottom: 16px;
}

.login-header h1 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.login-header p {
  font-size: 14px;
  color: var(--text-secondary);
}

.login-error {
  padding: 12px;
  background: var(--danger-bg);
  color: var(--danger);
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-bottom: 16px;
  text-align: center;
}

.btn-full {
  width: 100%;
  justify-content: center;
}

.btn-logout {
  width: 100%;
  justify-content: center;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.btn-logout:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: var(--danger-bg);
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
}
