/* ============================================
   SMART STOMA — Design System
   Tema escuro profissional para saúde
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ─── TOKENS ─── */
:root {
  /* Premium Slate Dark Mode */
  --bg-primary: #020617; /* Slate 950 */
  --bg-secondary: #0f172a; /* Slate 900 */
  --bg-card: rgba(15, 23, 42, 0.45);
  --bg-card-hover: rgba(30, 41, 59, 0.65); /* Slate 800 */
  --bg-input: rgba(2, 6, 23, 0.6);
  --bg-modal: rgba(2, 6, 23, 0.85);

  /* Vibrant Emerald Accent */
  --accent: #10b981; /* Emerald 500 */
  --accent-light: #34d399; /* Emerald 400 */
  --accent-dark: #059669; /* Emerald 600 */
  --accent-glow: rgba(16, 185, 129, 0.15);

  /* Semantic */
  --danger: #ef4444; /* Red 500 */
  --danger-dark: #dc2626; /* Red 600 */
  --warning: #f59e0b; /* Amber 500 */
  --success: #10b981; /* Emerald 500 */
  --info: #3b82f6; /* Blue 500 */

  /* Text */
  --text: #f8fafc; /* Slate 50 */
  --text-secondary: #94a3b8; /* Slate 400 */
  --text-muted: #64748b; /* Slate 500 */

  /* Glassmorphism Borders */
  --border: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(16, 185, 129, 0.3);
  --glass-border: rgba(255, 255, 255, 0.05);
  --glass-border-strong: rgba(255, 255, 255, 0.12);

  /* Radius */
  --radius-xs: 6px;
  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 32px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.2);
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 50px rgba(0, 0, 0, 0.6);
  --shadow-accent: 0 4px 20px rgba(16, 185, 129, 0.25);
  --glass: rgba(255, 255, 255, 0.02);

  /* Sizing */
  --nav-height: 72px;
  --header-height: 64px;

  /* Transitions */
  --transition: 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  --transition-fast: 0.15s ease-out;
  --transition-bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ─── RESET ─── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  background-image:
    radial-gradient(circle at 15% 50%, rgba(16, 185, 129, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 85% 30%, rgba(59, 130, 246, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 50% 100%, rgba(16, 185, 129, 0.03) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  padding-top: var(--header-height);
  padding-bottom: 24px;
}

/* ─── HEADER ─── */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(2, 6, 23, 0.75);
  backdrop-filter: blur(24px) saturate(1.8);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  display: flex;
  align-items: center;
  padding: 0 16px;
  z-index: 100;
  border-bottom: 1px solid var(--glass-border-strong);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}

.app-header h1 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  flex: 1;
  text-align: center;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-menu {
  position: absolute;
  left: 12px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 8px;
  transition: var(--transition);
  z-index: 2;
}

.header-menu:hover {
  color: var(--accent);
}

.header-menu.hidden {
  opacity: 0;
  pointer-events: none;
}

.header-back {
  position: absolute;
  left: 12px;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 8px;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
  z-index: 2;
}

.header-back.visible {
  opacity: 1;
  pointer-events: all;
}

.header-back.visible + .header-menu,
.header-back.visible ~ .header-menu {
  display: none;
}

.header-actions {
  position: absolute;
  right: 12px;
  display: flex;
  gap: 8px;
}

.header-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.header-btn:hover {
  color: var(--accent);
  background: var(--accent-glow);
}

/* ─── SIDEBAR OVERLAY ─── */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* ─── SIDEBAR DRAWER ─── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  max-width: 85vw;
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(32px) saturate(1.5);
  -webkit-backdrop-filter: blur(32px) saturate(1.5);
  border-right: 1px solid var(--glass-border-strong);
  z-index: 200;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 10px 0 50px rgba(0, 0, 0, 0.5);
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  font-size: 2rem;
  line-height: 1;
}

.sidebar-brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  flex: 1;
  letter-spacing: -0.5px;
}

.sidebar-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.sidebar-close:hover {
  color: var(--text);
  background: var(--glass);
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  background: none;
  border: none;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
  text-align: left;
  position: relative;
}

.sidebar-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  transition: height 0.25s ease;
}

.sidebar-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  transform: translateX(4px);
}

.sidebar-item:active {
  transform: scale(0.98);
}

