/* ============================================
   MüllBot CRM - Estilos Profesionales
   ============================================ */

:root {
  --primary: #1a472a;
  --primary-dark: #0f2818;
  --primary-light: #2d5a3d;
  --secondary: #6ee7b7;
  --sidebar-width: 280px;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --border-color: #e5e7eb;
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-hover: #f3f4f6;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  box-sizing: border-box;
}

body {
  background: linear-gradient(to bottom, #f0fdf4, #ffffff);
  min-height: 100vh;
  color: var(--text-primary);
  line-height: 1.6;
}

/* ============================================
   LOGIN PAGE
   ============================================ */

.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
}

.login-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  transition: var(--transition);
}

.login-card:hover {
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

.logo-container {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0.75rem;
  width: 96px;
  height: 96px;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
}

.logo-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.login-title {
  text-align: center;
  margin-bottom: 2rem;
}

.login-title h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.login-title p {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.login-title .divider {
  height: 3px;
  width: 80px;
  margin: 0 auto;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 2px;
}

.input-group {
  margin-bottom: 1.25rem;
}

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

.input-simple {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--bg-primary);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: 0.9375rem;
  transition: var(--transition);
}

.input-simple:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 71, 42, 0.1);
}

.input-simple::placeholder {
  color: #9ca3af;
}

.btn-simple {
  width: 100%;
  padding: 0.875rem 1.5rem;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-md);
}

.btn-simple:hover:not(:disabled) {
  background: var(--primary-dark);
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

.btn-simple:active:not(:disabled) {
  transform: translateY(0);
}

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

.error-message {
  margin-top: 1rem;
  padding: 0.875rem 1rem;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  border-radius: var(--radius-md);
  color: #991b1b;
  font-size: 0.875rem;
  text-align: center;
}

.login-footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.login-footer .security-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.login-footer .copyright {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* ============================================
   ADMIN DASHBOARD
   ============================================ */

.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(to bottom, #ffffff, #f9fafb);
  border-right: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  position: fixed;
  inset-y: 0;
  left: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  height: 80px;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-primary);
}

.sidebar-logo {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  padding: 0.375rem;
  margin-right: 0.75rem;
  transition: var(--transition);
}

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

.sidebar-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sidebar-brand {
  flex: 1;
}

.sidebar-brand .brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}

.sidebar-brand .brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.2;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 1rem;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 0.875rem 1rem;
  margin-bottom: 0.5rem;
  border-radius: var(--radius-lg);
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
  position: relative;
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--primary);
  transform: scaleY(0);
  transition: transform 0.2s ease;
  border-radius: 0 2px 2px 0;
}

.nav-item.active::before {
  transform: scaleY(1);
}

.nav-item.active {
  background: linear-gradient(to right, #ecfdf5, #f0fdf4);
  color: var(--primary);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.nav-item:hover:not(.active) {
  background: var(--bg-hover);
  color: var(--primary);
  transform: translateX(2px);
}

.nav-item i {
  width: 28px;
  text-align: center;
  font-size: 1.125rem;
  margin-right: 0.75rem;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  background: linear-gradient(to top, #ffffff, #f9fafb);
}

.user-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.875rem;
  box-shadow: var(--shadow-md);
}

.user-details {
  flex: 1;
  margin-left: 0.75rem;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.user-role {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.2;
}

.logout-btn {
  padding: 0.5rem;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: var(--transition);
  cursor: pointer;
  border: none;
  background: transparent;
}

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

.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ============================================
   COMPONENTS
   ============================================ */

.page-header {
  background: linear-gradient(135deg, #ffffff, #f9fafb);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
}

.page-header h1 {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.25rem;
}

.page-header p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.stat-card {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary);
}

.stat-card p {
  color: var(--text-primary);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  box-shadow: var(--shadow-md);
}

.content-card {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 0.9375rem;
  transition: var(--transition);
  border: none;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

.btn-secondary {
  background: white;
  color: var(--text-primary);
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9375rem;
  transition: var(--transition);
  border: 1px solid var(--border-color);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

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

/* ============================================
   MODALS
   ============================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease-out;
}

.modal-content {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease-out;
  border: 1px solid var(--border-color);
}

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

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

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

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

.modal-body {
  padding: 1.5rem;
}

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

/* ============================================
   VERSION NOTES MODAL
   ============================================ */

.version-notes-modal {
  max-width: 700px;
}

.version-notes-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  padding: 1.5rem;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.version-notes-header h3 {
  color: white;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.version-notes-header .version-badge {
  background: rgba(255, 255, 255, 0.2);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
}

.version-notes-body {
  padding: 1.5rem;
}

.version-date {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.version-changes li {
  padding: 0.75rem 0;
  padding-left: 1.75rem;
  position: relative;
  color: var(--text-primary);
  line-height: 1.6;
  border-bottom: 1px solid var(--border-color);
}

.version-changes li:last-child {
  border-bottom: none;
}

.version-changes li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1.25rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

.version-changes li.new::before {
  background: var(--success);
}

.version-changes li.improved::before {
  background: var(--info);
}

.version-changes li.fixed::before {
  background: var(--warning);
}

.version-notes-footer {
  padding: 1rem 1.5rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dont-show-again {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.dont-show-again input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

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

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

.section-content {
  animation: fadeIn 0.4s ease-out;
}

/* ============================================
   SCROLLBAR
   ============================================ */

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #e5e5e5;
}

::-webkit-scrollbar-thumb {
  background: #9ca3af;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

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

  .main-content {
    margin-left: 0;
  }

  .login-card {
    padding: 2rem 1.5rem;
  }

  .page-header {
    padding: 1.25rem;
  }
}

