/**
 * Main Styles - Manual Operativo 072
 * Optimizado para PWA y performance
 */

/* CSS Variables */
:root {
  --primary-color: #6366f1;
  --primary-dark: #4f46e5;
  --secondary-color: #ec4899;
  --background-color: #f5f5f5;
  --surface-color: #ffffff;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --error-color: #ef4444;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --border-radius: 8px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

  /* Variables adicionales para Manual Operativo */
  --card-bd: #e2e8f0;
  --radius: 16px;
  --radius-sm: 8px;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --text-main: var(--text-primary);

  /* Aliases de color con nombres cortos (usados en manual HTML) */
  --cy: var(--primary-color);
  --cys: rgba(99, 102, 241, 0.1);
  --gn: var(--success-color);
  --gns: rgba(16, 185, 129, 0.1);
  --or: var(--warning-color);
  --ors: rgba(245, 158, 11, 0.1);
  --rd: var(--error-color);
  --rds: rgba(239, 68, 68, 0.1);
  --pr: #a855f7;
  --prs: rgba(168, 85, 247, 0.1);
  --yw: #fbbf24;
  --yws: rgba(251, 191, 36, 0.1);
  --tx: var(--text-primary);
  --txd: var(--text-secondary);
  --txb: #020617;
  --sf: var(--surface-color);
  --sf2: #f8fafc;
  --bg: var(--background-color);
  --bd: var(--card-bd);
  --r: var(--radius);
  --rs: var(--radius-sm);
}

/* Reset and Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--background-color);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
}

#app {
  min-height: 100vh;
}

/* Layout */
#app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

#app-header {
  background-color: var(--surface-color);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

#app-main {
  flex: 1;
  padding: 2rem 1rem;
  background-color: var(--background-color);
}

#app-footer {
  background-color: var(--surface-color);
  padding: 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
  margin-top: auto;
}

#app-footer p {
  margin: 0.25rem 0;
}

/* Navigation */
.main-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary-color);
}

.logo span:first-child {
  font-size: 1.5rem;
}

.nav-links {
  display: flex;
  gap: 0.5rem;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  padding: 0.625rem 1rem;
  border-radius: var(--border-radius);
  transition: all 0.2s;
  position: relative;
}

.nav-links a:hover {
  color: var(--primary-color);
  background-color: rgba(99, 102, 241, 0.1);
}

.nav-links a.active {
  color: var(--primary-color);
  background-color: rgba(99, 102, 241, 0.15);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 1rem;
  right: 1rem;
  height: 2px;
  background-color: var(--primary-color);
}

.user-actions button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.625rem 1.25rem;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.user-actions button:hover {
  background-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(99, 102, 241, 0.2);
}

/* PWA Components */

/* Offline Indicator */
.offline-indicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: var(--warning-color);
  color: white;
  text-align: center;
  padding: 0.5rem;
  font-weight: 500;
  z-index: 9999;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

/* Update Toast */
.update-toast {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  background-color: var(--surface-color);
  padding: 1rem 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: 9999;
  animation: slideUp 0.3s ease-out;
}

.update-toast button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-weight: 500;
}

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

/* Login Screen */
.login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
}

.login-container h1 {
  color: var(--primary-color);
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.login-container h2 {
  color: var(--text-secondary);
  font-size: 1.25rem;
  margin-bottom: 2rem;
}

.login-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.25rem;
  border-radius: 9999px;
  background: #eef2ff;
}

.login-tab {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 9999px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.login-tab:hover {
  color: var(--primary-dark);
}

.login-tab.active {
  background: var(--surface-color);
  color: var(--primary-dark);
  box-shadow: var(--shadow-sm);
}

.login-form {
  width: 100%;
  max-width: 320px;
}

.login-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.875rem;
}

.login-form .form-group label {
  font-weight: 500;
  color: var(--text-primary);
}

.login-form .form-group input {
  padding: 0.75rem;
  border: 2px solid #e5e7eb;
  border-radius: var(--border-radius);
  outline: none;
  transition: border-color 0.2s;
}

.login-form .form-group input:focus {
  border-color: var(--primary-color);
}

.login-form .btn {
  width: 100%;
}