.sidebar-item.active {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.15) 0%, transparent 100%);
  color: var(--accent-light);
  font-weight: 600;
}

.sidebar-item.active::before {
  height: 28px;
  box-shadow: 0 0 10px var(--accent);
}

.sidebar-item .sidebar-icon {
  font-size: 1.25rem;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

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

.sidebar-disclaimer {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 8px;
  padding: 10px 12px;
  background: rgba(255, 167, 38, 0.05);
  border: 1px solid rgba(255, 167, 38, 0.1);
  border-radius: var(--radius-sm);
}

.sidebar-version {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: center;
  opacity: 0.5;
}

.sidebar-branding {
  padding: 10px 12px;
  margin-bottom: 10px;
  background: rgba(0, 191, 165, 0.06);
  border: 1px solid rgba(0, 191, 165, 0.12);
  border-radius: var(--radius-sm);
  text-align: center;
}

.sidebar-powered {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
}

.sidebar-cnpj {
  font-size: 0.68rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.sidebar-rights {
  font-size: 0.66rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-top: 6px;
}

/* ─── PAGES ─── */
.page {
  display: none;
  padding: 16px;
  animation: fadeIn 0.3s ease;
}

.page.active {
  display: block;
}

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

/* ─── SECTION TITLES ─── */
.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  letter-spacing: -0.3px;
}

.section-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: -10px;
  margin-bottom: 16px;
}

/* ─── CARDS ─── */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  transition: var(--transition-bounce);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.06) 50%, transparent 100%);
}

.card:hover, .card:active {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.card-icon {
  font-size: 1.6rem;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass);
  border-radius: var(--radius-sm);
}

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.card-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.card-body {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ─── STAT CARDS ─── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 16px 10px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40%;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0.3;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -1px;
}

.stat-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ─── ALERT CARDS ─── */
.alert-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius);
  margin-bottom: 10px;
  border: 1px solid;
  animation: slideIn 0.3s ease;
}

.alert-card.critical {
  background: rgba(198, 40, 40, 0.1);
  border-color: rgba(198, 40, 40, 0.3);
}

.alert-card.high {
  background: rgba(239, 83, 80, 0.1);
  border-color: rgba(239, 83, 80, 0.3);
}

.alert-card.moderate {
  background: rgba(255, 167, 38, 0.1);
  border-color: rgba(255, 167, 38, 0.3);
}

.alert-card .alert-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.alert-card .alert-content {
  flex: 1;
}

.alert-card .alert-title {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 3px;
}

.alert-card .alert-message {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-full);
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

.btn:active {
  transform: scale(0.96);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  box-shadow: var(--shadow-accent);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger), var(--danger-dark));
  color: white;
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.btn-danger:hover {
  box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.btn-full {
  width: 100%;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.78rem;
}

.btn-icon {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  font-size: 1.1rem;
}

/* ─── FAB (Floating Action Button) ─── */
.fab {
  position: fixed;
  bottom: 24px;
  right: 16px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #00897b);
  color: white;
  border: none;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(0, 191, 165, 0.4);
  z-index: 50;
  transition: var(--transition);
}

.fab:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 32px rgba(0, 191, 165, 0.5);
}

.fab:active {
  transform: scale(0.95);
}

/* ─── FORMS ─── */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-input);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  transition: var(--transition-fast);
  outline: none;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-textarea {
  min-height: 80px;
  resize: vertical;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239aa0a6' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

/* ─── OPTION GRID (seleção de tipo de tecido, etc) ─── */
.option-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.option-item {
  padding: 10px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.option-item:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

.option-item.selected {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.option-item .opt-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 4px;
}

.option-item .opt-desc {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ─── CHECKBOX GRID (sinais de infecção) ─── */
.checkbox-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.checkbox-item:hover {
  background: var(--bg-card-hover);
}

.checkbox-item.checked {
  border-color: var(--danger);
  background: rgba(239, 83, 80, 0.08);
}

.checkbox-item input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}

.checkbox-item label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  cursor: pointer;
}

/* ─── PAIN SLIDER ─── */
.pain-slider {
  width: 100%;
  -webkit-appearance: none;
  height: 6px;
  border-radius: 4px;
  background: linear-gradient(to right, #4caf50, #ffa726, #ef5350, #c62828);
  outline: none;
}

.pain-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--accent);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.pain-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.pain-emoji {
  font-size: 1.5rem;
}

.pain-value {
  font-size: 1.2rem;
  font-weight: 700;
}

/* ─── CAMERA VIEW ─── */
.camera-container {
  position: relative;
  width: 100%;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 12px;
}

.camera-container video {
  width: 100%;
  display: block;
}

.camera-controls {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 12px;
}

.camera-capture-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: white;
  border: 4px solid var(--accent);
  cursor: pointer;
  transition: var(--transition);
}

