/* ============================================
   DASHBOARD ADMIN - DISEÑO LIMPIO Y PROFESIONAL
   ============================================ */

/* Utility */
.hidden {
  display: none !important;
}

/* ============================================
   FILTROS HEADER
   ============================================ */
.filters-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: white;
  border-radius: 12px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  flex-wrap: wrap;
}

.filter-select {
  padding: 10px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  background: white;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 160px;
}

.filter-select:hover {
  border-color: #cbd5e1;
}

.filter-select:focus {
  outline: none;
  border-color: #f88414;
  box-shadow: 0 0 0 3px rgba(248, 132, 20, 0.1);
}

.btn-filter {
  padding: 10px 20px;
  background: #f88414;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-filter:hover {
  background: #e67710;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(248, 132, 20, 0.3);
}

.periodo-badge {
  margin-left: auto;
  padding: 10px 16px;
  background: #fef3c7;
  color: #92400e;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

/* ============================================
   KPIs COMPACTOS
   ============================================ */
.kpi-compact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-compact {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.2s;
}

.kpi-compact:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.kpi-compact--primary {
  background: linear-gradient(135deg, #fef3c7 0%, #ffffff 100%);
}

.kpi-compact--success {
  background: linear-gradient(135deg, #dcfce7 0%, #ffffff 100%);
}

.kpi-compact__icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 12px;
  font-size: 24px;
  color: #64748b;
  flex-shrink: 0;
}

.kpi-compact--primary .kpi-compact__icon {
  color: #f88414;
}

.kpi-compact--success .kpi-compact__icon {
  color: #15803d;
}

.kpi-compact__info {
  flex: 1;
  min-width: 0;
}

.kpi-compact__label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.kpi-compact__value {
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1;
  margin-bottom: 4px;
}

.kpi-compact__meta {
  font-size: 13px;
  color: #64748b;
}

/* ============================================
   GRÁFICAS
   ============================================ */
.charts-main {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.chart-box {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.chart-box--large {
  min-height: 360px;
}

.chart-box__title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-box__canvas {
  height: 300px;
  position: relative;
}

.chart-box--large .chart-box__canvas {
  height: 280px;
}

/* ============================================
   PAYMENT BULLETS
   ============================================ */
.payment-bullets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.payment-bullet {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  border-left: 4px solid transparent;
  transition: all 0.2s;
}

.payment-bullet:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.payment-bullet--efectivo {
  border-left-color: #22c55e;
}

.payment-bullet--tarjeta {
  border-left-color: #3b82f6;
}

.payment-bullet--transferencia {
  border-left-color: #f59e0b;
}

.payment-bullet--mixto {
  border-left-color: #a855f7;
}

.payment-bullet__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.payment-bullet--efectivo .payment-bullet__dot {
  background: #22c55e;
}

.payment-bullet--tarjeta .payment-bullet__dot {
  background: #3b82f6;
}

.payment-bullet--transferencia .payment-bullet__dot {
  background: #f59e0b;
}

.payment-bullet--mixto .payment-bullet__dot {
  background: #a855f7;
}

.payment-bullet__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.payment-bullet__label {
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.payment-bullet__value {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
}

.payment-bullet__percent {
  padding: 4px 12px;
  background: #f1f5f9;
  color: #475569;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

/* ============================================
   ANALYTICS - FINANCIAL CARD
   ============================================ */
.financial-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  margin-bottom: 24px;
}

.financial-card__title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.financial-card__title i {
  color: #f88414;
}

.financial-rows {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: #f1f5f9;
  border-radius: 8px;
  overflow: hidden;
}

.financial-row-clean {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: white;
}

.financial-row-clean--ingresos {
  background: #f8fafc;
}

.financial-row-clean--gastos {
  background: #fef2f2;
}

.financial-row-clean--ganancia {
  background: #f0fdf4;
  font-size: 18px;
  font-weight: 700;
}

.financial-row-clean__label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}

.financial-row-clean__label i {
  width: 20px;
  text-align: center;
  color: #64748b;
}

.financial-row-clean--ganancia .financial-row-clean__label i {
  color: #15803d;
}

.financial-row-clean__value {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  font-family: 'Courier New', monospace;
}

.financial-row-clean__value--negative {
  color: #dc2626;
}

.financial-row-clean__value--success {
  color: #15803d;
  font-size: 22px;
}

.financial-divider-clean {
  height: 2px;
  background: linear-gradient(90deg, transparent, #cbd5e1, transparent);
}

.financial-badge-clean {
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 700;
}

.financial-badge-clean--excellent {
  background: #dcfce7;
  color: #15803d;
}

.financial-badge-clean--good {
  background: #dbeafe;
  color: #1e40af;
}

.financial-badge-clean--warning {
  background: #fef3c7;
  color: #a16207;
}

.financial-badge-clean--danger {
  background: #fee2e2;
  color: #dc2626;
}

/* ============================================
   ANALYTICS - CARDS & GRID
   ============================================ */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
}

.analytics-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.analytics-card__title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.analytics-card__title i {
  color: #f88414;
}

.ranking-placeholder {
  padding: 40px;
  text-align: center;
  color: #94a3b8;
  font-size: 14px;
}

/* Ranking List */
.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: #f1f5f9;
  border-radius: 8px;
  overflow: hidden;
}

.ranking-item {
  background: white;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.2s;
}

.ranking-item:hover {
  background: #f8fafc;
  transform: translateX(4px);
}

.ranking-position {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f88414 0%, #f97316 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.ranking-item:nth-child(1) .ranking-position {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
  transform: scale(1.1);
}

.ranking-item:nth-child(2) .ranking-position {
  background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
}

.ranking-item:nth-child(3) .ranking-position {
  background: linear-gradient(135deg, #fca5a5 0%, #f87171 100%);
}

.ranking-info {
  flex: 1;
  min-width: 0;
}

.ranking-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}

.ranking-meta {
  font-size: 13px;
  color: #64748b;
  line-height: 1.4;
}

.ranking-value {
  font-size: 20px;
  font-weight: 700;
  color: #f88414;
  white-space: nowrap;
  font-family: 'Courier New', monospace;
}

/* ============================================
   METRIC CARDS
   ============================================ */
.metric-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.metric-card__icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 20px;
  flex-shrink: 0;
}

.metric-card__icon--high {
  background: #dcfce7;
  color: #15803d;
}

.metric-card__icon--low {
  background: #fee2e2;
  color: #dc2626;
}

.metric-card__info {
  flex: 1;
}

.metric-card__label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}

.metric-card__value {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
}

/* ============================================
   TABLES
   ============================================ */
.gastos-table {
  overflow-x: auto;
}

.table-clean {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table-clean thead {
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
}

.table-clean th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.table-clean td {
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: #0f172a;
}

.table-clean tbody tr:hover {
  background: #f8fafc;
}

.empty-state {
  padding: 40px !important;
  text-align: center;
  color: #94a3b8;
  font-style: italic;
}

.text-right {
  text-align: right !important;
}

/* ============================================
   LOADING
   ============================================ */
.loading-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .charts-main {
    grid-template-columns: 1fr;
  }
  
  .analytics-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .filters-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-select {
    width: 100%;
  }
  
  .periodo-badge {
    margin-left: 0;
  }
  
  .kpi-compact-grid {
    grid-template-columns: 1fr;
  }
  
  .payment-bullets {
    grid-template-columns: 1fr;
  }
}