.verify-code-block {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

.pin-input {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 300px;
}

.pin-input label {
  font-weight: 500;
  color: var(--text-primary);
}

.pin-input input {
  padding: 0.75rem;
  font-size: 1.5rem;
  text-align: center;
  letter-spacing: 0.5rem;
  border: 2px solid #e5e7eb;
  border-radius: var(--border-radius);
  outline: none;
  transition: border-color 0.2s;
}

.pin-input input:focus {
  border-color: var(--primary-color);
}

.pin-input button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.75rem;
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

.pin-input button:hover {
  background-color: var(--primary-dark);
}

.error-message {
  color: var(--error-color);
  font-size: 0.875rem;
  text-align: center;
  margin-top: 0.5rem;
}

.success-message {
  color: var(--success-color);
  font-size: 0.875rem;
  text-align: center;
  margin-top: 0.5rem;
}

/* Error Screen */
.error-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
  text-align: center;
}

.error-container h1 {
  color: var(--error-color);
  margin-bottom: 1rem;
}

.error-container pre {
  background-color: #f3f4f6;
  padding: 1rem;
  border-radius: var(--border-radius);
  margin: 1rem 0;
  overflow-x: auto;
  max-width: 100%;
}

.error-container button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.error-container button:hover {
  background-color: var(--primary-dark);
}

/* Lazy loading placeholder */
img.lazy {
  opacity: 0;
  transition: opacity 0.3s;
}

img:not(.lazy) {
  opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
  .main-nav {
    flex-direction: column;
    gap: 1rem;
  }
  
  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  #app-main {
    padding: 0.75rem;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
  border-radius: var(--border-radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--primary-dark);
}

.btn-secondary {
  background-color: var(--text-secondary);
  color: white;
}

.btn-success {
  background-color: var(--success-color);
  color: white;
}

.btn-danger {
  background-color: var(--error-color);
  color: white;
}

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

.btn-ghost {
  background-color: transparent;
  color: var(--text-secondary);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
}