.camera-capture-btn:active {
  transform: scale(0.9);
  background: var(--accent-light);
}

.photo-preview {
  position: relative;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 12px;
}

.photo-preview img {
  width: 100%;
  display: block;
  object-fit: cover;
  max-height: 300px;
}

.photo-thumb-card {
  position: relative;
  width: 65px;
  height: 65px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}

.photo-thumb-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.photo-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 12px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
}

.photo-overlay.compact {
  padding: 6px;
}

.photo-overlay-top {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.photo-overlay-bottom {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.3;
  margin-top: 4px;
}

.photo-location-tag {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 191, 165, 0.92);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}

.photo-overlay.compact .photo-location-tag {
  margin-top: 0;
  padding: 3px 6px;
  font-size: 0.56rem;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── TIMELINE ─── */
.timeline {
  position: relative;
  padding-left: 24px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--border));
}

.timeline-item {
  position: relative;
  margin-bottom: 16px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
}

.timeline-item:hover {
  border-color: var(--border-accent);
  background: var(--bg-card-hover);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 18px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-primary);
}

.timeline-date {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.timeline-content {
  display: flex;
  gap: 12px;
}

.timeline-thumb {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.timeline-info {
  flex: 1;
}

.timeline-area {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.timeline-score {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.timeline-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-top: 4px;
}

/* ─── COMPARISON ─── */
.comparison-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.comparison-photo {
  border-radius: var(--radius);
  overflow: hidden;
}

.comparison-photo img {
  width: 100%;
  display: block;
  object-fit: cover;
  aspect-ratio: 1;
}

.comparison-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 4px;
}

/* ─── CHART CONTAINERS ─── */
.chart-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.chart-container canvas {
  width: 100%;
}

.evolution-card {
  cursor: default;
}

.evolution-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.evolution-card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.evolution-card-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.evolution-summary-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.evolution-summary-item {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
}

.evolution-summary-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.evolution-summary-value {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 4px;
}

.evolution-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.clinical-form-card,
.clinical-history-card {
  cursor: default;
}

.sync-access-card {
  border-top: 3px solid var(--accent);
  background: linear-gradient(180deg, rgba(15, 34, 44, 0.92) 0%, rgba(14, 24, 40, 0.82) 100%);
  padding: 32px 28px;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .sync-access-card {
    max-width: 95%;
    padding: 24px 20px;
  }
}

@media (max-width: 480px) {
  .sync-access-card {
    max-width: 100%;
    padding: 20px 16px;
    border-radius: 0;
  }
}

.privacy-acceptance-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  margin-bottom: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.privacy-acceptance-card input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
  flex: 0 0 auto;
}

.privacy-acceptance-card span {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.privacy-acceptance-card strong {
  color: var(--text);
  font-size: 0.78rem;
  line-height: 1.35;
}

.privacy-acceptance-card small {
  color: var(--text-secondary);
  font-size: 0.7rem;
  line-height: 1.45;
}

.privacy-acceptance-warning {
  margin: -2px 0 12px;
  font-size: 0.72rem;
  color: var(--warning);
  text-align: center;
}

.sync-status-title {
  font-size: 1.24rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}

@media (max-width: 600px) {
  .sync-status-title {
    font-size: 1.12rem;
    margin-bottom: 12px;
  }
}

@media (max-width: 480px) {
  .sync-status-title {
    font-size: 1.04rem;
    margin-bottom: 10px;
  }
}

.sync-status-text {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.70;
  margin-bottom: 4px;
}

@media (max-width: 600px) {
  .sync-status-text {
    font-size: 0.86rem;
  }
}

@media (max-width: 480px) {
  .sync-status-text {
    font-size: 0.80rem;
  }
}

.sync-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  margin-bottom: 4px;
}

.sync-account-meta {
  margin-top: 16px;
  padding: 14px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}

.sync-account-meta div {
  font-size: 0.87rem;
  color: var(--text-secondary);
  line-height: 1.70;
}

.sync-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.sync-action-row .btn {
  flex: 1;
  min-width: 180px;
}

.clinical-form-helper {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 12px;
}

.clinical-textarea {
  min-height: 110px;
}

.clinical-history-card {
  margin-bottom: 12px;
}

.clinical-history-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.clinical-history-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
}

