/* ========================================
   PALETA CORPORATIVA
   ======================================== */
:root {
  --positive-energy: #e2e3d0;
  --black-chestnut: #232322;
  --lodgepole-pines: #a9a78c;
  --apricot-glazed: #eaaa28;
  --furious-fox: #df6017;
  --tail-lights: #dc4610;
  
  /* Colores complementarios */
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-900: #111827;
}

/* ========================================
   BASE
   ======================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, var(--positive-energy) 0%, var(--lodgepole-pines) 100%);
  min-height: 100vh;
  padding: 20px;
  color: var(--black-chestnut);
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  background: var(--white);
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 10px 40px rgba(35, 35, 34, 0.15);
}

/* ========================================
   HEADER
   ======================================== */
.header {
  text-align: center;
  margin-bottom: 50px;
}

.icon {
  font-size: 60px;
  margin-bottom: 20px;
}

h1 {
  color: var(--black-chestnut);
  font-size: 2.5em;
  margin-bottom: 10px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.subtitle {
  color: var(--gray-700);
  font-size: 1.2em;
  margin-bottom: 5px;
  font-weight: 500;
}

.description {
  color: var(--gray-600);
  font-size: 1em;
}

/* ========================================
   SECTIONS
   ======================================== */
.section {
  margin: 40px 0;
}

h2 {
  color: var(--black-chestnut);
  margin-bottom: 20px;
  text-align: center;
  font-size: 2em;
  font-weight: 600;
}

.section-description {
  text-align: center;
  color: var(--gray-600);
  margin-bottom: 30px;
}

/* ========================================
   ADVISOR CARDS
   ======================================== */
.advisors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 30px;
}

.advisor-card {
  background: var(--gray-50);
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  transition: all 0.3s ease;
  border: 1px solid var(--gray-200);
}

.advisor-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(35, 35, 34, 0.15);
  border-color: var(--apricot-glazed);
}

.advisor-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  margin: 0 auto 20px;
}

.advisor-icon.blue {
  background: linear-gradient(135deg, var(--furious-fox) 0%, var(--tail-lights) 100%);
}

.advisor-icon.green {
  background: linear-gradient(135deg, var(--apricot-glazed) 0%, var(--furious-fox) 100%);
}

.advisor-icon.purple {
  background: linear-gradient(135deg, var(--lodgepole-pines) 0%, var(--black-chestnut) 100%);
}

.advisor-icon.orange {
  background: linear-gradient(135deg, var(--tail-lights) 0%, var(--furious-fox) 100%);
}

h3 {
  color: var(--black-chestnut);
  margin-bottom: 10px;
  font-weight: 600;
}

.advisor-role {
  color: var(--gray-600);
  margin-bottom: 20px;
  font-size: 0.95em;
}

.product-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  font-size: 14px;
  text-align: center;
}

.btn-primary {
  background: linear-gradient(135deg, var(--furious-fox) 0%, var(--apricot-glazed) 100%);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(223, 96, 23, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(223, 96, 23, 0.4);
  transform: translateY(-2px);
}

.btn-success {
  background: linear-gradient(135deg, var(--apricot-glazed) 0%, var(--furious-fox) 100%);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(234, 170, 40, 0.3);
}

.btn-success:hover {
  box-shadow: 0 6px 20px rgba(234, 170, 40, 0.4);
  transform: translateY(-2px);
}

.btn-purple {
  background: linear-gradient(135deg, var(--lodgepole-pines) 0%, var(--black-chestnut) 100%);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(169, 167, 140, 0.3);
}

.btn-purple:hover {
  box-shadow: 0 6px 20px rgba(169, 167, 140, 0.4);
  transform: translateY(-2px);
}

.btn-orange {
  background: linear-gradient(135deg, var(--tail-lights) 0%, var(--furious-fox) 100%);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(220, 70, 16, 0.3);
}

.btn-orange:hover {
  box-shadow: 0 6px 20px rgba(220, 70, 16, 0.4);
  transform: translateY(-2px);
}

.btn-admin {
  background: linear-gradient(135deg, var(--tail-lights) 0%, var(--furious-fox) 100%);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(220, 70, 16, 0.3);
}

.btn-admin:hover {
  box-shadow: 0 6px 20px rgba(220, 70, 16, 0.4);
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--positive-energy);
  color: var(--black-chestnut);
  border: 1px solid var(--lodgepole-pines);
}