.btn-md {
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

.btn-full {
  width: 100%;
}

.btn-icon {
  padding: 0.5rem;
  aspect-ratio: 1;
}

.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* Cards */
.card {
  background-color: var(--surface-color);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.card-default {
  box-shadow: var(--shadow-sm);
}

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

.card-outlined {
  border: 1px solid #e5e7eb;
}

.card-clickable {
  cursor: pointer;
  transition: all 0.2s;
}

.card-clickable:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.card-content {
  padding: 1.5rem;
}

.card-footer {
  padding: 1rem 1.5rem;
  background-color: #f9fafb;
  border-top: 1px solid #e5e7eb;
}

/* Decision Cards */
.decision-card {
  background-color: var(--surface-color);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
}

.decision-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.decision-choices {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.decision-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.decision-label {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.decision-description {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background-color: var(--surface-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
  animation: slideIn 0.2s ease-out;
}

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

.modal-sm { max-width: 400px; width: 100%; }
.modal-md { max-width: 600px; width: 100%; }
.modal-lg { max-width: 800px; width: 100%; }
.modal-xl { max-width: 1000px; width: 100%; }
.modal-full { max-width: 95vw; width: 100%; }

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 0.25rem;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.modal-message {
  margin-bottom: 1rem;
}

/* Inputs */
.input-wrapper {
  margin-bottom: 1rem;
}

.input-label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.input-container {
  position: relative;
}

.input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  border: 1px solid #d1d5db;
  border-radius: var(--border-radius);
  transition: all 0.2s;
  background-color: var(--surface-color);
}

.input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.input-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
}

.input-error {
  color: var(--error-color);
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

.input-helper {
  color: var(--text-secondary);
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

/* Toasts */
.toast-container {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  background-color: var(--surface-color);
  padding: 1rem 1.25rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 300px;
  max-width: 400px;
  animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast-visible {
  animation: slideInRight 0.3s ease-out;
}

.toast-hiding {
  animation: slideOutRight 0.3s ease-out;
}

@keyframes slideOutRight {
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

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

.toast-icon {
  font-size: 1.25rem;
}

.toast-message {
  flex: 1;
  color: var(--text-primary);
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.25rem;
  padding: 0;
  line-height: 1;
}

.toast-close:hover {
  color: var(--text-primary);
}

/* Loaders */
.loader-dot {
  display: inline-flex;
  gap: 0.25rem;
}

.loader-dot span {
  width: 0.5rem;
  height: 0.5rem;
  background-color: var(--primary-color);
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out both;
}

.loader-dot span:nth-child(1) { animation-delay: -0.32s; }
.loader-dot span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

.loader-pulse {
  display: inline-block;
  width: 3rem;
  height: 3rem;
  border: 3px solid var(--primary-color);
  border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
}

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

/* Utility Classes */
.text-danger {
  color: var(--error-color);
}

.text-success {
  color: var(--success-color);
}

.text-warning {
  color: var(--warning-color);
}

/* Dashboard */
.dashboard {
  max-width: 1200px;
  margin: 0 auto;
}

.dashboard h1 {
  color: var(--text-primary);
  font-size: 2rem;
  margin-bottom: 2rem;
  font-weight: 700;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: linear-gradient(135deg, var(--surface-color) 0%, #fafafa 100%);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  border: 1px solid #f0f0f0;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
}

.stat-card h3 {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.stat-number {
  color: var(--primary-color);
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dashboard-content {
  background-color: var(--surface-color);
  padding: 3rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  text-align: center;
}

.dashboard-content h2 {
  color: var(--text-primary);
  font-size: 2rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.dashboard-content p {
  color: var(--text-secondary);
  font-size: 1.125rem;
  line-height: 1.6;
}

/* Pages */
.search-page,
.map-page,
.wizard-page,
.simulator-page {
  max-width: 1200px;
  margin: 0 auto;
  background-color: var(--surface-color);
  padding: 3rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  min-height: 400px;
}

.search-page h1,
.map-page h1,
.wizard-page h1,
.simulator-page h1 {
  color: var(--text-primary);
  font-size: 2rem;
  margin-bottom: 1.5rem;
  font-weight: 700;
  padding-bottom: 1rem;
  border-bottom: 3px solid var(--primary-color);
}

.search-page p,
.map-page p,
.wizard-page p,
.simulator-page p {
  color: var(--text-secondary);
  font-size: 1.125rem;
  line-height: 1.6;
}

/* Wizard Styles */
.wizard-container {
  max-width: 900px;
  margin: 0 auto;
}

.wizard-stepper {
  display: flex;
  justify-content: space-between;
  margin-bottom: 3rem;
  position: relative;
  padding: 0 1rem;
}

.wizard-stepper::before {
  content: '';
  position: absolute;
  top: 1.5rem;
  left: 2rem;
  right: 2rem;
  height: 2px;
  background-color: #e5e7eb;
  z-index: 0;
}

.wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
  flex: 1;
  cursor: pointer;
}

.wizard-step-circle {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background-color: #e5e7eb;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  margin-bottom: 0.5rem;
  transition: all 0.3s;
  position: relative;
  z-index: 2;
}

.wizard-step.active .wizard-step-circle {
  background-color: var(--primary-color);
  color: white;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
  transform: scale(1.1);
}

.wizard-step.completed .wizard-step-circle {
  background-color: var(--success-color);
  color: white;
}

.wizard-step-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: center;
  max-width: 100px;
}

.wizard-step.active .wizard-step-label {
  color: var(--primary-color);
  font-weight: 600;
}

.wizard-content {
  background-color: var(--surface-color);
  padding: 2.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  min-height: 400px;
  margin-bottom: 2rem;
}

.wizard-step-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.wizard-step-description {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.wizard-form-group {
  margin-bottom: 1.5rem;
}

.wizard-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.wizard-label-required::after {
  content: ' *';
  color: var(--error-color);
}

.wizard-input,
.wizard-textarea,
.wizard-select {
  width: 100%;
  padding: 0.75rem;
  font-size: 0.875rem;
  border: 2px solid #e5e7eb;
  border-radius: var(--border-radius);
  transition: all 0.2s;
  background-color: var(--surface-color);
}

.wizard-input:focus,
.wizard-textarea:focus,
.wizard-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.wizard-textarea {
  min-height: 120px;
  resize: vertical;
}

.wizard-error {
  color: var(--error-color);
  font-size: 0.75rem;
  margin-top: 0.25rem;
  display: block;
}

.wizard-actions {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
}

.wizard-actions-left,
.wizard-actions-right {
  display: flex;
  gap: 0.75rem;
}

.wizard-summary {
  display: grid;
  gap: 1.5rem;
}

.wizard-summary-section {
  background-color: #f9fafb;
  padding: 1.5rem;
  border-radius: var(--border-radius);
  border-left: 4px solid var(--primary-color);
}

.wizard-summary-title {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-size: 1rem;
}

.wizard-summary-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid #e5e7eb;
}

.wizard-summary-item:last-child {
  border-bottom: none;
}

.wizard-summary-label {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.wizard-summary-value {
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.875rem;
  text-align: right;
}

.wizard-success {
  text-align: center;
  padding: 3rem 2rem;
}

.wizard-success-icon {
  font-size: 4rem;
  color: var(--success-color);
  margin-bottom: 1.5rem;
}

.wizard-success-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.wizard-success-message {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 2rem;
}

.wizard-radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.wizard-radio-option {
  display: flex;
  align-items: center;
  padding: 1rem;
  border: 2px solid #e5e7eb;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.2s;
}

.wizard-radio-option:hover {
  border-color: var(--primary-color);
  background-color: rgba(99, 102, 241, 0.05);
}

.wizard-radio-option input[type="radio"] {
  margin-right: 0.75rem;
  width: 1.25rem;
  height: 1.25rem;
  cursor: pointer;
}

.wizard-radio-option.selected {
  border-color: var(--primary-color);
  background-color: rgba(99, 102, 241, 0.1);
}

/* Responsive Wizard */
@media (max-width: 768px) {
  .wizard-stepper {
    overflow-x: auto;
    padding-bottom: 1rem;
  }

  .wizard-step-label {
    font-size: 0.65rem;
    max-width: 80px;
  }

  .wizard-step-circle {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 0.875rem;
  }

  .wizard-content {
    padding: 1.5rem;
  }

  .wizard-actions {
    flex-direction: column-reverse;
  }

  .wizard-actions-left,
  .wizard-actions-right {
    width: 100%;
  }

  .wizard-actions-left button,
  .wizard-actions-right button {
    flex: 1;
  }
}

/* Print styles */
@media print {
  #app-header,
  #app-footer,
  .offline-indicator,
  .update-toast {
    display: none;
  }
}
/* =====================================================
   ESTILOS DEL MANUAL OPERATIVO
   Agregar estos estilos al archivo main.css
   (antes de las media queries responsive)
   ===================================================== */

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--surface-color) 0%, var(--background-color) 100%);
  border: 1px solid var(--card-bd);
  border-radius: var(--radius);
  padding: 2.5rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.06), transparent 70%);
  pointer-events: none;
}

.hero h2 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
}

.hero p {
  color: var(--text-secondary);
  font-size: 1rem;
  position: relative;
  z-index: 1;
}

/* Dashboard Cards Grid */
.dg {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.75rem;
}

.dc {
  background: var(--surface-color);
  border: 1px solid var(--card-bd);
  border-radius: var(--radius);
  padding: 1.25rem;
  cursor: pointer;
  transition: all 0.3s;
}

.dc:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.dc .di {
  font-size: 1.75rem;
  margin-bottom: 0.625rem;
}

.dc .dl {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.dc .dv {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #6366f1, #10b981, #14b8a6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.dc .db {
  margin-top: 0.75rem;
  height: 4px;
  background: var(--background-color);
  border-radius: 4px;
  overflow: hidden;
}

.dc .dbf {
  height: 100%;
  border-radius: 4px;
  transition: width 1.5s ease;
}

/* Card Container */
.cc {
  background: var(--surface-color);
  border: 1px solid var(--card-bd);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin: 1.25rem 0;
}

.ct {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.ct span {
  color: var(--text-secondary);
  font-weight: 400;
  font-size: 0.8125rem;
}

/* Radial Charts */
.rg {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1.25rem;
}

.ri {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.ri svg {
  transform: rotate(-90deg);
  filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.15));
}

.rl {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: center;
}

/* Step Timeline */
.stl {
  position: relative;
  padding-left: 3rem;
}

.stl::before {
  content: '';
  position: absolute;
  left: 1.1875rem;
  top: 1.875rem;
  bottom: 1.875rem;
  width: 2px;
  background: linear-gradient(180deg, var(--primary-color), var(--success-color));
  border-radius: 2px;
  opacity: 0.3;
}

.stp {
  position: relative;
  margin-bottom: 1.5rem;
  animation: stepReveal 0.5s ease backwards;
}

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

.sd {
  position: absolute;
  left: -3rem;
  top: 1.25rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.875rem;
  z-index: 2;
  transition: all 0.3s;
}

.stp:hover .sd {
  transform: scale(1.1);
}

.sd-b {
  background: rgba(99, 102, 241, 0.1);
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
}

.sd-p {
  background: rgba(168, 85, 247, 0.1);
  border: 2px solid #a855f7;
  color: #a855f7;
}

.sd-g {
  background: rgba(16, 185, 129, 0.1);
  border: 2px solid var(--success-color);
  color: var(--success-color);
}

.sd-o {
  background: rgba(245, 158, 11, 0.1);
  border: 2px solid var(--warning-color);
  color: var(--warning-color);
}

.sb {
  background: var(--surface-color);
  border: 1px solid var(--card-bd);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all 0.3s;
}

.stp:hover .sb {
  border-color: rgba(99, 102, 241, 0.25);
  box-shadow: var(--shadow);
}

.sb h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  margin-bottom: 0.625rem;
}

.sb p {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Script Box (Copyable) */
.scr {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(168, 85, 247, 0.04));
  border-left: 3px solid var(--primary-color);
  padding: 0.875rem 1.125rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 0.75rem 0;
  font-style: italic;
  font-size: 0.875rem;
  color: var(--primary-color);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.scr:hover {
  background: rgba(99, 102, 241, 0.1);
}

.scr .ch {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.625rem;
  font-style: normal;
  color: var(--text-secondary);
  opacity: 0;
  transition: opacity 0.2s;
}

.scr:hover .ch {
  opacity: 1;
}

.scr.cpd {
  border-left-color: var(--success-color);
  color: var(--success-color);
}

.scr.cpd .ch {
  opacity: 1;
  color: var(--success-color);
}

/* Decision Box */
.dec {
  background: var(--background-color);
  border: 1px solid var(--card-bd);
  border-radius: var(--radius-sm);
  padding: 1.125rem;
  margin: 0.875rem 0;
}

.dh {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--warning-color);
  margin-bottom: 0.75rem;
}

.dop {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.625rem 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.dop + .dop {
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}

/* Badges */
.bdg {
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0.1875rem 0.625rem;
  border-radius: 1.25rem;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.by {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success-color);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.bn {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error-color);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.bw {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning-color);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

/* Alerts */
.al {
  padding: 0.875rem 1.125rem;
  border-radius: var(--radius-sm);
  font-size: 0.84375rem;
  margin: 0.75rem 0;
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  line-height: 1.6;
}

.ai {
  font-size: 1.125rem;
  flex-shrink: 0;
}

.ar {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.15);
  color: var(--error-color);
}

.ao {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.15);
  color: var(--warning-color);
}

.ab {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.15);
  color: var(--primary-color);
}

.ag {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.15);
  color: var(--success-color);
}

/* SLA Bars */
.slv {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0;
}

.slr {
  background: var(--surface-color);
  border: 1px solid var(--card-bd);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1rem;
  transition: all 0.3s;
}

.slr:hover {
  border-color: rgba(99, 102, 241, 0.25);
  transform: translateX(4px);
}

.slrn {
  font-size: 0.875rem;
  font-weight: 600;
}

.slrb {
  height: 0.5rem;
  background: var(--background-color);
  border-radius: 0.5rem;
  margin-top: 0.5rem;
  overflow: hidden;
}

.slrf {
  height: 100%;
  border-radius: 0.5rem;
  transition: width 1.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.slrt {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.125rem;
  white-space: nowrap;
}

.slru {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 400;
}

/* Status Cards */
.stc {
  display: grid;
  gap: 0.875rem;
  margin: 0.875rem 0;
}

.stcd {
  border-radius: var(--radius-sm);
  padding: 1.125rem;
  transition: all 0.3s;
}

.stcd:hover {
  transform: translateX(4px);
}

.stb {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.15);
}

.stg {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.15);
}

.str {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.15);
}