.clinical-history-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.5;
}

.clinical-evolution-meta-line {
  font-size: 0.74rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.clinical-history-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.clinical-history-label {
  font-size: 0.73rem;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}

.clinical-history-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.6;
  white-space: pre-wrap;
}

.family-permission-card {
  border-top: 3px solid var(--info);
}

.caregiver-permission-item {
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.caregiver-permission-item:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.caregiver-permission-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.viewer-patient-list.compact {
  gap: 6px;
}

.prontuario-event-card {
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.prontuario-event-card:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.prontuario-event-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 4px;
}

.prontuario-event-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 5px;
}

.empty-state.compact {
  padding: 20px 12px;
}

/* ─── TREATMENT CARDS ─── */
.treatment-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
}

.treatment-card.ideal {
  border-left: 3px solid var(--accent);
}

.treatment-card.accessible {
  border-left: 3px solid var(--warning);
}

.treatment-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.treatment-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 8px;
}

.treatment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.treatment-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: var(--glass);
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  color: var(--text-secondary);
}

/* ─── BADGE ─── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
}

.badge-success { background: rgba(102, 187, 106, 0.15); color: #66bb6a; }
.badge-warning { background: rgba(255, 167, 38, 0.15); color: #ffa726; }
.badge-danger { background: rgba(239, 83, 80, 0.15); color: #ef5350; }
.badge-info { background: rgba(66, 165, 245, 0.15); color: #42a5f5; }
.badge-accent { background: var(--accent-glow); color: var(--accent); }

/* ─── DISCLAIMER ─── */
.disclaimer {
  background: rgba(255, 167, 38, 0.08);
  border: 1px solid rgba(255, 167, 38, 0.2);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 0.72rem;
  color: var(--warning);
  line-height: 1.5;
  margin: 16px 0;
}

/* ─── EMPTY STATE ─── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

/* ─── GUIDED EXPERIENCE ─── */
.guide-card {
  background: linear-gradient(135deg, rgba(0, 212, 170, 0.14), rgba(68, 138, 255, 0.08));
  border: 1px solid rgba(0, 212, 170, 0.18);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}

.guide-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.guide-steps {
  display: grid;
  gap: 10px;
}

.guide-step-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  background: rgba(7, 11, 20, 0.35);
  border-radius: var(--radius-sm);
}

.guide-step-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: white;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}

.guide-step-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.guide-step-text,
.guide-footnote {
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.guide-footnote {
  margin-top: 12px;
}

.context-banner {
  background: rgba(68, 138, 255, 0.1);
  border: 1px solid rgba(68, 138, 255, 0.22);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 14px;
}

.context-banner-title {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--info);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.context-banner-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.context-banner-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* ─── MODAL ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(40px) saturate(2);
  -webkit-backdrop-filter: blur(40px) saturate(2);
  border: 1px solid var(--glass-border-strong);
  border-bottom: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px 16px;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal-handle {
  width: 36px;
  height: 4px;
  background: var(--text-muted);
  border-radius: 2px;
  margin: 0 auto 16px;
}

.modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 16px;
  text-align: center;
}

/* ─── WIZARD STEPS ─── */
.wizard-steps {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 20px;
}

.wizard-step {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: var(--transition);
}

.wizard-step.active {
  background: var(--accent);
  width: 24px;
  border-radius: 4px;
}

.wizard-step.done {
  background: var(--accent-dark);
}

.wizard-content {
  animation: fadeIn 0.3s ease;
}

