/* ==========================================================================
   FICHERO MÉDICO - DR. RICARDO TAPIA (MÉDICO FAMILIAR)
   Sistema de Diseño: Paleta de Colores Extraída del Logo RT
   - Azul Marino Oscuro / Navy: #0B192C / #132A4A
   - Azul Escudo / Royal Navy: #1B4965 / #2B6CB0
   - Azul Cian / Teal Eléctrico: #00B4D8 / #0096C7 / #0077B6
   - Acentos de Luz: #90E0EF / #CAF0F8
   - Fondo Claro: #F8FAFC / #F1F5F9
   ========================================================================== */

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

:root {
  /* Paleta Base RT */
  --primary-navy: #0B192C;
  --primary-deep: #0D2137;
  --primary-blue: #1B4965;
  --accent-cyan: #00B4D8;
  --accent-cyan-hover: #0096C7;
  --accent-cyan-light: #E0F7FA;
  --accent-cyan-glow: rgba(0, 180, 216, 0.25);
  --accent-teal: #0E7490;
  
  /* Estados */
  --color-success: #10B981;
  --color-success-bg: #ECFDF5;
  --color-warning: #F59E0B;
  --color-warning-bg: #FFFBEB;
  --color-danger: #EF4444;
  --color-danger-bg: #FEF2F2;
  --color-info: #3B82F6;
  --color-info-bg: #EFF6FF;

  /* Modo Claro por defecto */
  --bg-app: #F4F7FB;
  --bg-sidebar: #0B192C;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F8FAFC;
  --bg-input: #FFFFFF;
  --border-color: #E2E8F0;
  --border-focus: #00B4D8;
  
  --text-main: #1E293B;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;
  --text-inverse: #FFFFFF;
  
  --shadow-sm: 0 1px 3px rgba(11, 25, 44, 0.05);
  --shadow-md: 0 4px 12px rgba(11, 25, 44, 0.08);
  --shadow-lg: 0 10px 25px -5px rgba(11, 25, 44, 0.12), 0 8px 10px -6px rgba(11, 25, 44, 0.05);
  --shadow-glow: 0 0 20px rgba(0, 180, 216, 0.35);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --sidebar-width: 260px;
}

/* Modo Oscuro */
[data-theme="dark"] {
  --bg-app: #080F18;
  --bg-sidebar: #050B12;
  --bg-card: #0F1F33;
  --bg-card-hover: #142842;
  --bg-input: #13273F;
  --border-color: #1E385B;
  --border-focus: #00B4D8;
  
  --text-main: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --text-inverse: #FFFFFF;
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(0, 180, 216, 0.25);
  
  --color-success-bg: rgba(16, 185, 129, 0.15);
  --color-warning-bg: rgba(245, 158, 11, 0.15);
  --color-danger-bg: rgba(239, 68, 68, 0.15);
  --color-info-bg: rgba(59, 130, 246, 0.15);
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .brand-font {
  font-family: 'Outfit', sans-serif;
  letter-spacing: -0.02em;
}

/* Layout Principal */
.app-layout {
  display: flex;
  width: 100vw;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  color: var(--text-inverse);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 50;
  transition: transform var(--transition-normal);
}

.sidebar-header {
  padding: 24px 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-logo-img {
  width: 90px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 180, 216, 0.3));
  margin-bottom: 12px;
  transition: transform var(--transition-normal);
}

.brand-logo-img:hover {
  transform: scale(1.05);
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: 0.02em;
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--accent-cyan);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
}

/* Navegación */
.sidebar-nav {
  flex: 1;
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.nav-item:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.06);
}

.nav-item.active {
  color: #FFFFFF;
  background: linear-gradient(135deg, rgba(0, 180, 216, 0.25) 0%, rgba(27, 73, 101, 0.4) 100%);
  border-color: rgba(0, 180, 216, 0.4);
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(0, 180, 216, 0.15);
}

.nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: inherit;
}

.nav-item.active svg {
  color: var(--accent-cyan);
}

/* Sidebar Footer / Estado de Sincronización */
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sync-status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.85);
}

.sync-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-success);
  box-shadow: 0 0 8px var(--color-success);
}

.sync-indicator.syncing {
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
  animation: pulse 1s infinite;
}

.sync-indicator.offline {
  background: var(--color-warning);
  box-shadow: 0 0 8px var(--color-warning);
}

.sync-indicator.error {
  background: var(--color-danger);
  box-shadow: 0 0 8px var(--color-danger);
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.2); }
}

/* Contenido Principal */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
}

/* Header Superior */
.top-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 40;
}

.top-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.menu-toggle-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  padding: 6px;
}

.page-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
}

.top-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-toggle-btn, .header-icon-btn {
  background: var(--bg-app);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover, .header-icon-btn:hover {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
  background: var(--bg-card);
}

/* Contenedor de Vista */
.view-container {
  padding: 28px;
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.view-section {
  display: none;
  animation: fadeIn 0.25s ease forwards;
}

.view-section.active {
  display: block;
}

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

/* ==========================================================================
   COMPONENTES UI & ESTILOS REUTILIZABLES
   ========================================================================== */

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  font-family: inherit;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #00B4D8 0%, #0077B6 100%);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(0, 180, 216, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #00C4EB 0%, #0088CC 100%);
  box-shadow: 0 6px 16px rgba(0, 180, 216, 0.4);
  transform: translateY(-1px);
}

.btn-navy {
  background: var(--primary-navy);
  color: #FFFFFF;
}

.btn-navy:hover {
  background: #132A4A;
  color: #FFFFFF;
}

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

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

.btn-outline {
  background: transparent;
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.btn-outline:hover {
  background: var(--accent-cyan);
  color: #FFFFFF;
}

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

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

.btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 12px 24px;
  font-size: 1rem;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* Tarjetas (Cards) */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

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

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Métricas / Estadísticas (Dashboard) */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent-cyan);
}

