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

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-hover: #1e40af;
  --secondary: #64748b;
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #0f172a;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --success: #10b981;
  --success-bg: #d1fae5;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --danger: #ef4444;
  --danger-bg: #fee2e2;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 20px 30px -10px rgba(15, 23, 42, 0.12);
  --grad-primary: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  --grad-stat-1: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  --grad-stat-2: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  --grad-stat-3: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

* { box-sizing: border-box; }

body {
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  margin: 0;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  position: relative;
  min-height: 100vh;
}

#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

.navbar, .dashboard-container, .card, .offer-banner, .smtp-card {
  position: relative;
  z-index: 1;
}

a { text-decoration: none; color: inherit; transition: all 0.2s; }

/* LAYOUT CONTAINER */
.dashboard-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 32px 24px 60px;
}

/* NAVBAR */
.navbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.04);
  backdrop-filter: blur(16px);
}

.nav-brand {
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-brand .brand-badge {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.nav-links {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav-item {
  font-weight: 600;
  color: var(--secondary);
  font-size: 0.95rem;
  padding: 8px 16px;
  border-radius: 10px;
  transition: all 0.2s;
}

.nav-item:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.nav-item.active {
  color: var(--primary);
  background: var(--primary-light);
  font-weight: 700;
}

/* GRID SYSTEM */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .navbar { padding: 0 16px; }
  .dashboard-container { padding: 20px 16px; }
}

/* CARDS */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(226, 232, 240, 0.8);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* STAT CARDS */
.stat-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: var(--primary-light);
  color: var(--primary);
  margin-bottom: 16px;
}

.stat-value {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -1px;
  margin: 4px 0 8px;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  gap: 8px;
  font-family: inherit;
}
.btn-sm { padding: 6px 14px; font-size: 0.82rem; border-radius: 8px; }

.btn-primary { 
  background: var(--grad-primary); 
  color: white; 
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}
.btn-primary:hover { 
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
}

.btn-secondary { 
  background: var(--bg-card); 
  border: 1px solid var(--border); 
  color: var(--text-main); 
}
.btn-secondary:hover { 
  background: var(--bg-body); 
  border-color: #cbd5e1;
}

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-success { background: var(--success); color: white; }
.btn-success:hover { opacity: 0.9; }

.btn-warning { background: var(--warning); color: #78350f; }

/* TABLES */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius);
}
table {
  width: 100%;
  border-collapse: collapse;
}
th {
  text-align: left;
  padding: 14px 18px;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--bg-body);
  border-bottom: 1px solid var(--border);
}
td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-main);
  font-size: 0.92rem;
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(248, 250, 252, 0.7); }

/* BADGES */
.badge {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-block;
}
.badge-active { background: var(--success-bg); color: #065f46; }
.badge-expired { background: var(--danger-bg); color: #991b1b; }
.badge-pending { background: var(--warning-bg); color: #92400e; }
.badge-secondary { background: var(--border-light); color: var(--secondary); }

/* ALERTS */
.alert {
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}
.alert-success { background: var(--success-bg); color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger { background: var(--danger-bg); color: #991b1b; border: 1px solid #fecaca; }

/* CHAT BOX */
.chat-box {
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  height: 280px;
  overflow-y: auto;
  margin-bottom: 16px;
}
.msg {
  margin-bottom: 10px;
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.9rem;
}
.msg-in {
  background: white;
  border: 1px solid var(--border);
  margin-right: auto;
}
.msg-out {
  background: var(--primary-light);
  border: 1px solid #bfdbfe;
  margin-left: auto;
}

/* FORM CONTROLS */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 6px;
  color: var(--text-main);
}
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.92rem;
  transition: all 0.2s;
  background: var(--bg-card);
  font-family: inherit;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* UTILS */
.mt-1 { margin-top: 4px; }
.mt-4 { margin-top: 24px; }
.mb-4 { margin-bottom: 24px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-row { display: flex; align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.h2 { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.5px; margin: 0; }
.text-muted { color: var(--text-muted); }
.small { font-size: 0.82rem; }
.w-100 { width: 100%; }