.btn-secondary:hover {
  background: var(--lodgepole-pines);
  color: var(--white);
}

.btn-large {
  padding: 15px 40px;
  font-size: 16px;
  margin: 5px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  margin: 2px;
}

/* ========================================
   ADMIN SECTION
   ======================================== */
.admin-section {
  background: linear-gradient(135deg, var(--black-chestnut) 0%, var(--gray-900) 100%);
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  margin-top: 50px;
  border: 2px solid var(--apricot-glazed);
}

.admin-icon {
  font-size: 50px;
  margin-bottom: 15px;
}

.admin-section h3 {
  color: var(--white);
  margin-bottom: 20px;
}

/* ========================================
   FORMS
   ======================================== */
.form-header {
  text-align: center;
  margin-bottom: 30px;
  padding: 30px;
  background: linear-gradient(135deg, var(--furious-fox) 0%, var(--apricot-glazed) 100%);
  border-radius: 12px;
  color: var(--white);
  box-shadow: 0 6px 20px rgba(223, 96, 23, 0.3);
}

.sale-form {
  max-width: 800px;
  margin: 0 auto;
}

.form-section {
  background: var(--gray-50);
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 30px;
  border: 1px solid var(--gray-200);
}

.form-section h3 {
  color: var(--black-chestnut);
  margin-bottom: 20px;
  text-align: left;
  font-weight: 600;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  color: var(--black-chestnut);
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--gray-200);
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.3s ease;
  background: var(--white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--furious-fox);
  box-shadow: 0 0 0 3px rgba(223, 96, 23, 0.1);
}

/* ========================================
   LOGIN
   ======================================== */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.login-box {
  background: var(--white);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 10px 40px rgba(35, 35, 34, 0.2);
  border: 1px solid var(--gray-200);
}

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

.login-header .icon {
  font-size: 50px;
  margin-bottom: 15px;
}

.login-form {
  margin-top: 30px;
}

.login-footer {
  text-align: center;
  margin-top: 20px;
}

.login-footer a {
  color: var(--furious-fox);
  text-decoration: none;
  font-weight: 600;
}

.login-footer a:hover {
  color: var(--tail-lights);
}

/* ========================================
   ALERTS
   ======================================== */
.alert {
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-weight: 500;
}

.alert-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.alert-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

/* ========================================
   NAVBAR
   ======================================== */
.navbar {
  background: linear-gradient(135deg, var(--black-chestnut) 0%, var(--gray-900) 100%);
  padding: 15px 0;
  margin-bottom: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(35, 35, 34, 0.3);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 30px;
}

.nav-brand h2 {
  color: var(--white);
  margin: 0;
  font-size: 1.5em;
  font-weight: 700;
}

.nav-menu {
  display: flex;
  gap: 20px;
  align-items: center;
}

.nav-user {
  color: var(--apricot-glazed);
  font-weight: 600;
}

.nav-link {
  color: var(--white);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-weight: 500;
}

.nav-link:hover {
  background: rgba(234, 170, 40, 0.2);
  color: var(--apricot-glazed);
}

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

.dashboard-welcome {
  text-align: center;
  margin-bottom: 40px;
}

.metrics-section {
  margin-bottom: 50px;
}

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

.metric-card {
  background: linear-gradient(135deg, var(--furious-fox) 0%, var(--tail-lights) 100%);
  border-radius: 12px;
  padding: 30px;
  color: var(--white);
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(223, 96, 23, 0.3);
}

.metric-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(223, 96, 23, 0.4);
}

.metric-card.team {
  background: linear-gradient(135deg, var(--apricot-glazed) 0%, var(--furious-fox) 100%);
}

.metric-card.facturado {
  background: linear-gradient(135deg, var(--furious-fox) 0%, var(--apricot-glazed) 100%);
}

.metric-card.recolectado {
  background: linear-gradient(135deg, var(--apricot-glazed) 0%, var(--lodgepole-pines) 100%);
}