.stl2 {
  font-weight: 700;
  font-size: 0.8125rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stb .stl2 { color: var(--primary-color); }
.stg .stl2 { color: var(--success-color); }
.str .stl2 { color: var(--error-color); }

/* Checkboxes */
.chk {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.375rem 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.ckb {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--card-bd);
  border-radius: 0.375rem;
  flex-shrink: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-size: 0.75rem;
  margin-top: 0.0625rem;
}

.ckb:hover {
  border-color: var(--primary-color);
}

.ckb.ck {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

/* Platform Badges */
.plt {
  display: inline-flex;
  align-items: center;
  gap: 0.3125rem;
  font-size: 0.65625rem;
  font-weight: 700;
  padding: 0.1875rem 0.625rem;
  border-radius: 0.375rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pz {
  background: rgba(168, 85, 247, 0.1);
  color: #a855f7;
  border: 1px solid rgba(168, 85, 247, 0.2);
}

.pe {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success-color);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Accordions */
.acc {
  margin-bottom: 0.75rem;
}

.ach {
  background: var(--surface-color);
  border: 1px solid var(--card-bd);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.3s;
  user-select: none;
}

.ach:hover {
  border-color: rgba(99, 102, 241, 0.25);
}

.acc.opn .ach {
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border-color: var(--primary-color);
  background: var(--background-color);
}

.ach h4 {
  font-size: 0.9375rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.acv {
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: transform 0.3s;
}

.acc.opn .acv {
  transform: rotate(180deg);
  color: var(--primary-color);
}

.acb {
  background: var(--surface-color);
  border: 1px solid var(--card-bd);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  padding: 1.25rem;
  display: none;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.acc.opn .acb {
  display: block;
  animation: accordionOpen 0.3s ease;
}

@keyframes accordionOpen {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Flow Diagram */
.flow-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 1.25rem 0;
}

.flow-node {
  background: var(--surface-color);
  border: 2px solid var(--card-bd);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  text-align: center;
  min-width: 200px;
  position: relative;
  z-index: 2;
  transition: all 0.3s;
}

.flow-node:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow);
  border-color: var(--primary-color);
}

.flow-node strong {
  display: block;
  color: var(--text-main);
  font-size: 0.9375rem;
}

.flow-node span {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.flow-line {
  width: 2px;
  height: 30px;
  background: var(--card-bd);
}

.flow-branch {
  display: flex;
  gap: 2.5rem;
  justify-content: center;
  position: relative;
}

.flow-branch::before {
  content: '';
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 200px);
  height: 2px;
  background: var(--card-bd);
  z-index: 1;
}

.flow-branch-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.flow-branch-col::before {
  content: '';
  position: absolute;
  top: -15px;
  left: 50%;
  width: 2px;
  height: 15px;
  background: var(--card-bd);
}

.node-start {
  border-color: var(--primary-color);
  background: rgba(99, 102, 241, 0.05);
}

.node-decision {
  border-color: var(--warning-color);
  border-style: dashed;
}

.node-end {
  border-color: var(--success-color);
  background: rgba(16, 185, 129, 0.05);
}

/* Links */
.lnk {
  color: var(--primary-color);
  cursor: pointer;
  font-weight: 600;
  transition: color 0.2s;
}

.lnk:hover {
  color: var(--text-main);
  text-decoration: underline;
}

/* Button variations (for manual pages) */
.sbn {
  background: var(--surface-color);
  border: 1px solid var(--card-bd);
  border-radius: var(--radius-sm);
  padding: 0.875rem;
  text-align: center;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  transition: all 0.25s;
}

.sbn:hover {
  border-color: var(--primary-color);
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary-color);
  transform: translateY(-2px);
}

/* Responsive Adjustments for Manual */
@media (max-width: 768px) {
  .dg {
    grid-template-columns: 1fr 1fr;
  }

  .stl {
    padding-left: 2.5rem;
  }

  .sd {
    left: -2.5rem;
    width: 2rem;
    height: 2rem;
    font-size: 0.75rem;
  }

  .flow-branch {
    flex-direction: column;
    gap: 1rem;
  }

  .flow-branch::before {
    display: none;
  }
}
