/* ==========================================================================
   CARTEC DASHBOARD STYLES - ADMIN & PERFORMANCE ANALYTICS
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800;900&display=swap');

:root {
  --bg-darkest: #050608;
  --bg-dark: #0d1017;
  --bg-card: rgba(18, 22, 32, 0.9);
  --bg-card-hover: rgba(28, 34, 48, 0.95);
  
  --accent-red: #e50914;
  --accent-red-glow: rgba(229, 9, 20, 0.35);
  --accent-gold: #ffd700;
  --accent-gold-glow: rgba(255, 215, 0, 0.25);
  --accent-cyan: #00f2fe;
  --accent-green: #22c55e;
  
  --border-light: rgba(255, 255, 255, 0.1);
  --border-active: rgba(229, 9, 20, 0.5);
  
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-darkest);
  color: #f8fafc;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* --- Top Navigation Header --- */
.dash-header {
  background: rgba(13, 16, 23, 0.95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
}

.dash-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 90px;
  max-width: 1350px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.dash-brand {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.dash-logo {
  height: 65px;
  width: auto;
  filter: drop-shadow(0 0 12px rgba(229, 9, 20, 0.4));
}

.dash-title h1 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
}

.dash-title p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.dash-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

/* --- Buttons --- */
.btn-dash {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  border: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  transition: all 0.2s ease;
}

.btn-dash:hover {
  background: rgba(229, 9, 20, 0.15);
  border-color: var(--accent-red);
}

.btn-dash-primary {
  background: linear-gradient(135deg, #ff1e27 0%, #d32f2f 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 0 20px rgba(229, 9, 20, 0.35);
}

.btn-dash-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(229, 9, 20, 0.55);
}

/* --- Main Layout Grid --- */
.dash-content {
  max-width: 1350px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* --- KPI Summary Cards --- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.kpi-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-active);
}

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.kpi-title {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.kpi-icon.red { background: rgba(229, 9, 20, 0.15); color: var(--accent-red); }
.kpi-icon.gold { background: rgba(255, 215, 0, 0.15); color: var(--accent-gold); }
.kpi-icon.green { background: rgba(34, 197, 94, 0.15); color: var(--accent-green); }
.kpi-icon.cyan { background: rgba(0, 242, 254, 0.15); color: var(--accent-cyan); }

.kpi-value {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 900;
  color: #fff;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.kpi-subtext {
  font-size: 0.78rem;
  color: #94a3b8;
}

.kpi-subtext span {
  color: var(--accent-green);
  font-weight: 700;
}

/* --- Charts Grid --- */
.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.chart-header h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
}

.chart-container {
  position: relative;
  width: 100%;
  height: 320px;
}

/* --- Live Activity Feed Table --- */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.dash-table th {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #94a3b8;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-light);
}

.dash-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
}

.dash-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.event-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
}

.event-badge.whatsapp { background: rgba(37, 211, 102, 0.15); color: #25d366; }
.event-badge.form { background: rgba(229, 9, 20, 0.15); color: #ff4d4d; }
.event-badge.phone { background: rgba(255, 215, 0, 0.15); color: #ffd700; }
.event-badge.service { background: rgba(0, 242, 254, 0.15); color: #00f2fe; }

/* --- Responsive Media Queries --- */
@media (max-width: 1024px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .dash-header .container {
    height: 80px;
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
  }
  .dash-logo {
    height: 45px;
  }
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .btn-dash {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
  }
}