/* ─── PROGRESS BAR ─── */
.progress-bar-outer {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* ─── SCORE DISPLAY ─── */
.score-ring {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto;
}

.score-ring canvas {
  width: 80px;
  height: 80px;
}

.score-ring .score-value {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.score-ring .score-number {
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1;
}

.score-ring .score-max {
  font-size: 0.6rem;
  color: var(--text-muted);
}

/* ─── BODY MAP ─── */
.body-locations {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 4px;
}

.location-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.location-item:hover {
  border-color: var(--accent);
}

.location-item.selected {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.location-item .loc-icon {
  font-size: 1.2rem;
}

.location-item .loc-name {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text);
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 2px;
}

/* ─── LOADING ─── */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 20px auto;
}

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

/* ─── PROFESSIONAL/TEAM CARDS ─── */
.prof-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: var(--transition);
  cursor: pointer;
}

.prof-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
}

.prof-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.prof-avatar.medico { background: rgba(66, 165, 245, 0.15); }
.prof-avatar.enfermeiro { background: rgba(102, 187, 106, 0.15); }
.prof-avatar.tecnico { background: rgba(171, 71, 188, 0.15); }
.prof-avatar.cuidador { background: rgba(255, 167, 38, 0.15); }

.prof-info {
  flex: 1;
  min-width: 0;
}

.prof-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prof-role {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.prof-detail {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.prof-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 380px) {
  .stats-row { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .stat-value { font-size: 1.2rem; }
  .form-row { grid-template-columns: 1fr; }
  .option-grid { grid-template-columns: 1fr; }
  .comparison-container { grid-template-columns: 1fr; }
  .sidebar { width: 260px; }
}

@media (min-width: 600px) {
  body { max-width: 480px; margin: 0 auto; }
}

/* ─── TISSUE COLOR INDICATORS ─── */
.tissue-indicator {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 4px;
}

.tissue-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 6px;
}

.tissue-bar-segment {
  height: 100%;
  transition: width 0.3s ease;
}

/* ─── WOUND STATUS ─── */
.wound-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
}

.wound-status.active {
  background: rgba(239, 83, 80, 0.15);
  color: var(--danger);
}

.wound-status.healing {
  background: rgba(255, 167, 38, 0.15);
  color: var(--warning);
}

.wound-status.healed {
  background: rgba(102, 187, 106, 0.15);
  color: var(--success);
}

/* ─── TAB SELECTOR ─── */
.tab-selector {
  display: flex;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  padding: 3px;
  margin-bottom: 16px;
}

.tab-btn {
  flex: 1;
  padding: 8px 12px;
  background: none;
  border: none;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.tab-btn.active {
  background: var(--accent);
  color: white;
}

/* ─── MARKETPLACE ─── */
.marketplace-filters {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 14px;
  -webkit-overflow-scrolling: touch;
}

.filter-chip {
  flex-shrink: 0;
  padding: 7px 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.filter-chip:hover {
  border-color: var(--accent);
  color: var(--text);
}

.filter-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.marketplace-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  transition: var(--transition);
}

.marketplace-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
}

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

.mp-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.mp-category {
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.65rem;
  font-weight: 600;
  background: var(--accent-glow);
  color: var(--accent);
  white-space: nowrap;
}

.mp-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}

.mp-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.mp-meta-item {
  display: flex;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.mp-meta-label {
  color: var(--text-muted);
  min-width: 90px;
  flex-shrink: 0;
}

.mp-price {
  color: var(--accent);
  font-weight: 600;
}

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

/* ─── AI ANALYSIS ─── */
.ai-analysis-result {
  padding: 2px 0;
}

.ai-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

.ai-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.ai-metric {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}

.ai-metric-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.ai-metric-value {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
}

.ai-metric-sub {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.ai-section {
  margin-bottom: 14px;
}

.ai-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.ai-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.ai-tissue-bar {
  display: flex;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 6px;
}

.ai-tissue-bar > div {
  height: 100%;
  transition: width 0.3s ease;
}

.ai-tissue-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.68rem;
  color: var(--text-muted);
}

.ai-alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  line-height: 1.5;
  margin-bottom: 14px;
}

.ai-alert.danger {
  background: rgba(239, 83, 80, 0.1);
  border: 1px solid rgba(239, 83, 80, 0.25);
  color: var(--danger);
}

.ai-alert.warning {
  background: rgba(255, 167, 38, 0.1);
  border: 1px solid rgba(255, 167, 38, 0.25);
  color: var(--warning);
}