.stat-card.navy::before { background: var(--primary-navy); }
.stat-card.cyan::before { background: var(--accent-cyan); }
.stat-card.green::before { background: var(--color-success); }
.stat-card.amber::before { background: var(--color-warning); }

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  color: var(--text-main);
  margin-top: 4px;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--bg-app);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
}

/* Formularios y Controles */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-label .required {
  color: var(--color-danger);
  margin-left: 3px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.92rem;
  font-family: inherit;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  outline: none;
  transition: all var(--transition-fast);
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-cyan-glow);
}

.form-control::placeholder {
  color: var(--text-muted);
}

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

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.form-hint {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* Barra de Búsqueda y Filtros */
.search-filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.search-input-wrapper svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input-wrapper input {
  padding-left: 42px;
}

/* Tablas Modernas */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.custom-table th {
  background: var(--bg-app);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.custom-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
}

.custom-table tbody tr {
  transition: background-color var(--transition-fast);
}

.custom-table tbody tr:hover {
  background-color: var(--bg-card-hover);
}

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

/* Badges / Etiquetas */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
}

.badge-ips {
  background: #E0F2FE;
  color: #0369A1;
}

.badge-boreal {
  background: #EDE9FE;
  color: #6D28D9;
}

.badge-particular {
  background: #F1F5F9;
  color: #475569;
}

.badge-other {
  background: #FEF3C7;
  color: #B45309;
}

.badge-blood {
  background: #FEE2E2;
  color: #B91C1C;
  font-weight: 700;
}

.badge-alert {
  background: #FEE2E2;
  color: #DC2626;
}

/* Timeline Cronológico de Atenciones */
.timeline {
  position: relative;
  padding-left: 28px;
  margin-top: 16px;
}

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

.timeline-item {
  position: relative;
  margin-bottom: 24px;
}

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

.timeline-dot {
  position: absolute;
  left: -28px;
  top: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-cyan);
  border: 3px solid var(--bg-card);
  box-shadow: 0 0 0 2px var(--accent-cyan);
}

.timeline-content {
  background: var(--bg-card-hover);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
}

.timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
}

.timeline-date {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-cyan-hover);
}

.timeline-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.timeline-body {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.timeline-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-teal);
  margin-top: 10px;
  margin-bottom: 2px;
}

/* Modales */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(11, 25, 44, 0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  animation: fadeIn 0.2s ease forwards;
}

.modal-backdrop.active {
  display: flex;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalScale 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal-card.modal-lg {
  max-width: 880px;
}

.modal-card form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

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

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

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

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

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

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

/* Toast Notificaciones */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 200;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 300px;
  max-width: 420px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: all var(--transition-normal);
}

.toast.toast-success { border-left: 4px solid var(--color-success); }
.toast.toast-error { border-left: 4px solid var(--color-danger); }
.toast.toast-info { border-left: 4px solid var(--accent-cyan); }
.toast.toast-warning { border-left: 4px solid var(--color-warning); }

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

.toast-content {
  flex: 1;
  font-size: 0.88rem;
  color: var(--text-main);
}

.toast-title {
  font-weight: 700;
  margin-bottom: 2px;
}

/* Guía de Configuración & Code Preview */
.code-box {
  background: #0B192C;
  color: #90E0EF;
  padding: 16px;
  border-radius: var(--radius-md);
  font-family: 'Consolas', monospace;
  font-size: 0.85rem;
  overflow-x: auto;
  position: relative;
  margin: 12px 0;
  border: 1px solid #1E385B;
}

.step-card {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  background: var(--bg-card);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-cyan);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
}

.step-content {
  flex: 1;
}

.step-content h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.step-content p {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

/* Patient profile summary card */
.patient-profile-header {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 20px;
  background: linear-gradient(135deg, rgba(11, 25, 44, 0.05) 0%, rgba(0, 180, 216, 0.08) 100%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.patient-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--primary-navy) 100%);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
  flex-shrink: 0;
}

.patient-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px 20px;
  margin-top: 12px;
}

.patient-detail-item {
  display: flex;
  flex-direction: column;
}

.patient-detail-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.patient-detail-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}

/* Responsive */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: -280px;
  }
  
  .sidebar.open {
    left: 0;
  }
  
  .menu-toggle-btn {
    display: flex;
  }
  
  .view-container {
    padding: 16px;
  }
}

/* Configuración Profesional y Firma Digital */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

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

.signature-upload-zone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px 16px;
  text-align: center;
  background: var(--bg-app);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 140px;
}

.signature-upload-zone:hover,
.signature-upload-zone.dragover {
  border-color: var(--accent-cyan);
  background: rgba(0, 180, 216, 0.05);
}

.signature-preview-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.signature-preview-thumb {
  max-height: 80px;
  max-width: 220px;
  object-fit: contain;
  background: #FFFFFF;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid #E2E8F0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.live-stamp-preview-card {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
  color: #1A202C;
}

[data-theme="dark"] .live-stamp-preview-card {
  background: #FFFFFF;
  color: #1A202C;
}

.live-stamp-header {
  border-bottom: 1px dashed #CBD5E1;
  padding-bottom: 10px;
  margin-bottom: 24px;
  text-align: center;
}

.live-stamp-body {
  width: 250px;
  margin: 0 auto;
  text-align: center;
}

.live-stamp-line {
  width: 100%;
  border-top: 1.5px dashed #718096;
  margin: 4px 0 8px;
}

.live-stamp-text strong {
  color: #0B192C;
  font-family: 'Outfit', sans-serif;
}