.metric-card.cartera {
  background: linear-gradient(135deg, var(--lodgepole-pines) 0%, var(--black-chestnut) 100%);
}

.metric-card.devoluciones {
  background: var(--positive-energy);
  color: var(--black-chestnut);
  border: 2px solid var(--lodgepole-pines);
}

.metric-icon {
  font-size: 40px;
  margin-bottom: 15px;
}

.metric-value {
  font-size: 2em;
  font-weight: 700;
  margin-bottom: 10px;
}

.metric-label {
  font-size: 1em;
  opacity: 0.95;
  font-weight: 500;
}

/* ========================================
   SALES TABLE
   ======================================== */
.sales-section {
  margin-top: 40px;
}

.sales-table {
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(35, 35, 34, 0.1);
  overflow-x: auto;
  border: 1px solid var(--gray-200);
}

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

thead {
  background: linear-gradient(135deg, var(--black-chestnut) 0%, var(--gray-900) 100%);
  color: var(--white);
}

th, td {
  padding: 15px;
  text-align: left;
  font-weight: 500;
}

tbody tr:nth-child(even) {
  background: var(--gray-50);
}

tbody tr:hover {
  background: rgba(234, 170, 40, 0.1);
}

/* ========================================
   BADGES
   ======================================== */
.badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-product {
  background: rgba(234, 170, 40, 0.2);
  color: var(--furious-fox);
  border: 1px solid var(--apricot-glazed);
}

.badge-warning {
  background: rgba(220, 70, 16, 0.2);
  color: var(--tail-lights);
  border: 1px solid var(--furious-fox);
}

.badge-success {
  background: rgba(169, 167, 140, 0.2);
  color: var(--black-chestnut);
  border: 1px solid var(--lodgepole-pines);
}

/* ========================================
   SALE DETAIL
   ======================================== */
.sale-detail-header {
  text-align: center;
  margin-bottom: 30px;
  padding: 30px;
  background: linear-gradient(135deg, var(--furious-fox) 0%, var(--apricot-glazed) 100%);
  border-radius: 12px;
  color: var(--white);
  box-shadow: 0 6px 20px rgba(223, 96, 23, 0.3);
}

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

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

.info-item label {
  font-weight: 600;
  color: var(--black-chestnut);
  margin-bottom: 5px;
}

.info-item span {
  color: var(--gray-600);
}

.form-hint {
  color: var(--gray-600);
  font-size: 14px;
  margin-bottom: 15px;
}

.cuotas-summary {
  margin-top: 20px;
  padding: 15px;
  background: var(--positive-energy);
  border-radius: 8px;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  color: var(--black-chestnut);
  border: 2px solid var(--lodgepole-pines);
}

.form-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 30px;
  flex-wrap: wrap;
}

/* ========================================
   SUCCESS/ERROR MESSAGES
   ======================================== */
.success-message, .error-message {
  text-align: center;
  padding: 60px 20px;
}

.success-icon, .error-icon {
  font-size: 80px;
  margin-bottom: 20px;
}

.client-name {
  font-size: 1.2em;
  margin: 20px 0;
  color: var(--gray-600);
}

.cuota-section {
  border-left: 4px solid var(--furious-fox);
  margin-bottom: 20px;
  padding-left: 20px;
}

.cuota-section h4 {
  color: var(--furious-fox);
  margin-bottom: 15px;
  font-weight: 600;
}

/* ========================================
   READONLY FIELDS
   ======================================== */
.readonly-field {
  background: var(--positive-energy) !important;
  cursor: not-allowed;
  opacity: 0.8;
  color: var(--gray-600) !important;
}

.helper-text {
  font-size: 12px;
  color: var(--gray-600);
  margin-top: 5px;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
  .advisors-grid {
    grid-template-columns: 1fr;
  }
  
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  
  .nav-container {
    flex-direction: column;
    gap: 15px;
  }
  
  .nav-menu {
    flex-direction: column;
  }
  
  table {
    font-size: 12px;
  }
  
  th, td {
    padding: 10px 5px;
  }
  
  .form-actions {
    flex-direction: column;
  }
  
  .btn-large {
    width: 100%;
  }
  
  .container {
    padding: 20px;
  }
}