.ai-treatment {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-treatment-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.ai-treatment-item.ideal {
  border-left: 3px solid var(--accent);
}

.ai-treatment-item.accessible {
  border-left: 3px solid var(--warning);
}

.ai-treat-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 55px;
  color: var(--text-muted);
}

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

.ai-list li {
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding: 4px 0 4px 16px;
  position: relative;
  line-height: 1.5;
}

.ai-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.ai-ocr-box,
.ai-note-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.ai-disclaimer {
  font-size: 0.68rem;
  color: var(--text-muted);
  padding: 10px 12px;
  background: rgba(255, 167, 38, 0.05);
  border: 1px solid rgba(255, 167, 38, 0.1);
  border-radius: var(--radius-sm);
  line-height: 1.5;
  margin-top: 16px;
}

.clinical-warning-card {
  background: rgba(255, 167, 38, 0.08);
  border: 1px solid rgba(255, 167, 38, 0.28);
  border-left: 4px solid var(--warning);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 12px 0;
}

.clinical-warning-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--warning);
  margin-bottom: 4px;
  line-height: 1.4;
}

.clinical-warning-text {
  font-size: 0.74rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.medication-guidance-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.medication-guidance-item {
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--bg-card);
  border-left: 3px solid var(--info);
}

.medication-guidance-item.info {
  border-left-color: var(--info);
}

.medication-guidance-item.warning {
  border-left-color: var(--warning);
}

.medication-guidance-item.critical {
  border-left-color: var(--danger);
}

.medication-guidance-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.medication-guidance-text {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.observation-helper {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 6px;
}

.record-note-preview,
.record-ocr-preview {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.45;
}

.settings-ownership {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(0, 191, 165, 0.06);
  border: 1px solid rgba(0, 191, 165, 0.12);
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ─── SIDEBAR SVG ICONS ─── */
.sidebar-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.sidebar-icon svg {
  width: 20px;
  height: 20px;
}

.prescription-authority-card {
  background: rgba(255, 171, 64, 0.1);
  border: 1px solid rgba(255, 171, 64, 0.22);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 14px;
}

.prescription-authority-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--warning);
  margin-bottom: 6px;
}

.prescription-authority-text {
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.task-summary-card,
.schedule-summary-card,
.finance-card {
  margin-bottom: 14px;
}

.task-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.task-summary-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.task-summary-item strong {
  font-size: 0.95rem;
  color: var(--text);
}

.task-summary-item span {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.task-summary-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.task-card {
  margin-bottom: 10px;
}

.task-card.overdue {
  border-left: 3px solid var(--danger);
}

.task-card.today {
  border-left: 3px solid var(--warning);
}

.task-card.upcoming {
  border-left: 3px solid var(--info);
}

.task-card.done {
  border-left: 3px solid var(--success);
}

.task-card-header,
.schedule-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.task-card-title,
.schedule-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text);
}

