/* Admin API Costs Dashboard */

.admin-api-costs-page {
  max-width: 1600px;
  margin: 0 auto;
  padding: 32px 48px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.admin-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: white;
  margin: 0 0 8px 0;
}

.admin-stats-summary {
  display: flex;
  gap: 24px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.stat-label {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: white;
}

.stat-success {
  color: #34d399;
}

.stat-danger {
  color: #ef4444;
}

/* Alerts */
.alerts-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
}

.alert-info {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
}

.alert-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.alert-content h3 {
  color: white;
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 4px 0;
}

.alert-content p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.875rem;
  margin: 0;
  line-height: 1.5;
}

/* Costs Overview */
.costs-overview-section {
  margin-bottom: 48px;
}

.costs-overview-section h2 {
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 20px 0;
}

.cost-summary-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.cost-summary-card {
  padding: 24px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
}

.cost-summary-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(167, 139, 250, 0.4);
  transform: translateY(-2px);
}

.cost-summary-total {
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.2) 0%, rgba(233, 69, 96, 0.2) 100%);
  border-color: rgba(167, 139, 250, 0.3);
}

.card-header {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-amount {
  color: white;
  font-size: 2rem;
  font-weight: 700;
}

.card-detail {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.75rem;
}

/* API Services */
.api-services-section {
  margin-bottom: 48px;
}

.api-services-section h2 {
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 20px 0;
}

.api-services-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.api-service-card {
  padding: 24px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  transition: all 0.2s ease;
}

.api-service-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(167, 139, 250, 0.4);
}

.api-service-card.free-tier {
  border-color: rgba(16, 185, 129, 0.3);
}

.api-service-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.api-name {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.api-name h3 {
  color: white;
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
}

.api-tier-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.api-tier-badge.basic {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.api-tier-badge.free {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.api-tier-badge.pay-as-you-go {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.api-tier-badge.starter {
  background: rgba(167, 139, 250, 0.2);
  color: #a78bfa;
}

.api-tier-badge.self-hosted {
  background: rgba(139, 92, 246, 0.2);
  color: #a78bfa;
}

.api-cost {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.cost-amount {
  color: white;
  font-size: 1.75rem;
  font-weight: 700;
}

.cost-period {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.75rem;
}

.cost-free {
  color: #34d399;
  font-size: 1.25rem;
  font-weight: 700;
}

/* Usage Bars */
.api-usage {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.usage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.usage-label {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.usage-numbers {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.875rem;
  font-weight: 600;
}

.usage-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.usage-fill {
  height: 100%;
  background: linear-gradient(90deg, #34d399 0%, #10b981 100%);
  transition: width 0.3s ease;
}

.usage-fill.usage-warning {
  background: linear-gradient(90deg, #f59e0b 0%, #ef4444 100%);
}

.usage-percentage {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.75rem;
}

.text-warning {
  color: #f59e0b;
}

.api-usage-unlimited {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  margin-bottom: 12px;
}

.usage-value {
  color: white;
  font-weight: 600;
}

.api-upgrade-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: rgba(167, 139, 250, 0.1);
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: 6px;
  font-size: 0.875rem;
}

.upgrade-label {
  color: rgba(255, 255, 255, 0.7);
}

.upgrade-value {
  color: #a78bfa;
  font-weight: 600;
}

/* Historical Chart */
.historical-section {
  margin-bottom: 48px;
}

.historical-section h2 {
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 20px 0;
}

.chart-container {
  padding: 32px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
}

.chart-bars {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  min-height: 240px;
}

.chart-bar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.chart-bar-stack {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  width: 100%;
  max-width: 80px;
}

.chart-bar {
  width: 100%;
  transition: all 0.3s ease;
  cursor: pointer;
}

.chart-bar:hover {
  opacity: 0.8;
}

.chart-bar-apis {
  background: linear-gradient(180deg, #a78bfa 0%, #7c3aed 100%);
}

.chart-bar-hosting {
  background: linear-gradient(180deg, #60a5fa 0%, #3b82f6 100%);
}

.chart-bar-other {
  background: linear-gradient(180deg, #34d399 0%, #10b981 100%);
}

.chart-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  font-weight: 600;
}

.chart-total {
  color: white;
  font-size: 1.125rem;
  font-weight: 700;
}

.chart-agencies {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.75rem;
}

.chart-legend {
  display: flex;
  justify-content: center;
  gap: 32px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 4px;
}

.legend-apis {
  background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%);
}

.legend-hosting {
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
}

.legend-other {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
}

/* Decision Points */
.decision-points-section {
  margin-bottom: 48px;
}

.decision-points-section h2 {
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 12px 0;
}

.section-description {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.875rem;
  margin: 0 0 20px 0;
}

.decision-points-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.decision-point-card {
  padding: 24px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  transition: all 0.2s ease;
}

.decision-point-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(245, 158, 11, 0.4);
}

.decision-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.decision-header h3 {
  color: white;
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
}

.decision-status-badge {
  padding: 6px 14px;
  background: rgba(245, 158, 11, 0.2);
  border-radius: 6px;
  color: #fbbf24;
  font-size: 0.875rem;
  font-weight: 600;
}

.decision-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.decision-action {
  color: white;
  font-size: 0.875rem;
}

.decision-notes {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Projections */
.projections-section {
  margin-bottom: 48px;
}

.projections-section h2 {
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 20px 0;
}

.projections-table {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
}

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

.projections-table thead {
  background: rgba(255, 255, 255, 0.05);
}

.projections-table th {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  font-weight: 600;
  text-align: left;
  padding: 16px 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.projections-table td {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.875rem;
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.projections-table tr.current-scale {
  background: rgba(167, 139, 250, 0.1);
}

.text-success {
  color: #34d399;
}

/* Quick Actions */
.quick-actions-section {
  margin-bottom: 32px;
}

.quick-actions-section h2 {
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 20px 0;
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: white;
  font-size: 0.875rem;
  font-weight: 500;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(167, 139, 250, 0.4);
  transform: translateY(-2px);
}

.action-icon {
  font-size: 2rem;
}

.action-text {
  text-align: center;
}

/* Responsive */
@media (max-width: 1200px) {
  .cost-summary-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .api-services-list {
    grid-template-columns: 1fr;
  }

  .actions-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .admin-api-costs-page {
    padding: 24px 20px;
  }

  .admin-header {
    flex-direction: column;
    gap: 20px;
  }

  .admin-stats-summary {
    width: 100%;
    justify-content: space-between;
  }

  .cost-summary-cards {
    grid-template-columns: 1fr;
  }

  .chart-bars {
    overflow-x: auto;
  }

  .actions-grid {
    grid-template-columns: 1fr;
  }
}

