/* ============================================================================
  ADMIN CSS - DILVEX SAS
  Tema: Imperio (Negro + Dorado + Teal)
  ============================================================================ */

:root {
  --bg-dark: #0a0a0a;
  --bg-card: #111111;
  --bg-hover: #1a1a1a;
  --accent-gold: #FFD700;
  --accent-gold-dim: #B8860B;
  --accent-teal: #00FFD4;
  --accent-red: #FF4444;
  --accent-green: #00FF88;
  --accent-blue: #4488FF;
  --text-primary: #ffffff;
  --text-secondary: #888888;
  --text-muted: #555555;
  --border-color: #222222;
  --border-gold: #FFD700;
  --shadow-gold: 0 0 20px rgba(255, 215, 0, 0.1);
  --font-primary: 'Segoe UI', system-ui, sans-serif;
}

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

body {
  font-family: var(--font-primary);
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
}

/* ============================================================================
  LAYOUT
  ============================================================================ */

.admin-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

/* ============================================================================
  SIDEBAR
  ============================================================================ */

.sidebar {
  background: var(--bg-card);
  border-right: 1px solid var(--border-color);
  padding: 24px 16px;
  position: fixed;
  height: 100vh;
  width: 260px;
  overflow-y: auto;
}

.sidebar-logo {
  text-align: center;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.sidebar-logo h1 {
  font-size: 18px;
  color: var(--accent-gold);
  letter-spacing: 2px;
}

.sidebar-logo span {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.sidebar-nav {
  list-style: none;
}

.sidebar-nav li {
  margin-bottom: 4px;
}

.sidebar-nav a {
  display: block;
  padding: 12px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s;
  font-size: 14px;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: var(--bg-hover);
  color: var(--accent-gold);
  border-left: 3px solid var(--accent-gold);
}

.sidebar-nav i {
  margin-right: 12px;
  width: 20px;
  text-align: center;
}

/* ============================================================================
  MAIN CONTENT
  ============================================================================ */

.main-content {
  margin-left: 260px;
  padding: 32px;
}

.page-header {
  margin-bottom: 32px;
}

.page-header h1 {
  font-size: 28px;
  color: var(--accent-gold);
  margin-bottom: 8px;
}

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

/* ============================================================================
  KPI CARDS
  ============================================================================ */

.kpi-section {
  margin-bottom: 32px;
}

.section-title {
  font-size: 18px;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-left: 12px;
  border-left: 3px solid var(--accent-gold);
}

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

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  transition: all 0.3s;
}

.kpi-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-gold);
}

.kpi-card.border-gold { border-top: 3px solid var(--accent-gold); }
.kpi-card.border-green { border-top: 3px solid var(--accent-green); }
.kpi-card.border-red { border-top: 3px solid var(--accent-red); }
.kpi-card.border-blue { border-top: 3px solid var(--accent-blue); }

.kpi-title {
  font-size: 13px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.kpi-values {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kpi-usd {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-gold);
}

.kpi-cop {
  font-size: 16px;
  color: var(--text-secondary);
}

/* ============================================================================
  LOADING & ERROR
  ============================================================================ */

.loading {
  text-align: center;
  padding: 60px;
  color: var(--text-secondary);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

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

.error-box {
  background: rgba(255, 68, 68, 0.1);
  border: 1px solid var(--accent-red);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
}

.error-box button {
  margin-top: 16px;
  padding: 12px 24px;
  background: var(--accent-gold);
  color: var(--bg-dark);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

.period-info {
  text-align: right;
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 16px;
}

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

@media (max-width: 768px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }
  
  .sidebar {
    display: none;
  }
  
  .main-content {
    margin-left: 0;
    padding: 16px;
  }
  
  .kpi-grid {
    grid-template-columns: 1fr;
  }
}
