:root {
  --bg-color: #0f172a; /* Deep Navy */
  --text-color: #f8fafc;
  --accent-color: #06b6d4; /* Cyan */
  --accent-hover: #0891b2;
  --success-color: #10b981;
  --glass-bg: rgba(30, 41, 59, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
  min-height: 100vh;
}

.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--glass-shadow);
  transition: transform 0.3s ease;
}
.glass-panel:hover {
  transform: translateY(-2px);
  border-color: rgba(6, 182, 212, 0.3);
}

/* ANIMATIONS */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in {
  animation: fadeInUp 0.6s ease-out forwards;
  opacity: 0;
}

/* LOGIN SCREEN */
.login-container {
  display: none;
  height: 100vh;
  justify-content: center;
  align-items: center;
}
.login-container.active { display: flex; }
.login-card { text-align: center; max-width: 400px; width: 90%; padding: 3rem 2rem;}
.login-card h2 { color: var(--accent-color); margin-bottom: 0.5rem; }
.login-card p { margin-bottom: 1.5rem; color: #94a3b8; }
.login-card input {
  width: 100%; padding: 14px; margin-bottom: 1.5rem;
  background: rgba(0,0,0,0.4); border: 1px solid var(--glass-border);
  color: white; border-radius: 8px; font-size: 1rem; text-align: center;
  outline: none; transition: border-color 0.3s;
}
.login-card input:focus { border-color: var(--accent-color); }
.error-msg { color: #ef4444; margin-top: 1rem; font-size: 0.9rem; }

/* BUTTONS */
.btn-primary, .btn-secondary, .btn-small {
  cursor: pointer; border: none; font-weight: 600; transition: all 0.3s;
  border-radius: 8px;
}
.btn-primary {
  width: 100%; padding: 14px; background: linear-gradient(135deg, var(--accent-color), #3b82f6); color: #fff; font-size: 1rem;
}
.btn-primary:hover { box-shadow: 0 0 15px rgba(6, 182, 212, 0.5); }
.btn-secondary {
  padding: 8px 16px; background: transparent; border: 1px solid var(--accent-color); color: var(--accent-color);
}
.btn-secondary:hover { background: var(--accent-color); color: #fff; }
.btn-small {
  padding: 8px 14px; font-size: 0.85rem; background: rgba(255,255,255,0.05); color: #fff; border: 1px solid var(--glass-border);
}
.btn-small:hover { background: rgba(255,255,255,0.1); border-color: var(--accent-color); }
.btn-success {
  background: rgba(16, 185, 129, 0.2) !important;
  color: #10b981 !important;
  border-color: rgba(16, 185, 129, 0.4) !important;
}

/* DASHBOARD MAIN */
.dashboard-container { display: none; padding: 2rem; max-width: 1300px; margin: 0 auto; }
.dashboard-container.active { display: block; }
.glass-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.5rem 2rem; background: var(--glass-bg); border: 1px solid var(--glass-border);
  border-radius: 16px; margin-bottom: 2rem; box-shadow: var(--glass-shadow);
}
.header-logos {
  display: flex; align-items: center; gap: 1rem;
}
.header-logo {
  height: 40px; width: auto; object-fit: contain; filter: drop-shadow(0 0 5px rgba(255,255,255,0.2));
}
.header-title {
  margin-left: 10px; font-size: 1.5rem; border-left: 2px solid var(--glass-border); padding-left: 1rem;
}
.header-title span { color: var(--accent-color); }

/* METRICS */
.metrics-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem; margin-bottom: 1.5rem;
}
.metric-card { text-align: center; padding: 2rem 1.5rem; }
.metric-card h3 { font-size: 1rem; color: #94a3b8; margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 1px;}
.metric-card p { font-size: 3rem; font-weight: 800; color: var(--text-color); margin-bottom: 0.5rem; text-shadow: 0 0 20px rgba(255,255,255,0.2);}
.metric-card .trend { font-size: 0.85rem; color: var(--accent-color); font-weight: 600; }

/* CHARTS */
.charts-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem; margin-bottom: 1.5rem;
}
.chart-container {
  display: flex; flex-direction: column; align-items: center;
}
.chart-container h3 {
  width: 100%; text-align: left; font-size: 1.1rem; margin-bottom: 1rem; color: #cbd5e1;
}
canvas {
  max-height: 250px;
  width: 100% !important;
}

/* TABLE */
.table-section { margin-bottom: 2rem; }
.table-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem;}
.table-actions { display: flex; gap: 1rem; align-items: center; }
.search-box {
  padding: 8px 16px; border-radius: 8px; border: 1px solid var(--glass-border);
  background: rgba(0,0,0,0.3); color: white; outline: none; width: 250px;
}
.search-box:focus { border-color: var(--accent-color); }

.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 900px; }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.05); }
th { color: #94a3b8; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; background: rgba(0,0,0,0.2); }
th:first-child { border-top-left-radius: 8px; }
th:last-child { border-top-right-radius: 8px; }
td { font-size: 0.95rem; }
tbody tr { transition: background 0.2s; }
tbody tr:hover { background: rgba(255,255,255,0.02); }
td a { color: var(--accent-color); text-decoration: none; font-weight: 600;}
td a:hover { text-decoration: underline; text-shadow: 0 0 8px rgba(6,182,212,0.5);}
.status-badge {
  padding: 6px 12px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; display: inline-block; text-align: center; min-width: 90px;
}
.status-pendiente { background: rgba(234, 179, 8, 0.15); color: #facc15; border: 1px solid rgba(234, 179, 8, 0.3); }
.status-pagado { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }

/* RESPONSIVE */
@media (max-width: 768px) {
  .glass-header { flex-direction: column; gap: 1rem; text-align: center; }
  .table-header { flex-direction: column; align-items: flex-start; }
  .table-actions { width: 100%; flex-direction: column; align-items: stretch;}
  .search-box { width: 100%; }
}