.task-card-meta,
.schedule-meta,
.schedule-prescription-meta,
.schedule-prescription-footer {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.task-card-body {
  display: grid;
  gap: 6px;
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.task-card-note,
.schedule-prescription-note {
  font-size: 0.74rem;
  color: var(--text-secondary);
  line-height: 1.5;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  margin-top: 2px;
}

.task-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.schedule-prescription-list {
  display: grid;
  gap: 10px;
}

.schedule-prescription-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.schedule-prescription-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.viewer-patient-list {
  display: grid;
  gap: 8px;
}

.viewer-patient-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* ============================================
   REFINAMENTO TIPOGRÁFICO — UX sóbria e legível
   (regras ao final sobrescrevem as anteriores)
   ============================================ */

:root {
  /* Texto secundário/auxiliar um pouco mais legível, mantendo a sobriedade */
  --text-secondary: #a3b2c7; /* Slate 300/400 */
  --text-muted: #7585a0;     /* Slate 500 levemente mais claro */
}

body {
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv05", "cv11", "ss01";
  letter-spacing: 0.005em;
}

/* Títulos sólidos e nítidos no lugar de texto em gradiente (mais sóbrio) */
.app-header h1,
.sidebar-brand {
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  -webkit-text-fill-color: var(--text);
  color: var(--text);
  letter-spacing: -0.012em;
  font-weight: 600;
}

.section-title {
  letter-spacing: -0.015em;
  font-weight: 650;
}

.sync-status-title {
  font-size: 1rem;
  letter-spacing: -0.01em;
  font-weight: 600;
}

.sync-status-text,
.section-subtitle,
.card-body {
  line-height: 1.6;
}

.card-title {
  letter-spacing: -0.008em;
}

/* Números alinhados e legíveis em estatísticas e métricas */
.stat-value,
.dash-stat-value,
.ai-metric-value,
.task-summary-item strong {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* Credenciais/códigos em monoespaçada, mais legíveis */
code {
  font-family: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
  font-size: 0.92em;
  letter-spacing: 0;
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--accent-light);
}

/* Botões de copiar o acesso demo — discretos e consistentes */
.btn-copy-demo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-copy-demo:hover {
  color: var(--text);
  border-color: var(--border-accent);
  background: var(--accent-glow);
}

.btn-copy-demo.copied {
  color: var(--accent-light);
  border-color: var(--border-accent);
  background: var(--accent-glow);
}

/* ============================================
   PALETA MAIS SÓBRIA + LOGIN DEMO 1 CLIQUE
   ============================================ */

:root {
  /* Accent um pouco mais profundo e menos neon (mais sóbrio) */
  --accent: #0fa473;
  --accent-light: #2bbd8c;
  --accent-dark: #0b815b;
  --accent-glow: rgba(16, 185, 129, 0.08);
  --border-accent: rgba(16, 185, 129, 0.22);
  --shadow-accent: 0 4px 16px rgba(16, 185, 129, 0.12);
  /* Texto com hierarquia mais nítida */
  --text: #f1f5f9;
  --text-secondary: #aab6c6;
  --text-muted: #76839a;
}

/* Fundo mais plano e sóbrio (glows discretos) */
body {
  background-image:
    radial-gradient(circle at 18% 0%, rgba(16, 185, 129, 0.035) 0%, transparent 45%),
    radial-gradient(circle at 85% 12%, rgba(59, 130, 246, 0.022) 0%, transparent 45%);
}

/* Login de demonstração — entra direto em 1 clique */
.demo-login-block { margin-bottom: 24px; }

.demo-login-title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 18px;
  text-align: center;
}

.demo-login-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  width: 100%;
}

@media (max-width: 600px) {
  .demo-login-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .demo-login-grid {
    gap: 10px;
  }
}

.btn-demo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 18px 16px;
  text-align: left;
  background: rgba(255, 255, 255, 0.025);
  border: 1.5px solid var(--glass-border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  font-family: inherit;
  min-height: 120px;
  justify-content: flex-start;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 600px) {
  .btn-demo {
    padding: 16px 14px;
    min-height: 110px;
  }
}

@media (max-width: 480px) {
  .btn-demo {
    padding: 14px 12px;
    min-height: 100px;
    gap: 6px;
  }
}

.btn-demo:hover {
  border-color: var(--border-accent);
  background: var(--accent-glow);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(15, 180, 115, 0.2);
}

.btn-demo:active { transform: translateY(0); }
.btn-demo:disabled { opacity: 0.55; cursor: default; transform: none; }

.btn-demo-role {
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

@media (max-width: 600px) {
  .btn-demo-role {
    font-size: 1.08rem;
  }
}

@media (max-width: 480px) {
  .btn-demo-role {
    font-size: 1.02rem;
  }
}

.btn-demo-sub {
  font-size: 0.84rem;
  color: var(--text-muted);
  letter-spacing: 0.01em;
  font-weight: 500;
}

@media (max-width: 600px) {
  .btn-demo-sub {
    font-size: 0.80rem;
  }
}

@media (max-width: 480px) {
  .btn-demo-sub {
    font-size: 0.76rem;
  }
}

.btn-demo-credential {
  font-size: 0.80rem;
  color: var(--accent);
  line-height: 1.40;
  overflow-wrap: anywhere;
  margin-top: 4px;
  font-weight: 500;
}

@media (max-width: 600px) {
  .btn-demo-credential {
    font-size: 0.76rem;
  }
}

@media (max-width: 480px) {
  .btn-demo-credential {
    font-size: 0.72rem;
    margin-top: 2px;
  }
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 6px;
  color: var(--text-muted);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
